diff --git a/CHECKSUMS.txt b/CHECKSUMS.txt index 4c0d477a5b0649be058394386533451f36835513..393a1cbf1b06f50d5d917829bfc35a8cf7ac0e52 100644 --- a/CHECKSUMS.txt +++ b/CHECKSUMS.txt @@ -1,29 +1,29 @@ -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. +Cover Charge v0.3.12.123: 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.123. SHA-256 of each web app's start page, service worker, manifest and logo: -fbdb83fbf4777f56607bcb264e057ee3894d2cc1d6a302cae8fb903466c2db01 owner-app/index.html -327e78363155aa93d6ee2282715cfd85ea0dd2e38e899f087ea5b5d08c874167 owner-app/sw.js +e5ff8a8f0fd5b5e93124254e9800c92ca8d3b3d32a7f9ff075ece49f9bf54937 owner-app/index.html +4d099c786bf89f7d773c64b765a45a0915e60b6e8516f0cb26e2a869b6a3546f owner-app/sw.js e305c44d11a9c25f37372f3fa4d329d4ffb04df2edee6e7b4b9ac91f3875ac67 owner-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png -2e0d4cb5357ebf1cf8ecb155c845c4399f29760444d3cc26a74220d6d628bbc4 staff-app/index.html -a156889af517c50868010b8f5b8708c3c4827760bf2ca9a2ca4910c68cfec61a staff-app/sw.js +79a4152b701344b3d7807aa2f642d4f49b891fe2783f3bbf01bae5a00e1db22d staff-app/index.html +03b93c5f3b1aef07d5f32f5f80299e358982abcdbd286e396f08d9cb99ef7c2b staff-app/sw.js bd1d310ebf8e2a80808e100c41fb7fe1c4369d3026478f3ad8eececaeadaf4ac staff-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png -3ac6d5cf2b86affd8eb873115a3329f3cd8dfc237c36a0b98771d7b7754bf0fd customer-app/index.html -a8ec486f35e7475580bfa5f59217ee9584d5fbfb69c98647d28bda5aebd59c8e customer-app/sw.js +96d074d617256bfb227e7bb65e9510a0c874e847fb51ff6c63fad000de503f16 customer-app/index.html +cad56d9ca378902491c74c11b467669ef9c95bbd63178984776fc2372f3fa23f customer-app/sw.js 3bfb1fd10cc13f09ca6be65c461e1f6b5750ae51a3ece12e079750b2a066052e customer-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png -c158f9b9dc85567bc330956b8ea51a8f844b8b94f283306b406e0283223427bd display-app/index.html -de966e812d551833c9d5c5f117fde73931846bd8061feb736a44c713992ed264 display-app/sw.js +654dd1bb8bbe98308b1f85561d199fe7331c8afdfb5889eedc15e18bd3d08e8b display-app/index.html +f70265d014c4dce12cabd49cdeda63a4f1a2786d4ff52cd599759c10e5cba4a0 display-app/sw.js 35e2721b86eb1ae1605e55bee64177adcee72f4e53a24ac417d19ea2873434a1 display-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png -0bee0c592ad6dc9c4a64752c7457973283f980aeeabb7d21685412610b205883 chef-app/index.html -66564ee82f90b5599c75d8db313ee18295ce11d3a3b57a07644235870d9489d9 chef-app/sw.js +ff7839f8f4c4d690a649d1d40714c4469b3b261e7e62f3bbcc20af3ab84364b6 chef-app/index.html +c96e95c1df4fda6dea68f21256071a4451b61de703783d8ed036a39636ad0451 chef-app/sw.js 97ed43decde8a888e22b7411e13a2122c6f8b9944cf38b2e28e8f62ef2e25397 chef-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png -faa4f57375da7973f255a94c951feb301e9c0244b6a1845691ccb5863dbd4a4c car-app/index.html -0126b941aeb21a49512edd296b3d1b42d9b7d3f1e18f7cd001d83c5165b96cca car-app/sw.js +3449f094fa20a6339a83d98b27904ff17927d7232cb20ebc9d53a0ef5f2e9335 car-app/index.html +a349aed57309ea253e9c5e0f3dfae7f7d432d61610f5cfb41d47cef2e2bb3564 car-app/sw.js 091b9f96d36153d270b44dbf458aa99e4fd5e2f127769d030436fcd1d51e724a car-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 car-app/brand-logo.png -4c75c3bcf346006a2f8e28e5abf372f0dffd57ab1ce49cde9b0f62526889910b car.html +43edd3a3b1a128521cf36988ddca7f5ea03959bb99a3129ba7fa53c5d4b3c75b car.html 98081968ac06b8ca464c4e5c66c95465d50c20bd7318d2b18eac93464c6e39af t.html diff --git a/car-app/_expo/static/js/web/bundle.js b/car-app/_expo/static/js/web/bundle.js index c1cbbbc0cbf78fc4883cc4e36378643c14f64828..f35b54805ec1f1b8eaffe813abdfc580e4702b88 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.122'},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.123'},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]); @@ -1195,7 +1195,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}),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: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";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)(!0);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]); @@ -1359,7 +1359,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}),_e.TableOrderLive=function({token:e}){const[s,m]=(0,l.useState)(null),[x,y]=(0,l.useState)(null),[j,f]=(0,l.useState)([]),[k,w]=(0,l.useState)(null),T=(0,h.useCustomer)(),[C,S]=(0,l.useState)(()=>(T?.allergies??[]).map(e=>e.allergen)),[v,O]=(0,l.useState)(''),[P,R]=(0,l.useState)(''),[I,M]=(0,l.useState)(''),[L,N]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),[B,D]=(0,l.useState)([]),q=(0,l.useCallback)(async()=>{try{m(await(0,c.tablePublic)(e)),y(null)}catch(e){y((0,d.tableOrderError)(e,'menu'))}},[e]),_=(0,l.useCallback)(async()=>{try{D(await(0,c.myTableOrders)(e))}catch{}},[e]);(0,l.useEffect)(()=>{q(),_();const e=setInterval(()=>{_(),q()},8e3);return()=>clearInterval(e)},[q,_]);const W=s?.menu??[];(0,l.useEffect)(()=>{f(e=>e.filter(e=>W.some(t=>t.id===e.id&&!t.soldOut)))},[s]);const E=(0,l.useMemo)(()=>{const e=new Map;for(const t of W)e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()]},[s]),Y=(0,d.cartTotal)(j,W),z='yes'===k?C.map(e=>({allergen:e,severity:T?.allergies?.find(t=>t.allergen===e)?.severity??'allergy'})):[],G=(0,d.allergyClashes)(j,W,z.map(e=>e.allergen)),V=e=>j.find(t=>t.id===e)?.qty??0,F=(e,t)=>f(n=>t<=0?n.filter(t=>t.id!==e):n.some(t=>t.id===e)?n.map(n=>n.id===e?{...n,qty:t}:n):[...n,{id:e,qty:t,note:''}]),H=(e,t)=>f(n=>n.map(n=>n.id===e?{...n,note:t}:n)),J=async()=>{N(!0),A(null);try{const t=await(0,c.sendTableOrder)(e,j,{note:I,name:v,phone:P,allergies:z});f([]),M(''),A({kind:'success',text:t.held?`Order ${t.ref} sent. A member of staff will check it, then it goes to the kitchen.`:`Order ${t.ref} sent to the kitchen.`}),_()}catch(e){A({kind:'warn',text:(0,d.tableOrderError)(e,'send')}),q()}finally{N(!1)}};if(x)return(0,p.jsxs)(o.Screen,{title:"Order at the table",children:[(0,p.jsx)(o.Banner,{kind:"warn",title:"Couldn't open the menu",children:x}),(0,p.jsx)(o.Button,{label:"Try again",onPress:()=>{q()}})]});if(!s)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Muted,{children:"Opening the menu\u2026"})});if(!s.ok)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Banner,{kind:"warn",title:"This code isn't working",children:s.reason??'Please ask a member of staff.'})});const K=s.open&&j.length>0&&null!==k&&('none'===k||C.length>0)&&(0,d.nameOk)(v)&&(0,d.phoneOk)(P)&&!L,Q=s.askServer??[],U=[...new Set(Q.map(e=>e.section))],X=L?'Sending\u2026':j.length?null===k?'Answer the allergy question':(0,d.nameOk)(v)?(0,d.phoneOk)(P)?`Send order to the kitchen (${(0,i.gbp)(Y)})`:'Check the phone number':'Add your name to send':'Add a dish to order';return(0,p.jsxs)(o.Screen,{title:`Table ${(0,n.tableNumbers)(s.table)}`,subtitle:s.venueName,footer:s.open?(0,p.jsx)(o.Button,{label:X,disabled:!K,onPress:()=>{J()},testID:"send-table-order-live"}):void 0,children:[(0,p.jsxs)(o.Muted,{center:!0,children:["Tip: add dishes, answer the allergy question, add your name, then send. Staff bring it to table ",(0,n.tableNumbers)(s.table),". ",d.PAY_WORDS]}),s.tip?(0,p.jsx)(o.Banner,{kind:"demo",children:s.tip}):null,s.open?null:(0,p.jsx)(o.Banner,{kind:"warn",title:"Not taking table orders right now",children:s.reason}),s.open&&s.staffAccept&&!B.some(e=>e.accepted)?(0,p.jsx)(o.Muted,{children:"The first order from your phone is checked by a member of staff before it goes to the kitchen."}):null,$?(0,p.jsx)(o.Banner,{kind:$.kind,children:$.text}):null,B.length?(0,p.jsx)(r.default,{testID:"my-table-orders",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Your orders at this table"}),B.map(e=>(0,p.jsxs)(r.default,{style:{gap:2,paddingVertical:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e.ref}),(0,p.jsx)(o.T,{size:13,colour:'cancelled'===e.status?u.colours.amber:u.colours.gold,children:(0,d.guestStatusWords)(e)})]}),(0,p.jsxs)(o.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,i.gbp)(e.totalPence)," to pay at the bar or with the server"]})]},e.id))]})}):null,s.open?E.map(([e,t])=>(0,p.jsxs)(r.default,{style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:e}),t.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,p.jsxs)(r.default,{style:{flex:1,gap:2},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),e.description?(0,p.jsx)(o.Muted,{children:e.description}):null,(0,p.jsxs)(o.T,{size:13,colour:u.colours.muted,children:[e.allergens.length?`Contains: ${e.allergens.map(a.allergenLabel).join(', ')}`:'No allergens listed: ask staff if unsure',e.mayContain.length?` \xb7 May contain: ${e.mayContain.map(a.allergenLabel).join(', ')}`:'']})]}),(0,p.jsx)(o.T,{weight:"semibold",colour:u.colours.gold,children:(0,i.gbp)(e.pricePence)})]}),e.soldOut?(0,p.jsx)(o.Badge,{kind:"amber",label:"Sold out today"}):V(e.id)?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:V(e.id),min:0,max:20,onChange:t=>F(e.id,t),label:e.name}),(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>F(e.id,0)})]}):(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"Add",accessibilityLabel:`Add ${e.name}`,onPress:()=>F(e.id,1)})]},e.id))]},e)):null,s.open&&!W.length?(0,p.jsx)(o.Banner,{kind:"demo",title:"No dishes to order from your phone yet",children:"The kitchen is still checking the allergens on the menu. Please order with your server or at the bar."}):null,s.open&&Q.length?(0,p.jsxs)(r.default,{testID:"table-ask-server",style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:W.length?'Also on the menu':'On the menu'}),(0,p.jsx)(o.Muted,{center:!0,children:"Ask your server for these. They can't be ordered from your phone yet, while the kitchen checks their allergens."}),U.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:e}),Q.filter(t=>t.section===e).map((e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{style:{flex:1},children:e.name}),(0,p.jsx)(o.T,{colour:u.colours.muted,children:(0,i.gbp)(e.pricePence)})]},`${e.name}-${t}`))]},e))]}):null,s.open&&j.length?(0,p.jsx)(r.default,{testID:"table-cart",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:"Review your order"}),j.map(e=>{const n=W.find(t=>t.id===e.id);return(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{children:[e.qty,"\xd7 ",n?.name]}),(0,p.jsx)(o.T,{children:(0,i.gbp)(e.qty*(n?.pricePence??0))})]}),(0,p.jsx)(t.TextInput,{style:b,value:e.note,onChangeText:t=>H(e.id,t),placeholder:"Note for the kitchen (optional), e.g. no onions",placeholderTextColor:u.colours.muted,maxLength:140,accessibilityLabel:`Note for ${n?.name}`,testID:`table-note-${e.id}`})]},e.id)}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Total"}),(0,p.jsx)(o.T,{weight:"semibold",children:(0,i.gbp)(Y)})]})]})}):null,s.open?(0,p.jsx)(r.default,{testID:"table-allergy",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Does anyone at the table have a food allergy?"}),(0,p.jsx)(o.Muted,{center:!0,children:"We ask everyone, so the kitchen can keep you safe."}),(0,p.jsxs)(o.Row,{gap:8,style:{justifyContent:'center'},children:[(0,p.jsx)(o.Chip,{label:"No allergies",selected:'none'===k,onPress:()=>w('none')}),(0,p.jsx)(o.Chip,{label:"Yes, allergies",selected:'yes'===k,onPress:()=>w('yes')})]}),'yes'===k?(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:a.ALLERGENS.map(e=>(0,p.jsx)(o.Chip,{label:e.short,selected:C.includes(e.id),onPress:()=>S(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},e.id))}):null,G.length?(0,p.jsxs)(o.Banner,{kind:"warn",title:"Check with staff",children:[G.map(e=>e.name).join(', ')," ",G.length>1?'contain':'contains'," or may contain an allergy you picked. The kitchen will see your allergies on the ticket."]}):null]})}):null,s.open?(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Who's the order for?"}),(0,p.jsx)(t.TextInput,{style:b,value:v,onChangeText:O,placeholder:"Your name (needed)",placeholderTextColor:u.colours.muted,maxLength:40,accessibilityLabel:"Your name, needed",testID:"table-name",autoComplete:"name"}),(0,p.jsx)(t.TextInput,{style:b,value:P,onChangeText:R,placeholder:"Phone number (optional)",placeholderTextColor:u.colours.muted,maxLength:20,keyboardType:"phone-pad",accessibilityLabel:"Phone number, optional",testID:"table-phone",autoComplete:"tel"}),P&&!(0,d.phoneOk)(P)?(0,p.jsx)(o.Muted,{center:!0,children:"Please check the phone number, or leave it blank."}):null,(0,p.jsx)(o.Muted,{center:!0,children:"We only use these for this order."}),(0,p.jsx)(t.TextInput,{style:b,value:I,onChangeText:M,placeholder:"Note for the staff (optional)",placeholderTextColor:u.colours.muted,maxLength:300,accessibilityLabel:"Note for the staff (optional)"})]}):null,(0,p.jsx)(r.default,{testID:"pay-placeholder",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Paying"}),(0,p.jsx)(o.T,{center:!0,children:d.PAY_WORDS}),(0,p.jsx)(o.Muted,{center:!0,children:"No card details are asked for or kept in this app."})]})})]})};var e,t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),r=(e=s)&&e.__esModule?e:{default:e},o=_r(_d[4]),a=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]);const b={borderWidth:1,borderColor:u.colours.border,borderRadius:10,padding:10,color:u.colours.text,backgroundColor:u.colours.surface2}},1276,[796,829,34,102,794,830,836,1131,1277,848,840,25]); __d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tablePublic",{enumerable:!0,get:function(){return s}}),e.sendTableOrder=async function(t,r,a){if(!await(0,n.guestSession)())throw new Error('No connection. Try again when you are back online.');const o=await(0,n.rpc)('guest_table_order_v2',{p_phone:(a.phone??'').trim().slice(0,20)||null,p_token:t,p_lines:r.map(t=>({id:t.id,qty:t.qty,note:t.note.trim().slice(0,140)})),p_note:a.note.trim().slice(0,300)||null,p_allergies:a.allergies.map(t=>({allergen:t.allergen,severity:t.severity})),p_name:a.name.trim().slice(0,40)||null});if(!o||!1===o.ok||!o.id)throw new Error(o?.reason||'This table code isn\u2019t working any more. Please ask a member of staff.');return{id:o.id,ref:o.ref,held:!!o.held,totalPence:o.totalPence}},e.myTableOrders=async function(t){return await(0,n.guestSession)()?await(0,n.rpc)('guest_table_my_orders',{p_token:t})??[]:[]},e.loadTableSettings=async function(){const{data:t,error:n}=await a().from('table_order_settings').select('*').eq('venue_id',o()).maybeSingle();if(n)throw n;return(0,r.fromRow)(t)},e.saveTableSettings=async function(t,n){const{error:s}=await a().from('table_order_settings').upsert({venue_id:o(),...(0,r.toRow)(t),updated_at:(new Date).toISOString(),updated_by:n.slice(0,80)});if(s)throw s},e.listTableCodes=async function(){const{data:t,error:n}=await a().from('table_qr_codes').select('table_no, token, created_at').eq('venue_id',o()).eq('is_on',!0);if(n)throw n;return(t??[]).map(t=>({table:String(t.table_no),token:String(t.token),createdAt:String(t.created_at)})).sort((t,n)=>Number(t.table)-Number(n.table))},Object.defineProperty(e,"tableReadiness",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"makeTableCodes",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"renewTableCode",{enumerable:!0,get:function(){return u}}),e.watchTableSettings=function(t){const r=n.useSync.getState().venueId;if(!r)return()=>{};const o=a().channel(`tos-${r}-${Math.random().toString(36).slice(2,8)}`).on('postgres_changes',{event:'*',schema:'public',table:'table_order_settings',filter:`venue_id=eq.${r}`},()=>t()).subscribe();return()=>{a().removeChannel(o)}};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const a=()=>(0,t.getSupabase)(),o=()=>{const t=n.useSync.getState().venueId;if(!t)throw new Error('Not connected to the venue yet.');return t},s=t=>(0,n.rpc)('table_public',{p_token:t});const l=()=>(0,n.rpc)('table_order_readiness',{p_venue:o()}),c=t=>(0,n.rpc)('table_qr_make',{p_venue:o(),p_tables:t}),u=t=>(0,n.rpc)('table_qr_renew',{p_venue:o(),p_table:t})},1277,[931,985,1131]); __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 l}});var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]);function l(){return(0,t.canShow)('display')?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.DisplayBoard,{}),(0,c.jsx)(u.DisplayPairing,{})]}):(0,c.jsx)(n.Redirect,{href:t.ENTRY[t.APP_VARIANT]})}},1278,[30,34,846,1279,1334,25]); -__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Pe}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:G,subHeader:Le,noVoice:We=!1}={}){const Oe=(0,P.default)(),Ve=g??Oe.width,Ue=Oe.height,Ke=Ve<700,qe=Ve>=Ue,Ye=!Ke&&qe&&Ve>=600,Qe=Ye,Je=Math.round(Math.min(520,Math.max(Ve>=1e3?448:280,.3*Ve))),Xe=S.default.useRef(null),Ze=S.default.useRef(0),[et,tt]=(0,v.useState)({w:0,h:0}),lt=(0,q.useOwner)(e=>e.site),st=(0,V.useRestaurant)(lt);(0,me.useAlertWatcher)(lt,{enabled:!e});const it=(0,V.useOrders)(lt),ot=(0,V.useBookings)(lt),nt=(0,V.useEvents)(lt),at=(0,V.useStore)(e=>e.skipMinutes),rt=(0,V.useStore)(e=>e.clock.mode),dt=(0,V.useNow)(5e3),ct=(0,q.useOwner)(e=>e.staff),ut=(0,q.useOwner)(e=>e.attendance),ht=(0,q.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,Q.ensureAttendance)((0,F.ymd)(dt),dt)},[(0,F.ymd)(dt)]);const gt=ut.filter(e=>e.in&&!e.out&&dt.getTime()-new Date(e.in).getTime()<72e6&&dt.getTime()>=new Date(e.in).getTime()),bt=Ee(ct.find(e=>e.id===gt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,bt,!e);const yt=(0,F.ymd)(dt),pt=(0,T.useTravelDay)('display',yt),xt=(0,Y.useFrontDoor)(yt,qe),ft=(0,J.useDisplaySettings)(lt),mt=ft.privacy,jt=(0,ne.useSaverSync)(),wt=(0,J.usePlan)(lt),kt=(0,J.useFloor)(e=>e.live[lt]),It=(0,je.useBlocks)(e=>e.blocks),[Dt,vt]=(0,v.useState)('plan'),[St,Ct]=(0,v.useState)('all'),[Tt,$t]=(0,v.useState)(null),[Bt,Rt]=(0,v.useState)(null),[Lt,Wt]=(0,v.useState)(null),[zt,Mt]=(0,v.useState)(!1),[Ht,Pt]=(0,v.useState)(!1),[Et,At]=(0,v.useState)(null),[Ot,Nt]=(0,v.useState)(!1),[_t,Gt]=(0,v.useState)(!1),[Ft,Vt]=(0,v.useState)(null),[Ut,Kt]=(0,v.useState)(null),[qt,Yt]=(0,v.useState)(null),Qt=S.default.useRef(0),Jt=e=>{Qt.current=Date.now(),Yt(e)};S.default.useEffect(()=>{if(!qt)return;const e=setInterval(()=>{Date.now()-Qt.current>=De.DAY_IDLE_MS&&Yt(null)},5e3);return()=>clearInterval(e)},[qt]);const Xt=(0,V.useWaitlist)(lt),Zt=(0,V.useStore)(e=>e.walkIns[lt]??0),[el,tl]=(0,v.useState)(!1),[ll,sl]=(0,v.useState)(!1),[il,ol]=(0,v.useState)(!1);(0,N.useReviewAlerts)(lt);const[nl,al]=(0,v.useState)({view:0,content:0}),[rl,dl]=(0,v.useState)(null);S.default.useEffect(()=>{rl&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:rl,timeoutMs:4500,big:!0,testID:'floor-toast'}),dl(null))},[rl]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[cl,ul]=(0,v.useState)(null),hl=S.default.useRef(0),[gl,bl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!cl)return;hl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-hl.current;if(e>=Pe)return ul(null),void dl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');bl(e>=105e3?Math.ceil((Pe-e)/1e3):null)},1e3);return()=>clearInterval(e)},[cl]);const yl=e=>e.date!==yt?Wt({title:`Guest details \xb7 ${(0,De.dayWord)(e.date,yt)} ${e.time}`,body:(0,He.jsx)(He.Fragment,{children:(0,ye.bookingDetails)(e)})}):Wt({title:`Guest details \xb7 ${e.time}`,body:(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Fe,{rid:lt,id:e.id,turnBase:st.settings.turnMins}),e.walkIn?null:(0,He.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Wt(null),At(e.id)},style:{minHeight:56}}),e.walkIn?(0,He.jsx)(ue.CancelWalkInButton,{rid:lt,b:e,big:!0,onDone:e=>{Wt(null),dl(e)}}):null,e.walkIn?(0,He.jsx)(ue.ReinstateWalkInButton,{rid:lt,b:e,today:yt,onDone:e=>{Wt(null),dl(e)}}):null,(0,ye.bookingDetails)(e)]})}),pl=ot.filter(e=>e.date===yt).sort((e,t)=>e.time.localeCompare(t.time)),xl=pl.filter(e=>!['cancelled','noshow'].includes(e.status)),fl=it.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),ml=(0,v.useMemo)(()=>(0,d.forecastToday)(st,ot,it,nt,dt),[st,ot,it,nt,dt.getTime()/6e4|0]),jl=(0,je.closedAreasAt)(It,lt,yt,(0,F.hm)(dt)),wl=[...jl].join(','),kl=(0,v.useMemo)(()=>(0,X.floorView)(wt,ot,it,kt??{},dt,st.settings.turnMins,jl),[wt,ot,it,kt,dt.getTime(),wl]),Il=(0,be.hoursFor)(st,dt),Dl=Il?.open??new Date(`${yt}T12:00:00`),vl=Il?.close??new Date(`${yt}T21:00:00`),Sl=(0,F.addMins)(Dl,-Dl.getMinutes()),Cl=(0,F.addMins)(vl,90),Tl=e=>new Date(`${yt}T${e}:00`),$l=(0,je.blocksOn)(It,lt,yt).map(e=>({from:Tl(e.from),to:Tl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(st,dt,yt)),Bl=Object.keys(kl).filter(e=>'blocked'===kl[e]?.status),Rl=qt&&qt!==yt?qt:yt,Ll=Rl!==yt,Wl=(0,De.dayWord)(Rl,yt),zl=/^(Today|Yesterday|Tomorrow)$/.test(Wl),Ml=Ll?(0,De.bookingsForDay)(ot,Rl,yt).sort((e,t)=>e.time.localeCompare(t.time)):pl,Hl=(0,F.parseYmd)(Rl);Hl.setHours(12);const Pl=Ll?(0,be.hoursFor)(st,Hl):Il,El=Pl?.open??new Date(`${Rl}T12:00:00`),Al=Pl?.close??new Date(`${Rl}T21:00:00`),Ol=e=>new Date(`${Rl}T${e}:00`),Nl=[...Ll?(0,je.blocksOn)(It,lt,Rl).map(e=>({from:Ol(e.from),to:Ol(e.to),label:e.reason??'Paused'})):$l,...Ll?(0,i.queuedServicePauses)(st,Hl,Rl):[]],_l=(0,i.queuedServiceSessions)(st,Hl),Gl=l.IS_QUEUED_VENUE&&(void 0===_l||!_l.length),Fl=(0,He.jsxs)(H.default,{testID:"queued-hours-gate",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:void 0===_l?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,He.jsx)(A.Muted,{children:s.queuedVenues[lt]?.hours.note})]}),Vl=Ll?Pl||Ml.length?RlLl?(0,X.dayFloorView)(wt,Ml,Rl):kl,[Ll,wt,Ml,Rl,kl]),[Kl,ql]=(0,v.useState)(null),Yl=Ll?Ml.filter(e=>!['cancelled','noshow'].includes(e.status)):xl,Ql=Yl.reduce((e,t)=>e+t.partySize,0),Jl=(0,c.coversSplit)(Yl,Rl),Xl=(0,ve.cancelledDayTally)(ot,Rl),Zl=(0,Se.cancellationsFor)(ot,Rl,e=>e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)','')),es=(0,ve.cancelledTallyWords)(Xl,zl?Wl.toLowerCase():Ll?`on ${Wl}`:'today'),ts=It.filter(e=>e.rid===lt&&e.date===Rl&&!e.removedAt),ls=(0,Ie.chartBands)(ts,60*El.getHours()+El.getMinutes(),60*Al.getHours()+Al.getMinutes()),ss=new Set((0,Ie.blockedHours)(ls)),is=dt.getHours()+(dt.getMinutes()>=30?1:0),os=ml.hours.filter(e=>e.hour>=is&&!ss.has(e.hour)),ns=os.reduce((e,t)=>e+t.coversHigh,0),as=os.reduce((e,t)=>e+t.coversLow,0),rs=Math.round((as+ns)/2),ds=!ml.example&&ml.open&&ml.enough&&ns>0?`Usually ${(0,d.coversRange)(rs,rs)} more`:void 0,cs=async(e,t)=>{const l=kl[e]?.booking;if(!l||e===t)return;const s=kl[t]?.status;if(s&&!['free','soon'].includes(s))return void dl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${X.STATUS[s].label.toLowerCase()}. Pick a free table.`);await V.repo.bookings.update(l.id,{table:t});const i=kt?.[e]?.stage;J.useFloor.getState().setLive(lt,t,{stage:i??'seated',dirty:!1}),J.useFloor.getState().setLive(lt,e,{stage:void 0,dirty:!0}),dl(`${(0,ae.privName)(l,mt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},us=Ut?ot.find(e=>e.id===Ut.id):void 0,hs=Ut&&us?(()=>{const e=us.walkIn?(0,ae.privName)(us,mt):Ee(us.name),t=(0,ge.seatsOf)(wt,Ut.tables).total,l=(0,ge.seatLine)(t,us.partySize),s=(0,ge.pickClashes)(us,Ut.tables,ot.filter(e=>e.date===us.date),st.settings.turnMins),i=(0,ge.tableKey)(Ut.tables)!==(0,ge.tableKey)((0,J.tablesOf)(us.table));return(0,He.jsxs)(H.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:U.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,padding:10},children:[(0,He.jsxs)(H.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,De.dayWord)(us.date,yt)} ${us.time}. Tap tables on the plan to add or take them off. ${(0,ge.tablesWords)(Ut.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,De.dayWord)(us.date,yt)," ",us.time]}),(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[(0,ge.tablesWords)(Ut.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,He.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,He.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,ge.tablesWords)(Ut.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(us){try{await(0,he.saveBookingTables)(lt,us,Ut.tables),dl((0,ge.savedWords)(e,us.partySize,Ut.tables,t))}catch(t){dl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Kt(null)}else Kt(null)}}),(0,He.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Kt(null)})]})]})})():null,gs=wt.areas.filter(e=>wt.tables.some(t=>t.areaId===e.id)),bs=e=>{const t=wt.tables.filter(t=>t.areaId===e);return Ll?`${t.filter(e=>!Ul[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(kl[e.name]?.status??'free')).length}/${t.length} free`},ys='all'===St||gs.some(e=>e.id===St)?St:'all',ps=e=>(0,He.jsx)(Z.FloorCanvas,{plan:wt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Ye,big:!0,view:Ul,privacy:mt,turnBase:st.settings.turnMins,highlight:Ut?Ut.tables:Bt?[Bt]:void 0,onTap:e=>{return t=e.name,void(Ut?Kt(e=>e?{...e,tables:(0,ge.toggleTable)(e.tables,t)}:e):Ll?ql(t):Bt?(t!==Bt&&cs(Bt,t),Rt(null)):$t(t));var t},onDrop:(e,t)=>Ut||Ll?void 0:cs(e.name,t.name)}),xs=Ke?1:qe||gs.length>2?2:1,fs=e=>{const t=wt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ms=[];for(let e=0;e{const t=(0,Z.areaBounds)(wt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,Z.minReadableScale)(wt,e.id)}}),et.w,et.h):null,ws=e=>(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',height:ee.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:bs(e.id)})]}),ks=(0,He.jsx)(H.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-et.w)>1||Math.abs(l-et.h)>1)&&tt({w:t,h:l})},children:js?(0,He.jsx)(M.default,{style:{flex:1},scrollEnabled:js.scroll,showsVerticalScrollIndicator:js.scroll,contentContainerStyle:{gap:ee.GRID_GAP},children:js.rows.map((e,t)=>(0,He.jsx)(H.default,{style:{height:js.rowHeights[t],flexDirection:'row',gap:ee.GRID_GAP},children:e.map(e=>{const t=gs.find(t=>t.id===e);return(0,He.jsxs)(H.default,{testID:`area-cell-${e}`,style:{width:js.cellW,gap:2},children:[ws(t),(0,He.jsx)(H.default,{style:{flex:1},children:ps(e)})]},e)})},t))}):null}),Is=(0,He.jsxs)(H.default,{testID:"venue-plan",style:{flex:Ke?void 0:1,gap:10,minWidth:0},children:[(0,He.jsx)(a.TableNumberWarning,{plan:wt}),wt.tables.length?null:(0,He.jsxs)(H.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,He.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,He.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,He.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,He.jsx)(_e,{chipId:"all",compact:!Ke,label:"Whole venue",selected:'all'===ys,onPress:()=>Ct('all')},"__all"),...gs.map(e=>(0,He.jsx)(_e,{chipId:e.id,compact:!Ke,label:`${e.name}${(0,te.areaMarks)(e)}`,colour:(0,U.brandColour)(e.colour),sub:Ke?jl.has(e.id)?'closed':ys===e.id?bs(e.id):void 0:void 0,selected:ys===e.id,onPress:()=>Ct(e.id)},e.id))];return Ke?(0,He.jsx)(H.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,He.jsx)(M.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;al(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>al(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:nl.view>0&&nl.content>0&&nl.content<=nl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:nl.view>0&&nl.content<=nl.view+1?'100%':void 0},children:e})})(),(0,He.jsx)(h.FloorLegend,{}),hs,Bt?(0,He.jsxs)(A.Row,{gap:8,style:{backgroundColor:U.colours.goldTint,borderRadius:10,padding:8},children:[(0,He.jsxs)(A.T,{weight:"semibold",colour:U.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Bt),": tap the new table."]}),(0,He.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Rt(null)})]}):null,'all'===ys&&Ye?ks:'all'===ys?(0,He.jsx)(H.default,{style:{flex:Ke?void 0:1,gap:12,minHeight:Qe?void 0:360},children:ms.map((e,t)=>(0,He.jsxs)(H.default,{style:{flex:Ke?void 0:Math.max(.3,...e.map(e=>fs(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,He.jsxs)(H.default,{style:{flex:1,gap:2},children:[Ke?(0,He.jsxs)(H.default,{style:{alignItems:'center',gap:4},children:[(0,He.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{center:!0,children:bs(e.id)})]}):(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{children:bs(e.id)})]}),(0,He.jsx)(H.default,{style:Ke?{height:Math.max(280,Math.round((Ve-40)*fs(e.id)))}:{flex:1},children:ps(e.id)})]},e.id)),e.length{if(Ll)return void Vt(e.id);const t=(0,J.tablesOf)(e.table)[0];t&&kl[t]?$t(t):yl(e)}},Rl)}),vs='timeline'===Dt,Ss=Ll?(0,He.jsxs)(H.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,backgroundColor:U.colours.goldTint},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:zl?`Showing ${Wl} \xb7 ${(0,F.niceDate)((0,F.parseYmd)(Rl))}`:`Showing ${(0,De.dayWord)(Rl,yt)}`}),(0,He.jsx)(H.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${es}. Showing ${(0,De.dayLong)(Rl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,He.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Kt(null),Jt(null)},style:{minHeight:44}})]}):null,Cs=(0,He.jsx)(H.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:Ke?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===vs;return(0,He.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},onPress:()=>vt(e),style:{flex:Ke?1:void 0,minHeight:Ke?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?U.colours.gold:'transparent',...$e.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,He.jsx)(A.T,{size:Ke?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ts=(0,u.useBookingWrite)(),$s=e=>(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Be.BigAction,{premium:!0,label:"Walk-in",onPress:xt.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"New booking",onPress:xt.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"Edit booking",onPress:()=>Pt(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint})]});(0,Me.useDisplayNotices)(lt,!e);const Bs=Ke?180:168,[Rs,Ls]=(0,v.useState)(Bs),Ws=S.default.useRef(Bs),zs=S.default.useRef(null),Ms=S.default.useRef(null),Hs=()=>{const e=zs.current,t=Ms.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ue<820?8:12,o=44+(Ue<820?4:8),n=i>Ws.current?Math.ceil(i-Ws.current):ke.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Bs,Math.floor(t-s-l)-n-o));Math.abs(Ws.current-a)>=2&&(Ws.current=a,Ls(a))})})};S.default.useEffect(()=>{const e=setTimeout(Hs,60);return()=>clearTimeout(e)},[Ve,Ue]);const Ps=(0,He.jsxs)(H.default,{ref:Ms,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),Hs()},style:{flexDirection:'row',flexWrap:Ve>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:Ke?12:6,justifyContent:Ke?'center':void 0,borderTopWidth:1,borderTopColor:U.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,He.jsx)(ze.DisplayClockButton,{}),(0,He.jsx)(se.HoldToEdit,{quiet:!0,onUnlock:()=>{bl(null),ul({at:Date.now()})},onHint:()=>dl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,He.jsx)(we.BlockBookingsButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,display:!0,day:Rl}),wt.areas.some(e=>e.outdoor)?(0,He.jsx)(we.CloseGardenButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,short:!0}):null,(0,He.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>ol(!0),style:({pressed:e})=>({...$e.look.quiet(e),flexGrow:1}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,He.jsx)(p.GiftQrButton,{rid:lt,venue:st.name})]}),Es=fl.length?(0,He.jsxs)(H.default,{testID:"takeaway-panel",style:[$e.look.panel,{overflow:'hidden'}],children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,He.jsxs)(A.T,{size:12,colour:U.colours.muted,children:[fl.length," live"]})]}),(0,He.jsx)(H.default,{style:{padding:10},children:(0,He.jsx)(Ge,{list:fl,me:bt,compact:!0,bookings:ot})})]}):null,As=(Te.DueToday,Ll?Ml:pl.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Os=Ll?zl?`${Wl}\u2019s guests`:`Guests ${Wl}`:'Today\u2019s guests',Ns=(0,He.jsxs)(He.Fragment,{children:[0===As.length?(0,He.jsx)(A.Muted,{children:Ll?Rl{const t=(0,K.isSeatedHighlight)(e.status,{otherDay:Ll}),l=(0,re.guestRowText)(e,{name:e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)',''),seated:t}),s=t?K.SEATED_FG:U.colours.text,i=t?K.SEATED_MUTED:U.colours.muted,o=t?K.SEATED_FG:U.colours.gold,n=l.depositWarn?U.colours.amber:t?K.SEATED_FG:U.colours.goldLight;return(0,He.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:Ll?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Gt(!1),Vt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,K.seatedHighlightStyle)({backgroundColor:e?U.colours.goldLight:U.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:U.colours.hairline,backgroundColor:e?U.colours.tilePressed:'transparent'},children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,He.jsx)(H.default,{style:{paddingTop:2},children:(0,He.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':U.colours.amber,ink:t?U.colours.gold:U.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,He.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,He.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,He.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,He.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,He.jsx)(H.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,He.jsx)(de.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,He.jsx)(Ce.CancellationsSection,{items:Zl,dayWord:Ll?zl?Wl.toLowerCase():`on ${Wl}`:'today'})]}),_s=(0,He.jsx)(M.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Ns}),Gs=W.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Gt(!1)}}),Fs=(0,He.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Os}, ${As.length}`,accessibilityState:{expanded:_t},'aria-expanded':_t,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Gt(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:_t?U.colours.gold:U.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?U.colours.tilePressed:_t?U.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,He.jsx)(A.T,{size:16,weight:"bold",colour:U.colours.gold,children:As.length}),(0,He.jsx)(H.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(H.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,He.jsxs)(A.T,{size:13,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,children:[Os," ",_t?'\u2039':'\u203a']})})})]}),Vs=_t?(0,He.jsxs)(H.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,He.jsxs)(H.default,{testID:"guests-drawer",...Gs.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ve)),backgroundColor:U.colours.surface,borderRightWidth:1,borderColor:U.colours.gold,borderRadius:14,...$e.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Os.toUpperCase()," (",As.length,")"]}),Xl.count?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:es}):null,(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Os}`,onPress:()=>Gt(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:18,colour:U.colours.muted,children:"\u2715"})})]}),_s]}),(0,He.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Os}`,accessibilityRole:"button",onPress:()=>Gt(!1),style:{flex:1}})]}):null,Us=Gl?Fl:l.IS_KIRKTON&&!Object.values(st.kitchenHours??{}).some(Boolean)?(0,He.jsxs)(H.default,{testID:"kirkton-hours-to-confirm",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,He.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,He.jsx)(ke.DayGraph,{busyThreshold:(0,t.venueBusy)(st,ot,dt).busy,todays:Ml,open:El,close:Al,now:dt,turnBase:st.settings.turnMins,blocks:ts,pauses:Nl,compact:Ke,dense:!Ke,height:Ye?Rs:Bs,forecastNote:Ll?void 0:ds,emptyText:Vl,past:Rl{Ll?Gt(!0):vt('timeline')},Qs=(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',padding:Ue<820?8:12,paddingTop:Ue<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[pt?null:Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[pt?null:Ss,pt?(0,He.jsx)(M.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"})}):vs?Ds:Is,Vs]}),(0,He.jsxs)(H.default,{testID:"display-side",style:{width:Je,gap:Ue<820?4:8,minHeight:0},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:$s(!1)}),(0,He.jsx)(H.default,{style:{flexShrink:0},children:Cs}),pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:Ue<820,snug:Ue<820,tight:Ue<700,aside:`${Yl.length} ${1===Yl.length?'table':'tables'} booked${fl.length?` \xb7 ${fl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{ref:zs,testID:"day-graph-slot",onLayout:Hs,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Ks}),(0,He.jsxs)(M.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,He.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,He.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),Es,(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt})]})]})]});return(0,He.jsxs)(E.SafeAreaView,{style:{flex:1,backgroundColor:U.colours.bg},onTouchStart:()=>{Qt.current=Date.now()},onMouseDown:()=>{Qt.current=Date.now()},children:[Ke?(0,He.jsxs)(H.default,{style:{flex:1},children:[(0,He.jsxs)(M.default,{ref:Xe,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,He.jsx)(H.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,He.jsx)(f.ExitButton,{})}),(0,He.jsx)(_.RestaurantLogo,{rid:lt,size:64}),(0,He.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:st.name}),(0,He.jsx)(_.PoweredBy,{}),(0,He.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,He.jsx)(H.default,{accessible:!0,accessibilityLabel:`Current time ${(0,F.hm)(dt)}`,children:(0,He.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:U.colours.goldLight,children:(0,F.hm)(dt)})}),(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:"m"}),(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:"m"}),G]}),Le,qs,(0,He.jsx)(H.default,{testID:"phone-glance",style:{width:'100%'},children:(0,He.jsx)(Ne,{phone:!0,split:Jl,items:[{label:`Tables \xb7 ${Wl}`,value:Yl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Wl}`,value:Ql,testID:'badge-covers'},{label:'Takeaway',value:fl.length,alert:fl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Mt(!0)}]})}),(0,He.jsx)(H.default,{testID:"primary-actions",style:{gap:8},children:$s(!0)}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),Cs,(0,He.jsx)(H.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:vs?Ds:Is}),(0,He.jsxs)(H.default,{onLayout:e=>{Ze.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[$e.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,He.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:U.colours.goldLight,accessibilityRole:"header",children:[Os," (",As.length,")"]}),(0,He.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{gap:4},children:Ns})]}),Es,Ks,(0,He.jsx)(H.default,{testID:"covers-dock",children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Xe.current?.scrollTo({y:Ze.current,animated:!0})})}),(0,He.jsxs)(H.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,He.jsx)(A.T,{center:!0,size:14,colour:mt?U.colours.muted:U.colours.amber,children:mt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,He.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,He.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ps]}),e?null:(0,He.jsx)(H.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:U.colours.hairline},children:(0,He.jsx)(R.VoiceSlot,{size:56})})]}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ve>=1e3?18:14,paddingVertical:Ue<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...$e.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,He.jsx)(H.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,He.jsx)(_.RestaurantBrand,{rid:st.id,size:Ve<900?32:40,beside:!0})}),(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,He.jsx)(A.T,{size:Ve<900?18:21,weight:"semibold",colour:U.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,F.hm)(dt)}),Ve>=900?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:(0,F.niceDate)(dt)}):null]})]}),pt?(0,He.jsx)(H.default,{style:{width:220}}):(0,He.jsx)(H.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:qs}),(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:Ve<900?'xs':Ve<1100||Ue<700?'s':'m'}),(0,He.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.muted,children:"?"})}),'simulated'===rt?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>at(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:11,colour:U.colours.muted,children:"+15"})}):null,e?null:(0,He.jsx)(f.ExitButton,{}),G,We?null:(0,He.jsx)(R.VoiceSlot,{size:44})]})]}),Le,pt?null:(0,He.jsxs)(H.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,He.jsx)(Ne,{splitOnly:!0,split:Jl,items:[]}),(0,He.jsx)(H.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ve>=1e3?18:14)+(e?0:52)+('simulated'===rt?52:0),zIndex:4},children:(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:Ve<1100||Ue<700?'s':'m'})})]}),Ye?Qs:(Js=(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"front-door-bar",style:{gap:10},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:$s(!1)}),Cs]}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),pt?(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"}):(0,He.jsx)(He.Fragment,{children:(0,He.jsxs)(H.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Ss,vs?Ds:Is,Vs]})]})}),Es,pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Bs+ke.DAY_GRAPH_CHROME},children:Ks})]}),(0,He.jsx)(M.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:Js})),Ps]}),(0,He.jsx)(j.SoldOutStrip,{rid:lt,by:bt,onOpen:()=>ol(!0)}),(0,He.jsx)(w.SoldOutSheet,{visible:il,onClose:()=>ol(!1),rid:lt,by:bt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,He.jsx)(y.TableOrderCue,{rid:lt}),xt.elements,Ht?(0,He.jsx)(b.EditBookingPicker,{rid:lt,today:yt,who:bt,hidePrivate:!0,onClose:()=>Pt(!1)}):null,Et?(0,He.jsx)(b.EditBookingSheet,{rid:lt,id:Et,who:bt,hidePrivate:!0,onClose:()=>At(null)}):null,Tt?(0,He.jsx)(ye.TableSheet,{rid:lt,name:Tt,view:kl,plan:wt,todays:pl,now:dt,privacy:mt,turnBase:st.settings.turnMins,onClose:()=>$t(null),onWalkIn:e=>xt.openWalkInAt(e),onMove:e=>Rt(e),onDetails:yl}):null,Kl?(()=>{const e=Ul[Kl],t=e?.dayBookings??[];return(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>ql(null),title:`${(0,r.tableNumbers)(Kl)} \xb7 ${zl?Wl:(0,De.dayLong)(Rl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${zl?Wl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${zl?Wl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,ae.privName)(e,mt):Ee(e.name);return(0,He.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,ge.tablesWords)((0,J.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{ql(null),Vt(e.id)},style:{minHeight:56}},e.id)}),(0,He.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>ql(null),style:{minHeight:56}})]})})():null,Ft?(()=>{const e=ot.find(e=>e.id===Ft);return e?(0,He.jsx)(ce.GuestActionsSheet,{rid:lt,b:e,name:e.walkIn?(0,ae.privName)(e,mt):Ee(e.name),view:kl,now:dt,otherDay:e.date!==yt,turnBase:st.settings.turnMins,onClose:()=>Vt(null),onDetails:yl,onDone:dl,onPickOnPlan:(e,t)=>{Gt(!1),vt('plan'),Ct('all'),Kt({id:e.id,tables:t})}}):null})():null,Lt?(0,He.jsx)(ye.DetailsPanel,{title:Lt.title,onClose:()=>Wt(null),children:Lt.body}):null,Ot?(0,He.jsx)(ye.ServiceSummary,{r:st,todays:pl,orders:it,waitlistAll:Xt,walkInCount:Zt,onClose:()=>Nt(!1)}):null,el?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>tl(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,He.jsx)(h.FloorLegend,{}),(0,He.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>tl(!1)})]}):null,ll?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>sl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,He.jsx)(O.ReviewsSection,{rid:lt,mode:"read",venueName:st.name}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>sl(!1)})]}):null,zt?(0,He.jsxs)(ye.DetailsPanel,{title:"Takeaway",onClose:()=>Mt(!1),children:[(0,He.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,He.jsx)(Ge,{list:fl,me:bt,bookings:ot})]}):null,cl?(0,He.jsx)(H.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:U.colours.bg},children:(0,He.jsx)(le.PlanDesigner,{initial:wt,venue:st.name,mode:"display",startStep:"arrange",onActivity:()=>{hl.current=Date.now(),null!==gl&&bl(null)},notice:null!==gl?`Locking again in ${gl} s \xb7 touch to keep editing`:null,onSave:e=>{J.useFloor.getState().setPlan(lt,e),ul(null),dl('Table plan saved. Editing is locked again.')},onCancel:()=>{ul(null),dl('No changes kept. Editing is locked again.')}},cl.at)}):null,e?null:(0,He.jsx)(oe.Screensaver,{rid:lt,idleMins:ft.idleMins,pinOn:ft.pinOn,wake:ft,tonightCards:ft.tonightCards,cfg:jt}),e?null:(0,He.jsx)(xe.PrintHost,{rid:lt}),e?null:(0,He.jsx)(pe.AlertHost,{variant:"display",rid:lt,skipTakeaway:!0}),e?null:(0,He.jsx)(B.SeatAllergenReminder,{rid:lt}),e?null:(0,He.jsx)(fe.TakeawayTakeover,{rid:lt,me:bt})]});var Js};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),z=e(_r(_d[31])),M=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=_r(_d[35]),A=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),ze=_r(_d[85]),Me=_r(_d[86]),He=_r(_d[87]);const Pe=12e4,Ee=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Oe=e=>e.slotTime?(0,F.hm)(new Date(e.slotTime)):'ASAP';function Ne({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,He.jsxs)(H.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,He.jsx)(H.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,He.jsxs)(H.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,He.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?U.colours.amber:U.colours.text,children:e.value}),(0,He.jsx)(A.T,{size:l?14:12,colour:U.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,He.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,He.jsx)(H.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,He.jsx)(A.T,{size:14,colour:U.colours.muted,children:"No Covers yet"}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:U.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,He.jsxs)(H.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:U.colours.gold},children:[(0,He.jsx)(H.default,{style:{width:`${s.walkInPct}%`,backgroundColor:U.colours.gold}}),(0,He.jsx)(H.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function _e({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,He.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,He.jsx)(H.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,He.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?U.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,He.jsx)(A.T,{size:12,colour:U.colours.muted,children:l}):null]})}function Ge({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,We.statusBlock)(e,t,(0,We.linkedBooking)(e,s));return e.length?(0,He.jsx)(H.default,{style:{gap:8},children:e.map(e=>(0,He.jsxs)(H.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:U.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?U.colours.ok:e.allergies.length?U.colours.red:U.colours.gold},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Oe(e)," \xb7 ",Ee(e.customerName)]}),(0,He.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,He.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:U.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,G.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,He.jsx)(Le.AllergyChain,{o:e,me:t,compact:!0}):null,(0,He.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,He.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>V.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,He.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,He.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'collected',t)}):null,(0,He.jsx)(xe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,He.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Fe({rid:e,id:t,turnBase:l}){const s=(0,V.useBookings)(e).find(e=>e.id===t);return s?(0,He.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1279,[1121,5,6,1280,798,822,1094,829,1120,1281,1282,1283,1091,1115,1284,1285,1287,1288,1289,1130,977,1099,1290,34,1073,1148,1033,1087,1116,1291,380,402,295,102,426,36,794,1186,1190,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1292,1107,1293,1296,1298,1301,1304,1300,1305,1307,1308,1112,1093,1095,852,1310,1175,1311,1185,1177,1011,1316,1324,1326,1076,1114,1328,1329,1330,1143,1331,1142,1136,838,1332,1333,25]); +__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Ee}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:F,subHeader:We,noVoice:Me=!1}={}){const Ne=(0,E.default)(),Ue=g??Ne.width,Ke=Ne.height,qe=Ue<700,Ye=Ue>=Ke,Qe=!qe&&Ye&&Ue>=600,Je=Qe,Xe=Math.round(Math.min(520,Math.max(Ue>=1e3?448:280,.3*Ue))),Ze=S.default.useRef(null),et=S.default.useRef(0),[tt,lt]=(0,v.useState)({w:0,h:0}),st=(0,Y.useOwner)(e=>e.site),it=(0,U.useRestaurant)(st);(0,je.useAlertWatcher)(st,{enabled:!e});const ot=(0,U.useOrders)(st),nt=(0,U.useBookings)(st),at=(0,U.useEvents)(st),rt=(0,U.useStore)(e=>e.skipMinutes),dt=(0,U.useStore)(e=>e.clock.mode),ct=(0,U.useNow)(5e3),ut=(0,Y.useOwner)(e=>e.staff),ht=(0,Y.useOwner)(e=>e.attendance),gt=(0,Y.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,J.ensureAttendance)((0,V.ymd)(ct),ct)},[(0,V.ymd)(ct)]);const bt=ht.filter(e=>e.in&&!e.out&&ct.getTime()-new Date(e.in).getTime()<72e6&&ct.getTime()>=new Date(e.in).getTime()),yt=Oe(ut.find(e=>e.id===bt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,yt,!e);const pt=(0,V.ymd)(ct),xt=(0,T.useTravelDay)('display',pt),ft=(0,Q.useFrontDoor)(pt,Ye),mt=(0,X.useDisplaySettings)(st),jt=mt.privacy,wt=(0,ae.useSaverSync)(),kt=(0,X.usePlan)(st),It=(0,X.useFloor)(e=>e.live[st]),Dt=(0,we.useBlocks)(e=>e.blocks),[vt,St]=(0,v.useState)('plan'),[Ct,Tt]=(0,v.useState)(!1),[$t,Bt]=(0,v.useState)('all'),[Rt,Lt]=(0,v.useState)(null),[Wt,Mt]=(0,v.useState)(null),[zt,Ht]=(0,v.useState)(null),[Pt,Et]=(0,v.useState)(!1),[Ot,At]=(0,v.useState)(!1),[Nt,_t]=(0,v.useState)(null),[Gt,Ft]=(0,v.useState)(!1),[Vt,Ut]=(0,v.useState)(!1),[Kt,qt]=(0,v.useState)(null),[Yt,Qt]=(0,v.useState)(null),[Jt,Xt]=(0,v.useState)(null),Zt=S.default.useRef(0),el=e=>{Zt.current=Date.now(),Xt(e)};S.default.useEffect(()=>{if(!Jt)return;const e=setInterval(()=>{Date.now()-Zt.current>=ve.DAY_IDLE_MS&&Xt(null)},5e3);return()=>clearInterval(e)},[Jt]);const tl=(0,U.useWaitlist)(st),ll=(0,U.useStore)(e=>e.walkIns[st]??0),[sl,il]=(0,v.useState)(!1),[ol,nl]=(0,v.useState)(!1),[al,rl]=(0,v.useState)(!1);(0,_.useReviewAlerts)(st);const[dl,cl]=(0,v.useState)({view:0,content:0}),[ul,hl]=(0,v.useState)(null);S.default.useEffect(()=>{ul&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:ul,timeoutMs:4500,big:!0,testID:'floor-toast'}),hl(null))},[ul]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[gl,bl]=(0,v.useState)(null),yl=S.default.useRef(0),[pl,xl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!gl)return;yl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-yl.current;if(e>=Ee)return bl(null),void hl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');xl(e>=105e3?Math.ceil((Ee-e)/1e3):null)},1e3);return()=>clearInterval(e)},[gl]);const fl=e=>e.date!==pt?Ht({title:`Guest details \xb7 ${(0,ve.dayWord)(e.date,pt)} ${e.time}`,body:(0,Pe.jsx)(Pe.Fragment,{children:(0,pe.bookingDetails)(e)})}):Ht({title:`Guest details \xb7 ${e.time}`,body:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ve,{rid:st,id:e.id,turnBase:it.settings.turnMins}),e.walkIn?null:(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Ht(null),_t(e.id)},style:{minHeight:56}}),e.walkIn?(0,Pe.jsx)(he.CancelWalkInButton,{rid:st,b:e,big:!0,onDone:e=>{Ht(null),hl(e)}}):null,e.walkIn?(0,Pe.jsx)(he.ReinstateWalkInButton,{rid:st,b:e,today:pt,onDone:e=>{Ht(null),hl(e)}}):null,(0,pe.bookingDetails)(e)]})}),ml=nt.filter(e=>e.date===pt).sort((e,t)=>e.time.localeCompare(t.time)),jl=ml.filter(e=>!['cancelled','noshow'].includes(e.status)),wl=ot.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),kl=(0,v.useMemo)(()=>(0,d.forecastToday)(it,nt,ot,at,ct),[it,nt,ot,at,ct.getTime()/6e4|0]),Il=(0,we.closedAreasAt)(Dt,st,pt,(0,V.hm)(ct)),Dl=[...Il].join(','),vl=(0,v.useMemo)(()=>(0,Z.floorView)(kt,nt,ot,It??{},ct,it.settings.turnMins,Il),[kt,nt,ot,It,ct.getTime(),Dl]),Sl=(0,ye.hoursFor)(it,ct),Cl=Sl?.open??new Date(`${pt}T12:00:00`),Tl=Sl?.close??new Date(`${pt}T21:00:00`),$l=(0,V.addMins)(Cl,-Cl.getMinutes()),Bl=(0,V.addMins)(Tl,90),Rl=e=>new Date(`${pt}T${e}:00`),Ll=(0,we.blocksOn)(Dt,st,pt).map(e=>({from:Rl(e.from),to:Rl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(it,ct,pt)),Wl=Object.keys(vl).filter(e=>'blocked'===vl[e]?.status),Ml=Jt&&Jt!==pt?Jt:pt,zl=Ml!==pt,Hl=(0,ve.dayWord)(Ml,pt),Pl=/^(Today|Yesterday|Tomorrow)$/.test(Hl),El=zl?(0,ve.bookingsForDay)(nt,Ml,pt).sort((e,t)=>e.time.localeCompare(t.time)):ml,Ol=(0,V.parseYmd)(Ml);Ol.setHours(12);const Al=zl?(0,ye.hoursFor)(it,Ol):Sl,Nl=Al?.open??new Date(`${Ml}T12:00:00`),_l=Al?.close??new Date(`${Ml}T21:00:00`),Gl=e=>new Date(`${Ml}T${e}:00`),Fl=[...zl?(0,we.blocksOn)(Dt,st,Ml).map(e=>({from:Gl(e.from),to:Gl(e.to),label:e.reason??'Paused'})):Ll,...zl?(0,i.queuedServicePauses)(it,Ol,Ml):[]],Vl=(0,i.queuedServiceSessions)(it,Ol),Ul=l.IS_QUEUED_VENUE&&(void 0===Vl||!Vl.length),Kl=(0,Pe.jsxs)(P.default,{testID:"queued-hours-gate",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:void 0===Vl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Pe.jsx)(A.Muted,{children:s.queuedVenues[st]?.hours.note})]}),ql=zl?Al||El.length?Mlzl?(0,Z.dayFloorView)(kt,El,Ml):vl,[zl,kt,El,Ml,vl]),[Ql,Jl]=(0,v.useState)(null),Xl=zl?El.filter(e=>!['cancelled','noshow'].includes(e.status)):jl,Zl=Xl.reduce((e,t)=>e+t.partySize,0),es=(0,c.coversSplit)(Xl,Ml),ts=(0,Se.cancelledDayTally)(nt,Ml),ls=(0,Ce.cancellationsFor)(nt,Ml,e=>e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)','')),ss=(0,Se.cancelledTallyWords)(ts,Pl?Hl.toLowerCase():zl?`on ${Hl}`:'today'),is=Dt.filter(e=>e.rid===st&&e.date===Ml&&!e.removedAt),os=(0,De.chartBands)(is,60*Nl.getHours()+Nl.getMinutes(),60*_l.getHours()+_l.getMinutes()),ns=new Set((0,De.blockedHours)(os)),as=ct.getHours()+(ct.getMinutes()>=30?1:0),rs=kl.hours.filter(e=>e.hour>=as&&!ns.has(e.hour)),ds=rs.reduce((e,t)=>e+t.coversHigh,0),cs=rs.reduce((e,t)=>e+t.coversLow,0),us=Math.round((cs+ds)/2),hs=!kl.example&&kl.open&&kl.enough&&ds>0?`Usually ${(0,d.coversRange)(us,us)} more`:void 0,gs=async(e,t)=>{const l=vl[e]?.booking;if(!l||e===t)return;const s=vl[t]?.status;if(s&&!['free','soon'].includes(s))return void hl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${Z.STATUS[s].label.toLowerCase()}. Pick a free table.`);await U.repo.bookings.update(l.id,{table:t});const i=It?.[e]?.stage;X.useFloor.getState().setLive(st,t,{stage:i??'seated',dirty:!1}),X.useFloor.getState().setLive(st,e,{stage:void 0,dirty:!0}),hl(`${(0,re.privName)(l,jt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},bs=Yt?nt.find(e=>e.id===Yt.id):void 0,ys=Yt&&bs?(()=>{const e=bs.walkIn?(0,re.privName)(bs,jt):Oe(bs.name),t=(0,be.seatsOf)(kt,Yt.tables).total,l=(0,be.seatLine)(t,bs.partySize),s=(0,be.pickClashes)(bs,Yt.tables,nt.filter(e=>e.date===bs.date),it.settings.turnMins),i=(0,be.tableKey)(Yt.tables)!==(0,be.tableKey)((0,X.tablesOf)(bs.table));return(0,Pe.jsxs)(P.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:K.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,padding:10},children:[(0,Pe.jsxs)(P.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,ve.dayWord)(bs.date,pt)} ${bs.time}. Tap tables on the plan to add or take them off. ${(0,be.tablesWords)(Yt.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,ve.dayWord)(bs.date,pt)," ",bs.time]}),(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[(0,be.tablesWords)(Yt.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,Pe.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,Pe.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,be.tablesWords)(Yt.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(bs){try{await(0,ge.saveBookingTables)(st,bs,Yt.tables),hl((0,be.savedWords)(e,bs.partySize,Yt.tables,t))}catch(t){hl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Qt(null)}else Qt(null)}}),(0,Pe.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Qt(null)})]})]})})():null,ps=kt.areas.filter(e=>kt.tables.some(t=>t.areaId===e.id)),xs=e=>{const t=kt.tables.filter(t=>t.areaId===e);return zl?`${t.filter(e=>!Yl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(vl[e.name]?.status??'free')).length}/${t.length} free`},fs='all'===$t||ps.some(e=>e.id===$t)?$t:'all',ms=e=>(0,Pe.jsx)(ee.FloorCanvas,{plan:kt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Qe,big:!0,view:Yl,privacy:jt,turnBase:it.settings.turnMins,highlight:Yt?Yt.tables:Wt?[Wt]:void 0,onTap:e=>{return t=e.name,void(Yt?Qt(e=>e?{...e,tables:(0,be.toggleTable)(e.tables,t)}:e):zl?Jl(t):Wt?(t!==Wt&&gs(Wt,t),Mt(null)):Lt(t));var t},onDrop:(e,t)=>Yt||zl?void 0:gs(e.name,t.name)}),js=qe?1:Ye||ps.length>2?2:1,ws=e=>{const t=kt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ks=[];for(let e=0;e{const t=(0,ee.areaBounds)(kt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ee.minReadableScale)(kt,e.id)}}),tt.w,tt.h):null,Ds=e=>(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',height:te.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:xs(e.id)})]}),vs=(0,Pe.jsx)(P.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-tt.w)>1||Math.abs(l-tt.h)>1)&<({w:t,h:l})},children:Is?(0,Pe.jsx)(H.default,{style:{flex:1},scrollEnabled:Is.scroll,showsVerticalScrollIndicator:Is.scroll,contentContainerStyle:{gap:te.GRID_GAP},children:Is.rows.map((e,t)=>(0,Pe.jsx)(P.default,{style:{height:Is.rowHeights[t],flexDirection:'row',gap:te.GRID_GAP},children:e.map(e=>{const t=ps.find(t=>t.id===e);return(0,Pe.jsxs)(P.default,{testID:`area-cell-${e}`,style:{width:Is.cellW,gap:2},children:[Ds(t),(0,Pe.jsx)(P.default,{style:{flex:1},children:ms(e)})]},e)})},t))}):null}),Ss=(0,Pe.jsxs)(P.default,{testID:"venue-plan",style:{flex:qe?void 0:1,gap:10,minWidth:0},children:[(0,Pe.jsx)(a.TableNumberWarning,{plan:kt}),kt.tables.length?null:(0,Pe.jsxs)(P.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Pe.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Pe.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,Pe.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Pe.jsx)(Ge,{chipId:"all",compact:!qe,label:"Whole venue",selected:'all'===fs,onPress:()=>Bt('all')},"__all"),...ps.map(e=>(0,Pe.jsx)(Ge,{chipId:e.id,compact:!qe,label:`${e.name}${(0,le.areaMarks)(e)}`,colour:(0,K.brandColour)(e.colour),sub:qe?Il.has(e.id)?'closed':fs===e.id?xs(e.id):void 0:void 0,selected:fs===e.id,onPress:()=>Bt(e.id)},e.id))];return qe?(0,Pe.jsx)(P.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Pe.jsx)(H.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;cl(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>cl(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:dl.view>0&&dl.content>0&&dl.content<=dl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:dl.view>0&&dl.content<=dl.view+1?'100%':void 0},children:e})})(),(0,Pe.jsx)(h.FloorLegend,{}),ys,Wt?(0,Pe.jsxs)(A.Row,{gap:8,style:{backgroundColor:K.colours.goldTint,borderRadius:10,padding:8},children:[(0,Pe.jsxs)(A.T,{weight:"semibold",colour:K.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Wt),": tap the new table."]}),(0,Pe.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Mt(null)})]}):null,'all'===fs&&Qe?vs:'all'===fs?(0,Pe.jsx)(P.default,{style:{flex:qe?void 0:1,gap:12,minHeight:Je?void 0:360},children:ks.map((e,t)=>(0,Pe.jsxs)(P.default,{style:{flex:qe?void 0:Math.max(.3,...e.map(e=>ws(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Pe.jsxs)(P.default,{style:{flex:1,gap:2},children:[qe?(0,Pe.jsxs)(P.default,{style:{alignItems:'center',gap:4},children:[(0,Pe.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{center:!0,children:xs(e.id)})]}):(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{children:xs(e.id)})]}),(0,Pe.jsx)(P.default,{style:qe?{height:Math.max(280,Math.round((Ue-40)*ws(e.id)))}:{flex:1},children:ms(e.id)})]},e.id)),e.length{if(zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},Ml)}),Ts='timeline'===vt,$s=Ct?(0,Pe.jsx)(W.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Tt(!1),supportedOrientations:['landscape','portrait'],children:(0,Pe.jsxs)(P.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:K.colours.bg,padding:10,gap:8},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Pe.jsx)(z.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Tt(!1),style:{minHeight:64,minWidth:180,paddingHorizontal:22,borderRadius:16,borderWidth:2,borderColor:K.colours.goldLight,backgroundColor:K.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Pe.jsx)(P.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Pe.jsx)(A.T,{size:22,weight:"semibold",colour:K.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${zl?(0,ve.dayLong)(Ml):'Today'}`})}),(0,Pe.jsx)(P.default,{style:{minWidth:180}})]}),Ul?Kl:(0,Pe.jsx)(P.default,{style:{flex:1,minHeight:0},children:(0,Pe.jsx)(oe.Timeline,{hideNow:!0,plan:kt,bookings:zl?El:ml,now:zl?Nl:ct,privacy:jt,turnBase:it.settings.turnMins,t0:zl?(0,V.addMins)(Nl,-Nl.getMinutes()):$l,t1:zl?(0,V.addMins)(_l,90):Bl,pauses:zl?Fl:Ll,blockedTables:zl?[]:Wl,onOpen:e=>{if(Tt(!1),zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},`full-${Ml}`)})]})}):null,Bs=zl?(0,Pe.jsxs)(P.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,backgroundColor:K.colours.goldTint},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:Pl?`Showing ${Hl} \xb7 ${(0,V.niceDate)((0,V.parseYmd)(Ml))}`:`Showing ${(0,ve.dayWord)(Ml,pt)}`}),(0,Pe.jsx)(P.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${ss}. Showing ${(0,ve.dayLong)(Ml)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Pe.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Qt(null),el(null)},style:{minHeight:44}})]}):null,Rs=(0,Pe.jsx)(P.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:qe?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(Ts||Ct);return(0,Pe.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},accessibilityHint:'timeline'===e?'Opens the timeline over the whole screen':void 0,onPress:()=>{'timeline'===e?(St('plan'),Tt(!0)):(Tt(!1),St('plan'))},style:{flex:qe?1:void 0,minHeight:qe?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?K.colours.gold:'transparent',...Be.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,Pe.jsx)(A.T,{size:qe?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ls=(0,u.useBookingWrite)(),Ws=e=>(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Walk-in",onPress:ft.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"New booking",onPress:ft.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Edit booking",onPress:()=>At(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint})]});(0,He.useDisplayNotices)(st,!e);const Ms=qe?180:168,[zs,Hs]=(0,v.useState)(Ms),Ps=S.default.useRef(Ms),Es=S.default.useRef(null),Os=S.default.useRef(null),As=()=>{const e=Es.current,t=Os.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ke<820?8:12,o=44+(Ke<820?4:8),n=i>Ps.current?Math.ceil(i-Ps.current):Ie.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Ms,Math.floor(t-s-l)-n-o));Math.abs(Ps.current-a)>=2&&(Ps.current=a,Hs(a))})})};S.default.useEffect(()=>{const e=setTimeout(As,60);return()=>clearTimeout(e)},[Ue,Ke]);const Ns=(0,Pe.jsxs)(P.default,{ref:Os,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),As()},style:{flexDirection:'row',flexWrap:Ue>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:qe?12:6,justifyContent:qe?'center':void 0,borderTopWidth:1,borderTopColor:K.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Pe.jsx)(ze.DisplayClockButton,{}),(0,Pe.jsx)(ie.HoldToEdit,{quiet:!0,onUnlock:()=>{xl(null),bl({at:Date.now()})},onHint:()=>hl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Pe.jsx)(ke.BlockBookingsButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,display:!0,day:Ml}),kt.areas.some(e=>e.outdoor)?(0,Pe.jsx)(ke.CloseGardenButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,short:!0}):null,(0,Pe.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>rl(!0),style:({pressed:e})=>({...Be.look.quiet(e),flexGrow:1}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,Pe.jsx)(p.GiftQrButton,{rid:st,venue:it.name})]}),_s=wl.length?(0,Pe.jsxs)(P.default,{testID:"takeaway-panel",style:[Be.look.panel,{overflow:'hidden'}],children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Pe.jsxs)(A.T,{size:12,colour:K.colours.muted,children:[wl.length," live"]})]}),(0,Pe.jsx)(P.default,{style:{padding:10},children:(0,Pe.jsx)(Fe,{list:wl,me:yt,compact:!0,bookings:nt})})]}):null,Gs=($e.DueToday,zl?El:ml.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Fs=zl?Pl?`${Hl}\u2019s guests`:`Guests ${Hl}`:'Today\u2019s guests',Vs=(0,Pe.jsxs)(Pe.Fragment,{children:[0===Gs.length?(0,Pe.jsx)(A.Muted,{children:zl?Ml{const t=(0,q.isSeatedHighlight)(e.status,{otherDay:zl}),l=(0,de.guestRowText)(e,{name:e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)',''),seated:t}),s=t?q.SEATED_FG:K.colours.text,i=t?q.SEATED_MUTED:K.colours.muted,o=t?q.SEATED_FG:K.colours.gold,n=l.depositWarn?K.colours.amber:t?q.SEATED_FG:K.colours.goldLight;return(0,Pe.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:zl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Ut(!1),qt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,q.seatedHighlightStyle)({backgroundColor:e?K.colours.goldLight:K.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:K.colours.hairline,backgroundColor:e?K.colours.tilePressed:'transparent'},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Pe.jsx)(P.default,{style:{paddingTop:2},children:(0,Pe.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':K.colours.amber,ink:t?K.colours.gold:K.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Pe.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,Pe.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,Pe.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,Pe.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,Pe.jsx)(P.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Pe.jsx)(ce.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,Pe.jsx)(Te.CancellationsSection,{items:ls,dayWord:zl?Pl?Hl.toLowerCase():`on ${Hl}`:'today'})]}),Us=(0,Pe.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Vs}),Ks=M.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Ut(!1)}}),qs=(0,Pe.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Fs}, ${Gs.length}`,accessibilityState:{expanded:Vt},'aria-expanded':Vt,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Ut(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:Vt?K.colours.gold:K.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?K.colours.tilePressed:Vt?K.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Pe.jsx)(A.T,{size:16,weight:"bold",colour:K.colours.gold,children:Gs.length}),(0,Pe.jsx)(P.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(P.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Pe.jsxs)(A.T,{size:13,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,children:[Fs," ",Vt?'\u2039':'\u203a']})})})]}),Ys=Vt?(0,Pe.jsxs)(P.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Pe.jsxs)(P.default,{testID:"guests-drawer",...Ks.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ue)),backgroundColor:K.colours.surface,borderRightWidth:1,borderColor:K.colours.gold,borderRadius:14,...Be.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Fs.toUpperCase()," (",Gs.length,")"]}),ts.count?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:ss}):null,(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Fs}`,onPress:()=>Ut(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:18,colour:K.colours.muted,children:"\u2715"})})]}),Us]}),(0,Pe.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Fs}`,accessibilityRole:"button",onPress:()=>Ut(!1),style:{flex:1}})]}):null,Qs=Ul?Kl:l.IS_KIRKTON&&!Object.values(it.kitchenHours??{}).some(Boolean)?(0,Pe.jsxs)(P.default,{testID:"kirkton-hours-to-confirm",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Pe.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,Pe.jsx)(Ie.DayGraph,{busyThreshold:(0,t.venueBusy)(it,nt,ct).busy,todays:El,open:Nl,close:_l,now:ct,turnBase:it.settings.turnMins,blocks:is,pauses:Fl,compact:qe,dense:!qe,height:Qe?zs:Ms,forecastNote:zl?void 0:hs,emptyText:ql,past:Ml{zl?Ut(!0):Tt(!0)},ei=(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',padding:Ke<820?8:12,paddingTop:Ke<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[xt?null:qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[xt?null:Bs,xt?(0,Pe.jsx)(H.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"})}):Ts?Cs:Ss,$s,Ys]}),(0,Pe.jsxs)(P.default,{testID:"display-side",style:{width:Xe,gap:Ke<820?4:8,minHeight:0},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Ws(!1)}),(0,Pe.jsx)(P.default,{style:{flexShrink:0},children:Rs}),xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:Ke<820,snug:Ke<820,tight:Ke<700,aside:`${Xl.length} ${1===Xl.length?'table':'tables'} booked${wl.length?` \xb7 ${wl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{ref:Es,testID:"day-graph-slot",onLayout:As,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Js}),(0,Pe.jsxs)(H.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,Pe.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Pe.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),_s,(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt})]})]})]});return(0,Pe.jsxs)(O.SafeAreaView,{style:{flex:1,backgroundColor:K.colours.bg},onTouchStart:()=>{Zt.current=Date.now()},onMouseDown:()=>{Zt.current=Date.now()},children:[qe?(0,Pe.jsxs)(P.default,{style:{flex:1},children:[(0,Pe.jsxs)(H.default,{ref:Ze,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Pe.jsx)(P.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Pe.jsx)(f.ExitButton,{})}),(0,Pe.jsx)(G.RestaurantLogo,{rid:st,size:64}),(0,Pe.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:it.name}),(0,Pe.jsx)(G.PoweredBy,{}),(0,Pe.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Pe.jsx)(P.default,{accessible:!0,accessibilityLabel:`Current time ${(0,V.hm)(ct)}`,children:(0,Pe.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:K.colours.goldLight,children:(0,V.hm)(ct)})}),(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:"m"}),(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:"m"}),F]}),We,Xs,(0,Pe.jsx)(P.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Pe.jsx)(_e,{phone:!0,split:es,items:[{label:`Tables \xb7 ${Hl}`,value:Xl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Hl}`,value:Zl,testID:'badge-covers'},{label:'Takeaway',value:wl.length,alert:wl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Et(!0)}]})}),(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{gap:8},children:Ws(!0)}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),Rs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[Ts?Cs:Ss,$s]}),(0,Pe.jsxs)(P.default,{onLayout:e=>{et.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Be.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Pe.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:K.colours.goldLight,accessibilityRole:"header",children:[Fs," (",Gs.length,")"]}),(0,Pe.jsx)(P.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{gap:4},children:Vs})]}),_s,Js,(0,Pe.jsx)(P.default,{testID:"covers-dock",children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Ze.current?.scrollTo({y:et.current,animated:!0})})}),(0,Pe.jsxs)(P.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Pe.jsx)(A.T,{center:!0,size:14,colour:jt?K.colours.muted:K.colours.amber,children:jt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Pe.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,Pe.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ns]}),e?null:(0,Pe.jsx)(P.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:K.colours.hairline},children:(0,Pe.jsx)(R.VoiceSlot,{size:56})})]}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ue>=1e3?18:14,paddingVertical:Ke<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Be.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,Pe.jsx)(P.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Pe.jsx)(G.RestaurantBrand,{rid:it.id,size:Ue<900?32:40,beside:!0})}),(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Pe.jsx)(A.T,{size:Ue<900?18:21,weight:"semibold",colour:K.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,V.hm)(ct)}),Ue>=900?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:(0,V.niceDate)(ct)}):null]})]}),xt?(0,Pe.jsx)(P.default,{style:{width:220}}):(0,Pe.jsx)(P.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:Xs}),(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:Ue<900?'xs':Ue<1100||Ke<700?'s':'m'}),(0,Pe.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.muted,children:"?"})}),'simulated'===dt?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>rt(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:11,colour:K.colours.muted,children:"+15"})}):null,e?null:(0,Pe.jsx)(f.ExitButton,{}),F,Me?null:(0,Pe.jsx)(R.VoiceSlot,{size:44})]})]}),We,xt?null:(0,Pe.jsxs)(P.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,Pe.jsx)(_e,{splitOnly:!0,split:es,items:[]}),(0,Pe.jsx)(P.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ue>=1e3?18:14)+(e?0:52)+('simulated'===dt?52:0),zIndex:4},children:(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:Ue<1100||Ke<700?'s':'m'})})]}),Qe?ei:(ti=(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Ws(!1)}),Rs]}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),xt?(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"}):(0,Pe.jsx)(Pe.Fragment,{children:(0,Pe.jsxs)(P.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Bs,Ts?Cs:Ss,$s,Ys]})]})}),_s,xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Ms+Ie.DAY_GRAPH_CHROME},children:Js})]}),(0,Pe.jsx)(H.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:ti})),Ns]}),(0,Pe.jsx)(j.SoldOutStrip,{rid:st,by:yt,onOpen:()=>rl(!0)}),(0,Pe.jsx)(w.SoldOutSheet,{visible:al,onClose:()=>rl(!1),rid:st,by:yt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Pe.jsx)(y.TableOrderCue,{rid:st}),ft.elements,Ot?(0,Pe.jsx)(b.EditBookingPicker,{rid:st,today:pt,who:yt,hidePrivate:!0,onClose:()=>At(!1)}):null,Nt?(0,Pe.jsx)(b.EditBookingSheet,{rid:st,id:Nt,who:yt,hidePrivate:!0,onClose:()=>_t(null)}):null,Rt?(0,Pe.jsx)(pe.TableSheet,{rid:st,name:Rt,view:vl,plan:kt,todays:ml,now:ct,privacy:jt,turnBase:it.settings.turnMins,onClose:()=>Lt(null),onWalkIn:e=>ft.openWalkInAt(e),onMove:e=>Mt(e),onDetails:fl}):null,Ql?(()=>{const e=Yl[Ql],t=e?.dayBookings??[];return(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>Jl(null),title:`${(0,r.tableNumbers)(Ql)} \xb7 ${Pl?Hl:(0,ve.dayLong)(Ml)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${Pl?Hl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${Pl?Hl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,re.privName)(e,jt):Oe(e.name);return(0,Pe.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,be.tablesWords)((0,X.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Jl(null),qt(e.id)},style:{minHeight:56}},e.id)}),(0,Pe.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>Jl(null),style:{minHeight:56}})]})})():null,Kt?(()=>{const e=nt.find(e=>e.id===Kt);return e?(0,Pe.jsx)(ue.GuestActionsSheet,{rid:st,b:e,name:e.walkIn?(0,re.privName)(e,jt):Oe(e.name),view:vl,now:ct,otherDay:e.date!==pt,turnBase:it.settings.turnMins,onClose:()=>qt(null),onDetails:fl,onDone:hl,onPickOnPlan:(e,t)=>{Ut(!1),St('plan'),Bt('all'),Qt({id:e.id,tables:t})}}):null})():null,zt?(0,Pe.jsx)(pe.DetailsPanel,{title:zt.title,onClose:()=>Ht(null),children:zt.body}):null,Gt?(0,Pe.jsx)(pe.ServiceSummary,{r:it,todays:ml,orders:ot,waitlistAll:tl,walkInCount:ll,onClose:()=>Ft(!1)}):null,sl?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>il(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Pe.jsx)(h.FloorLegend,{}),(0,Pe.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>il(!1)})]}):null,ol?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>nl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Pe.jsx)(N.ReviewsSection,{rid:st,mode:"read",venueName:it.name}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>nl(!1)})]}):null,Pt?(0,Pe.jsxs)(pe.DetailsPanel,{title:"Takeaway",onClose:()=>Et(!1),children:[(0,Pe.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Pe.jsx)(Fe,{list:wl,me:yt,bookings:nt})]}):null,gl?(0,Pe.jsx)(P.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:K.colours.bg},children:(0,Pe.jsx)(se.PlanDesigner,{initial:kt,venue:it.name,mode:"display",startStep:"arrange",onActivity:()=>{yl.current=Date.now(),null!==pl&&xl(null)},notice:null!==pl?`Locking again in ${pl} s \xb7 touch to keep editing`:null,onSave:e=>{X.useFloor.getState().setPlan(st,e),bl(null),hl('Table plan saved. Editing is locked again.')},onCancel:()=>{bl(null),hl('No changes kept. Editing is locked again.')}},gl.at)}):null,e?null:(0,Pe.jsx)(ne.Screensaver,{rid:st,idleMins:mt.idleMins,pinOn:mt.pinOn,wake:mt,tonightCards:mt.tonightCards,cfg:wt}),e?null:(0,Pe.jsx)(fe.PrintHost,{rid:st}),e?null:(0,Pe.jsx)(xe.AlertHost,{variant:"display",rid:st,skipTakeaway:!0}),e?null:(0,Pe.jsx)(B.SeatAllergenReminder,{rid:st}),e?null:(0,Pe.jsx)(me.TakeawayTakeover,{rid:st,me:yt})]});var ti};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),M=e(_r(_d[31])),z=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=e(_r(_d[35])),O=_r(_d[36]),A=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),Me=_r(_d[85]),ze=_r(_d[86]),He=_r(_d[87]),Pe=_r(_d[88]);const Ee=12e4,Oe=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Ne=e=>e.slotTime?(0,V.hm)(new Date(e.slotTime)):'ASAP';function _e({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,Pe.jsxs)(P.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,Pe.jsx)(P.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,Pe.jsxs)(P.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,Pe.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?K.colours.amber:K.colours.text,children:e.value}),(0,Pe.jsx)(A.T,{size:l?14:12,colour:K.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Pe.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,Pe.jsx)(P.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,Pe.jsx)(A.T,{size:14,colour:K.colours.muted,children:"No Covers yet"}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:K.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,Pe.jsxs)(P.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:K.colours.gold},children:[(0,Pe.jsx)(P.default,{style:{width:`${s.walkInPct}%`,backgroundColor:K.colours.gold}}),(0,Pe.jsx)(P.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function Ge({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,Pe.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,Pe.jsx)(P.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,Pe.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?K.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,Pe.jsx)(A.T,{size:12,colour:K.colours.muted,children:l}):null]})}function Fe({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,Me.statusBlock)(e,t,(0,Me.linkedBooking)(e,s));return e.length?(0,Pe.jsx)(P.default,{style:{gap:8},children:e.map(e=>(0,Pe.jsxs)(P.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:K.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?K.colours.ok:e.allergies.length?K.colours.red:K.colours.gold},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Ne(e)," \xb7 ",Oe(e.customerName)]}),(0,Pe.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,Pe.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:K.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,F.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Pe.jsx)(We.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Pe.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Pe.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>U.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Pe.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Pe.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Pe.jsx)(fe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Pe.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Ve({rid:e,id:t,turnBase:l}){const s=(0,U.useBookings)(e).find(e=>e.id===t);return s?(0,Pe.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1279,[1121,5,6,1280,798,822,1094,829,1120,1281,1282,1283,1091,1115,1284,1285,1287,1288,1289,1130,977,1099,1290,34,1073,1148,1033,1087,1116,1291,395,380,402,295,102,426,36,794,1186,1190,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1292,1107,1293,1296,1298,1301,1304,1300,1305,1307,1308,1112,1093,1095,852,1310,1175,1311,1185,1177,1011,1316,1324,1326,1076,1114,1328,1329,1330,1143,1331,1142,1136,838,1332,1333,25]); __d(function(g,_r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.queuedServiceSessions=u,e.queuedServicePauses=function(n,t,s){const i=u(n,t);return i?i.slice(1).flatMap((n,t)=>{const u=i[t][1],r=n[0];return u!!t.walkIn||'walk-in'===t.source},1281,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useBookingWrite=function(){const t=(0,s.useSignedIn)(),c=(0,n.canChangeBookings)(t);return{ok:c,hint:c?void 0:n.BOOKING_VIEW_ONLY,lock:s=>c?{disabled:!1,accessibilityLabel:s}:{disabled:!0,accessibilityLabel:s,accessibilityHint:n.BOOKING_VIEW_ONLY}}};var n=r(d[0]),s=r(d[1])},1282,[1012,1100]); @@ -1473,7 +1473,7 @@ __d(function(g,r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModu __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"READY_ITEMS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"NOT_ANSWERED",{enumerable:!0,get:function(){return t}});const n=['A drawing or other picture of the table plan with area names labelled and how many people each seats','Opening hours','Staff and roles','Pay and tips dates','Supplier account numbers','Logo','Menu','Allergens'],t='Not answered yet'},1390,[]); __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,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1391,[798,34,283,364,236,402,102,815,794,840,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.StaffHome=function({go:e}){const L=(0,m.useInStaffApp)(),{now:N,meId:A,me:O,r:R,today:z}=(0,m.useCtx)(3e4),H=(0,s.useTravelDay)('staff',z),P=(0,h.useOwner)(e=>e.shifts),F=(0,h.useOwner)(e=>e.attendance),_=(0,h.useOwner)(e=>e.staffCanViewSuppliers),E=(0,h.useOwner)(e=>e.quickLinks),W=(0,h.useOwner)(e=>e.chat),q=(0,h.useOwner)(e=>e.swaps),V=(0,h.useOwner)(e=>e.leave),G=P.filter(e=>e.staffId===A&&e.published&&e.date>=z).sort((e,s)=>e.date.localeCompare(s.date)||e.start-s.start),U=G.find(e=>e.date===z),Y=F.filter(e=>e.staffId===A&&e.in&&!e.out&&N.getTime()-new Date(e.in).getTime()<72e6).sort((e,s)=>s.in.localeCompare(e.in))[0],Q=(0,x.usePay)(A,0),K=(0,b.useOrders)(R.id),J=(0,b.useBookings)(R.id),X=K.filter(e=>(0,T.LIVE)(e)&&e.allergies.length&&(0,k.nextStep)(e,(0,k.linkedBooking)(e,J))),Z=J.filter(e=>e.date===z&&['confirmed','seated'].includes(e.status)&&(0,k.bookingNeedsAction)(e,K.filter(T.LIVE))),ee=J.filter(e=>(0,S.undoKind)(e,z)||e.walkIn&&'cancelled'===e.status&&e.date===z).sort((e,s)=>e.time.localeCompare(s.time)).slice(0,12),se=W.filter(e=>'all'===e.ch&&e.pinned&&!e.removed).slice(-1)[0],te=q.filter(e=>e.fromId===A&&'open'===e.status).length+V.filter(e=>e.staffId===A&&'pending'===e.status).length,ie=[['Clock in / out',()=>e('more','clock')],['My rota, swaps & time off',()=>e('more','rota')],['Staff chat',()=>e('chat')],['Recipe cards',()=>e('more','recipecards')],['My hours & pay',()=>e('more','mypay')],['My tips',()=>e('more','mytips')],['Post to social (draft)',()=>e('more','social')],..._?[['Suppliers',()=>e('more','suppliers')]]:[]];return!L&&H?(0,v.jsxs)(o.default,{style:{gap:10},children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(s.DayView,{rid:R.id,day:H,today:z,app:"staff"})]}):(0,v.jsxs)(o.default,{style:{gap:10},children:[L?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(t.CoversToday,{rid:R.id})]}),(0,v.jsxs)(r.Card,{highlight:u.colours.accentBorder,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.Row,{gap:10,style:{flex:1},children:[(0,v.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"My avatar",onPress:()=>e('more','avatar'),children:(0,v.jsx)(C.StaffAvatar,{id:A,size:52})}),(0,v.jsxs)(r.T,{size:18,weight:"bold",children:["Hi ",O.replace(' (example)','').split(' ')[0]]})]}),(0,v.jsx)(r.Badge,{kind:"gold",label:L?R.name:'Staff app preview'})]}),(0,v.jsx)(r.Muted,{children:L?`${N.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})}`:'This is what staff will see in the separate Staff app.'})]}),(0,v.jsx)(M.StaffTipsTile,{rid:R.id,today:z,onPress:()=>e('more','mytips')}),(0,v.jsxs)(r.Card,{highlight:Y?u.colours.ok:void 0,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{weight:"semibold",children:Y?`On shift since ${(0,c.hm)(new Date(Y.in))}`:'Not clocked in'}),Y?(0,v.jsx)(r.Badge,{kind:"ok",label:(0,m.hmDur)(Math.max(0,Math.round((N.getTime()-new Date(Y.in).getTime())/6e4)))}):null]}),U?(0,v.jsxs)(r.Muted,{children:["Today on the rota: ",(0,m.fmtH)(U.start),"\u2013",(0,m.fmtH)(U.end)]}):G[0]?(0,v.jsxs)(r.Muted,{children:["Next on the rota: ",m.DAY3[G[0].day]," ",Number(G[0].date.slice(8))," ",(0,m.fmtH)(G[0].start),"\u2013",(0,m.fmtH)(G[0].end)]}):(0,v.jsx)(r.Muted,{children:"No shifts on the rota this week."}),(0,v.jsx)(r.Button,{small:!0,kind:Y?'secondary':'success',label:Y?'Clock out':'Clock in',onPress:()=>e('more','clock')})]}),A?(0,v.jsx)($.RequestTimeOff,{meId:A,me:O,testID:"staff-home-time-off"}):null,(0,v.jsx)(p.ShellfishTile,{rid:R.id,by:O.replace(' (example)',''),app:"staff"}),ee.length?(0,v.jsx)(r.Card,{children:(0,v.jsxs)(o.default,{testID:"staff-seated-today",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Seated and finished today (",ee.length,")"]}),(0,v.jsx)(r.Muted,{children:"Seated someone by mistake? Tap Unseat: they go back to Booked and their tables are freed. Finished or No-show by mistake? Tap Undo."}),ee.map(e=>{const s=e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;return(0,v.jsxs)(o.default,{testID:(0,f.isSeatedHighlight)(e.status)?`staff-seated-row-${e.id}`:`staff-done-row-${e.id}`,style:(0,f.isSeatedHighlight)(e.status)?{gap:6,padding:10,borderRadius:12,marginTop:4,...(0,f.seatedHighlightStyle)()}:{gap:6,borderTopWidth:1,borderTopColor:u.colours.hairline,paddingTop:8,opacity:'finished'===e.status||'noshow'===e.status?.7:1},children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.T,{size:17,weight:"semibold",colour:(0,f.isSeatedHighlight)(e.status)?f.SEATED_FG:u.colours.text,children:[e.time," \xb7 ",s]}),(0,v.jsx)(r.Badge,{kind:'noshow'===e.status?'red':'seated'===e.status?'ok':'neutral',label:'noshow'===e.status?'No-show':'seated'===e.status?'Seated':'Finished'})]}),(0,v.jsxs)(r.Muted,{children:[e.table?(0,I.tableCardLabel)(e.table):'No table'," \xb7 ",e.ref]}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsxs)(r.Row,{wrap:!0,gap:6,children:['seated'===e.status?(0,v.jsx)(r.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${s}`,onPress:()=>(0,B.finishBookingNow)(R.id,e)}):null,e.walkIn?(0,v.jsx)(a.CancelWalkInButton,{rid:R.id,b:e,small:!0}):null,e.walkIn?(0,v.jsx)(a.ReinstateWalkInButton,{rid:R.id,b:e,today:z,small:!0}):null,(0,v.jsx)(S.BookingUndo,{b:e,rid:R.id,today:z,who:s})]})]},e.id)})]})}):null,X.length+Z.length?(0,v.jsxs)(o.default,{testID:"staff-allergy-signoffs",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Allergy sign-offs (",X.length+Z.length,")"]}),(0,v.jsx)(r.Muted,{children:"Tap Sign off for your step. Your name and the time are recorded."}),X.map(e=>(0,v.jsx)(j.AllergyChain,{o:e,me:O},e.id)),Z.map(e=>(0,v.jsxs)(o.default,{accessible:!0,accessibilityLabel:`Booking ${e.time}, ${e.name}, ${e.partySize}${e.table?`, ${(0,D.tableNumbersA11y)(e.table)}`:''}`,style:{gap:4},children:[(0,v.jsxs)(r.Muted,{children:["Booking ",e.time," \xb7 ",e.name," (",e.partySize,")",e.table?` \xb7 ${(0,I.tablesLabel)(e.table)}`:'']}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsx)(j.BookingAllergyChain,{b:e,me:O}),(0,v.jsx)(o.default,{style:{flexDirection:'row'},children:(0,v.jsx)(w.WhatsAppGuest,{b:e,rid:R.id,kind:"auto"})})]},e.id))]}):null,se?(0,v.jsxs)(r.Card,{onPress:()=>e('chat'),children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{size:12,weight:"semibold",colour:u.colours.gold,children:"\ud83d\udccc PINNED IN ALL STAFF"}),(0,v.jsx)(r.Muted,{children:"Open chat \u203a"})]}),(0,v.jsx)(r.T,{size:14,children:se.text})]}):null,(0,v.jsxs)(r.Card,{children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Hours this pay period"}),(0,v.jsxs)(r.T,{size:18,weight:"semibold",colour:u.colours.goldLight,children:[(0,m.hmDur)(Q.paid)," paid hours"]})]}),te?(0,v.jsx)(r.Card,{onPress:()=>e('more','rota'),children:(0,v.jsxs)(r.T,{size:14,children:["You have ",te," request",te>1?'s':''," waiting for a manager \u203a"]})}):null,(0,y.visibleLinks)(E,'staff').length?(0,v.jsxs)(o.default,{testID:"quick-links",style:{gap:6},children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Quick links"}),(0,v.jsx)(y.QuickLinksRow,{compact:!0})]}):null,L?null:(0,v.jsx)(o.default,{style:{gap:6},children:ie.map(([e,s])=>(0,v.jsx)(r.Button,{kind:"secondary",label:e,onPress:s},e))})]})};var s=_r(d[0]),t=_r(d[1]),a=_r(d[2]),l=_r(d[3]);_r(d[4]);var n=e(_r(d[5])),o=e(_r(d[6])),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),f=_r(d[11]),p=_r(d[12]),m=_r(d[13]),x=_r(d[14]),y=_r(d[15]),j=_r(d[16]),b=_r(d[17]),w=_r(d[18]),k=_r(d[19]),T=_r(d[20]),C=_r(d[21]),S=_r(d[22]),I=_r(d[23]),D=_r(d[24]),B=_r(d[25]),M=_r(d[26]),$=_r(d[27]),v=_r(d[28])},1392,[1148,1073,1112,1089,34,402,102,794,865,827,840,1090,1142,1100,1145,1367,1136,850,1149,838,1147,899,1346,1014,829,1096,1154,1159,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.Forecasts=function({go:e}){const{rid:v,r:C,now:$,today:S}=(0,x.useCtx)(3e4),{width:T}=(0,r.default)(),B=(0,n.useBookings)(v),M=(0,n.useOrders)(v),D=(0,n.useEvents)(v),[H,R]=(0,t.useState)(7),A=(0,b.useRealHistory)(v,$),P=(0,t.useMemo)(()=>(0,s.forecastToday)(C,B,M,D,$,A??void 0),[C,B,M,D,A,$.getTime()/6e4|0]),E=(0,t.useMemo)(()=>Array.from({length:H},(e,t)=>{const o=(0,c.addMins)((0,c.parseYmd)(S),1440*t);return{d:o,f:(0,s.forecastToday)(C,B,M,D,o,A??void 0)}}),[C,B,M,D,S,H,A]),F=P.hours.reduce((e,s)=>e+s.booked,0),L=Math.max(C.settings.capacityPerHour,...P.hours.map(e=>e.coversHigh)),I=(0,i.showTakeaway)(C),[N,O]=(0,t.useState)(I),_=D.filter(e=>e.date>=S).sort((e,s)=>e.date.localeCompare(s.date)).slice(0,14),z=Math.min(T,900)-60,Y=e=>E.map(s=>{const t='booked'===e?s.f.hours.reduce((e,s)=>e+s.booked,0):s.f.restOfDay.covers;return{key:(0,c.ymd)(s.d),label:(0,c.dayShort)(s.d),spoken:(0,c.dayLong)(s.d),value:s.f.open?t:0,open:!!s.f.open}}),G=(0,p.jsx)(d.Row,{gap:4,style:{justifyContent:'center'},children:[7,14].map(e=>(0,p.jsx)(d.Chip,{label:`${e}d`,accessibilityLabel:`Next ${e} days`,selected:H===e,onPress:()=>R(e),testID:`forecast-range-${e}`},e))});return P.enough?(0,p.jsxs)(a.default,{style:{gap:12},children:[(0,p.jsx)(d.T,{center:!0,size:18,testID:"forecast-busy-level",children:P.busy.words}),(0,p.jsxs)(d.Muted,{children:["Hourly labels use the upper end of the Covers range. Steady starts at ",P.busy.steady,"; Busy starts at ",P.busy.busy,"."]}),(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(d.T,{weight:"semibold",colour:u.colours.gold,children:["Today by hour \xb7 ",(0,c.niceDate)($)]}),P.example?(0,p.jsx)(b.ExampleBadge,{}):(0,p.jsx)(d.Badge,{kind:"amber",label:"ESTIMATE"})]}),P.open?(0,p.jsx)(y.Bars,{data:P.hours.map(e=>({key:String(e.hour),label:String(e.hour),a:e.booked,b:e.walkIns})),max:L,highlight:P.nextHour?String(P.nextHour.hour):void 0}):(0,p.jsx)(d.Muted,{children:"Closed today."}),(0,p.jsxs)(d.Row,{gap:12,children:[(0,p.jsxs)(d.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:10,height:10,backgroundColor:'#9C7C45'}}),(0,p.jsx)(d.Muted,{children:"Booked"})]}),(0,p.jsxs)(d.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:10,height:10,backgroundColor:'#6B5A3A'}}),(0,p.jsx)(d.Muted,{children:"Expected walk-ins and later bookings"})]})]}),P.hours.map(e=>{const t=(0,y.busyLevel)(e.coversHigh,P.busy.busy);return(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(d.T,{size:14,children:(0,x.fmtH)(e.hour)}),(0,p.jsxs)(d.T,{size:14,colour:u.colours.muted,children:[(0,s.coversRange)(e.coversLow,e.coversHigh),I?` \xb7 about ${e.takeaway} takeaway`:'']}),(0,p.jsx)(d.T,{size:14,weight:"semibold",colour:t.colour,children:t.label})]},e.hour)})]}),(0,p.jsxs)(d.Card,{children:[(0,p.jsx)(d.T,{weight:"semibold",colour:u.colours.gold,children:"Suggested actions"}),P.suggestions.map((e,s)=>(0,p.jsxs)(d.T,{size:14,children:["\u2022 ",e]},s)),(0,p.jsx)(d.Muted,{children:P.example?`${l.EXAMPLE_ACCURACY}. Example figures: confirmed bookings + example weekday/hour averages + expected walk-ins, adjusted for calendar events.`:'Baseline: confirmed bookings + your own weekday/hour averages from past bookings, walk-ins and takeaway, adjusted for calendar events. An estimate, never a promise.'})]}),(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.T,{center:!0,weight:"semibold",colour:u.colours.gold,children:["Next ",H," days (covers)"]}),G,(0,p.jsx)(j.DaysLineGraph,{days:Y('forecast'),titleSpoken:`Covers for the next ${H} days`}),E.filter(e=>e.f.flags.length).map(e=>(0,p.jsxs)(d.Muted,{children:[(0,c.niceDate)(e.d),": ",e.f.flags.join(', ')," (\xd7",e.f.multiplier.toFixed(2),")"]},(0,c.ymd)(e.d)))]}),(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(d.T,{weight:"semibold",colour:I?u.colours.gold:u.colours.muted,children:"Takeaway"}),(0,p.jsx)(d.Button,{small:!0,kind:"ghost",label:N?'Hide':'Show',testID:"forecast-takeaway-toggle",onPress:()=>O(!N)})]}),N?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d.Muted,{children:"Takeaway orders by hour (forecast vs placed)"}),(0,p.jsx)(j.LineChart,{width:z,series:[P.hours.map(e=>e.takeaway),P.hours.map(e=>e.takeawayPlaced)],labels:P.hours.map(e=>String(e.hour))}),(0,p.jsxs)(d.Row,{gap:12,children:[(0,p.jsx)(d.Muted,{children:"Gold: forecast"}),(0,p.jsx)(d.Muted,{children:"Blue: placed so far"})]})]}):null]}),(0,p.jsx)(y.SectionHead,{title:"Holidays & local events",sub:"Scottish bank holidays (gov.uk), South Ayrshire school holidays, key dining dates and your events"}),_.map(s=>(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(d.T,{weight:"semibold",style:{flex:1},children:(0,o.holidayName)(s.title)}),(0,p.jsx)(d.Badge,{kind:w[s.kind][1],label:w[s.kind][0]})]}),(0,p.jsxs)(d.Muted,{children:[(0,c.niceDate)((0,c.parseYmd)(s.date))," ",s.date.slice(0,4),s.description?` \xb7 ${s.description}`:'']}),'regular'===s.source?(0,p.jsx)(d.Muted,{children:[s.time?`From ${(0,i.fmt12)(s.time)}`:'',s.lastFood?`last food orders ${(0,i.fmt12)(s.lastFood)}`:'',s.busier?'expect busier':''].filter(Boolean).join(' \xb7 ')}):null,'regular'===s.source?(0,p.jsx)(d.Button,{small:!0,kind:"secondary",testID:`promote-${s.id}`,label:`Promote: ${s.title} ${k(s.date,S)}`,onPress:()=>{h.useOwner.getState().setOwner({marketingDraft:{title:`${s.title} ${k(s.date,S)}`,body:`${s.title} at ${C.name} ${k(s.date,S)}${s.time?` from ${(0,i.fmt12)(s.time)}`:''}.${s.lastFood?` Food until ${(0,i.fmt12)(s.lastFood)}.`:''} Book a table in the app.`}}),e('more','marketing')}}):'school-holiday'!==s.kind?(0,p.jsx)(d.Button,{small:!0,kind:"secondary",label:`Promote: "${f(s.title)}"`,onPress:()=>{h.useOwner.getState().setOwner({marketingDraft:{title:f(s.title),body:`${f(s.title)} at ${C.name}. Book in the app.`}}),e('more','marketing')}}):null]},s.id)),(0,p.jsx)(d.Button,{kind:"secondary",label:"Add an event",onPress:()=>e('more','events')})]}):(0,p.jsxs)(a.default,{style:{gap:12},testID:"forecast-not-enough",children:[(0,p.jsx)(d.T,{center:!0,size:18,testID:"forecast-busy-level",children:P.busy.words}),(0,p.jsx)(b.NotEnoughHistory,{weeks:P.minWeeks,booked:F}),(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.T,{center:!0,weight:"semibold",colour:u.colours.gold,children:["Booked, next ",H," days"]}),G,(0,p.jsx)(j.DaysLineGraph,{days:Y('booked'),titleSpoken:`Booked covers for the next ${H} days`}),(0,p.jsx)(d.Muted,{children:"Confirmed bookings only. No estimate is added until there is enough history."})]}),(0,p.jsx)(y.SectionHead,{title:"Holidays & local events",sub:"Scottish bank holidays (gov.uk), South Ayrshire school holidays, key dining dates and your events"}),_.slice(0,6).map(e=>(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(d.T,{weight:"semibold",style:{flex:1},children:(0,o.holidayName)(e.title)}),(0,p.jsx)(d.Badge,{kind:w[e.kind][1],label:w[e.kind][0]})]}),(0,p.jsxs)(d.Muted,{children:[(0,c.niceDate)((0,c.parseYmd)(e.date))," ",e.date.slice(0,4)]})]},e.id)),(0,p.jsx)(d.Button,{kind:"secondary",label:"Add an event",onPress:()=>e('more','events')})]})};var s=_r(_d[0]),t=_r(_d[1]),o=_r(_d[2]),a=e(_r(_d[3])),r=e(_r(_d[4])),d=_r(_d[5]),n=_r(_d[6]),l=_r(_d[7]),i=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),y=_r(_d[12]),x=_r(_d[13]),j=_r(_d[14]),b=_r(_d[15]),p=_r(_d[16]);const k=(e,s)=>{const t=(0,c.parseYmd)(e),o=Math.round((t.getTime()-(0,c.parseYmd)(s).getTime())/864e5),a=t.toLocaleDateString('en-GB',{weekday:'long'});return o<=0?'tonight':1===o?'tomorrow':o<=6?`this ${a}`:`on ${(0,c.niceDate)(t)}`},f=e=>`${(0,o.holidayName)(e).replace(/ \(example\)| Supper/g,'')} booking now open`,w={'bank-holiday':['Bank holiday','red'],'school-holiday':['School holiday','blue'],occasion:['Key date','gold'],event:['Event','amber']}},1393,[1120,34,1075,102,426,794,848,1122,851,827,840,865,1147,1100,1366,1125,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.Forecasts=function({go:e}){const{rid:v,r:$,now:S,today:T}=(0,x.useCtx)(3e4),{width:B}=(0,a.default)(),C=(0,r.useBookings)(v),D=(0,r.useOrders)(v),M=(0,r.useEvents)(v),[P,A]=(0,s.useState)(7),F=(0,k.useRealHistory)(v,S),E=(0,s.useMemo)(()=>(0,l.forecastToday)($,C,D,M,S,F??void 0),[$,C,D,M,F,S.getTime()/6e4|0]),I=(0,s.useMemo)(()=>Array.from({length:P},(e,s)=>{const t=(0,c.addMins)((0,c.parseYmd)(T),1440*s);return{d:t,f:(0,l.forecastToday)($,C,D,M,t,F??void 0)}}),[$,C,D,M,T,P,F]),R=E.hours.reduce((e,s)=>e+s.booked,0),H=(0,i.showTakeaway)($),[L,N]=(0,s.useState)(H),O=M.filter(e=>e.date>=T).sort((e,s)=>e.date.localeCompare(s.date)).slice(0,14),_=Math.min(B,900)-60,Y=e=>I.map(s=>{const t='booked'===e?s.f.hours.reduce((e,s)=>e+s.booked,0):s.f.restOfDay.covers;return{key:(0,c.ymd)(s.d),label:(0,c.dayShort)(s.d),spoken:(0,c.dayLong)(s.d),value:s.f.open?t:0,open:!!s.f.open}}),G=(0,j.jsx)(d.Row,{gap:4,style:{justifyContent:'center'},children:[7,14].map(e=>(0,j.jsx)(d.Chip,{label:`${e}d`,accessibilityLabel:`Next ${e} days`,selected:P===e,onPress:()=>A(e),testID:`forecast-range-${e}`},e))});return E.enough?(0,j.jsxs)(o.default,{style:{gap:12},children:[(0,j.jsx)(d.T,{center:!0,size:18,testID:"forecast-busy-level",children:E.busy.words}),(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(o.default,{testID:"forecast-week",style:{flexDirection:'row',justifyContent:'center',alignItems:'center',gap:8,flexWrap:'wrap'},children:[(0,j.jsxs)(d.T,{center:!0,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:[7===P?'This week':`Next ${P} days`," \xb7 forecast covers"]}),E.example?(0,j.jsx)(k.ExampleBadge,{}):(0,j.jsx)(d.Badge,{kind:"amber",label:"ESTIMATE"})]}),G,(0,j.jsx)(f.DaysLineGraph,{days:Y('forecast'),titleSpoken:`Forecast covers for the next ${P} days`}),I.filter(e=>e.f.flags.length).map(e=>(0,j.jsxs)(d.Muted,{center:!0,children:[(0,c.niceDate)(e.d),": ",e.f.flags.join(', ')," (\xd7",e.f.multiplier.toFixed(2),")"]},(0,c.ymd)(e.d)))]}),(0,j.jsxs)(d.Card,{children:[(0,j.jsx)(d.T,{weight:"semibold",colour:u.colours.gold,children:"Suggested actions"}),E.suggestions.map((e,s)=>(0,j.jsxs)(d.T,{size:14,children:["\u2022 ",e]},s)),(0,j.jsx)(d.Muted,{children:E.example?`${n.EXAMPLE_ACCURACY}. Example figures: confirmed bookings + example weekday/hour averages + expected walk-ins, adjusted for calendar events.`:'Baseline: confirmed bookings + your own weekday/hour averages from past bookings, walk-ins and takeaway, adjusted for calendar events. An estimate, never a promise.'})]}),(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(d.T,{weight:"semibold",colour:H?u.colours.gold:u.colours.muted,children:"Takeaway"}),(0,j.jsx)(d.Button,{small:!0,kind:"ghost",label:L?'Hide':'Show',testID:"forecast-takeaway-toggle",onPress:()=>N(!L)})]}),L?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d.Muted,{children:"Takeaway orders by hour (forecast vs placed)"}),(0,j.jsx)(f.LineChart,{width:_,series:[E.hours.map(e=>e.takeaway),E.hours.map(e=>e.takeawayPlaced)],labels:E.hours.map(e=>String(e.hour))}),(0,j.jsxs)(d.Row,{gap:12,children:[(0,j.jsx)(d.Muted,{children:"Gold: forecast"}),(0,j.jsx)(d.Muted,{children:"Blue: placed so far"})]})]}):null]}),(0,j.jsx)(y.SectionHead,{title:"Holidays & local events",sub:"Scottish bank holidays (gov.uk), South Ayrshire school holidays, key dining dates and your events"}),O.map(s=>(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(d.T,{weight:"semibold",style:{flex:1},children:(0,t.holidayName)(s.title)}),(0,j.jsx)(d.Badge,{kind:w[s.kind][1],label:w[s.kind][0]})]}),(0,j.jsxs)(d.Muted,{children:[(0,c.niceDate)((0,c.parseYmd)(s.date))," ",s.date.slice(0,4),s.description?` \xb7 ${s.description}`:'']}),'regular'===s.source?(0,j.jsx)(d.Muted,{children:[s.time?`From ${(0,i.fmt12)(s.time)}`:'',s.lastFood?`last food orders ${(0,i.fmt12)(s.lastFood)}`:'',s.busier?'expect busier':''].filter(Boolean).join(' \xb7 ')}):null,'regular'===s.source?(0,j.jsx)(d.Button,{small:!0,kind:"secondary",testID:`promote-${s.id}`,label:`Promote: ${s.title} ${p(s.date,T)}`,onPress:()=>{h.useOwner.getState().setOwner({marketingDraft:{title:`${s.title} ${p(s.date,T)}`,body:`${s.title} at ${$.name} ${p(s.date,T)}${s.time?` from ${(0,i.fmt12)(s.time)}`:''}.${s.lastFood?` Food until ${(0,i.fmt12)(s.lastFood)}.`:''} Book a table in the app.`}}),e('more','marketing')}}):'school-holiday'!==s.kind?(0,j.jsx)(d.Button,{small:!0,kind:"secondary",label:`Promote: "${b(s.title)}"`,onPress:()=>{h.useOwner.getState().setOwner({marketingDraft:{title:b(s.title),body:`${b(s.title)} at ${$.name}. Book in the app.`}}),e('more','marketing')}}):null]},s.id)),(0,j.jsx)(d.Button,{kind:"secondary",label:"Add an event",onPress:()=>e('more','events')})]}):(0,j.jsxs)(o.default,{style:{gap:12},testID:"forecast-not-enough",children:[(0,j.jsx)(d.T,{center:!0,size:18,testID:"forecast-busy-level",children:E.busy.words}),(0,j.jsx)(k.NotEnoughHistory,{weeks:E.minWeeks,booked:R}),(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.T,{center:!0,weight:"semibold",colour:u.colours.gold,children:["Booked, next ",P," days"]}),G,(0,j.jsx)(f.DaysLineGraph,{days:Y('booked'),titleSpoken:`Booked covers for the next ${P} days`}),(0,j.jsx)(d.Muted,{children:"Confirmed bookings only. No estimate is added until there is enough history."})]}),(0,j.jsx)(y.SectionHead,{title:"Holidays & local events",sub:"Scottish bank holidays (gov.uk), South Ayrshire school holidays, key dining dates and your events"}),O.slice(0,6).map(e=>(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(d.T,{weight:"semibold",style:{flex:1},children:(0,t.holidayName)(e.title)}),(0,j.jsx)(d.Badge,{kind:w[e.kind][1],label:w[e.kind][0]})]}),(0,j.jsxs)(d.Muted,{children:[(0,c.niceDate)((0,c.parseYmd)(e.date))," ",e.date.slice(0,4)]})]},e.id)),(0,j.jsx)(d.Button,{kind:"secondary",label:"Add an event",onPress:()=>e('more','events')})]})};var s=_r(_d[0]),t=_r(_d[1]),o=e(_r(_d[2])),a=e(_r(_d[3])),d=_r(_d[4]),r=_r(_d[5]),n=_r(_d[6]),l=_r(_d[7]),i=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),y=_r(_d[12]),x=_r(_d[13]),f=_r(_d[14]),k=_r(_d[15]),j=_r(_d[16]);const p=(e,s)=>{const t=(0,c.parseYmd)(e),o=Math.round((t.getTime()-(0,c.parseYmd)(s).getTime())/864e5),a=t.toLocaleDateString('en-GB',{weekday:'long'});return o<=0?'tonight':1===o?'tomorrow':o<=6?`this ${a}`:`on ${(0,c.niceDate)(t)}`},b=e=>`${(0,t.holidayName)(e).replace(/ \(example\)| Supper/g,'')} booking now open`,w={'bank-holiday':['Bank holiday','red'],'school-holiday':['School holiday','blue'],occasion:['Key date','gold'],event:['Event','amber']}},1393,[34,1075,102,426,794,848,1122,1120,851,827,840,865,1147,1100,1366,1125,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useShellBadges",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(()=>({notifCount:0}))},1394,[815]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.OrderCard=P,_e.Orders=function(){const{rid:e,r:t,now:l,me:s}=(0,w.useCtx)(5e3),n=(0,u.useOrders)(e),[c,h]=(0,r.useState)(!1),[b,x]=(0,r.useState)(null),[f,T]=(0,r.useState)('all'),C=n.filter(k.LIVE).filter(e=>'all'===f||e.type===f).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),v=n.filter(e=>!(0,k.LIVE)(e)).slice(0,8),R=n.filter(k.LIVE).flatMap(e=>(0,m.readinessFor)(e,t,l).map(t=>({...t,order:e}))),A=R.filter(e=>'due'===e.state||'overdue'===e.state),M=R.filter(e=>'upcoming'===e.state).sort((e,t)=>e.due.getTime()-t.due.getTime()).slice(0,5),N={cook:'START COOKING',bag:'BAG IT',ready:'READY'};return(0,B.jsxs)(o.default,{style:{gap:12},children:[(0,B.jsx)(i.Button,{testID:"take-order",label:"Take an order",sub:(0,p.orderAtTableOn)(t)?'(phone, walk-in or table)':'(phone or walk-in takeaway)',accessibilityLabel:(0,p.orderAtTableOn)(t)?'Take an order, phone, walk-in or table':'Take an order, phone or walk-in takeaway',style:{minHeight:64},onPress:()=>h(!0)}),b?(0,B.jsx)(i.Banner,{kind:"success",title:`Order ${b} sent to the kitchen`,children:"It is on the live board below."}):null,(0,B.jsx)(i.Row,{gap:8,children:[['new','acknowledged'],['preparing'],['ready']].map((e,t)=>(0,B.jsxs)(o.default,{style:{flex:1,backgroundColor:j.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:j.colours.border},children:[(0,B.jsx)(i.T,{size:12,colour:j.colours.muted,children:['New','Preparing','Ready'][t]}),(0,B.jsx)(i.T,{size:22,weight:"bold",colour:[j.colours.red,j.colours.amber,j.colours.ok][t],children:n.filter(t=>e.includes(t.status)).length})]},t))}),(0,B.jsx)(k.SectionHead,{title:"Collection readiness",sub:`Takeaway timings: slot \u2212 prep \u2212 ${t.settings.bufferMins} min buffer`}),0===A.length?(0,B.jsx)(i.Muted,{children:"Nothing due right now."}):null,A.map(e=>(0,B.jsxs)(k.AlertBox,{colour:'overdue'===e.state?j.colours.red:j.colours.amber,title:`${N[e.stage]} \xb7 ${e.order.ref} \xb7 pickup ${(0,y.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,B.jsx)(i.T,{size:14,children:e.detail}),'ready'===e.stage?(0,B.jsx)(i.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>u.repo.orders.setStatus(e.orderId,'ready',s)}):(0,B.jsx)(i.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:!!(0,S.statusBlock)(e.order,'preparing',(0,S.linkedBooking)(e.order,u.useStore.getState().bookings)),onPress:()=>u.repo.orders.acknowledgeReadiness(e.orderId,e.stage,s)})]},e.id)),M.map(e=>(0,B.jsxs)(i.Muted,{children:[(0,y.hm)(e.due)," \xb7 ",N[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,y.hm)(new Date(e.order.slotTime)),")"]},e.id)),(0,B.jsx)(k.SectionHead,{title:"Live orders",right:(0,B.jsx)(i.Row,{gap:4,children:((0,p.orderAtTableOn)(t)?['all','takeaway','table']:['all','takeaway']).map(e=>(0,B.jsx)(i.Chip,{label:'all'===e?'All':'takeaway'===e?'Takeaway':'Table',selected:f===e,onPress:()=>T(e)},e))})}),0===C.length?(0,B.jsx)(i.Muted,{children:"No live orders."}):null,C.map(e=>(0,B.jsx)(P,{o:e},e.id)),v.length?(0,B.jsx)(k.SectionHead,{title:"Recently completed"}):null,v.map(e=>(0,B.jsx)(i.Card,{style:{opacity:.7},children:(0,B.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(i.T,{children:[e.ref," \xb7 ",'table'===e.type?`${(0,a.tableNumbers)(e.tableNo)}`:e.customerName]}),(0,B.jsx)(i.Badge,{kind:(0,k.statusKind)(e.status),label:(0,k.statusLabel)(e)})]})},e.id)),c?(0,B.jsx)(O,{onClose:e=>{h(!1),e&&x(e)}}):null]})};var e,t=_r(d[0]),l=_r(d[1]),a=_r(d[2]),s=_r(d[3]),r=_r(d[4]),n=_r(d[5]),o=(e=n)&&e.__esModule?e:{default:e},i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),p=_r(d[9]),h=_r(d[10]),b=_r(d[11]),m=_r(d[12]),x=_r(d[13]),y=_r(d[14]),j=_r(d[15]),k=_r(d[16]),w=_r(d[17]),f=_r(d[18]),T=_r(d[19]),S=_r(d[20]),C=_r(d[21]),v=_r(d[22]),B=_r(d[23]);const R={app:'App',phone:'Phone','walk-in':'Walk-in','staff-table':'Staff (table)','table-qr':'Table QR'};function O({onClose:e}){const{rid:a,r:s,now:n,me:m}=(0,w.useCtx)(3e4),y=(0,c.useAllMenu)(a).filter(e=>!e.hidden&&null!=e.price),k=(0,u.useOrders)(a),[T,S]=(0,r.useState)('phone'),[C,R]=(0,r.useState)(''),[O,P]=(0,r.useState)(''),[A,M]=(0,r.useState)(null),[N,$]=(0,r.useState)({}),[I,L]=(0,r.useState)([]),[D,E]=(0,r.useState)(''),[z,F]=(0,r.useState)(''),[_,G]=(0,r.useState)(''),[H,V]=(0,r.useState)(s.sections[0]??'All'),q=(0,x.takeawaySlots)(s,k,n).filter(e=>!e.full).slice(0,8),K=Object.entries(N).filter(([,e])=>e>0),W=K.reduce((e,[t,l])=>e+(y.find(e=>e.id===t)?.price??0)*l,0),Q='staff-table'===T,U=(0,v.ukPhone)(z),Y=Q||('phone'===T?U.ok:!z.trim()||U.ok)&&(0,v.emailOk)(_),J=K.length>0&&Y&&(Q?O.trim().length>0:C.trim().length>1&&('walk-in'===T||A)),X=s.sections.length?s.sections:Array.from(new Set(y.map(e=>e.section)));return(0,B.jsxs)(i.Sheet,{visible:!0,onClose:()=>e(),title:"Take an order",children:[(0,B.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,B.jsx)(i.Chip,{label:"Phone takeaway",selected:'phone'===T,onPress:()=>S('phone')}),(0,B.jsx)(i.Chip,{label:"Walk-in takeaway",selected:'walk-in'===T,onPress:()=>S('walk-in')}),(0,p.orderAtTableOn)(s)?(0,B.jsx)(i.Chip,{label:"Table",selected:Q,onPress:()=>S('staff-table')}):null]}),Q?(0,B.jsx)(i.Field,{label:"Table number",value:O,onChangeText:P,keyboardType:"number-pad",placeholder:"e.g. 6"}):(0,B.jsx)(i.Field,{label:"Customer name",value:C,onChangeText:R,placeholder:"e.g. Mrs Reid"}),Q?null:(0,B.jsx)(i.Field,{label:'phone'===T?'Mobile or phone number (needed)':'Mobile number (optional, for a text when it\u2019s ready)',value:z,onChangeText:F,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123"}),Q||!z||U.ok?null:(0,B.jsx)(i.T,{size:13,colour:j.colours.amber,children:U.error}),Q?null:(0,B.jsx)(i.Field,{label:"Email (optional)",value:_,onChangeText:G,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too"}),'phone'===T?(0,B.jsxs)(o.default,{style:{gap:4},children:[(0,B.jsxs)(i.Muted,{children:["Collection slot (cap ",s.settings.slotCap," per ",s.settings.slotMinutes," min)"]}),(0,B.jsx)(i.Row,{wrap:!0,gap:6,children:q.map(e=>(0,B.jsx)(i.Chip,{label:e.label,sub:e.cap-e.taken+" left",selected:A===e.time.toISOString(),onPress:()=>M(e.time.toISOString())},e.label))}),q.length?null:(0,B.jsx)(i.Muted,{children:"No slots left today."})]}):null,(0,B.jsx)(i.Row,{wrap:!0,gap:6,children:X.map(e=>(0,B.jsx)(i.Chip,{label:e,selected:H===e,onPress:()=>V(e)},e))}),y.filter(e=>e.section===H||!X.includes(e.section)).map(e=>(0,B.jsxs)(i.Row,{style:{justifyContent:'space-between',opacity:e.soldOut?.4:1},children:[(0,B.jsxs)(o.default,{style:{flex:1},children:[(0,B.jsx)(i.T,{size:15,children:e.name}),(0,B.jsxs)(i.Muted,{children:[(0,b.gbp)(e.price??0),e.soldOut?' \xb7 sold out':'']})]}),e.soldOut?null:(0,B.jsx)(i.Stepper,{value:N[e.id]??0,min:0,max:20,label:e.name,onChange:t=>$({...N,[e.id]:t})})]},e.id)),(0,B.jsx)(i.Muted,{children:"Allergies (ask every customer)"}),(0,B.jsx)(i.Row,{wrap:!0,gap:6,children:h.ALLERGENS.map(e=>{const t=I.some(t=>t.allergen===e.id);return(0,B.jsx)(i.Chip,{label:e.short,selected:t,onPress:()=>L(t?I.filter(t=>t.allergen!==e.id):[...I,{allergen:e.id,severity:'allergy'}])},e.id)})}),(0,B.jsx)(i.Field,{label:"Notes",value:D,onChangeText:E,placeholder:"e.g. extra salt, call on arrival"}),t.IS_GREENSIDE?(0,B.jsx)(l.GreensideCashOnly,{}):(0,B.jsx)(i.Banner,{kind:"demo",title:"Card payments: not set up yet",children:"Pay on collection or at the table. Nothing is charged in the app."}),(0,B.jsx)(i.Button,{label:`Place order \xb7 ${(0,b.gbp)(W)}`,disabled:!J,onPress:()=>{const t=u.useStore.getState().placeManualOrder({restaurantId:a,type:Q?'table':'takeaway',channel:T,customerName:C.trim(),tableNo:Q?O.trim():void 0,slotTime:'phone'===T?A:'walk-in'===T?new Date(n.getTime()+9e5).toISOString():void 0,lines:K.map(([e,t])=>({itemId:e,qty:t})),allergies:I,notes:D.trim()||void 0,by:m,phone:!Q&&U.ok?U.pretty:void 0,email:Q?void 0:_.trim()||void 0});I.length&&(0,f.autoPost)('kitchen',`Allergy alert ${Q?`table ${O.trim()}`:t.ref}: ${I.map(e=>(0,h.allergenLabel)(e.allergen).toLowerCase()).join(', ')}`),e(t.ref)}})]})}function P({o:e}){const{r:t,now:l,me:r}=(0,w.useCtx)(1e4),n=(0,k.nextStatus)(e),c=(0,u.useStore)(e=>e.bookings),p=(0,S.linkedBooking)(e,c),m=e.allergies.length>0&&!!(0,S.nextStep)(e,p)&&!('table'===(0,S.nextStep)(e,p)&&!['ready','served'].includes(e.status)),x=!!n&&!!(0,S.statusBlock)(e,n.to,p);return(0,B.jsxs)(o.default,{style:[i.styles.card,{borderColor:m?j.colours.red:'new'===e.status?j.colours.amber:j.colours.border}],children:[(0,B.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(i.T,{weight:"semibold",children:[e.ref," \xb7 ",'table'===e.type?`${(0,a.tableNumbers)(e.tableNo)}`:e.customerName]}),(0,B.jsx)(i.Badge,{kind:(0,k.statusKind)(e.status),label:(0,k.statusLabel)(e)})]}),(0,B.jsxs)(i.Muted,{children:['takeaway'===e.type?"Takeaway"+(e.slotTime?` \xb7 pickup ${(0,y.hm)(new Date(e.slotTime))}`:''):'Dine-in'," \xb7 ",R[e.channel??(e.type,'app')]," \xb7 ",(0,y.minsBetween)(new Date(e.createdAt),l)," min ago \xb7 ",(0,b.gbp)(e.total),e.paid>=e.total?' paid':' unpaid']}),e.lines.map((e,t)=>(0,B.jsxs)(i.T,{size:14,children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'',e.notes?` \xb7 ${e.notes}`:'']},t)),e.notes?(0,B.jsxs)(i.Muted,{children:["Note: ",e.notes]}):null,e.allergies.length?(0,B.jsx)(i.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,B.jsx)(i.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \xb7 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,e.allergies.length?(0,B.jsx)(T.AllergyChain,{o:e,me:r}):null,e.accepted?(0,B.jsxs)(i.T,{size:13,colour:j.colours.ok,children:["Accepted by ",e.accepted.by,e.readyBy?` \xb7 ready by ${(0,y.hm)(new Date(e.readyBy))}`:'']}):null,'takeaway'===e.type?(0,B.jsx)(C.ConfirmTimeline,{refId:e.id}):null,'takeaway'===e.type?(0,B.jsx)(s.ReprintButton,{rid:t.id,o:e}):null,e.customerSignal?(0,B.jsx)(i.Badge,{kind:"blue",label:'here'===e.customerSignal?'Customer is here':'Customer on the way'}):null,(0,B.jsxs)(i.Row,{wrap:!0,gap:6,children:[n?(0,B.jsx)(i.Button,{small:!0,kind:'ready'===n.to?'success':'primary',label:n.label,testID:`next-${e.ref}`,disabled:x,onPress:()=>u.repo.orders.setStatus(e.id,n.to,r)}):null,'takeaway'!==e.type||'new'!==e.status||e.accepted?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(i.Button,{small:!0,kind:"success",label:"Accept",onPress:()=>u.repo.orders.accept(e.id,r)}),[15,20,30].map(t=>(0,B.jsx)(i.Button,{small:!0,kind:"secondary",label:`Ready in ${t}`,onPress:()=>u.repo.orders.accept(e.id,r,t)},t))]}),'new'===e.status?(0,B.jsx)(i.Button,{small:!0,kind:"ghost",label:"Reject",onPress:()=>u.repo.orders.setStatus(e.id,'cancelled',r)}):null]})]})}},1395,[5,1342,829,1311,34,102,794,848,850,855,830,836,1134,1104,827,840,1147,1100,1135,1136,838,1348,833,25]); __d(function(g,_r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"tableOnHere",{enumerable:!0,get:function(){return le}});var e,t=_r(d[0]),s=_r(d[1]),r=_r(d[2]),o=_r(d[3]),n=_r(d[4]),l=_r(d[5]),u=_r(d[6]),c=_r(d[7]),p=_r(d[8]),b=_r(d[9]),h=_r(d[10]),f=_r(d[11]),y=_r(d[12]),C=_r(d[13]),S=_r(d[14]),k=_r(d[15]),v=_r(d[16]),w=_r(d[17]),E=_r(d[18]),N=_r(d[19]),P=_r(d[20]),W=_r(d[21]),A=_r(d[22]),T=_r(d[23]),R=_r(d[24]),M=(e=R)&&e.__esModule?e:{default:e},B=_r(d[25]),O=_r(d[26]),G=_r(d[27]),x=_r(d[28]),D=_r(d[29]),I=_r(d[30]),L=_r(d[31]),H=_r(d[32]),F=_r(d[33]),_=_r(d[34]),Q=_r(d[35]),V=_r(d[36]),q=_r(d[37]),U=_r(d[38]),Y=_r(d[39]),j=_r(d[40]),z=_r(d[41]),$=_r(d[42]),J=_r(d[43]),K=_r(d[44]),X=_r(d[45]),Z=_r(d[46]),ee=_r(d[47]),te=_r(d[48]),ae=_r(d[49]),se=_r(d[50]),ie=_r(d[51]),re=_r(d[52]),oe=_r(d[53]),ne=_r(d[54]),de=_r(d[55]);const le=()=>{const e=n.useOwner.getState().site;return(0,p.orderAtTableOn)(c.useStore.getState().restaurants.find(t=>t.id===e))},ue=e=>n.CAN.manage(e);(0,y.register)([{id:'lookback',title:'Look back',sub:'Bookings on one exact past date: times, party sizes, recorded tables and Booked covers',group:'Run the day',can:e=>ue(e)&&'owner'===r.APP_VARIANT,C:s.LookBack},{id:'serviceboard',title:'Restaurant dashboard',sub:'The Display in Managers: any day, plan, Timeline, guests, Covers and all service actions',group:'Run the day',can:ue,C:o.ServiceBoard},{id:'info',title:'Info & hours',sub:'Tagline, phone, about, kitchen hours',group:'Manage app',can:ue,C:f.InfoHours},{id:'photos',title:'Photos',sub:'Gallery shown in the customer app',group:'Manage app',can:ue,C:f.Photos},{id:'recipecards',title:'Recipe cards',sub:'Photo, ingredients, method, allergens, section and price; head chef signs off',group:'Manage app',badge:'NEW',C:k.RecipeCardsPage},{id:'menu',title:'Menu & allergens',sub:'Add, hide, mark sold out, descriptions and options; allergens come from the recipe cards',group:'Manage app',can:ue,C:f.MenuManager},{id:'offers',title:'Specials & offers',sub:'Live specials; notifications are not connected',group:'Manage app',can:ue,C:f.Offers},{id:'events',title:'Events',sub:"What's on, feeds the forecast",group:'Manage app',can:ue,C:f.EventsPage},{id:'feedback',title:'Feedback inbox',sub:'Private ratings after each visit',group:'Manage app',can:ue,C:f.Feedback},{id:'staff',title:'Staff & roles',sub:'Team, roles and role preview',group:'Team',C:b.StaffRoles},{id:'branding',title:'Branding',sub:'Your logo and accent colour in all five apps',group:'Account',can:ue,badge:'NEW',C:S.BrandingSettings},{id:'plan',title:'Plan & billing',sub:h.PLAN_SUB,group:'Account',can:n.CAN.billing,C:h.PlanBilling}]),(0,y.register)([{id:'avatar',title:'My avatar',sub:'Original icons, Bar & kitchen, animals, sea, sport, patterns or your own photo',group:'Team',badge:'NEW',C:W.MyAvatar},{id:'clock',title:'Clock in / out',sub:'Geofenced, break prompt, privacy-first',group:'Team',badge:'NEW',C:N.ClockInOut},{id:'rota',title:'Rota',sub:'Shift builder, swaps, leave, availability, labour vs forecast',group:'Team',C:N.Rota},{id:'signoff',title:'Sign off hours',sub:'Rostered vs actual, flags, fix times, confirm hours for pay',group:'Team',badge:'NEW',can:ue,C:P.SignOff},{id:'timesheets',title:'Timesheets',sub:'Scheduled vs actual, breaks, paid hours, payroll export',group:'Team',C:N.Timesheets}]),(0,y.register)([{id:'insights',title:'Insights',sub:'Smart suggestions from your data',group:'Run the day',can:n.CAN.forecasts,badge:'AI',C:A.Insights},{id:'prep',title:'Prep & stock list',sub:'What to prep from tonight\u2019s forecast',group:'Run the day',C:A.PrepList},{id:'blocks',title:'Block bookings',sub:'Block now, add a block for a future date, time, area or tables, and see every future block',group:'Run the day',badge:'NEW',can:ue,C:w.BlocksPage},{id:'spendhead',title:'Spend per head',sub:'Takings \xf7 covers by day, week and service, from your cash ups',group:'Run the day',badge:'NEW',can:ue,C:E.SpendPerHeadPage},{id:'cashup',title:'Cash up & sales',sub:'Photo of the cash up sheet, weekly sales report, graphs, Today\u2019s tips and the Tips pot',group:'Run the day',badge:'NEW',can:ue,C:v.CashUpPage},{id:'notifications',title:'Notifications',sub:'Orders, allergies, requests, reviews',group:'Run the day',C:A.Notifications},{id:'search',title:'Search',sub:'Dishes, orders, bookings, customers, staff',group:'Run the day',C:A.Search},{id:'analytics',title:'Sales & analytics',sub:'Revenue by channel, top dishes, commission saved',group:'Grow',can:n.CAN.takings,C:A.Analytics},{id:'engineering',title:'Menu engineering',sub:'Margin vs popularity, sold out toggle',group:'Grow',can:ue,C:A.MenuEngineering},{id:'crm',title:'Customers (CRM)',sub:'Profiles, visits, allergies, tags, segments',group:'Grow',can:ue,C:A.Crm},{id:'marketing',title:'Marketing',sub:'Saved campaign drafts; delivery is not connected',group:'Grow',can:ue,C:A.Marketing},{id:'reviews',title:'Reviews',sub:'Look through reviews, publish or remove with a recorded reason',group:'Grow',can:ue,C:A.Reviews},{id:'reviewemail',title:'Review emails',sub:'Ask guests for a review after their visit',group:'Settings',can:ue,C:A.ReviewEmailSettings},{id:'compliance',title:'Daily checks & allergen log',sub:'Fridge temps, opening checks, audit log',group:'Compliance',C:A.Compliance},{id:'lost',title:'Lost property & coat check',sub:'Found items and coat-check tickets',group:'Compliance',C:A.LostProperty},{id:'apps',title:'Your apps',sub:'Links to all five apps (customer, Staff, Display, Head Chef, Managers)',group:'Account',can:ue,badge:'NEW',C:A.YourApps},{id:'demo',title:'Example data',sub:'Example service time, reset',group:'Account',can:()=>!t.LIVE_VENUE_BUILD,C:A.DemoTools}]),(0,y.register)([{id:'features',title:'All features',sub:'Every CoverCharge feature, one tap away',group:'Start here',badge:'19',C:T.AllFeatures},{id:'tables',title:'Tables & QR codes',sub:'QR order & pay at table, live table orders',group:'Run the day',can:()=>le(),C:T.TablesQr},{id:'takeaway',title:'Takeaway settings',sub:'Slots, capacity, pause, live queue',group:'Run the day',can:ue,C:T.TakeawaySettings},{id:'bookingsettings',title:'Booking settings',sub:'Deposits, reminders',group:'Run the day',can:ue,C:T.BookingSettings},{id:'allergy',title:'Allergy hub',sub:'14 allergens, alerts, verification, audit log',group:'Compliance',C:T.AllergyHub},{id:'loyalty',title:'Stamp card',sub:'Settings, members, add/redeem stamps, stats',group:'Grow',can:ue,C:T.Loyalty},{id:'referrals',title:'Bring a friend',sub:'Referral rewards, list and stats',group:'Grow',can:ue,C:T.Referrals},{id:'giftcards',title:'Gift cards & vouchers',sub:'Sell, balance, redeem, honour website bookings cards',group:'Grow',can:ue,C:T.GiftVouchers},{id:'merch',title:'Merch shop',sub:'Optional: products, stock, orders',group:'Grow',can:ue,C:T.Merch},{id:'tablet',title:'Staff tablet preview',sub:'Tablet app coming later',group:'Account',C:T.TabletPreview}]);const ge=e=>'staff'!==e;(0,y.register)([{id:'mypay',title:'My hours & pay',sub:'Hours worked and gross pay, before tax (estimate)',group:'Team',badge:'NEW',C:()=>M.default.createElement(O.MyHoursPay)},{id:'mytips',title:'Tips',sub:'The venue tip pot and today\u2019s tips',group:'Team',C:B.MyTips},{id:'tips',title:'Tips',sub:'Split tips fairly, approve, compliance checklist',group:'Team',badge:'NEW',can:ge,C:B.Tips},{id:'payroll',title:'Payroll & pay rates',sub:'Hourly rates, team gross pay for the period',group:'Team',badge:'NEW',can:ge,C:O.Payroll},{id:'suppliers',title:'Suppliers',sub:'Contacts, cut-offs, call, email, order log',group:'Run the day',badge:'NEW',can:e=>'staff'!==e||n.useOwner.getState().staffCanViewSuppliers,C:G.Suppliers}]),(0,y.register)([{id:'social',title:'Post to social',sub:'Publishing is not connected',group:'Grow',badge:'NEW',C:x.SocialPage},{id:'socialaccounts',title:'Social posting accounts',sub:'No social publishing accounts are connected',group:'Grow',can:ue,C:x.SocialAccounts},{id:'quicklinks',title:'Quick links',sub:'Work email (Gmail), website bookings and your own shortcuts',group:'Account',can:ue,badge:'NEW',C:x.QuickLinksSettings}]),(0,y.register)([{id:'tableplan',title:'Table plan',sub:'Areas, tables, seats, joins; used by the Display floor view',group:'Run the day',can:ue,badge:'NEW',C:D.TablePlan},{id:'displaysettings',title:'Display settings',sub:'Privacy mode, screensaver, PIN on wake',group:'Run the day',can:ue,badge:'NEW',C:D.DisplaySettingsPage}]);const ce=e=>'owner'===e||'manager'===e;I.ASSISTANT_AVAILABLE&&(0,y.register)([{id:'assistant',title:'Assistant',sub:'Ask in plain English; you confirm every action. Activity log',group:'Start here',can:ce,badge:'NEW',C:I.AssistantPage},{id:'assistantsettings',title:'Assistant settings',sub:'On/off, voice, connected services',group:'Account',can:ce,C:I.AssistantSettings}]),(0,y.register)([{id:'carscreen',title:'Car screen',sub:'Sign the car in with its 6-digit code, or sign a car out. Parked only',group:'Run the day',badge:'NEW',can:e=>'owner'===e&&!r.IS_CAR,C:H.CarScreen}]);const pe=e=>'owner'===e||'manager'===e,be=()=>{const e=l.useSession.getState().meId;if(!e)return!0;const t=n.useOwner.getState().staff.find(t=>t.id===e);return!!t&&t.active&&(0,u.costsAllowedFor)(t)},he=e=>pe(e)&&be();(0,y.register)([{id:'specialsboard',title:'Specials board',sub:'Photo of the chalkboard or typed specials with allergens; shown in the customer app',group:'Run the day',can:pe,badge:'NEW',C:L.SafetyPages.Specials},{id:'dishcreator',title:'New dish creator',sub:'Cost a dish, set GP % or multiple, price it, publish to the menu',group:'Manage app',can:he,badge:'NEW',C:L.SafetyPages.Creator},{id:'ingredientprices',title:'Ingredient prices',sub:'What you pay per pack and what it averages; recipe cards work out their GP from it',group:'Manage app',can:he,badge:'NEW',C:L.SafetyPages.Prices},{id:'haccp',title:'Food safety log (HACCP)',sub:'Temperatures, cleaning, allergen checks; filters; CSV and print for the EHO',group:'Compliance',can:pe,badge:'NEW',C:L.SafetyPages.Haccp},{id:'allergen-signoffs',title:'Allergen sign-off log',sub:'Five-step sign-off chain for every guest allergy, with names and times',group:'Compliance',can:pe,badge:'NEW',C:C.AllergenSignOffLog},{id:'accidents',title:'Accident book',sub:'Accidents and near misses; RIDDOR prompt for serious ones',group:'Compliance',badge:'NEW',C:L.SafetyPages.Accidents}]),(0,y.register)([{id:'alerts',title:'Alerts & sounds',sub:'Live alerts, chime, which alerts, test alert, phone notifications',group:'Run the day',can:ue,badge:'NEW',C:F.AlertSettings},{id:'guestmsgs',title:'Guest texts & emails',sub:'Booking and order confirmations, with live preview',group:'Manage app',can:ue,badge:'NEW',C:F.GuestTemplates},{id:'outbox',title:'Outbox',sub:'Every guest text and email (preview mode)',group:'Run the day',can:ue,badge:'NEW',C:F.Outbox}]);const fe=e=>'owner'===e||'manager'===e;(0,y.register)([{id:'advanced',title:'Advanced',sub:'Bookings questions, table times, platters, regular events, kitchen hours and seasons, home screens',group:'Settings',can:fe,badge:'NEW',C:Q.AdvancedSettings},{id:'setup',title:'Guided setup',sub:'Nine steps with a progress bar: venue, hours, table plan, pay, staff, permissions, links',group:'Settings',can:fe,badge:'NEW',C:_.SetupGuide},{id:'orderattable',title:'Order at table',sub:'On or off for this venue: QR order & pay at table. Takeaway is separate',group:'Settings',can:fe,badge:'NEW',C:V.OrderAtTableSettings},{id:'ordersheets',title:'Supplier order sheets',sub:'Suppliers, delivery days, cut-offs and how to order; used by the Head Chef app',group:'Settings',can:fe,badge:'NEW',C:q.OrderSheetSettings},...U.SETUP_STEPS.flatMap(e=>[{id:`setup-${e.id}`,title:e.title,sub:e.sub,group:'Settings',can:fe,C:(0,_.stepPage)(e.id)},...'venue'===e.id?[{id:'screensaver',title:'Display screensaver',sub:'What the Display shows when it\'s idle',group:'Settings',can:fe,badge:'NEW',C:Y.DisplaySaverSettings}]:[]])]),(0,y.register)([{id:'displays',title:'Displays',sub:'Pair a tablet with a one-time code, or switch one off',group:'Settings',can:fe,badge:'NEW',C:j.DisplaysPage},{id:'trackedstock',title:'Tracked stock',sub:'Live counters (lobster, crab or anything else): units, low warning, supplier',group:'Settings',can:ue,badge:'NEW',C:j.TrackedStockPage},{id:'breakroom',title:'Break room game',sub:'On or off for the team',group:'Settings',can:fe,badge:'NEW',C:j.BreakRoomSettings}]),(0,y.register)([{id:'tableqr',title:'Table QR codes',sub:'Scan to order: on or off, hours, print and renew each table\'s QR',group:'Run the day',can:fe,badge:'NEW',C:z.TableQrPage}]),(0,y.register)([{id:'hours',title:'Payroll hours',sub:'Confirmed hours per person for a pay or tips period; copy into your spreadsheet, CSV or print',group:'Team',can:ue,badge:'NEW',C:$.PayrollHours},{id:'tipsday',title:'Tips day',sub:'Enter the total; it\u2019s shared by confirmed hours to the penny',group:'Team',can:ue,badge:'NEW',C:$.TipsDay},{id:'paysettings',title:'Pay & tips',sub:'Tips payday and frequency, wage pay day and cut-off',group:'Settings',can:ue,badge:'NEW',C:$.PayTipsSettings}]),(0,y.register)([{id:'setupchecklist',title:'Setup checklist',sub:'Your setup progress, replay the welcome, questionnaire answers',group:'Settings',can:ue,badge:'NEW',C:J.SetupChecklist}]),(0,y.register)([{id:'help',title:'Help & tutorials',sub:'Search how-tos, Show me where, or ask the Assistant',group:'Start here',can:ue,badge:'NEW',C:K.HelpPage}]),(0,y.register)([{id:'connections',title:'Connected accounts',sub:'Email, website, work socials, bookings, payments, accounting and supplier links',group:'Settings',can:ue,badge:'NEW',C:Z.ConnectionsPage}]),(0,y.register)([{id:'drafts',title:'Drafts for approval',sub:'Bookings, Booker and Bidfood lists, offers, events and specials the voice helper prepared; nothing is sent',group:'Run the day',can:ue,badge:'NEW',C:ee.DraftsPage},{id:'shiftnotes',title:'Shift notes',sub:'Notes for the next shift, left by voice or typing',group:'Run the day',badge:'NEW',C:ee.ShiftNotesPage},{id:'voice',title:'Voice helper',sub:'Hold-to-talk input, text-only replies, who gets it and microphone privacy',group:'Settings',can:ue,badge:'NEW',C:ee.VoiceSettingsPage}]),(0,y.register)([{id:'orderlists',title:'Order lists',sub:'Alsons drinks, Cash and carry: add items, tick on the day, history',group:'Run the day',badge:'NEW',C:function(){const{rid:e,role:t,me:s,today:r}=(0,se.useCtx)(6e4),o=(0,se.useSignedIn)();return M.default.createElement(te.OrderListsScreen,{rid:e,today:r,editor:'staff'!==t,who:{id:o?.id??'manager',name:(o?.name??s).replace(' (example)','')}})}},{id:'foodsafety',title:'Food safety (CookSafe)',sub:'Based on CookSafe (Food Standards Scotland). Full logs coming in the next update',group:'Compliance',can:pe,badge:'NEW',C:function(){return M.default.createElement(ae.FoodSafetyCard,null)}}]),(0,y.register)([{id:'board',title:'Question board',sub:'Anonymous questions from the team: vote, reply, hide (logged)',group:'Team',badge:'NEW',C:function(){const{rid:e,role:t,me:s,today:r}=(0,se.useCtx)(6e4),o=(0,se.useSignedIn)();return M.default.createElement(ie.QuestionBoard,{rid:e,today:r,manager:'owner'===t||'manager'===t,by:(o?.name??s).replace(' (example)','')})}},{id:'morale',title:'Team morale',sub:'Morale over time, staffing vs Covers each night, shout-outs. Anonymous',group:'Team',can:pe,badge:'NEW',C:function(){const{rid:e,today:t}=(0,se.useCtx)(6e4);return M.default.createElement(ie.MoraleTrend,{rid:e,today:t})}}]),(0,y.register)([{id:'soldout',title:'Sold out',sub:'Mark dishes sold out or back on. A reminder for staff, shown on the Display',group:'Run the day',badge:'NEW',C:function(){const{rid:e,me:t}=(0,se.useCtx)(6e4),s=(0,se.useSignedIn)();return M.default.createElement(re.SoldOutList,{rid:e,by:(s?.name??t).replace(' (example)','')})}}]),(0,y.register)([{id:'printerhelp',title:'Connect a ticket printer',sub:'Wi-Fi, network and Bluetooth printers for kitchen tickets, in plain words',group:'Start here',can:ue,badge:'NEW',C:X.PrinterHelpPage}]),(0,y.register)([{id:'guests',title:'Guest profiles',sub:'Visits and Covers from bookings, allergies checked with the guest, preferences, GDPR export and erase requests',group:'Grow',badge:'NEW',C:function(){const{me:e,role:t}=(0,se.useCtx)(6e4),s=(0,se.useSignedIn)();return M.default.createElement(oe.GuestProfiles,{me:(s?.name??e).replace(' (example)',''),manager:'owner'===t||'manager'===t})}}]),(0,y.register)([{id:'nightly',title:'Nightly report',sub:'Spend per head, Covers, takings, tips and no-shows from the cash-up',group:'Run the day',can:ue,C:ne.NightlyReportPage},{id:'support',title:'Chat with CoverCharge support',sub:'A message to the CoverCharge team',group:'Start here',can:ue,C:de.SupportChatPage}])},1396,[806,1397,846,1400,865,997,988,800,855,1402,1409,1419,1379,1420,1421,1423,1424,1425,1426,1155,1157,1428,1377,1429,34,1154,1145,1378,1367,1380,1413,1434,1435,1436,1370,1357,1384,1437,925,1438,1439,1440,1151,1385,1441,1311,1386,1453,1082,1043,1100,1156,1130,1454,1457,1460]); @@ -1553,12 +1553,12 @@ __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.MenuEditor=function({rid:e,me:o,role:s}){const a=(0,d.useAllMenu)(e),c=(0,l.useStore)(o=>o.restaurants.find(o=>o.id===e)),[u,h]=(0,t.useState)('dishes'),[D,O]=(0,t.useState)(null),[k,w]=(0,t.useState)(null),[C,I]=(0,t.useState)(''),z=(0,t.useMemo)(()=>{const e=[...c?.sections??[]];return a.forEach(o=>{e.includes(o.section)||e.push(o.section)}),e},[c?.sections,a]),M=a.filter(e=>!e.hidden||e.recipeCardId),P=e=>(0,p.hasRecipeCards)()?(0,p.recipeCards)().byMenuItem(e):void 0,T={name:o,role:s},R=(0,b.useHistory)(()=>({sections:[...z],items:Object.fromEntries(l.useStore.getState().menu.filter(o=>o.restaurantId===e).map(e=>{const o=a.find(o=>o.id===e.id)??e;return[e.id,{section:o.section,sort:e.sort,price:o.price,allergens:{...o.allergens},soldOut:e.soldOut,photo:P(e.id)?.photo}]}))}),o=>{const t=l.useStore.getState();c&&o.sections.join('|')!==(c.sections??[]).join('|')&&t.updateRestaurant(e,{sections:o.sections});for(const[e,s]of Object.entries(o.items)){const o=a.find(o=>o.id===e),n=t.menu.find(o=>o.id===e);if(!o||!n)continue;const r={};o.section!==s.section&&(r.section=s.section),n.sort!==s.sort&&(r.sort=s.sort),o.price!==s.price&&(r.price=s.price),JSON.stringify(o.allergens)!==JSON.stringify(s.allergens)&&(r.allergens=s.allergens),n.soldOut!==s.soldOut&&(r.soldOut=s.soldOut),Object.keys(r).length&&t.updateMenuItem(e,r);const d=P(e);d&&d.photo!==s.photo&&(0,p.recipeCards)().update(d.id,{photo:s.photo},T)}},'menu change'),B=(e,o,t)=>{const s=a.find(o=>o.id===e);if(!s)return;R.record(`moved ${s.name}`);const n=l.useStore.getState(),r=a.map(t=>t.id===e?{...t,section:o}:t);s.section!==o&&n.updateMenuItem(e,{section:o}),(0,y.reorder)(r,e,o,t).forEach(e=>n.updateMenuItem(e.id,{sort:e.sort})),I(`${s.name} moved${s.section!==o?` to ${o}`:''}.`)},F=async(o,t)=>{const s=P(o),n=a.find(e=>e.id===o);if(s&&n)try{const o=await(0,f.shrinkImage)(t,1024);R.record(`photo for ${n.name}`);const r=await(0,p.recipeCards)().savePhoto(e,s.id,{dataUrl:o,width:0,height:0,bytes:Math.round(.75*o.length)});await(0,p.recipeCards)().update(s.id,{photo:r},T),I(`Photo added to ${n.name}. The dish needs the Head Chef\u2019s sign-off again.`)}catch{I('That picture couldn\u2019t be read. Try a JPEG or PNG.')}else I('This dish has no recipe card yet, so it can\u2019t hold a photo.')},_=a.find(e=>e.id===D),E=({m:e})=>{const o=P(e.id),t=o?.photo&&(0,p.hasRecipeCards)()?(0,p.recipeCards)().photoSource(o.photo):null,s=t?.uri,n=D===e.id,r=k===`d:${e.id}`;return(0,S.jsxs)("div",{"data-testid":`menu-dish-${e.id}`,draggable:!0,onDragStart:o=>(0,f.dragData)(o,'dish',e.id),onClick:()=>O(e.id),onDragOver:o=>{o.preventDefault(),w(`d:${e.id}`)},onDragLeave:()=>w(null),onDrop:o=>{o.preventDefault(),o.stopPropagation(),w(null);const t=(0,f.filesOf)(o)[0];if(t)return void F(e.id,t);const s=(0,f.readDrag)(o);'dish'===s?.kind&&s.id!==e.id&&B(s.id,e.section,e.id)},style:(0,j.box)({display:'flex',alignItems:'center',gap:10,padding:'8px 10px',borderRadius:10,cursor:'grab',userSelect:'none',marginBottom:6,background:n?x.colours.goldTint:x.colours.tile,border:`1px solid ${r?x.colours.gold:n?x.colours.accentBorder:x.colours.hairline}`,borderTop:r?`3px solid ${x.colours.gold}`:void 0}),children:[(0,S.jsx)("span",{style:(0,j.box)({color:x.colours.muted,fontSize:16}),children:"\u283f"}),(0,S.jsx)("div",{style:(0,j.box)({width:40,height:40,borderRadius:8,background:x.colours.surface2,backgroundImage:s?`url(${s})`:void 0,backgroundSize:'cover',backgroundPosition:'center',flexShrink:0,display:'flex',alignItems:'center',justifyContent:'center',fontSize:10,color:x.colours.muted}),children:s?'':'photo'}),(0,S.jsxs)("div",{style:(0,j.box)({flex:1,minWidth:0}),children:[(0,S.jsx)("div",{style:(0,j.box)({fontFamily:'Poppins_600SemiBold',fontSize:14,whiteSpace:'nowrap',overflow:'hidden',textOverflow:'ellipsis',textDecoration:e.soldOut?'line-through':void 0}),children:e.name}),(0,S.jsxs)("div",{style:(0,j.box)({fontSize:12,color:x.colours.muted}),children:[Object.keys(e.allergens).length?Object.keys(e.allergens).length+' allergens':'No allergens',e.hidden?' \xb7 hidden':'']})]}),e.soldOut?(0,S.jsx)("span",{style:(0,j.box)({fontSize:11,color:x.colours.amber,border:`1px solid ${x.colours.amber}`,borderRadius:6,padding:'1px 6px'}),children:"Sold out"}):null,(0,S.jsx)("span",{style:(0,j.box)({fontFamily:'Poppins_600SemiBold',color:x.colours.gold,fontSize:14}),children:v(e.price)})]})};return(0,S.jsxs)(n.default,{style:{flex:1,gap:10},testID:"desk-menu",children:[(0,S.jsx)(j.Tip,{children:"Drag a dish (\u283f) to put it in order or onto another section. Drag a section name to move the whole section. Drop a photo from Finder onto a dish. \u2318Z undoes."}),(0,S.jsxs)(r.Row,{gap:8,children:[(0,S.jsx)(r.Chip,{label:"Dishes",selected:'dishes'===u,onPress:()=>h('dishes'),testID:"menu-tab-dishes"}),(0,S.jsx)(r.Chip,{label:"Sold out & counts",selected:'soldout'===u,onPress:()=>h('soldout'),testID:"menu-tab-soldout"}),(0,S.jsx)(n.default,{style:{flex:1}}),C?(0,S.jsx)(r.T,{size:13,colour:x.colours.goldLight,children:C}):null,(0,S.jsx)(r.Button,{small:!0,kind:"secondary",label:"Undo",disabled:!R.canUndo,onPress:R.undo,testID:"menu-undo"}),(0,S.jsx)(r.Button,{small:!0,kind:"secondary",label:"Redo",disabled:!R.canRedo,onPress:R.redo,testID:"menu-redo"})]}),'soldout'===u?(0,S.jsx)(n.default,{style:{maxWidth:760},children:(0,S.jsx)(m.SoldOutList,{rid:e,by:o})}):(0,S.jsxs)(n.default,{style:{flex:1,flexDirection:'row',gap:14,minHeight:0},children:[(0,S.jsx)("div",{style:(0,j.box)({flex:1,overflowY:'auto',paddingRight:6}),"data-testid":"menu-sections",children:z.map(o=>{const t=M.filter(e=>e.section===o),s=k===`s:${o}`;return(0,S.jsxs)("div",{style:(0,j.box)({marginBottom:14}),onDragOver:e=>{e.preventDefault(),w(`s:${o}`)},onDragLeave:()=>w(null),onDrop:t=>{t.preventDefault(),w(null);const s=(0,f.readDrag)(t);var n,r;'dish'===s?.kind&&B(s.id,o,null),'section'===s?.kind&&s.id!==o&&(n=s.id,r=o,c&&(R.record(`moved section ${n}`),l.useStore.getState().updateRestaurant(e,{sections:(0,y.moveSection)(z,n,r)}),I(`${n} moved.`)))},children:[(0,S.jsxs)("div",{draggable:!0,onDragStart:e=>(0,f.dragData)(e,'section',o),"data-testid":`menu-section-${o}`,style:(0,j.box)({display:'flex',alignItems:'center',gap:8,padding:'6px 4px',cursor:'grab',borderBottom:`${s?2:1}px solid ${s?x.colours.gold:x.colours.border}`,marginBottom:8}),children:[(0,S.jsx)("span",{style:(0,j.box)({color:x.colours.muted}),children:"\u283f"}),(0,S.jsx)("span",{style:(0,j.box)({fontFamily:'Poppins_700Bold',fontSize:16,color:x.colours.goldMuted,letterSpacing:.5,textTransform:'uppercase'}),children:o}),(0,S.jsxs)("span",{style:(0,j.box)({fontSize:12,color:x.colours.muted}),children:[t.length," dishes"]})]}),t.map(e=>(0,S.jsx)(E,{m:e},e.id)),t.length?null:(0,S.jsx)("div",{style:(0,j.box)({fontSize:12,color:x.colours.muted,padding:8,border:`1px dashed ${x.colours.border}`,borderRadius:8}),children:"Drop a dish here"})]},o)})}),(0,S.jsx)(n.default,{style:{width:340,gap:10},testID:"menu-inspector",children:_?(0,S.jsx)($,{rid:e,m:_,me:o,record:R.record,onPhoto:e=>{F(_.id,e)}},_.id):(0,S.jsx)(r.Muted,{children:"Click a dish to change its price, allergens and sold-out state."})})]})]})};var e,o=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),n=(e=s)&&e.__esModule?e:{default:e},r=_r(_d[3]),d=_r(_d[4]),l=_r(_d[5]),a=_r(_d[6]),c=_r(_d[7]),u=_r(_d[8]),h=_r(_d[9]),p=_r(_d[10]),m=_r(_d[11]),x=_r(_d[12]),f=_r(_d[13]),b=_r(_d[14]),j=_r(_d[15]),y=_r(_d[16]),S=_r(_d[17]);const v=e=>null==e?'Board':`\xa3${(e/100).toFixed(2)}`,D={none:'contains',contains:'may',may:void 0};function $({rid:e,m:s,me:d,record:p,onPhoto:m}){const[b,y]=(0,t.useState)(null==s.price?'':(s.price/100).toFixed(2)),v=(e,o)=>{p(o),l.useStore.getState().updateMenuItem(s.id,e)},$=(0,c.dishUsesFor)(e).find(e=>e.id===s.id),O=(0,c.itemsFor)(e),k=()=>{const e=b.trim(),o=''===e?null:Number(e.replace('\xa3',''));if(null!==o&&(!isFinite(o)||o<0))return void y(null==s.price?'':(s.price/100).toFixed(2));const t=null==o?null:Math.round(100*o);t!==s.price&&v({price:t},`price of ${s.name}`)},w=e=>{const o=s.allergens[e]??'none',t=D[o],n={...s.allergens};t?n[e]=t:delete n[e],v({allergens:n},`allergens on ${s.name}`)};return(0,S.jsxs)(n.default,{style:{gap:10,backgroundColor:x.colours.surface,borderRadius:12,borderWidth:1,borderColor:x.colours.border,padding:12},children:[(0,S.jsx)(r.T,{size:17,weight:"bold",children:s.name}),(0,S.jsxs)(r.Muted,{size:12,children:[s.section,s.signOff?` \xb7 signed off by ${s.signOff.by}`:' \xb7 awaiting Head Chef sign-off']}),(0,S.jsx)("div",{onDragOver:e=>{(0,f.hasFiles)(e)&&e.preventDefault()},onDrop:e=>{e.preventDefault();const o=(0,f.filesOf)(e)[0];o&&m(o)},"data-testid":"menu-photo-drop",style:(0,j.box)({border:`1px dashed ${x.colours.accentBorder}`,borderRadius:10,padding:12,textAlign:'center',fontSize:12,color:x.colours.muted}),children:"Drop a photo from Finder here"}),(0,S.jsxs)(n.default,{style:{gap:4},children:[(0,S.jsx)(r.T,{size:13,weight:"semibold",children:"Price (\xa3)"}),(0,S.jsx)(o.TextInput,{testID:"menu-price",value:b,onChangeText:y,onBlur:k,onSubmitEditing:k,placeholder:"Blank = on the specials board",placeholderTextColor:x.colours.muted,style:[r.styles.input,{width:160}]})]}),(0,S.jsxs)(n.default,{style:{gap:4},children:[(0,S.jsx)(r.T,{size:13,weight:"semibold",children:"Allergens"}),(0,S.jsx)(r.Muted,{size:12,children:"Click to cycle: contains \u2192 may contain \u2192 none. Changes go to the recipe card and need the Head Chef\u2019s sign-off."}),(0,S.jsx)(r.Row,{gap:6,wrap:!0,children:h.ALLERGENS.map(e=>{const o=s.allergens[e.id];return(0,S.jsx)(r.Chip,{testID:`menu-al-${e.id}`,label:'may'===o?`${e.short} (may)`:e.short,selected:!!o,onPress:()=>w(e.id)},e.id)})})]}),(0,S.jsx)(r.Toggle,{label:"Sold out now",value:s.soldOut,onChange:e=>{p(`sold out ${s.name}`),(0,a.setSoldOut)(s.id,e,d)},testID:"menu-soldout"}),(0,S.jsxs)(n.default,{style:{gap:4},children:[(0,S.jsx)(r.T,{size:13,weight:"semibold",children:"Sold-out link"}),$&&$.uses.length?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r.Muted,{size:12,children:(0,u.usesText)($.uses,O)}),(0,S.jsx)(r.Badge,{kind:"gold",label:"Sells out on its own when the count runs out"})]}):(0,S.jsx)(r.Muted,{size:12,children:"Not linked to a count. Link it in \u201cSold out & counts\u201d."})]})]})}},1470,[796,34,102,794,850,800,977,979,980,830,856,1130,840,1467,1468,1469,1471,25]); __d(function(g,r,_i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.reorder=function(t,n,i,f){const c=t.filter(t=>t.section===i&&t.id!==n).map(t=>t.id),o=f?c.indexOf(f):-1;return c.splice(o<0?c.length:o,0,n),c.map((t,n)=>({id:t,sort:10*(n+1)}))},e.moveSection=function(t,n,i){const f=t.filter(t=>t!==n),c=i?f.indexOf(i):-1;return f.splice(c<0?f.length:c,0,n),f},e.moveShift=function(n,i,f,c,o,s){const u=n.find(t=>t.id===i);if(!u)return n;if(!o&&u.staffId===f&&u.date===c)return n;const l={...u,staffId:f,date:c,day:(0,t.weekdayOf)(c)};return o?[...n,{...l,id:s(),published:!1,changed:!1}]:n.map(t=>t.id===i?{...l,changed:!!u.published||u.changed}:t)};var t=r(d[0])},1471,[865]); __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.RotaEditor=function({today:e}){const y=(0,i.useOwner)(e=>e.staff).filter(e=>e.active),S=(0,i.useOwner)(e=>e.shifts),[$,j]=(0,t.useState)((0,i.mondayOfDate)(e)),[v,k]=(0,t.useState)(null),[w,D]=(0,t.useState)(''),B=(0,c.useHistory)(()=>i.useOwner.getState().shifts,e=>i.useOwner.getState().setShifts(e),'rota change'),O=b.map((e,t)=>(0,i.addDays)($,t)),P=(e,t,o)=>{e.preventDefault(),k(null);const d=(0,u.readDrag)(e);if('shift'!==d?.kind)return;const s=S.find(e=>e.id===d.id);if(!s)return;const n=!!e.altKey,c=y.find(e=>e.id===t)?.name??'';(n||s.staffId!==t||s.date!==o)&&(S.some(e=>e.staffId===t&&e.date===o&&e.id!==s.id&&e.starte.date>=$&&e.date<=O[6]),I=T.filter(e=>!e.published||e.changed).length;return(0,p.jsxs)(d.default,{style:{flex:1,gap:10},testID:"desk-rota",children:[(0,p.jsx)(h.Tip,{children:"Drag a shift to another day or person. Hold Option (Alt) while you drop to copy it instead. Nothing goes to staff until you press Publish."}),(0,p.jsxs)(s.Row,{gap:8,children:[(0,p.jsx)(s.Button,{small:!0,kind:"secondary",label:"\u2039 Week before",onPress:()=>j((0,i.addDays)($,-7))}),(0,p.jsxs)(s.T,{weight:"semibold",children:["Week of ",new Date($+'T12:00:00').toLocaleDateString('en-GB',{day:'numeric',month:'long'})]}),(0,p.jsx)(s.Button,{small:!0,kind:"secondary",label:"Next week \u203a",onPress:()=>j((0,i.addDays)($,7))}),(0,p.jsx)(d.default,{style:{flex:1}}),w?(0,p.jsx)(s.T,{size:13,colour:n.colours.goldLight,children:w}):null,(0,p.jsx)(s.Button,{small:!0,kind:"secondary",label:"Undo",disabled:!B.canUndo,onPress:B.undo,testID:"rota-undo"}),(0,p.jsx)(s.Button,{small:!0,kind:"secondary",label:"Redo",disabled:!B.canRedo,onPress:B.redo,testID:"rota-redo"}),(0,p.jsx)(s.Button,{small:!0,label:I?`Publish (${I})`:'Published',disabled:!I,onPress:()=>{B.record('published the week');const e=i.useOwner.getState().publishWeek($);D(`${e} shifts published.`)},testID:"rota-publish"})]}),(0,p.jsx)("div",{style:(0,h.box)({flex:1,overflow:'auto',border:`1px solid ${n.colours.border}`,borderRadius:12}),"data-testid":"rota-grid",children:(0,p.jsxs)("div",{style:(0,h.box)({display:'grid',gridTemplateColumns:"180px repeat(7, minmax(110px, 1fr))",minWidth:960}),children:[(0,p.jsx)("div",{style:(0,h.box)({position:'sticky',top:0,background:n.colours.surface,padding:8,borderBottom:`1px solid ${n.colours.border}`,zIndex:1})}),O.map((t,o)=>(0,p.jsxs)("div",{style:(0,h.box)({position:'sticky',top:0,zIndex:1,background:t===e?n.colours.goldTint:n.colours.surface,padding:8,borderBottom:`1px solid ${n.colours.border}`,fontFamily:'Poppins_600SemiBold',fontSize:13,color:t===e?n.colours.gold:n.colours.text}),children:[b[o]," ",Number(t.slice(8))]},t)),y.map(e=>(0,p.jsxs)(o.default.Fragment,{children:[(0,p.jsxs)("div",{style:(0,h.box)({padding:8,borderBottom:`1px solid ${n.colours.hairline}`,fontSize:13}),children:[(0,p.jsx)("div",{style:(0,h.box)({fontFamily:'Poppins_600SemiBold'}),children:e.name}),(0,p.jsx)("div",{style:(0,h.box)({fontSize:11,color:n.colours.muted}),children:e.job})]}),O.map(t=>{const o=`${e.id}|${t}`,d=T.filter(o=>o.staffId===e.id&&o.date===t);return(0,p.jsx)("div",{"data-testid":`rota-cell-${e.id}-${t}`,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=e.altKey?'copy':'move',k(o)},onDragLeave:()=>k(null),onDrop:o=>P(o,e.id,t),style:(0,h.box)({padding:5,minHeight:54,borderBottom:`1px solid ${n.colours.hairline}`,borderLeft:`1px solid ${n.colours.hairline}`,background:v===o?n.colours.accentBg:void 0,outline:v===o?`2px dashed ${n.colours.gold}`:void 0,outlineOffset:-3}),children:d.map(e=>(0,p.jsxs)("div",{draggable:!0,onDragStart:t=>(0,u.dragData)(t,'shift',e.id),"data-testid":`rota-shift-${e.id}`,title:e.note??'',style:(0,h.box)({cursor:'grab',userSelect:'none',borderRadius:8,padding:'4px 6px',marginBottom:4,fontSize:12,fontFamily:'Poppins_600SemiBold',background:e.published&&!e.changed?n.colours.gold:n.colours.goldTint,color:e.published&&!e.changed?n.colours.onGold:n.colours.goldLight,border:`1px solid ${n.colours.accentBorder}`}),children:[(0,l.fmtH)(e.start),"\u2013",(0,l.fmtH)(e.end),!e.published||e.changed?' \u2022':'']},e.id))},o)})]},e.id))]})}),(0,p.jsx)(s.Muted,{size:12,children:"Solid gold = published. Outlined with a dot = not yet published (new or changed)."})]})};var t=r(_d[0]),o=e(t),d=e(r(_d[1])),s=r(_d[2]),i=r(_d[3]),l=r(_d[4]),n=r(_d[5]),u=r(_d[6]),c=r(_d[7]),h=r(_d[8]),f=r(_d[9]),p=r(_d[10]);const b=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],x=()=>`sh-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`},1472,[34,102,794,865,1103,840,1467,1468,1469,1471,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.micAvailable=R,_e.CarApp=function(){const{width:e,height:d}=(0,l.default)(),{role:h,today:b,now:y}=(0,f.useCtx)(3e4),[w,W]=(0,t.useState)(d),v=(0,D.railSizes)(e,w),$=Math.max(320,e-v.railW-1),[M,P]=(0,t.useState)(null),[A,_]=(0,t.useState)(null),[E,N]=(0,t.useState)(!1),[U,V]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(0,f.ensureAttendance)(b,y),(0,u.ensureChat)(y)},[b]),(0,t.useEffect)(()=>{R().then(_)},[]),(0,t.useEffect)(()=>{if(I.PITCH)return;const e=setInterval(()=>{(0,C.carPairPoll)()},6e4);return()=>clearInterval(e)},[]),(0,t.useEffect)(()=>{'owner'!==h&&j.useOwner.getState().setPreviewRole('owner')},[h]);const F=(0,t.useCallback)(()=>P(null),[]);(0,p.useBackLayer)(!!M,F);const Y=e=>P({btn:e,page:e.pages[0].id}),G=(0,t.useCallback)((e,t)=>{const n=e=>D.CAR_BUTTONS.find(t=>t.pages.some(t=>t.id===e));if('home'===e)return P(null);if('bookings'===e)return P({btn:n('@bookings'),page:'@bookings'});if('chat'===e)return P({btn:n('@chat'),page:'@chat'});if('orders'===e||'forecast'===e)return P(t=>({btn:t?.btn??D.CAR_BUTTONS[3],page:'orders'===e?'@orders':'@forecast'}));if('more'===e&&t){const e=n(t);return P(n=>({btn:e??n?.btn??D.CAR_BUTTONS[0],page:t}))}P(null)},[]),q=$<1400?$:Math.round(Math.min($,Math.max(960,.72*$))),J=M?M.btn.pages.find(e=>e.id===M.page)?.label??(0,c.pageFor)(M.page)?.title??M.btn.label:'';return(0,B.jsxs)(s.default,{testID:"car-app",onLayout:e=>{const t=Math.round(e.nativeEvent.layout.height);t>200&&Math.abs(t-w)>1&&W(t)},style:{flex:1,flexDirection:'row',backgroundColor:T.colours.bg,minHeight:0},children:[(0,B.jsxs)(s.default,{testID:"car-board",style:{width:$,minWidth:0,minHeight:0},children:[(0,B.jsx)(a.DisplayBoard,{embedded:!0,noVoice:!0,boardW:$,headerExtra:(0,B.jsx)(S.ParkedOnly,{small:e<1400}),subHeader:(0,B.jsx)(L,{onRota:()=>Y(D.CAR_BUTTONS[0]),onAccount:()=>N(!0)})}),M?(0,B.jsxs)(s.default,{testID:"car-panel",accessibilityViewIsModal:!0,style:{position:'absolute',top:0,bottom:0,right:0,width:q,zIndex:40,backgroundColor:T.colours.bg,borderLeftWidth:1,borderColor:T.colours.gold,boxShadow:'-18px 0 40px rgba(0,0,0,0.55)'},children:[(0,B.jsxs)(s.default,{testID:"car-panel-head",style:{flexDirection:'row',alignItems:'center',gap:8,paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderColor:T.colours.hairline},children:[(0,B.jsx)(n.default,{testID:"car-panel-close",accessibilityRole:"button",accessibilityLabel:`Close ${J}, back to the board`,onPress:()=>{(0,p.runBackLayer)()||F()},style:{minHeight:56,minWidth:96,paddingHorizontal:14,borderRadius:14,borderWidth:1,borderColor:T.colours.border,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{weight:"semibold",center:!0,children:"Close"})}),(0,B.jsx)(s.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,B.jsx)(x.T,{size:20,weight:"semibold",colour:T.colours.gold,center:!0,numberOfLines:1,accessibilityRole:"header",children:M.btn.label})}),(0,B.jsx)(s.default,{style:{minWidth:96}})]}),M.btn.pages.length>1?(0,B.jsx)(s.default,{testID:"car-panel-tabs",style:{flexDirection:'row',justifyContent:'center',flexWrap:'wrap',gap:8,paddingHorizontal:12,paddingVertical:8},children:M.btn.pages.map(e=>{const t=e.id===M.page;return(0,B.jsx)(n.default,{testID:`car-tab-${e.id.replace('@','')}`,accessibilityRole:"tab",accessibilityState:{selected:t},accessibilityLabel:e.label,onPress:()=>P({btn:M.btn,page:e.id}),style:{minHeight:48,paddingHorizontal:18,borderRadius:999,borderWidth:1,borderColor:t?T.colours.gold:T.colours.border,backgroundColor:t?H:'transparent',alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{weight:"semibold",colour:t?T.colours.goldLight:T.colours.text,center:!0,children:e.label})},e.id)})}):null,(0,B.jsx)(o.default,{testID:"car-panel-scroll",style:{flex:1},contentContainerStyle:{padding:16,paddingBottom:32,gap:12,width:'100%',maxWidth:1200,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:'assistant'===M.page&&!1===A?(0,B.jsx)(O,{}):(0,B.jsx)(z,{id:M.page,go:G},M.page)})]}):null]}),(0,B.jsxs)(s.default,{testID:"car-rail",accessibilityRole:"toolbar",accessibilityLabel:"Owner tools",style:{width:v.railW+1,borderLeftWidth:1,borderColor:T.colours.border,backgroundColor:'#0A0A0A',paddingTop:6,paddingBottom:6,alignItems:'stretch',minHeight:0,overflow:'hidden'},children:[(0,B.jsx)(s.default,{style:{height:D.RAIL_TITLE,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{size:11,weight:"semibold",colour:T.colours.goldMuted,center:!0,style:{letterSpacing:1},children:"OWNER"})}),(0,B.jsx)(s.default,{testID:"car-rail-grid",style:{flex:1,flexDirection:'row',flexWrap:'wrap',alignContent:'flex-start',minHeight:0},children:D.CAR_BUTTONS.map(e=>{const t=M?.btn.id===e.id;return(0,B.jsxs)(n.default,{testID:`car-btn-${e.id}`,accessibilityRole:"button",accessibilityState:{selected:t},accessibilityLabel:t?`${e.label}, open`:e.label,onPress:()=>t?F():Y(e),style:{width:v.colW,height:v.per,alignItems:'center',justifyContent:'center',gap:4,overflow:'hidden'},children:[(0,B.jsx)(s.default,{style:{width:v.circle,height:v.circle,borderRadius:v.circle/2,borderWidth:1.5,borderColor:T.colours.gold,backgroundColor:t?T.colours.gold:H,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(k.CarGlyph,{name:e.icon,size:v.icon,colour:t?'#0B0B0B':T.colours.goldLight})}),(0,B.jsx)(x.T,{size:v.label,weight:t?'semibold':'medium',colour:t?T.colours.goldLight:T.colours.text,center:!0,numberOfLines:1,style:{lineHeight:v.lineH,maxWidth:v.colW-6},children:v.colW<150?e.short:e.label})]},e.id)})})]}),E?(0,B.jsxs)(x.Sheet,{visible:!0,onClose:()=>N(!1),title:"This car",maxWidth:560,testID:"car-account-sheet",children:[(0,B.jsx)(x.T,{center:!0,children:"This car is signed in to The Anchorage as you, with your own rights. Use it only when the car is in Park."}),(0,B.jsx)(x.Muted,{center:!0,children:"To sign it out from your phone: Managers, More, Car screen."}),(0,B.jsx)(x.Button,{testID:"car-sign-out",kind:"secondary",label:"Sign this car out",onPress:()=>{N(!1),V(!0)},style:{minHeight:56}}),(0,B.jsx)(x.Button,{kind:"ghost",label:"Close",onPress:()=>N(!1),style:{minHeight:56}})]}):null,U?(0,B.jsxs)(x.Sheet,{visible:!0,onClose:()=>V(!1),title:"Sign this car out?",maxWidth:520,testID:"car-sign-out-confirm",children:[(0,B.jsx)(x.T,{center:!0,children:"You\u2019ll need a new code, approved on your phone, to use it again."}),(0,B.jsx)(x.Button,{testID:"car-sign-out-yes",label:"Yes, sign this car out",onPress:()=>{V(!1),(0,C.carSignOut)()},style:{minHeight:56}}),(0,B.jsx)(x.Button,{kind:"secondary",label:"Cancel",onPress:()=>V(!1),style:{minHeight:56}})]}):null]})};var t=r(_d[0]);r(_d[1]);var n=e(r(_d[2])),o=e(r(_d[3])),s=e(r(_d[4])),l=e(r(_d[5])),a=r(_d[6]),c=r(_d[7]);r(_d[8]);var d=r(_d[9]),u=r(_d[10]),h=r(_d[11]),b=r(_d[12]),f=r(_d[13]),p=r(_d[14]),x=r(_d[15]),y=r(_d[16]),j=r(_d[17]),w=r(_d[18]),C=r(_d[19]),I=r(_d[20]),T=r(_d[21]),D=r(_d[22]),k=r(_d[23]),S=r(_d[24]),W=r(_d[25]),v=r(_d[26]),B=r(_d[27]);const H='rgba(201,162,74,0.14)';async function R(){try{const e='undefined'!=typeof navigator?navigator.mediaDevices:null;if(!e?.getUserMedia||!e?.enumerateDevices)return!1;return(await e.enumerateDevices()).some(e=>'audioinput'===e.kind)}catch{return!1}}function L({onRota:e,onAccount:o}){const l=(0,f.useSignedIn)(),a=(0,j.useOwner)(e=>e.attendance),c=(0,j.useOwner)(e=>e.staff),[d,u]=(0,t.useState)(()=>Date.now());(0,t.useEffect)(()=>{const e=setInterval(()=>u(Date.now()),3e4);return()=>clearInterval(e)},[]);const h=a.filter(e=>e.in&&!e.out&&d-new Date(e.in).getTime()<72e6&&d>=new Date(e.in).getTime()).map(e=>(c.find(t=>t.id===e.staffId)?.name??'').replace(' (example)','')).filter(Boolean),b=[...new Set(h)],p=b.length?`On now: ${b.join(' \xb7 ')}`:'Nobody clocked in';return(0,B.jsxs)(s.default,{testID:"car-strip",style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',justifyContent:'center',gap:10,paddingHorizontal:12,paddingVertical:2,minHeight:44,borderBottomWidth:1,borderColor:T.colours.hairline},children:[(0,B.jsx)(n.default,{testID:"car-whos-on",accessibilityRole:"button",accessibilityLabel:`${p}. Opens the rota.`,onPress:e,style:{flexShrink:1,minHeight:44,justifyContent:'center',paddingHorizontal:8},children:(0,B.jsx)(x.T,{size:14,weight:"semibold",colour:T.colours.goldLight,numberOfLines:1,center:!0,children:p})}),l?(0,B.jsx)(n.default,{testID:"car-account",accessibilityRole:"button",accessibilityLabel:`Signed in as ${l.name}. Car sign-in options.`,onPress:o,style:{minHeight:44,justifyContent:'center',paddingHorizontal:12,borderRadius:22,borderWidth:1,borderColor:T.colours.gold,flexShrink:0},children:(0,B.jsx)(x.T,{size:13,weight:"semibold",colour:T.colours.gold,center:!0,numberOfLines:1,children:l.name.replace(' (example)','')})}):null,(0,B.jsx)(W.CarGameButton,{}),(0,B.jsx)(v.CarFullscreenButton,{})]})}function $({go:e}){const{rid:t,now:n}=(0,f.useCtx)(3e4),o=(0,y.useBookings)(t),l=(0,w.ymd)(n),a=(0,w.ymd)(new Date(n.getTime()-24192e5)),c=o.filter(e=>'noshow'===e.status&&e.date>=a&&e.date<=l).sort((e,t)=>(t.date+t.time).localeCompare(e.date+e.time)),d=o.filter(e=>e.date===l&&'confirmed'===e.status&&!e.walkIn&&new Date(`${e.date}T${e.time}:00`).getTime()e+(t.partySize||0),0);return(0,B.jsxs)(s.default,{testID:"car-noshows",style:{gap:10},children:[(0,B.jsx)(x.T,{center:!0,size:18,weight:"semibold",colour:T.colours.goldLight,children:c.length?`${c.length} no-show${1===c.length?'':'s'} in the last 28 days \xb7 ${u} Covers`:'No no-shows in the last 28 days'}),d.length?(0,B.jsxs)(s.default,{testID:"car-late",style:{gap:6,borderWidth:1,borderColor:T.colours.amber,borderRadius:12,padding:12},children:[(0,B.jsx)(x.T,{center:!0,weight:"semibold",colour:T.colours.amber,children:"Running more than 15 minutes late"}),d.map(e=>(0,B.jsx)(x.T,{center:!0,children:`${e.time} \xb7 ${e.name} \xb7 ${e.partySize} Covers${e.table?` \xb7 Table ${e.table}`:''}`},e.id)),(0,B.jsx)(x.Muted,{center:!0,children:"Call them first. If they don\u2019t come, mark No-show on their booking."})]}):null,c.map(e=>(0,B.jsxs)(s.default,{style:{borderWidth:1,borderColor:T.colours.border,borderRadius:12,padding:12,gap:2},children:[(0,B.jsx)(x.T,{center:!0,weight:"semibold",children:`${e.date===l?'Today':(0,w.niceDate)((0,w.parseYmd)(e.date))} \xb7 ${e.time} \xb7 ${e.name}`}),(0,B.jsx)(x.Muted,{center:!0,children:`${e.partySize} Covers${e.table?` \xb7 Table ${e.table}`:''}${e.phone?' \xb7 phone on the booking':''}`})]},e.id)),(0,B.jsx)(x.Button,{testID:"car-noshows-bookings",label:"Open Bookings to mark or undo a no-show",onPress:()=>e('bookings'),style:{minHeight:56}})]})}function O(){return(0,B.jsxs)(s.default,{testID:"car-no-mic",accessibilityLiveRegion:"polite",style:{gap:10,alignItems:'center',paddingVertical:24},children:[(0,B.jsx)(x.T,{center:!0,size:20,weight:"semibold",colour:T.colours.goldLight,children:"The Assistant needs the car\u2019s microphone"}),(0,B.jsx)(x.Muted,{center:!0,style:{maxWidth:520},children:"Sorry, this car\u2019s browser isn\u2019t letting the page use a microphone. For now, please use the Assistant in Managers on your phone."})]})}function z({id:e,go:t}){if('@bookings'===e)return(0,B.jsx)(d.Bookings,{go:t});if('@chat'===e)return(0,B.jsx)(u.Chat,{go:t});if('@noshows'===e)return(0,B.jsx)($,{go:t});if('@orders'===e)return(0,B.jsx)(h.Orders,{});if('@forecast'===e)return(0,B.jsx)(b.Forecasts,{go:t});const n=(0,c.pageFor)(e);if(!n)return(0,B.jsx)(x.Muted,{center:!0,children:"This screen isn\u2019t in the car yet. Open it in Managers on your phone."});const o=n.C;return(0,B.jsx)(o,{go:t})}},1473,[34,236,402,295,102,426,1279,1379,1396,1341,1135,1395,1393,1100,1041,794,848,865,827,985,2,840,1474,1475,1476,1477,1478,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=32;const l=s=>s.split('').join(' ')},1474,[]); +__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.micAvailable=L,_e.CarApp=function(){(0,v.useCarViewport)();const{width:e,height:c}=(0,a.default)(),[h,b]=(0,t.useState)(0),y=Math.max(320,z(e)-h);(0,t.useEffect)(()=>{b(0)},[e]);const{role:j,today:W,now:M}=(0,f.useCtx)(3e4),[A,P]=(0,t.useState)(c),_=(0,D.railSizes)(y,A),E=Math.max(320,y-_.railW-1),[N,V]=(0,t.useState)(null),[U,F]=(0,t.useState)(null),[Y,q]=(0,t.useState)(!1),[G,J]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(0,f.ensureAttendance)(W,M),(0,u.ensureChat)(M)},[W]),(0,t.useEffect)(()=>{L().then(F)},[]),(0,t.useEffect)(()=>{if(I.PITCH)return;const e=setInterval(()=>{(0,C.carPairPoll)()},6e4);return()=>clearInterval(e)},[]),(0,t.useEffect)(()=>{'owner'!==j&&w.useOwner.getState().setPreviewRole('owner')},[j]);const K=(0,t.useCallback)(()=>V(null),[]);(0,p.useBackLayer)(!!N,K);const Q=e=>V({btn:e,page:e.pages[0].id}),X=(0,t.useCallback)((e,t)=>{const n=e=>D.CAR_BUTTONS.find(t=>t.pages.some(t=>t.id===e));if('home'===e)return V(null);if('bookings'===e)return V({btn:n('@bookings'),page:'@bookings'});if('chat'===e)return V({btn:n('@chat'),page:'@chat'});if('orders'===e||'forecast'===e)return V(t=>({btn:t?.btn??D.CAR_BUTTONS[3],page:'orders'===e?'@orders':'@forecast'}));if('more'===e&&t){const e=n(t);return V(n=>({btn:e??n?.btn??D.CAR_BUTTONS[0],page:t}))}V(null)},[]),Z=E<1400?E:Math.round(Math.min(E,Math.max(960,.72*E))),ee=N?N.btn.pages.find(e=>e.id===N.page)?.label??(0,d.pageFor)(N.page)?.title??N.btn.label:'';return(0,B.jsxs)(s.default,{testID:"car-app",onLayout:e=>{const t=Math.round(e.nativeEvent.layout.height);t>200&&Math.abs(t-A)>1&&P(t)},style:{flex:1,flexDirection:'row',backgroundColor:T.colours.bg,minHeight:0,width:y,maxWidth:'100%',overflow:'hidden'},children:[(0,B.jsxs)(s.default,{testID:"car-board",style:{width:E,minWidth:0,minHeight:0},children:[(0,B.jsx)(l.DisplayBoard,{embedded:!0,noVoice:!0,boardW:E,headerExtra:(0,B.jsx)(k.ParkedOnly,{small:y<1400}),subHeader:(0,B.jsx)(R,{onRota:()=>Q(D.CAR_BUTTONS[0]),onAccount:()=>q(!0)})}),N?(0,B.jsxs)(s.default,{testID:"car-panel",accessibilityViewIsModal:!0,style:{position:'absolute',top:0,bottom:0,right:0,width:Z,zIndex:40,backgroundColor:T.colours.bg,borderLeftWidth:1,borderColor:T.colours.gold,boxShadow:'-18px 0 40px rgba(0,0,0,0.55)'},children:[(0,B.jsxs)(s.default,{testID:"car-panel-head",style:{flexDirection:'row',alignItems:'center',gap:8,paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderColor:T.colours.hairline},children:[(0,B.jsx)(n.default,{testID:"car-panel-close",accessibilityRole:"button",accessibilityLabel:`Close ${ee}, back to the board`,onPress:()=>{(0,p.runBackLayer)()||K()},style:{minHeight:56,minWidth:96,paddingHorizontal:14,borderRadius:14,borderWidth:1,borderColor:T.colours.border,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{weight:"semibold",center:!0,children:"Close"})}),(0,B.jsx)(s.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,B.jsx)(x.T,{size:20,weight:"semibold",colour:T.colours.gold,center:!0,numberOfLines:1,accessibilityRole:"header",children:N.btn.label})}),(0,B.jsx)(s.default,{style:{minWidth:96}})]}),N.btn.pages.length>1?(0,B.jsx)(s.default,{testID:"car-panel-tabs",style:{flexDirection:'row',justifyContent:'center',flexWrap:'wrap',gap:8,paddingHorizontal:12,paddingVertical:8},children:N.btn.pages.map(e=>{const t=e.id===N.page;return(0,B.jsx)(n.default,{testID:`car-tab-${e.id.replace('@','')}`,accessibilityRole:"tab",accessibilityState:{selected:t},accessibilityLabel:e.label,onPress:()=>V({btn:N.btn,page:e.id}),style:{minHeight:48,paddingHorizontal:18,borderRadius:999,borderWidth:1,borderColor:t?T.colours.gold:T.colours.border,backgroundColor:t?H:'transparent',alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{weight:"semibold",colour:t?T.colours.goldLight:T.colours.text,center:!0,children:e.label})},e.id)})}):null,(0,B.jsx)(o.default,{testID:"car-panel-scroll",style:{flex:1},contentContainerStyle:{padding:16,paddingBottom:32,gap:12,width:'100%',maxWidth:1200,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:'assistant'===N.page&&!1===U?(0,B.jsx)($,{}):(0,B.jsx)(O,{id:N.page,go:X},N.page)})]}):null]}),(0,B.jsxs)(s.default,{testID:"car-rail",onLayout:()=>{'undefined'!=typeof document&&requestAnimationFrame(()=>{const e=document.querySelector('[data-testid=car-rail]');if(!e)return;const t=Math.ceil(e.getBoundingClientRect().right-z(window.innerWidth));t>0&&b(e=>Math.min(400,e+t))})},accessibilityRole:"toolbar",accessibilityLabel:"Owner tools",style:{width:_.railW+1,borderLeftWidth:1,borderColor:T.colours.border,backgroundColor:'#0A0A0A',paddingTop:6,paddingBottom:6,alignItems:'stretch',minHeight:0,overflow:'hidden'},children:[(0,B.jsx)(s.default,{testID:"car-fullscreen-slot",style:{height:D.RAIL_TITLE,alignItems:'center',justifyContent:'center',paddingHorizontal:6},children:(0,B.jsx)(v.CarFullscreenButton,{place:"rail",width:_.railW-12})}),(0,B.jsx)(s.default,{testID:"car-rail-grid",style:{flex:1,flexDirection:'row',flexWrap:'wrap',alignContent:'flex-start',minHeight:0},children:D.CAR_BUTTONS.map(e=>{const t=N?.btn.id===e.id;return(0,B.jsxs)(n.default,{testID:`car-btn-${e.id}`,accessibilityRole:"button",accessibilityState:{selected:t},accessibilityLabel:t?`${e.label}, open`:e.label,onPress:()=>t?K():Q(e),style:{width:_.colW,height:_.per,alignItems:'center',justifyContent:'center',gap:4,overflow:'hidden'},children:[(0,B.jsx)(s.default,{style:{width:_.circle,height:_.circle,borderRadius:_.circle/2,borderWidth:1.5,borderColor:T.colours.gold,backgroundColor:t?T.colours.gold:H,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(S.CarGlyph,{name:e.icon,size:_.icon,colour:t?'#0B0B0B':T.colours.goldLight})}),(0,B.jsx)(x.T,{size:_.label,weight:t?'semibold':'medium',colour:t?T.colours.goldLight:T.colours.text,center:!0,numberOfLines:1,style:{lineHeight:_.lineH,maxWidth:_.colW-6},children:_.colW<150?e.short:e.label})]},e.id)})})]}),Y?(0,B.jsxs)(x.Sheet,{visible:!0,onClose:()=>q(!1),title:"This car",maxWidth:560,testID:"car-account-sheet",children:[(0,B.jsx)(x.T,{center:!0,children:"This car is signed in to The Anchorage as you, with your own rights. Use it only when the car is in Park."}),(0,B.jsx)(x.Muted,{center:!0,children:"To sign it out from your phone: Managers, More, Car screen."}),(0,B.jsx)(x.Button,{testID:"car-sign-out",kind:"secondary",label:"Sign this car out",onPress:()=>{q(!1),J(!0)},style:{minHeight:56}}),(0,B.jsx)(x.Button,{kind:"ghost",label:"Close",onPress:()=>q(!1),style:{minHeight:56}})]}):null,G?(0,B.jsxs)(x.Sheet,{visible:!0,onClose:()=>J(!1),title:"Sign this car out?",maxWidth:520,testID:"car-sign-out-confirm",children:[(0,B.jsx)(x.T,{center:!0,children:"You\u2019ll need a new code, approved on your phone, to use it again."}),(0,B.jsx)(x.Button,{testID:"car-sign-out-yes",label:"Yes, sign this car out",onPress:()=>{J(!1),(0,C.carSignOut)()},style:{minHeight:56}}),(0,B.jsx)(x.Button,{kind:"secondary",label:"Cancel",onPress:()=>J(!1),style:{minHeight:56}})]}):null]})};var t=r(_d[0]);r(_d[1]);var n=e(r(_d[2])),o=e(r(_d[3])),s=e(r(_d[4])),a=e(r(_d[5])),l=r(_d[6]),d=r(_d[7]);r(_d[8]);var c=r(_d[9]),u=r(_d[10]),h=r(_d[11]),b=r(_d[12]),f=r(_d[13]),p=r(_d[14]),x=r(_d[15]),y=r(_d[16]),w=r(_d[17]),j=r(_d[18]),C=r(_d[19]),I=r(_d[20]),T=r(_d[21]),D=r(_d[22]),S=r(_d[23]),k=r(_d[24]),W=r(_d[25]),v=r(_d[26]),B=r(_d[27]);const H='rgba(201,162,74,0.14)';async function L(){try{const e='undefined'!=typeof navigator?navigator.mediaDevices:null;if(!e?.getUserMedia||!e?.enumerateDevices)return!1;return(await e.enumerateDevices()).some(e=>'audioinput'===e.kind)}catch{return!1}}function R({onRota:e,onAccount:o}){const a=(0,f.useSignedIn)(),l=(0,w.useOwner)(e=>e.attendance),d=(0,w.useOwner)(e=>e.staff),[c,u]=(0,t.useState)(()=>Date.now());(0,t.useEffect)(()=>{const e=setInterval(()=>u(Date.now()),3e4);return()=>clearInterval(e)},[]);const h=l.filter(e=>e.in&&!e.out&&c-new Date(e.in).getTime()<72e6&&c>=new Date(e.in).getTime()).map(e=>(d.find(t=>t.id===e.staffId)?.name??'').replace(' (example)','')).filter(Boolean),b=[...new Set(h)],p=b.length?`On now: ${b.join(' \xb7 ')}`:'Nobody clocked in';return(0,B.jsxs)(s.default,{testID:"car-strip",style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',justifyContent:'center',gap:10,paddingHorizontal:12,paddingVertical:2,minHeight:44,borderBottomWidth:1,borderColor:T.colours.hairline},children:[(0,B.jsx)(n.default,{testID:"car-whos-on",accessibilityRole:"button",accessibilityLabel:`${p}. Opens the rota.`,onPress:e,style:{flexShrink:1,minHeight:44,justifyContent:'center',paddingHorizontal:8},children:(0,B.jsx)(x.T,{size:14,weight:"semibold",colour:T.colours.goldLight,numberOfLines:1,center:!0,children:p})}),a?(0,B.jsx)(n.default,{testID:"car-account",accessibilityRole:"button",accessibilityLabel:`Signed in as ${a.name}. Car sign-in options.`,onPress:o,style:{minHeight:44,justifyContent:'center',paddingHorizontal:12,borderRadius:22,borderWidth:1,borderColor:T.colours.gold,flexShrink:0},children:(0,B.jsx)(x.T,{size:13,weight:"semibold",colour:T.colours.gold,center:!0,numberOfLines:1,children:a.name.replace(' (example)','')})}):null,(0,B.jsx)(W.CarGameButton,{})]})}function M({go:e}){const{rid:t,now:n}=(0,f.useCtx)(3e4),o=(0,y.useBookings)(t),a=(0,j.ymd)(n),l=(0,j.ymd)(new Date(n.getTime()-24192e5)),d=o.filter(e=>'noshow'===e.status&&e.date>=l&&e.date<=a).sort((e,t)=>(t.date+t.time).localeCompare(e.date+e.time)),c=o.filter(e=>e.date===a&&'confirmed'===e.status&&!e.walkIn&&new Date(`${e.date}T${e.time}:00`).getTime()e+(t.partySize||0),0);return(0,B.jsxs)(s.default,{testID:"car-noshows",style:{gap:10},children:[(0,B.jsx)(x.T,{center:!0,size:18,weight:"semibold",colour:T.colours.goldLight,children:d.length?`${d.length} no-show${1===d.length?'':'s'} in the last 28 days \xb7 ${u} Covers`:'No no-shows in the last 28 days'}),c.length?(0,B.jsxs)(s.default,{testID:"car-late",style:{gap:6,borderWidth:1,borderColor:T.colours.amber,borderRadius:12,padding:12},children:[(0,B.jsx)(x.T,{center:!0,weight:"semibold",colour:T.colours.amber,children:"Running more than 15 minutes late"}),c.map(e=>(0,B.jsx)(x.T,{center:!0,children:`${e.time} \xb7 ${e.name} \xb7 ${e.partySize} Covers${e.table?` \xb7 Table ${e.table}`:''}`},e.id)),(0,B.jsx)(x.Muted,{center:!0,children:"Call them first. If they don\u2019t come, mark No-show on their booking."})]}):null,d.map(e=>(0,B.jsxs)(s.default,{style:{borderWidth:1,borderColor:T.colours.border,borderRadius:12,padding:12,gap:2},children:[(0,B.jsx)(x.T,{center:!0,weight:"semibold",children:`${e.date===a?'Today':(0,j.niceDate)((0,j.parseYmd)(e.date))} \xb7 ${e.time} \xb7 ${e.name}`}),(0,B.jsx)(x.Muted,{center:!0,children:`${e.partySize} Covers${e.table?` \xb7 Table ${e.table}`:''}${e.phone?' \xb7 phone on the booking':''}`})]},e.id)),(0,B.jsx)(x.Button,{testID:"car-noshows-bookings",label:"Open Bookings to mark or undo a no-show",onPress:()=>e('bookings'),style:{minHeight:56}})]})}function $(){return(0,B.jsxs)(s.default,{testID:"car-no-mic",accessibilityLiveRegion:"polite",style:{gap:10,alignItems:'center',paddingVertical:24},children:[(0,B.jsx)(x.T,{center:!0,size:20,weight:"semibold",colour:T.colours.goldLight,children:"The Assistant needs the car\u2019s microphone"}),(0,B.jsx)(x.Muted,{center:!0,style:{maxWidth:520},children:"Sorry, this car\u2019s browser isn\u2019t letting the page use a microphone. For now, please use the Assistant in Managers on your phone."})]})}function O({id:e,go:t}){if('@bookings'===e)return(0,B.jsx)(c.Bookings,{go:t});if('@chat'===e)return(0,B.jsx)(u.Chat,{go:t});if('@noshows'===e)return(0,B.jsx)(M,{go:t});if('@orders'===e)return(0,B.jsx)(h.Orders,{});if('@forecast'===e)return(0,B.jsx)(b.Forecasts,{go:t});const n=(0,d.pageFor)(e);if(!n)return(0,B.jsx)(x.Muted,{center:!0,children:"This screen isn\u2019t in the car yet. Open it in Managers on your phone."});const o=n.C;return(0,B.jsx)(o,{go:t})}function z(e){if('undefined'==typeof document)return e;const t=document.documentElement?.clientWidth||e,n=window.visualViewport?.width||e;return Math.floor(Math.min(e,t,n))}},1473,[34,236,402,295,102,426,1279,1379,1396,1341,1135,1395,1393,1100,1041,794,848,865,827,985,2,840,1474,1475,1476,1477,1478,25]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=64;const l=s=>s.split('').join(' ')},1474,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CarGlyph=function({name:e,size:x,colour:n}){const c={stroke:n,strokeWidth:1.8,fill:'none',strokeLinecap:'round',strokeLinejoin:'round'},l={rota:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Rect,{x:"3",y:"5",width:"18",height:"16",rx:"2",...c}),(0,h.jsx)(s.Path,{d:"M3 10h18M8 3v4M16 3v4M7 14h3M14 14h3M7 17h3",...c})]}),signoff:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Circle,{cx:"12",cy:"12",r:"9",...c}),(0,h.jsx)(s.Path,{d:"M12 7v5l3 2",...c}),(0,h.jsx)(s.Path,{d:"M15.5 18.5l1.8 1.8 3.4-3.6",...c})]}),menu:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Path,{d:"M6 3v8a2 2 0 0 0 2 2v8M10 3v8a2 2 0 0 1-2 2M8 3v6",...c}),(0,h.jsx)(s.Path,{d:"M16 21V3c2.5 1.5 3 5 3 8h-3",...c})]}),bookings:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Rect,{x:"3",y:"5",width:"18",height:"16",rx:"2",...c}),(0,h.jsx)(s.Path,{d:"M3 10h18M8 3v4M16 3v4M9 15l2 2 4-4",...c})]}),noshow:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Circle,{cx:"10",cy:"8",r:"4",...c}),(0,h.jsx)(s.Path,{d:"M3 21c0-4 3-6 7-6s7 2 7 6M17 9l4 4M21 9l-4 4",...c})]}),chat:(0,h.jsx)(s.Path,{d:"M4 5h16v11H9l-5 4z",...c}),stock:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Path,{d:"M3 7l9-4 9 4-9 4z",...c}),(0,h.jsx)(s.Path,{d:"M3 7v10l9 4 9-4V7M12 11v10",...c})]}),loyalty:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Rect,{x:"3",y:"6",width:"18",height:"12",rx:"2",...c}),(0,h.jsx)(s.Circle,{cx:"8",cy:"12",r:"1.5",...c}),(0,h.jsx)(s.Circle,{cx:"12",cy:"12",r:"1.5",...c}),(0,h.jsx)(s.Circle,{cx:"16",cy:"12",r:"1.5",...c})]}),takings:(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.Path,{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",...c})}),safety:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Path,{d:"M10 14V5a2 2 0 0 1 4 0v9a4 4 0 1 1-4 0z",...c}),(0,h.jsx)(s.Path,{d:"M12 9v7",...c})]}),reviews:(0,h.jsx)(s.Path,{d:"M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z",...c}),assistant:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",...c}),(0,h.jsx)(s.Path,{d:"M5 11a7 7 0 0 0 14 0M12 18v3M9 21h6",...c})]})};return(0,h.jsx)(t.default,{width:x,height:x,viewBox:"0 0 24 24",children:l[e]})},_e.GameGlyph=function({size:e,colour:x}){const n={stroke:x,strokeWidth:1.8,fill:'none',strokeLinecap:'round',strokeLinejoin:'round'};return(0,h.jsxs)(t.default,{width:e,height:e,viewBox:"0 0 24 24",children:[(0,h.jsx)(s.Path,{d:"M7 8h10a4 4 0 0 1 4 4v3a3 3 0 0 1-5.4 1.8L14.5 15h-5l-1.1 1.8A3 3 0 0 1 3 15v-3a4 4 0 0 1 4-4z",...n}),(0,h.jsx)(s.Path,{d:"M7 11v3M5.5 12.5h3",...n}),(0,h.jsx)(s.Circle,{cx:"16",cy:"11.5",r:"0.9",...n}),(0,h.jsx)(s.Circle,{cx:"18",cy:"13.5",r:"0.9",...n})]})},r(d[0]);var e,s=r(d[1]),t=(e=s)&&e.__esModule?e:{default:e},h=r(d[2])},1475,[34,900,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1476,[34,102,794,840,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CarGameButton=function(){const e=(0,u.useStore)(e=>!1!==e.restaurants.find(e=>e.id===f.VENUE_RID)?.settings?.games),s=(0,c.useSession)(e=>e.meId),j=(0,b.useSignedIn)(),[C,S]=(0,n.useState)(!1),[k]=(0,n.useState)(()=>new Date),x=(0,o.useGameClock)(s,C?new Date:k);return e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(t.default,{testID:"car-game-open",accessibilityRole:"button",accessibilityLabel:"Game: Lenny's Kitchen Chaos. Parked only.",onPress:()=>S(!0),style:{minHeight:44,justifyContent:'center',paddingHorizontal:14,borderRadius:22,borderWidth:1,borderColor:y.colours.gold,flexShrink:0},children:(0,_.jsx)(h.T,{size:13,weight:"semibold",colour:y.colours.gold,center:!0,numberOfLines:1,children:"Game"})}),C?(0,_.jsx)(o.BreakRoom,{car:!0,staffId:s??null,name:j?.name??'Owner',playable:(0,l.gamePlayable)(x),clock:x,onClose:()=>S(!1)}):null]}):null};var e,n=r(d[0]),s=r(d[1]),t=(e=s)&&e.__esModule?e:{default:e},o=r(d[2]),l=r(d[3]),u=r(d[4]),c=r(d[5]),b=r(d[6]),f=r(d[7]),h=r(d[8]),y=r(d[9]),_=r(d[10])},1477,[34,402,1137,1138,800,997,1100,5,794,840,25]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"FS_KEY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"THEATRE_KEY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"EASY_LINK",{enumerable:!0,get:function(){return b}}),_e.theatreUrl=p,_e.inTheatre=v,_e.CarFullscreenButton=function(){const[t,n]=(0,e.useState)(y),[f,T]=(0,e.useState)(!1),[x]=(0,e.useState)(v);(0,e.useEffect)(()=>{if(!u)return;const e=()=>{const e=y();n(e),e||w.set(h,null)};document.addEventListener('fullscreenchange',e),document.addEventListener('webkitfullscreenchange',e);let t='1'===w.get(h)&&!y();const c=()=>{t&&(t=!1,E())};return t&&(document.addEventListener('click',c,!0),document.addEventListener('touchend',c,!0)),()=>{document.removeEventListener('fullscreenchange',e),document.removeEventListener('webkitfullscreenchange',e),document.removeEventListener('click',c,!0),document.removeEventListener('touchend',c,!0)}},[]);const k=(0,e.useCallback)(async()=>{if(y()){w.set(h,null);try{await((document.exitFullscreen??document.webkitExitFullscreen)?.call(document))}catch{}return}const e=window.innerHeight;await E()?(w.set(h,'1'),setTimeout(()=>{(!y()||window.innerHeight<=e+8)&&T(!0)},900)):T(!0)},[]);return!u||x?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.default,{testID:"car-fullscreen",accessibilityRole:"button",accessibilityLabel:t?'Exit full screen':'Full screen: hide the browser bar',onPress:()=>{k()},style:{minHeight:44,justifyContent:'center',paddingHorizontal:14,borderRadius:22,borderWidth:1,borderColor:l.colours.gold,backgroundColor:t?'rgba(201,162,74,0.14)':'transparent',flexShrink:0},children:(0,o.jsx)(s.T,{size:13,weight:"semibold",colour:l.colours.gold,center:!0,numberOfLines:1,children:t?'Exit full screen':'Full screen'})}),f?(0,o.jsxs)(s.Sheet,{visible:!0,onClose:()=>T(!1),title:"Full screen in the car",maxWidth:600,testID:"car-fullscreen-help",children:[(0,o.jsx)(s.T,{center:!0,children:"The car\u2019s browser keeps its bar at the top. The car\u2019s own full-screen view has no bar at all."}),(0,o.jsx)(s.T,{center:!0,children:"Tap Open full screen. A YouTube page says you\u2019re leaving YouTube: tap the link on it. The car screen then opens with no bar."}),(0,o.jsx)(s.Muted,{center:!0,children:"The first time only, sign the car in again with a new code from your phone: the full-screen view keeps its own sign-in. The Assistant\u2019s microphone doesn\u2019t work there. To leave, tap the car\u2019s \u2715 in the top corner."}),(0,o.jsx)(s.Muted,{center:!0,children:`Easy link to save as a favourite: ${b}`}),(0,o.jsx)(s.Button,{testID:"car-fullscreen-theatre",label:"Open full screen",onPress:()=>{location.href=p(location.origin)},style:{minHeight:56}}),(0,o.jsx)(s.Button,{kind:"secondary",label:"Not now",onPress:()=>T(!1),style:{minHeight:56}})]}):null]})};var e=r(d[0]);r(d[1]);var t,n=r(d[2]),c=(t=n)&&t.__esModule?t:{default:t},s=r(d[3]),l=r(d[4]),o=r(d[5]);const u='undefined'!=typeof document,h='cc-car-fullscreen',f='cc-car-theatre',b='covercharge-apps.static.hf.space/car?full';function p(e){return`https://www.youtube.com/redirect?q=${encodeURIComponent(`${e}/car-app/index.html?theatre=1`)}`}const w={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}};function v(){if(!u)return!1;try{return/[?&]theatre=1\b/.test(location.search)&&w.set(f,'1'),/TESLA_AUTO/i.test(navigator.userAgent)||'1'===w.get(f)}catch{return!1}}const y=()=>u&&!(!document.fullscreenElement&&!document.webkitFullscreenElement);async function E(){const e=document.documentElement,t=e.requestFullscreen??e.webkitRequestFullscreen;if(!t)return!1;try{return await t.call(e,{navigationUI:'hide'}),!0}catch{return!1}}},1478,[34,236,402,794,840,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,"FS_KEY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"FS_BUTTON_H",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"NOT_ALLOWED",{enumerable:!0,get:function(){return b}}),_e.useCarViewport=function(){(0,t.useEffect)(()=>{if(!u)return;const e=document.documentElement,t=document.body,n=[e.style.cssText,t.style.cssText];for(const n of[e.style,t.style])n.height='100%',n.margin='0',n.overflow='hidden',n.overscrollBehavior='none',n.touchAction='manipulation';return()=>{e.style.cssText=n[0],t.style.cssText=n[1]}},[])},_e.CarFullscreenButton=function({place:e="rail",width:E}){const[x,p]=(0,t.useState)(y),[L,T]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!u)return;const e=()=>{const e=y();p(e),e||v.set(f,null)};document.addEventListener('fullscreenchange',e),document.addEventListener('webkitfullscreenchange',e);let t='1'===v.get(f)&&!y();const n=()=>{t&&(t=!1,w())};return t&&(document.addEventListener('click',n,!0),document.addEventListener('touchend',n,!0)),()=>{document.removeEventListener('fullscreenchange',e),document.removeEventListener('webkitfullscreenchange',e),document.removeEventListener('click',n,!0),document.removeEventListener('touchend',n,!0)}},[]),(0,t.useEffect)(()=>{if(!L)return;const e=setTimeout(()=>T(null),9e3);return()=>clearTimeout(e)},[L]);const F=(0,t.useCallback)(async()=>{if(T(null),y()){v.set(f,null);try{await((document.exitFullscreen??document.webkitExitFullscreen)?.call(document))}catch{}return}const e=window.innerHeight;await w()?(v.set(f,'1'),setTimeout(()=>{(!y()||window.innerHeight<=e+8)&&T(b)},900)):T(b)},[]);if(!u)return null;const k=x?'Exit full screen':'Full screen',j='corner'===e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{testID:"car-fullscreen",accessibilityRole:"button",accessibilityLabel:k,accessibilityHint:x?'Shows the browser bar again':'Hides the browser bar, if the car allows it',onPress:()=>{F()},style:[{minHeight:h,minWidth:j?220:void 0,width:j?void 0:E,alignSelf:j?void 0:'center',justifyContent:'center',alignItems:'center',paddingHorizontal:12,borderRadius:14,borderWidth:2,borderColor:o.colours.goldLight,backgroundColor:x?'#1d1708':o.colours.gold},j?{position:'fixed',top:12,right:12,zIndex:1200}:null],children:(0,s.jsx)(l.T,{size:j?20:17,weight:"bold",colour:x?o.colours.goldLight:'#1a1407',center:!0,numberOfLines:1,children:k})}),L?(0,s.jsx)(c.default,{testID:"car-fullscreen-msg",accessible:!0,accessibilityLiveRegion:"assertive",accessibilityLabel:L,style:{position:'fixed',top:j?76:12,right:j?12:220,maxWidth:420,zIndex:1300,padding:14,borderRadius:14,borderWidth:1.5,borderColor:o.colours.amber,backgroundColor:'#1d1708'},children:(0,s.jsx)(l.T,{size:17,center:!0,colour:"#FFE2A8",children:L})}):null]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),c=e(r(d[3])),l=r(d[4]),o=r(d[5]),s=r(d[6]);const u='undefined'!=typeof document,f='cc-car-fullscreen',h=56,b='The car\u2019s browser kept its address bar, so full screen isn\u2019t available here. The car screen already uses all the space it is given.',v={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}},y=()=>u&&!(!document.fullscreenElement&&!document.webkitFullscreenElement);async function w(){const e=document.documentElement,t=e.requestFullscreen??e.webkitRequestFullscreen;if(!t)return!1;try{return await t.call(e,{navigationUI:'hide'}),!0}catch{return!1}}},1478,[34,236,402,102,794,840,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),f=r(d[3]),u=r(d[4]);function c(){return(0,n.canShow)('staff')?(0,u.jsx)(f.StaffApp,{}):(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1479,[30,34,846,1480,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.StaffApp=function(){return(0,me.jsx)(J.StaffAppCtx.Provider,{value:!0,children:(0,me.jsx)(we,{})})};var s=_r(d[0]),t=_r(d[1]),o=_r(d[2]),i=_r(d[3]),r=_r(d[4]),l=_r(d[5]),n=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),f=_r(d[10]),p=_r(d[11]),b=_r(d[12]),y=_r(d[13]),x=_r(d[14]),j=_r(d[15]),k=_r(d[16]),w=_r(d[17]),v=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),M=_r(d[22]),R=_r(d[23]),B=_r(d[24]),P=e(_r(d[25])),A=e(_r(d[26])),I=e(_r(d[27])),O=e(_r(d[28])),L=e(_r(d[29])),W=_r(d[30]),z=_r(d[31]),H=_r(d[32]),E=_r(d[33]),D=_r(d[34]),N=_r(d[35]),_=_r(d[36]),V=_r(d[37]),F=_r(d[38]),U=_r(d[39]),$=_r(d[40]),G=_r(d[41]),Y=_r(d[42]),Q=_r(d[43]),J=_r(d[44]),K=_r(d[45]),q=_r(d[46]),X=_r(d[47]),Z=_r(d[48]),ee=_r(d[49]),se=_r(d[50]);_r(d[51]);var te=_r(d[52]),ae=_r(d[53]),oe=_r(d[54]),ie=_r(d[55]),re=_r(d[56]),le=_r(d[57]),ne=_r(d[58]),de=_r(d[59]),ce=_r(d[60]),ue=_r(d[61]),he=_r(d[62]),fe=_r(d[63]),pe=_r(d[64]),ge=_r(d[65]),me=_r(d[66]);const be=ce.ROSTER.find(e=>'chef'===e.app)?.id,ye=[{id:'home',label:'Home',icon:'home'},{id:'clock',label:'Clock',icon:'clock'},{id:'rota',label:'Rota',icon:'bookings'},{id:'chat',label:'Chat',icon:'chat'},{id:'me',label:'Me',icon:'user'}],xe={home:'Today',clock:'Clock in / out',rota:'Rota, swaps & leave',chat:'Staff chat',me:'Me'},je=[{id:'mytips',title:'Tips',sub:'The venue tip pot and today\u2019s tips'},{id:'reviews',title:'Reviews',sub:'Published reviews, newest first'},{id:'bookings',title:'Bookings',sub:'Any day, back or forward: tables, Covers, Unseat and Undo'},{id:'loyalty',title:'Stamp card',sub:'Find a guest, add a stamp or use a reward'},{id:'guests',title:'Guest profiles',sub:'Look a guest up: visits, Covers, allergies they told us, preferences'},{id:'giftcards',title:'Gift cards',sub:'Check a balance, take it off the bill, mark paid at the till'},{id:'tableorders',title:'Table orders',sub:'Orders from guests\u2019 phones at the table: accept, mark served or cancel'},{id:'soldout',title:'Sold out',sub:'What\u2019s run out today. Mark sold out or Back on; shows on the Display'},{id:'board',title:'Question board',sub:'Ask the team anything anonymously, and vote'},{id:'recipecards',title:'Recipe cards',sub:'Signed-off dishes: photo, ingredients, method and allergens (read-only)'},{id:'avatar',title:'My avatar',sub:'Your space-age avatar, or create one from a photo'},{id:'cashup',title:'Cash up',sub:'End-of-night takings: take a picture of the taking sheet or upload a spreadsheet (if a manager has switched it on for you)'},{id:'haccp',title:'Food safety checks',sub:'Record fridge, freezer, cooking and other checks (say or type)'},{id:'accidents',title:'Accident book',sub:'Report an accident or near miss; see your own entries'},{id:'mypay',title:'My hours & pay',sub:'Shifts, paid hours and estimated pay'},{id:'timesheets',title:'My timesheets',sub:'Your clock-ins, breaks and any changes'},{id:'orderlists',title:'Order lists',sub:'Add what\u2019s running low (Alsons drinks, Cash and carry)'},{id:'phone',title:'Phone notifications',sub:'Turn on reminders on this phone'},{id:'suppliers',title:'Suppliers',sub:'Contacts and order days (if your manager allows)'},{id:'privacy',title:'Privacy & location',sub:'What CoverCharge for Staff stores about you'}],ke=[{id:'mgr-plan',title:'Tables & areas',sub:'Edit the table plan, areas, seats and joined tables'},{id:'mgr-times',title:'Booking times',sub:'Kitchen hours, table times and Covers per booking slot'},{id:'mgr-bookings',title:'Bookings (manager)',sub:'New, edit and cancel bookings, walk-ins, seat, move and finish tables, deposit status'},{id:'mgr-clear',title:'Tables to clear',sub:'Tables waiting to be cleared; mark them cleared'},{id:'mgr-blocks',title:'Block bookings',sub:'Block now, add a block, close the garden'},{id:'mgr-allergy',title:'Allergy checks',sub:'Every allergy order\u2019s sign-offs and the allergen log'},{id:'mgr-stock',title:'Tracked stock',sub:'What\u2019s counted live through service; add or change items'},{id:'mgr-clock',title:'Who\u2019s clocked in',sub:'Today\u2019s clock-ins for the team (read only)'},{id:'mgr-swaps',title:'Shift swaps',sub:'Approve swaps and cover, or give a shift to someone else'}];function we(){const{r:e,rid:r,me:n,meId:w,today:v,now:S}=(0,J.useCtx)(3e4);(0,R.useReviewAlerts)(r),(0,le.useStaffTipsNotice)(r,v);const ne=(0,J.useSignedIn)(),de=ne?.ownerAccess&&'owner'!==ne.role?'owner privileges':ne?.managerAccess&&'staff'===ne.role?'manager privileges':'',ce=(0,J.useShiftManager)(),we=(0,ge.useSync)(e=>e.perms),Ce=ke.filter(e=>'mgr-swaps'===e.id?we.includes('rota.swap'):'mgr-times'!==e.id||(we.includes('bookings.settings')||we.includes('*')));(0,y.useSoldOutLink)(!0,n);(0,D.useOwner)(e=>e.staff);const Te=(0,D.useOwner)(e=>e.staffCanViewSuppliers),[Me,Re]=(0,C.useState)('home'),[Be,Pe]=(0,C.useState)(null),[Ae,Ie]=(0,C.useState)(!1),Oe=(0,C.useRef)(null);(0,C.useEffect)(()=>{(0,J.ensureAttendance)(v,S),(0,_.ensureChat)(S)},[v]),globalThis.__ccNow=S.getTime();const Le=(0,_.useChatUnread)().total,We=(0,C.useRef)({t:'home',s:null});We.current={t:Me,s:Be};const ze=(0,C.useRef)([]),He=(0,C.useCallback)((e,s=null)=>{const t=We.current;t.t===e&&t.s===s||(ze.current=[...ze.current,{...t,y:Ne.leave()}].slice(-30),Ne.restore(0)),Re(e),Pe(s)},[]),Ee=(0,C.useCallback)(()=>{if((0,u.runBackLayer)())return!0;const e=We.current;let s=ze.current.pop();for(;s&&s.t===e.t&&s.s===e.s;)s=ze.current.pop();if(!s&&'home'===e.t&&!e.s)return!1;const t=s??{t:'home',s:null};return Ne.leave(),Re(t.t),Pe(t.s),Ne.restore(t.y??0),!0},[]);(0,u.useWebBack)(Ee);const De=(0,u.useInnerBackShown)();(0,C.useEffect)(()=>{j.PITCH&&(globalThis.__pitchGo=He)},[He]),(0,F.useShiftReminders)({rid:r,staffId:w,name:n,onStartBreak:()=>He('clock')}),(0,U.useScheduledNotices)({rid:r,staffId:ne?.id??'',name:n,onOpen:()=>He('me','orderlists')}),(0,$.useOffRotaPrompt)({rid:r,staffId:ne?.id??''});const Ne=(0,c.useScrollMemory)(Oe),Ve=(0,C.useCallback)((e,s=null)=>'chat'===e?He('chat'):'clock'===s?He('clock'):'rota'===s?He('rota'):s&&je.some(e=>e.id===s)?He('me',s):'blocks'===s&&ce?He('me','mgr-blocks'):void He('home'===e?'home':'me'),[He,ce]);(0,C.useEffect)(()=>{const e=P.default.addEventListener('hardwareBackPress',Ee);return()=>e.remove()},[Ee]);const Fe='me'===Me&&Be?je.find(e=>e.id===Be)??(ce?Ce.find(e=>e.id===Be):void 0):void 0,Ue=(0,Q.useOrderLists)(e=>e.settings[r]?.allowStaff??!0),$e=je.filter(e=>('suppliers'!==e.id||Te)&&('orderlists'!==e.id||Ue||ne&&'staff'!==ne.role));(0,C.useEffect)(()=>{D.useOwner.getState().staffAs&&D.useOwner.setState({staffAs:void 0})},[]);(0,L.default)().width;return(0,me.jsxs)(W.SafeAreaView,{style:{flex:1,backgroundColor:N.colours.bg},edges:['top','left','right','bottom'],children:[(0,me.jsxs)(O.default,{style:{position:'relative',paddingHorizontal:14,paddingTop:6,paddingBottom:8,borderBottomWidth:1,borderColor:N.colours.border,gap:6},children:[(0,me.jsx)(O.default,{style:{position:'absolute',top:4,right:6,zIndex:5,flexDirection:'row',alignItems:'center'},children:(0,me.jsx)(E.VoiceSlot,{size:44})}),(0,me.jsx)(O.default,{testID:"header-me-wrap",style:{alignItems:'flex-start',minHeight:44,justifyContent:'center',maxWidth:'70%'},children:(0,me.jsx)(A.default,{testID:"header-me",accessibilityRole:"button",accessibilityLabel:`${(0,i.privateClockVenue)(r)?`Signed in as ${n}`:'Signed in as'}${de?`, ${de}`:''}`,onPress:()=>Ie(!0),hitSlop:6,style:{borderWidth:1,borderColor:N.colours.gold,borderRadius:22,paddingHorizontal:10,paddingVertical:4,maxWidth:'100%',minHeight:44,justifyContent:'center'},children:(0,me.jsxs)(z.Row,{gap:6,style:{justifyContent:'flex-start'},children:[(0,me.jsx)(fe.StaffAvatar,{id:w,size:24,ring:!1}),(0,me.jsxs)(O.default,{style:{flexShrink:1},children:[(0,me.jsxs)(z.T,{size:13,weight:"semibold",colour:N.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[n.replace(' (example)',''),ne?'':' (preview)'," \u25be"]}),de?(0,me.jsx)(z.Muted,{center:!1,size:10,numberOfLines:1,children:de}):null]})]})})}),(0,me.jsx)(H.VenueHeaderBlock,{rid:e.id,name:e.name,badge:"STAFF",place:"Front of House"+(e.location?` \xb7 ${e.location.split(',').slice(0,2).join(',')}`:'')})]}),(0,me.jsxs)(I.default,{ref:Oe,...Ne.props,contentContainerStyle:{padding:14,paddingBottom:16,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,me.jsx)(u.BackTitleRow,{back:!('home'===Me&&!Be||De),onBack:Ee,title:Fe?Fe.title:xe[Me]}),'home'===Me&&ce?(0,me.jsx)(Z.ManagerFeaturesNote,{}):null,'home'===Me&&ne&&'staff'!==ne.role&&!ce&&'undefined'!=typeof window?(0,me.jsxs)(O.default,{testID:"manager-access-banner",style:{borderWidth:1,borderColor:N.colours.gold,borderRadius:12,padding:10,gap:6},children:[(0,me.jsx)(z.T,{weight:"semibold",colour:N.colours.gold,children:"You have manager access"}),(0,me.jsx)(z.Muted,{children:"The Manager app has everything here plus bookings, the rota, staff and settings."}),(0,me.jsx)(A.default,{accessibilityRole:"button",onPress:()=>{const e=(0,se.appUrl)('owner');e&&window.location.assign(e)},style:{alignSelf:'flex-start',borderWidth:1,borderColor:N.colours.gold,borderRadius:14,paddingHorizontal:12,paddingVertical:5,minHeight:44,justifyContent:'center'},children:(0,me.jsx)(z.T,{size:14,colour:N.colours.gold,children:"Open the Managers app \u203a"})})]}):null,'home'===Me&&ne?(0,me.jsx)(k.MyTasksToday,{rid:r,staffId:ne.id,name:ne.name,onShift:(0,F.shiftNow)(ne.id,S.getTime()).on}):null,'home'===Me?(0,me.jsx)(ve,{go:Ve}):null,'clock'===Me?(0,me.jsx)(re.ClockInOut,{}):null,'rota'===Me?(0,me.jsx)(re.Rota,{}):null,'chat'===Me?(0,me.jsx)(_.Chat,{go:Ve}):null,'me'!==Me||Fe?null:(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(O.default,{style:{borderRadius:14,borderWidth:1,borderColor:N.colours.border,backgroundColor:N.colours.surface,overflow:'hidden'},children:$e.map((e,s)=>(0,me.jsx)(A.default,{testID:`audit-page-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>He('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:N.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,me.jsxs)(z.Row,{style:{justifyContent:'space-between'},children:[(0,me.jsxs)(O.default,{style:{flex:1},children:[(0,me.jsx)(z.T,{weight:"medium",children:e.title}),(0,me.jsx)(z.Muted,{children:e.sub})]}),(0,me.jsx)(z.T,{colour:N.colours.muted,children:"\u203a"})]})},e.id))}),ce?(0,me.jsxs)(O.default,{testID:"manager-features",style:{gap:6},children:[(0,me.jsx)(z.T,{weight:"semibold",colour:N.colours.gold,children:"Manager features"}),(0,me.jsx)(O.default,{style:{borderRadius:14,borderWidth:1,borderColor:N.colours.gold,backgroundColor:N.colours.surface,overflow:'hidden'},children:Ce.map((e,s)=>(0,me.jsx)(A.default,{testID:`audit-page-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>He('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:N.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,me.jsxs)(z.Row,{style:{justifyContent:'space-between'},children:[(0,me.jsxs)(O.default,{style:{flex:1},children:[(0,me.jsx)(z.T,{weight:"medium",children:e.title}),(0,me.jsx)(z.Muted,{children:e.sub})]}),(0,me.jsx)(z.T,{colour:N.colours.muted,children:"\u203a"})]})},e.id))}),(0,me.jsx)(Z.ManagerFeaturesAbout,{})]}):null,Te?null:(0,me.jsx)(z.Muted,{children:"Suppliers are hidden: your manager hasn\u2019t shared them with staff."}),(0,me.jsxs)(z.Muted,{center:!0,children:["Staff app \xb7 ",x.APP_VERSION," \xb7 ",'live'===ge.useSync.getState().mode?'shared with your team':'saved on this device until it connects']})]}),ce&&Fe?.id.startsWith('mgr-')?(0,me.jsxs)(J.ShiftMgrScope.Provider,{value:!0,children:['mgr-plan'===Fe.id?(0,me.jsx)(s.TablePlan,{}):null,'mgr-times'===Fe.id?(0,me.jsx)(t.StaffBookingTimes,{}):null,'mgr-bookings'===Fe.id?(0,me.jsx)(V.Bookings,{}):null,'mgr-clear'===Fe.id?(0,me.jsx)(Z.TablesToClear,{rid:r}):null,'mgr-blocks'===Fe.id?(0,me.jsx)(K.BlocksPage,{}):null,'mgr-allergy'===Fe.id?(0,me.jsx)(q.AllergenSignOffLog,{}):null,'mgr-stock'===Fe.id?(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(X.TrackedStockPage,{}),(0,me.jsx)(b.SoldOutList,{rid:r,by:n.replace(' (example)','')})]}):null,'mgr-clock'===Fe.id?(0,me.jsx)(Z.ClockOverview,{today:v,now:S}):null,'mgr-swaps'===Fe.id?(0,me.jsx)(Z.SwapApprovals,{today:v,me:n}):null]}):null,'loyalty'===Fe?.id?(0,me.jsx)(h.StaffLoyalty,{venue:e.name}):null,'guests'===Fe?.id?(0,me.jsx)(f.GuestProfiles,{me:n.replace(' (example)',''),manager:!1}):null,'bookings'===Fe?.id?(0,me.jsx)(V.Bookings,{}):null,'giftcards'===Fe?.id?(0,me.jsx)(p.GiftCardsPage,{me:n.replace(' (example)','')}):null,'tableorders'===Fe?.id?(0,me.jsx)(l.StaffTableOrders,{rid:r,me:n.replace(' (example)','')}):null,'soldout'===Fe?.id?(0,me.jsx)(b.SoldOutList,{rid:r,by:n.replace(' (example)','')}):null,'board'===Fe?.id?(0,me.jsx)(B.QuestionBoard,{rid:r,today:v,manager:!1,by:""}):null,'recipecards'===Fe?.id?(0,me.jsx)(T.RecipeCards,{rid:e.id,actor:{name:n,role:'staff'},mode:"read"}):null,'avatar'===Fe?.id?(0,me.jsx)(pe.AvatarMaker,{meId:w,me:n}):null,'cashup'===Fe?.id?(0,me.jsx)(Se,{rid:r,today:v,meId:w,me:n}):null,'haccp'===Fe?.id?(0,me.jsx)(he.HaccpLog,{mode:"staff",me:n,meId:w,now:S}):null,'accidents'===Fe?.id?(0,me.jsx)(ue.AccidentBook,{app:"staff",me:n,meId:w,now:S,seeAll:!1}):null,'mypay'===Fe?.id?(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(oe.MyPeriods,{staffId:w}),(0,me.jsx)(ae.MyHoursPay,{staffId:w})]}):null,'mytips'===Fe?.id?(0,me.jsx)(le.MyTips,{}):null,'reviews'===Fe?.id?(0,me.jsx)(M.ReviewsSection,{rid:r,mode:"read",venueName:e.name}):null,'timesheets'===Fe?.id?(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(oe.MyPeriods,{staffId:w}),(0,me.jsx)(re.Timesheets,{})]}):null,'orderlists'===Fe?.id?(0,me.jsx)(G.OrderListsScreen,{rid:r,today:v,editor:!!ne&&'staff'!==ne.role&&!ce,who:{id:w,name:n.replace(' (example)','')}}):null,'phone'===Fe?.id?(0,me.jsxs)(O.default,{style:{gap:8},children:[(0,me.jsx)(z.Muted,{children:"Get reminders like \u201cMills milk order\u201d on this phone, even with the app closed (once your manager switches phone notifications on). iPhone: add the app to your Home Screen first (iOS 16.4 or later)."}),(0,me.jsx)(Y.PushButton,{})]}):null,'suppliers'===Fe?.id?Te?(0,me.jsx)(ie.Suppliers,{}):(0,me.jsx)(z.Muted,{children:"Your manager hasn\u2019t shared suppliers with staff."}):null,'privacy'===Fe?.id?(0,me.jsxs)(O.default,{style:{gap:8},children:[(0,i.privateClockVenue)(r)?(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(z.T,{size:14,children:"Location is checked only when you choose Clock in at the pub. Only a pass or fail is saved with the clock-in time, or an audited manager override."}),(0,me.jsx)(z.T,{size:14,children:"Your position, accuracy and distance are never saved. There are no location trails, background/arrival checks, clock-out checks or break checks."})]}):(0,me.jsxs)(me.Fragment,{children:[" ",(0,me.jsx)(z.T,{size:14,children:"\u2022 Location is checked when you tap Clock in, Clock out, Start break or End break, and (if you allowed location) while the app is open to ask if you want to clock in when you\u2019re at the venue but not on the rota. Never in the background."}),(0,me.jsx)(z.T,{size:14,children:"\u2022 Each clock record keeps the location reading, how accurate it was, whether it was inside the venue area, and the time. Managers can see these."})]}),(0,me.jsx)(z.T,{size:14,children:"\u2022 You see only your own hours, pay estimates and tips. Managers see the team\u2019s."}),(0,me.jsxs)(z.T,{size:14,children:["\u2022 Chat messages stay within ",e.name,"\u2019s team."]}),(0,me.jsx)(z.T,{size:14,children:"\u2022 Pay figures are estimates before tax and deductions; your payslip is the official record."})]}):null]}),(0,me.jsx)(te.BottomTabs,{background:(0,o.soutersSurface)('#0d0d0d'),active:Me,onPress:e=>He(e),tabs:ye.map(e=>({id:e.id,label:e.label,icon:e.icon,badge:'chat'===e.id&&Le?{text:String(Le),bg:N.colours.red}:null}))}),(0,me.jsx)(z.Sheet,{visible:Ae,onClose:()=>Ie(!1),title:"Signed in as",children:ne?(0,me.jsxs)(O.default,{style:{gap:8},children:[(0,me.jsxs)(z.Row,{gap:10,children:[(0,me.jsx)(fe.StaffAvatar,{id:ne.id,size:48}),(0,me.jsxs)(O.default,{style:{flex:1},children:[(0,me.jsx)(z.T,{weight:"semibold",children:ne.name}),(0,me.jsx)(z.Muted,{children:(0,se.levelJob)(ne.level??'Staff',ne.job)})]})]}),(0,me.jsx)(z.Muted,{children:"Signed in with your personal link. This phone remembers you."}),ce?(0,me.jsx)(z.Muted,{children:"Manager features are on for you in this app."}):null,'staff'===ne.role||ce?null:(0,me.jsx)(z.Button,{kind:"secondary",label:"Back to CoverCharge for Managers",onPress:()=>{const e=(0,se.appUrl)('owner');e&&window.location.assign(e)}}),ne.id===be?(0,me.jsx)(z.Button,{kind:"secondary",label:"Back to CoverCharge for Head Chef",onPress:()=>{const e=(0,se.appUrl)('chef');e&&window.location.assign(e)}}):null]}):(0,me.jsxs)(O.default,{style:{gap:8},children:[(0,me.jsx)(z.Muted,{children:"Not signed in: this is a preview. Open your personal link, or paste it here, to sign in as yourself."}),(0,me.jsx)(ee.SignInWithLink,{})]})})]})}function ve({go:e}){const{rid:s,today:t}=(0,J.useCtx)(3e4),o=(0,de.useTravelDay)('staff',t);return(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(n.WhoBar,{}),(0,me.jsx)(de.DayBar,{app:"staff",today:t}),o?null:(0,me.jsx)(r.CoversToday,{rid:s}),o?(0,me.jsx)(de.DayView,{rid:s,day:o,today:t,app:"staff"}):(0,me.jsx)(ne.StaffHome,{go:e})]})}function Se({rid:e,today:s,meId:t,me:o}){return!0!==(0,S.useCashAccess)(e=>e.mine)?(0,me.jsx)(v.NoCashUpAccess,{}):(0,me.jsx)(w.CashUpScreen,{rid:e,today:s,canEdit:!0,who:{id:t??'me',name:o.replace(' (example)','')}})}},1480,[1380,1481,798,991,1073,1430,1161,1040,1041,1431,1454,1433,1130,977,1042,2,1047,1048,1407,993,34,1132,1186,1190,1156,373,402,295,102,426,36,794,847,1116,865,840,1135,1341,1070,1085,1086,1082,1043,1025,1100,1425,1420,1439,1482,1349,997,236,1192,1145,1151,1378,1155,1154,1392,1148,15,1162,1163,899,793,985,25]); __d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:n}=(0,l.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[b,h]=(0,t.useState)(String(e.settings.turnMins??'')),[y,v]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[f,k]=(0,t.useState)(!1),M=(e,t,n)=>c(s=>({...s,[e]:0===t?[n,s[e]?.[1]??'']:[s[e]?.[0]??'',n]})),S=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(b)<=360&&Number(y)>=1&&Number(y)<=1e3;return(0,r.jsxs)(s.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(n=>({...n,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>M(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>M(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:b,onChangeText:h,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:y,onChangeText:v,keyboardType:"number-pad"})]}),(0,r.jsx)(i.Button,{label:f?'Saving\u2026':'Save booking times',disabled:!S||f,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{k(!0);try{await(0,o.saveStaffBookingTimes)(n,u,Number(b),Number(y)),j('Booking times saved.')}catch(e){j(e.message)}finally{k(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),n=_r(_d[1]),s=(e=n)&&e.__esModule?e:{default:e},i=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1481,[34,102,794,1100,985,25]); @@ -1594,7 +1594,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,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},1511,[34,1486]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},1512,[1513]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preventAutoHideAsync=async function(){return!1},e.setOptions=function(n){},e.hide=function(){},e.hideAsync=async function(){}},1513,[]); -__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.CarGate=function(){const e=(0,c.useSession)(e=>e.meId),[s,o]=(0,t.useState)(c.useSession.persist.hasHydrated());return(0,t.useEffect)(()=>{const e=c.useSession.persist.onFinishHydration(()=>o(!0));return c.useSession.persist.hasHydrated()&&o(!0),e},[]),s?e||h.PITCH?null:(0,j.jsx)(I,{}):(0,j.jsx)(n.default,{style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=e(_r(d[1])),n=e(_r(d[2])),s=e(_r(d[3])),o=_r(d[4]),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),f=_r(d[10]),p=_r(d[11]),y=_r(d[12]),j=_r(d[13]);let b=null,w=null;async function M(e){return!e&&w&&Date.now()-w.at<6e4&&new Date(w.r.expiresAt).getTime()-Date.now()>12e4?w.r:b||(b=(0,u.carPairStart)().then(e=>(e.ok&&(w={r:e,at:Date.now()}),e)).finally(()=>{b=null}),b)}function I(){const{width:e,height:c}=(0,s.default)(),[h,b]=(0,t.useState)(null),[w,I]=(0,t.useState)('starting'),[T,D]=(0,t.useState)(''),[k,C]=(0,t.useState)(0),z=(0,t.useRef)(!1),S=(0,t.useCallback)(async(e=!0)=>{if(z.current)return;z.current=!0,I('starting'),D('');const t=await M(e);if(z.current=!1,!t.ok)return I('error'),void D(t.error);b({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),I('waiting')},[]);(0,t.useEffect)(()=>{S(!1)},[]),(0,t.useEffect)(()=>{if(!h||'waiting'!==w)return;const e=setInterval(async()=>{C(Math.max(0,Math.round((h.until-Date.now())/1e3)));('expired'===await(0,u.carPairPoll)(h.id)||Date.now()>h.until)&&I('expired')},3e3);return()=>clearInterval(e)},[h,w]);const P=Math.min(120,Math.max(64,Math.round(Math.min(e/9,c/7)))),H=h?.code??'',v=H?`${H.slice(0,3)} ${H.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,j.jsx)(n.default,{testID:"car-pairing",style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:(0,j.jsxs)(n.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:c<820?10:16},children:[(0,j.jsx)(l.RestaurantLogo,{rid:x.VENUE_RID,size:c<820?64:88}),(0,j.jsx)(o.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,j.jsx)(y.ParkedOnly,{}),'waiting'===w||'starting'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,j.jsx)(n.default,{testID:"car-code",accessible:!0,accessibilityLabel:H?`Car code ${(0,p.spokenCode)(H)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,j.jsx)(o.T,{center:!0,size:P,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:P/8,lineHeight:1.2*P},children:v})}),H?(0,j.jsx)(o.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,j.jsxs)(n.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,j.jsx)(o.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,j.jsx)(n.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,j.jsx)(o.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{S()},style:{minHeight:64,minWidth:200}})})]}):'expired'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{S()},style:{minHeight:64,minWidth:280}})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,j.jsx)(o.Muted,{center:!0,children:T}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{S()},style:{minHeight:64,minWidth:240}})]}),T&&'error'!==w?(0,j.jsx)(o.T,{center:!0,colour:f.colours.amber,children:T}):null,(0,j.jsx)(o.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})})}},1514,[34,41,102,426,794,847,997,985,2,5,840,1474,1476,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.CarGate=function(){const e=(0,u.useSession)(e=>e.meId),[t,o]=(0,r.useState)(u.useSession.persist.hasHydrated());return(0,r.useEffect)(()=>{const e=u.useSession.persist.onFinishHydration(()=>o(!0));return u.useSession.persist.hasHydrated()&&o(!0),e},[]),t?e||x.PITCH?null:(0,b.jsx)(T,{}):(0,b.jsx)(s.default,{style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=_r(d[1]),n=e(_r(d[2])),s=e(_r(d[3])),o=e(_r(d[4])),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),f=_r(d[11]),y=_r(d[12]),j=_r(d[13]),b=_r(d[14]);let w=null,M=null;async function I(e){return!e&&M&&Date.now()-M.at<6e4&&new Date(M.r.expiresAt).getTime()-Date.now()>12e4?M.r:w||(w=(0,h.carPairStart)().then(e=>(e.ok&&(M={r:e,at:Date.now()}),e)).finally(()=>{w=null}),w)}function T(){const{width:e,height:u}=(0,o.default)(),[x,w]=(0,r.useState)(null),[M,T]=(0,r.useState)('starting'),[C,D]=(0,r.useState)(''),[k,z]=(0,r.useState)(0),S=(0,r.useRef)(!1),P=(0,r.useCallback)(async(e=!0)=>{if(S.current)return;S.current=!0,T('starting'),D('');const t=await I(e);if(S.current=!1,!t.ok)return T('error'),void D(t.error);w({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),T('waiting')},[]);(0,r.useEffect)(()=>{P(!1)},[]),(0,r.useEffect)(()=>{if(!x||'waiting'!==M)return;const e=setInterval(async()=>{z(Math.max(0,Math.round((x.until-Date.now())/1e3)));('expired'===await(0,h.carPairPoll)(x.id)||Date.now()>x.until)&&T('expired')},3e3);return()=>clearInterval(e)},[x,M]);const H=Math.min(120,Math.max(64,Math.round(Math.min(e/9,u/7)))),v=x?.code??'',F=v?`${v.slice(0,3)} ${v.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,b.jsxs)(s.default,{testID:"car-pairing",style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:[(0,b.jsx)(t.CarFullscreenButton,{place:"corner"}),(0,b.jsxs)(s.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:u<820?10:16},children:[(0,b.jsx)(c.RestaurantLogo,{rid:p.VENUE_RID,size:u<820?64:88}),(0,b.jsx)(l.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,b.jsx)(j.ParkedOnly,{}),'waiting'===M||'starting'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,b.jsx)(s.default,{testID:"car-code",accessible:!0,accessibilityLabel:v?`Car code ${(0,y.spokenCode)(v)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,b.jsx)(l.T,{center:!0,size:H,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:H/8,lineHeight:1.2*H},children:F})}),v?(0,b.jsx)(l.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,b.jsxs)(s.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,b.jsx)(l.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,b.jsx)(s.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,b.jsx)(l.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{P()},style:{minHeight:64,minWidth:200}})})]}):'expired'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{P()},style:{minHeight:64,minWidth:280}})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,b.jsx)(l.Muted,{center:!0,children:C}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{P()},style:{minHeight:64,minWidth:240}})]}),C&&'error'!==M?(0,b.jsx)(l.T,{center:!0,colour:f.colours.amber,children:C}):null,(0,b.jsx)(l.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})]})}},1514,[1478,34,41,102,426,794,847,997,985,2,5,840,1474,1476,25]); __d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1515,[986,857,856,985]); __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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1516,[798,796,34,1381,1015,402,102,846,985,1007,1014,5,840,794,1287,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1517,[796,34,236,402,102,840,985,1045,2,25]); diff --git a/car-app/index.html b/car-app/index.html index f43f056d0ddcb07685ff27a1c1cb3a394f2bc48a..ea1cc8603ef6d828e87e691173d9665b5fb798c1 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 7021e29774652abda437f72b0dd3023c57d5e6b4..e6ca7e050fe788b4523fcf7693b1b6fb05085560 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 d2b1e83aebce5d5b570236c89d28c88b422f840e..f04de0e05915704169f39a5c1966543d5e2e0a79 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-8c36ed9bfe"; +const V = "cc-car-f4bc9e5341"; 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=8c36ed9bfe0f70144a76ebd0d27e3e972d161cd097cb10fd8396d944033c9270"]; +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=f4bc9e5341603a8c69f142d7db890c0b572b35348b62c04f10c156620b179220"]; // 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/car.html b/car.html index 721625b51024f47995c5ac52f6874ad572dea0b0..363f10232d4acc38d26becf99c9b77fc87bd4b10 100644 --- a/car.html +++ b/car.html @@ -7,10 +7,9 @@ The Anchorage · car screen

Opening The Anchorage car screen…

Tap here if it doesn’t open

diff --git a/chef-app/_expo/static/js/web/bundle.js b/chef-app/_expo/static/js/web/bundle.js index af4004466f22dae2c54d83da1b5de2c14ac4ba93..d30d7999a7f00031822b33457cd4aa46ea302bf4 100644 --- a/chef-app/_expo/static/js/web/bundle.js +++ b/chef-app/_expo/static/js/web/bundle.js @@ -23,11 +23,11 @@ __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,"PITCH_VENUE",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"PITCH_TEAM",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PITCH_TEXT",{enumerable:!0,get:function(){return o}}),e.pitchText=function(a){let n=a;for(const[a,t]of o)a.test(n)?(a.lastIndex=0,n=n.replace(a,t)):a.lastIndex=0;return n};const a={name:'The Harbour Kitchen',tagline:'Harbourside seafood & seasonal plates',location:'12 Quay Street, Portmorran',phone:'01632 960 123',website:'harbourkitchen.example'},n={'st-tracy':{name:'Morgan',job:'Owner',hourlyPence:null,salaried:!0},'st-gordon':{name:'Alex',job:'General Manager',dept:'Management',hourlyPence:null,salaried:!0},'st-bisto':{name:'Ravi',job:'Head Chef',hourlyPence:null,salaried:!0},'st-agate':{name:'Priya',job:'Front of house supervisor',hourlyPence:1450},'st-lenny':{name:'Tom',job:'Commis Chef',hourlyPence:1325},'st-finn':{name:'Lewis',job:'Bar staff',hourlyPence:1290},'st-eilidh':{name:'Chloe',job:'Front of house',hourlyPence:1271},'st-emily':{name:'Ellie',job:'Front of house',hourlyPence:1271},'st-lillie':{name:'Jordan',job:'Kitchen porter (KP)',hourlyPence:1271},'st-jack':{name:'Sam',job:'Kitchen porter (KP)',hourlyPence:1271}},o=[['Harbour View, Dunure, South Ayrshire',a.location],['Harbour View, Dunure',a.location],['Harbour View mug','Harbour Kitchen mug'],['Harbour View','Quay Street'],['anchoragedunure.com',a.website],['01292 502826',a.phone],['Mini Anchors','Little Crew'],['The Anchorage',a.name],['Anchorage','Harbour Kitchen'],['ANCHORAGE','HARBOUR KITCHEN'],['South Ayrshire','the Firth coast'],['Ayrshire','the Firth coast'],['Dunure','Portmorran'],['Kittyfisher boat (Big Sean)','Coastal Fish Co'],['Kittyfisher','Coastal Fish Co'],['Big Sean','Coastal Fish Co'],['Example Fish Co.','Coastal Fish Co'],['Sample Dairy Ltd','Hillside Dairy'],['Sample Fruit & Veg','Fieldfare Veg'],['Mills milk','Hillside Dairy milk'],['Mills','Hillside Dairy'],['J. Pieroni & Sons','Fieldfare Veg'],["Pieroni's",'Fieldfare Veg'],['Pieroni','Fieldfare Veg'],['Alsons (drinks)','Drinks wholesaler'],['Alsons','the drinks wholesaler'],['Spes Bona','the deli wholesaler'],['Tarelgin','the butcher'],['Reids','the bakery'],['Reeds','the bakery'],['Example Butchers Ltd','Quayside Butchers'],['Example Dry Goods Wholesale','Dry goods wholesaler'],['Sample Brewing Co.','Harbourside Brewing'],['Example Cleaning Supplies','Cleaning supplies'],['Sample Packaging Ltd','Packaging supplier'],['Example Kitchen Repairs','Kitchen repairs'],['Preston','Ravi'],['Bisto','Ravi'],['Tracy','Morgan'],['James','Morgan'],['Gordon','Alex'],['Agate','Priya'],['Lenny','Tom'],['Finn','Lewis'],['Eilidh','Chloe'],['Emily','Ellie'],['Gabrielle','Ellie'],['Cameron Mc','Sam'],['Cameron','Sam'],['Lillie','Jordan'],['Lily','Jordan'],['Mia','Jordan'],['Jack','Sam'],['Harvey','Jordan'],['Anna','the supplier'],['(preview)',''],[' (example)','']].map(([a,n])=>[new RegExp(`${/^[A-Za-z]/.test(a)?'(?g[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`](_),globalThis.__webpack_require__=o=>{const t=ErrorUtils.reportFatalError;_&&(ErrorUtils.reportFatalError=_=>{throw _});try{return g[`${__METRO_GLOBAL_PREFIX__}__r`](o)}finally{_&&(ErrorUtils.reportFatalError=t)}}},23,[]); -__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}function t(){const n=r(d[1]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"App",{enumerable:!0,get:function(){return c}}),r(d[2]);const o=r(d[3]),u=r(d[4]);function c(){return(0,n().jsx)(u.Head.Provider,{children:(0,n().jsx)(o.ExpoRoot,{context:t().ctx})})}r(d[5])},24,[25,27,34,709,1447,1450]); +__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}function t(){const n=r(d[1]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"App",{enumerable:!0,get:function(){return c}}),r(d[2]);const o=r(d[3]),u=r(d[4]);function c(){return(0,n().jsx)(u.Head.Provider,{children:(0,n().jsx)(o.ExpoRoot,{context:t().ctx})})}r(d[5])},24,[25,27,34,709,1448,1451]); __d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},25,[26]); __d(function(g,r,i,a,m,e,d){ /** @@ -41,7 +41,7 @@ __d(function(g,r,i,a,m,e,d){ */ "use strict";var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(t,o,f){var l=null;if(void 0!==f&&(l=""+f),void 0!==o.key&&(l=""+o.key),"key"in o)for(var y in f={},o)"key"!==y&&(f[y]=o[y]);else f=o;return o=f.ref,{$$typeof:n,type:t,key:l,ref:void 0!==o?o:null,props:f}}e.Fragment=t,e.jsx=o,e.jsxs=o},26,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ctx",{enumerable:!0,get:function(){return t}});const t=r(d[0])},27,[28]); -__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./(chef)/kitchen/[section].tsx":{enumerable:!0,get:()=>r(d[1])(d[0],d.paths)},"./(chef)/kitchen/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[2],d.paths)},"./(customer)/customer/[rid]/book.tsx":{enumerable:!0,get:()=>r(d[1])(d[3],d.paths)},"./(customer)/customer/[rid]/dish/[did].tsx":{enumerable:!0,get:()=>r(d[1])(d[4],d.paths)},"./(customer)/customer/[rid]/feedback.tsx":{enumerable:!0,get:()=>r(d[1])(d[5],d.paths)},"./(customer)/customer/[rid]/gift.tsx":{enumerable:!0,get:()=>r(d[1])(d[6],d.paths)},"./(customer)/customer/[rid]/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[7],d.paths)},"./(customer)/customer/[rid]/lost.tsx":{enumerable:!0,get:()=>r(d[1])(d[8],d.paths)},"./(customer)/customer/[rid]/loyalty.tsx":{enumerable:!0,get:()=>r(d[1])(d[9],d.paths)},"./(customer)/customer/[rid]/merch.tsx":{enumerable:!0,get:()=>r(d[1])(d[10],d.paths)},"./(customer)/customer/[rid]/offers.tsx":{enumerable:!0,get:()=>r(d[1])(d[11],d.paths)},"./(customer)/customer/[rid]/refer.tsx":{enumerable:!0,get:()=>r(d[1])(d[12],d.paths)},"./(customer)/customer/[rid]/waitlist.tsx":{enumerable:!0,get:()=>r(d[1])(d[13],d.paths)},"./(customer)/customer/[rid]/whatson.tsx":{enumerable:!0,get:()=>r(d[1])(d[14],d.paths)},"./(customer)/customer/basket.tsx":{enumerable:!0,get:()=>r(d[1])(d[15],d.paths)},"./(customer)/customer/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[16],d.paths)},"./(customer)/customer/order/[oid].tsx":{enumerable:!0,get:()=>r(d[1])(d[17],d.paths)},"./(customer)/customer/profile.tsx":{enumerable:!0,get:()=>r(d[1])(d[18],d.paths)},"./(customer)/demo.tsx":{enumerable:!0,get:()=>r(d[1])(d[19],d.paths)},"./(customer)/table/[n].tsx":{enumerable:!0,get:()=>r(d[1])(d[20],d.paths)},"./(customer)/table/live/[token].tsx":{enumerable:!0,get:()=>r(d[1])(d[21],d.paths)},"./(display)/display/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[22],d.paths)},"./(display)/staff/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[23],d.paths)},"./(owner)/admin/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[24],d.paths)},"./(owner)/owner/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[25],d.paths)},"./(staff)/team/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[26],d.paths)},"./+not-found.tsx":{enumerable:!0,get:()=>r(d[1])(d[27],d.paths)},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])(d[28],d.paths)},"./index.tsx":{enumerable:!0,get:()=>r(d[1])(d[29],d.paths)}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},28,[29,1038,1193,1194,1196,1198,1200,1207,1261,1262,1263,1264,1265,1266,1268,1269,1270,1271,1272,1273,1274,1275,1278,1336,1337,1338,1340,1382,1383,1446]); +__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./(chef)/kitchen/[section].tsx":{enumerable:!0,get:()=>r(d[1])(d[0],d.paths)},"./(chef)/kitchen/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[2],d.paths)},"./(customer)/customer/[rid]/book.tsx":{enumerable:!0,get:()=>r(d[1])(d[3],d.paths)},"./(customer)/customer/[rid]/dish/[did].tsx":{enumerable:!0,get:()=>r(d[1])(d[4],d.paths)},"./(customer)/customer/[rid]/feedback.tsx":{enumerable:!0,get:()=>r(d[1])(d[5],d.paths)},"./(customer)/customer/[rid]/gift.tsx":{enumerable:!0,get:()=>r(d[1])(d[6],d.paths)},"./(customer)/customer/[rid]/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[7],d.paths)},"./(customer)/customer/[rid]/lost.tsx":{enumerable:!0,get:()=>r(d[1])(d[8],d.paths)},"./(customer)/customer/[rid]/loyalty.tsx":{enumerable:!0,get:()=>r(d[1])(d[9],d.paths)},"./(customer)/customer/[rid]/merch.tsx":{enumerable:!0,get:()=>r(d[1])(d[10],d.paths)},"./(customer)/customer/[rid]/offers.tsx":{enumerable:!0,get:()=>r(d[1])(d[11],d.paths)},"./(customer)/customer/[rid]/refer.tsx":{enumerable:!0,get:()=>r(d[1])(d[12],d.paths)},"./(customer)/customer/[rid]/waitlist.tsx":{enumerable:!0,get:()=>r(d[1])(d[13],d.paths)},"./(customer)/customer/[rid]/whatson.tsx":{enumerable:!0,get:()=>r(d[1])(d[14],d.paths)},"./(customer)/customer/basket.tsx":{enumerable:!0,get:()=>r(d[1])(d[15],d.paths)},"./(customer)/customer/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[16],d.paths)},"./(customer)/customer/order/[oid].tsx":{enumerable:!0,get:()=>r(d[1])(d[17],d.paths)},"./(customer)/customer/profile.tsx":{enumerable:!0,get:()=>r(d[1])(d[18],d.paths)},"./(customer)/demo.tsx":{enumerable:!0,get:()=>r(d[1])(d[19],d.paths)},"./(customer)/table/[n].tsx":{enumerable:!0,get:()=>r(d[1])(d[20],d.paths)},"./(customer)/table/live/[token].tsx":{enumerable:!0,get:()=>r(d[1])(d[21],d.paths)},"./(display)/display/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[22],d.paths)},"./(display)/staff/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[23],d.paths)},"./(owner)/admin/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[24],d.paths)},"./(owner)/owner/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[25],d.paths)},"./(staff)/team/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[26],d.paths)},"./+not-found.tsx":{enumerable:!0,get:()=>r(d[1])(d[27],d.paths)},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])(d[28],d.paths)},"./index.tsx":{enumerable:!0,get:()=>r(d[1])(d[29],d.paths)}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},28,[29,1038,1193,1194,1196,1198,1200,1207,1261,1262,1263,1264,1265,1266,1268,1269,1270,1271,1272,1273,1274,1275,1278,1336,1337,1338,1340,1382,1383,1447]); __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 s}});var t=r(d[0]);r(d[1]);var n=r(d[2]),c=r(d[3]),o=r(d[4]),f=r(d[5]);function s(){const{section:s}=(0,t.useLocalSearchParams)();return(0,c.canShow)('chef')?s&&(0,o.chefSectionAllowed)(String(s))?(0,f.jsx)(n.ChefApp,{section:String(s)},String(s)):(0,f.jsx)(t.Redirect,{href:"/kitchen"}):(0,f.jsx)(t.Redirect,{href:c.ENTRY[c.APP_VARIANT]})}},29,[30,34,792,846,988,25]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){return Object.keys(t).forEach(function(c){"default"===c||Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{enumerable:!0,get:function(){return t[c]}})}),t}Object.defineProperty(e,"__esModule",{value:!0}),r(d[0]),t(r(d[1]),e),t(r(d[2]),e),t(r(d[3]),e),t(r(d[4]),e)},30,[31,32,782,783,785]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},31,[]); @@ -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.122'},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.123'},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]); @@ -1195,7 +1195,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}),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: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";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)(!0);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]); @@ -1359,7 +1359,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}),_e.TableOrderLive=function({token:e}){const[s,m]=(0,l.useState)(null),[x,y]=(0,l.useState)(null),[j,f]=(0,l.useState)([]),[k,w]=(0,l.useState)(null),T=(0,h.useCustomer)(),[C,S]=(0,l.useState)(()=>(T?.allergies??[]).map(e=>e.allergen)),[v,O]=(0,l.useState)(''),[P,R]=(0,l.useState)(''),[I,M]=(0,l.useState)(''),[L,N]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),[B,D]=(0,l.useState)([]),q=(0,l.useCallback)(async()=>{try{m(await(0,c.tablePublic)(e)),y(null)}catch(e){y((0,d.tableOrderError)(e,'menu'))}},[e]),_=(0,l.useCallback)(async()=>{try{D(await(0,c.myTableOrders)(e))}catch{}},[e]);(0,l.useEffect)(()=>{q(),_();const e=setInterval(()=>{_(),q()},8e3);return()=>clearInterval(e)},[q,_]);const W=s?.menu??[];(0,l.useEffect)(()=>{f(e=>e.filter(e=>W.some(t=>t.id===e.id&&!t.soldOut)))},[s]);const E=(0,l.useMemo)(()=>{const e=new Map;for(const t of W)e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()]},[s]),Y=(0,d.cartTotal)(j,W),z='yes'===k?C.map(e=>({allergen:e,severity:T?.allergies?.find(t=>t.allergen===e)?.severity??'allergy'})):[],G=(0,d.allergyClashes)(j,W,z.map(e=>e.allergen)),V=e=>j.find(t=>t.id===e)?.qty??0,F=(e,t)=>f(n=>t<=0?n.filter(t=>t.id!==e):n.some(t=>t.id===e)?n.map(n=>n.id===e?{...n,qty:t}:n):[...n,{id:e,qty:t,note:''}]),H=(e,t)=>f(n=>n.map(n=>n.id===e?{...n,note:t}:n)),J=async()=>{N(!0),A(null);try{const t=await(0,c.sendTableOrder)(e,j,{note:I,name:v,phone:P,allergies:z});f([]),M(''),A({kind:'success',text:t.held?`Order ${t.ref} sent. A member of staff will check it, then it goes to the kitchen.`:`Order ${t.ref} sent to the kitchen.`}),_()}catch(e){A({kind:'warn',text:(0,d.tableOrderError)(e,'send')}),q()}finally{N(!1)}};if(x)return(0,p.jsxs)(o.Screen,{title:"Order at the table",children:[(0,p.jsx)(o.Banner,{kind:"warn",title:"Couldn't open the menu",children:x}),(0,p.jsx)(o.Button,{label:"Try again",onPress:()=>{q()}})]});if(!s)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Muted,{children:"Opening the menu\u2026"})});if(!s.ok)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Banner,{kind:"warn",title:"This code isn't working",children:s.reason??'Please ask a member of staff.'})});const K=s.open&&j.length>0&&null!==k&&('none'===k||C.length>0)&&(0,d.nameOk)(v)&&(0,d.phoneOk)(P)&&!L,Q=s.askServer??[],U=[...new Set(Q.map(e=>e.section))],X=L?'Sending\u2026':j.length?null===k?'Answer the allergy question':(0,d.nameOk)(v)?(0,d.phoneOk)(P)?`Send order to the kitchen (${(0,i.gbp)(Y)})`:'Check the phone number':'Add your name to send':'Add a dish to order';return(0,p.jsxs)(o.Screen,{title:`Table ${(0,n.tableNumbers)(s.table)}`,subtitle:s.venueName,footer:s.open?(0,p.jsx)(o.Button,{label:X,disabled:!K,onPress:()=>{J()},testID:"send-table-order-live"}):void 0,children:[(0,p.jsxs)(o.Muted,{center:!0,children:["Tip: add dishes, answer the allergy question, add your name, then send. Staff bring it to table ",(0,n.tableNumbers)(s.table),". ",d.PAY_WORDS]}),s.tip?(0,p.jsx)(o.Banner,{kind:"demo",children:s.tip}):null,s.open?null:(0,p.jsx)(o.Banner,{kind:"warn",title:"Not taking table orders right now",children:s.reason}),s.open&&s.staffAccept&&!B.some(e=>e.accepted)?(0,p.jsx)(o.Muted,{children:"The first order from your phone is checked by a member of staff before it goes to the kitchen."}):null,$?(0,p.jsx)(o.Banner,{kind:$.kind,children:$.text}):null,B.length?(0,p.jsx)(r.default,{testID:"my-table-orders",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Your orders at this table"}),B.map(e=>(0,p.jsxs)(r.default,{style:{gap:2,paddingVertical:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e.ref}),(0,p.jsx)(o.T,{size:13,colour:'cancelled'===e.status?u.colours.amber:u.colours.gold,children:(0,d.guestStatusWords)(e)})]}),(0,p.jsxs)(o.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,i.gbp)(e.totalPence)," to pay at the bar or with the server"]})]},e.id))]})}):null,s.open?E.map(([e,t])=>(0,p.jsxs)(r.default,{style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:e}),t.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,p.jsxs)(r.default,{style:{flex:1,gap:2},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),e.description?(0,p.jsx)(o.Muted,{children:e.description}):null,(0,p.jsxs)(o.T,{size:13,colour:u.colours.muted,children:[e.allergens.length?`Contains: ${e.allergens.map(a.allergenLabel).join(', ')}`:'No allergens listed: ask staff if unsure',e.mayContain.length?` \xb7 May contain: ${e.mayContain.map(a.allergenLabel).join(', ')}`:'']})]}),(0,p.jsx)(o.T,{weight:"semibold",colour:u.colours.gold,children:(0,i.gbp)(e.pricePence)})]}),e.soldOut?(0,p.jsx)(o.Badge,{kind:"amber",label:"Sold out today"}):V(e.id)?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:V(e.id),min:0,max:20,onChange:t=>F(e.id,t),label:e.name}),(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>F(e.id,0)})]}):(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"Add",accessibilityLabel:`Add ${e.name}`,onPress:()=>F(e.id,1)})]},e.id))]},e)):null,s.open&&!W.length?(0,p.jsx)(o.Banner,{kind:"demo",title:"No dishes to order from your phone yet",children:"The kitchen is still checking the allergens on the menu. Please order with your server or at the bar."}):null,s.open&&Q.length?(0,p.jsxs)(r.default,{testID:"table-ask-server",style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:W.length?'Also on the menu':'On the menu'}),(0,p.jsx)(o.Muted,{center:!0,children:"Ask your server for these. They can't be ordered from your phone yet, while the kitchen checks their allergens."}),U.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:e}),Q.filter(t=>t.section===e).map((e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{style:{flex:1},children:e.name}),(0,p.jsx)(o.T,{colour:u.colours.muted,children:(0,i.gbp)(e.pricePence)})]},`${e.name}-${t}`))]},e))]}):null,s.open&&j.length?(0,p.jsx)(r.default,{testID:"table-cart",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:"Review your order"}),j.map(e=>{const n=W.find(t=>t.id===e.id);return(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{children:[e.qty,"\xd7 ",n?.name]}),(0,p.jsx)(o.T,{children:(0,i.gbp)(e.qty*(n?.pricePence??0))})]}),(0,p.jsx)(t.TextInput,{style:b,value:e.note,onChangeText:t=>H(e.id,t),placeholder:"Note for the kitchen (optional), e.g. no onions",placeholderTextColor:u.colours.muted,maxLength:140,accessibilityLabel:`Note for ${n?.name}`,testID:`table-note-${e.id}`})]},e.id)}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Total"}),(0,p.jsx)(o.T,{weight:"semibold",children:(0,i.gbp)(Y)})]})]})}):null,s.open?(0,p.jsx)(r.default,{testID:"table-allergy",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Does anyone at the table have a food allergy?"}),(0,p.jsx)(o.Muted,{center:!0,children:"We ask everyone, so the kitchen can keep you safe."}),(0,p.jsxs)(o.Row,{gap:8,style:{justifyContent:'center'},children:[(0,p.jsx)(o.Chip,{label:"No allergies",selected:'none'===k,onPress:()=>w('none')}),(0,p.jsx)(o.Chip,{label:"Yes, allergies",selected:'yes'===k,onPress:()=>w('yes')})]}),'yes'===k?(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:a.ALLERGENS.map(e=>(0,p.jsx)(o.Chip,{label:e.short,selected:C.includes(e.id),onPress:()=>S(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},e.id))}):null,G.length?(0,p.jsxs)(o.Banner,{kind:"warn",title:"Check with staff",children:[G.map(e=>e.name).join(', ')," ",G.length>1?'contain':'contains'," or may contain an allergy you picked. The kitchen will see your allergies on the ticket."]}):null]})}):null,s.open?(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Who's the order for?"}),(0,p.jsx)(t.TextInput,{style:b,value:v,onChangeText:O,placeholder:"Your name (needed)",placeholderTextColor:u.colours.muted,maxLength:40,accessibilityLabel:"Your name, needed",testID:"table-name",autoComplete:"name"}),(0,p.jsx)(t.TextInput,{style:b,value:P,onChangeText:R,placeholder:"Phone number (optional)",placeholderTextColor:u.colours.muted,maxLength:20,keyboardType:"phone-pad",accessibilityLabel:"Phone number, optional",testID:"table-phone",autoComplete:"tel"}),P&&!(0,d.phoneOk)(P)?(0,p.jsx)(o.Muted,{center:!0,children:"Please check the phone number, or leave it blank."}):null,(0,p.jsx)(o.Muted,{center:!0,children:"We only use these for this order."}),(0,p.jsx)(t.TextInput,{style:b,value:I,onChangeText:M,placeholder:"Note for the staff (optional)",placeholderTextColor:u.colours.muted,maxLength:300,accessibilityLabel:"Note for the staff (optional)"})]}):null,(0,p.jsx)(r.default,{testID:"pay-placeholder",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Paying"}),(0,p.jsx)(o.T,{center:!0,children:d.PAY_WORDS}),(0,p.jsx)(o.Muted,{center:!0,children:"No card details are asked for or kept in this app."})]})})]})};var e,t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),r=(e=s)&&e.__esModule?e:{default:e},o=_r(_d[4]),a=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]);const b={borderWidth:1,borderColor:u.colours.border,borderRadius:10,padding:10,color:u.colours.text,backgroundColor:u.colours.surface2}},1276,[796,829,34,102,794,830,836,1131,1277,848,840,25]); __d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tablePublic",{enumerable:!0,get:function(){return s}}),e.sendTableOrder=async function(t,r,a){if(!await(0,n.guestSession)())throw new Error('No connection. Try again when you are back online.');const o=await(0,n.rpc)('guest_table_order_v2',{p_phone:(a.phone??'').trim().slice(0,20)||null,p_token:t,p_lines:r.map(t=>({id:t.id,qty:t.qty,note:t.note.trim().slice(0,140)})),p_note:a.note.trim().slice(0,300)||null,p_allergies:a.allergies.map(t=>({allergen:t.allergen,severity:t.severity})),p_name:a.name.trim().slice(0,40)||null});if(!o||!1===o.ok||!o.id)throw new Error(o?.reason||'This table code isn\u2019t working any more. Please ask a member of staff.');return{id:o.id,ref:o.ref,held:!!o.held,totalPence:o.totalPence}},e.myTableOrders=async function(t){return await(0,n.guestSession)()?await(0,n.rpc)('guest_table_my_orders',{p_token:t})??[]:[]},e.loadTableSettings=async function(){const{data:t,error:n}=await a().from('table_order_settings').select('*').eq('venue_id',o()).maybeSingle();if(n)throw n;return(0,r.fromRow)(t)},e.saveTableSettings=async function(t,n){const{error:s}=await a().from('table_order_settings').upsert({venue_id:o(),...(0,r.toRow)(t),updated_at:(new Date).toISOString(),updated_by:n.slice(0,80)});if(s)throw s},e.listTableCodes=async function(){const{data:t,error:n}=await a().from('table_qr_codes').select('table_no, token, created_at').eq('venue_id',o()).eq('is_on',!0);if(n)throw n;return(t??[]).map(t=>({table:String(t.table_no),token:String(t.token),createdAt:String(t.created_at)})).sort((t,n)=>Number(t.table)-Number(n.table))},Object.defineProperty(e,"tableReadiness",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"makeTableCodes",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"renewTableCode",{enumerable:!0,get:function(){return u}}),e.watchTableSettings=function(t){const r=n.useSync.getState().venueId;if(!r)return()=>{};const o=a().channel(`tos-${r}-${Math.random().toString(36).slice(2,8)}`).on('postgres_changes',{event:'*',schema:'public',table:'table_order_settings',filter:`venue_id=eq.${r}`},()=>t()).subscribe();return()=>{a().removeChannel(o)}};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const a=()=>(0,t.getSupabase)(),o=()=>{const t=n.useSync.getState().venueId;if(!t)throw new Error('Not connected to the venue yet.');return t},s=t=>(0,n.rpc)('table_public',{p_token:t});const l=()=>(0,n.rpc)('table_order_readiness',{p_venue:o()}),c=t=>(0,n.rpc)('table_qr_make',{p_venue:o(),p_tables:t}),u=t=>(0,n.rpc)('table_qr_renew',{p_venue:o(),p_table:t})},1277,[931,985,1131]); __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 l}});var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]);function l(){return(0,t.canShow)('display')?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.DisplayBoard,{}),(0,c.jsx)(u.DisplayPairing,{})]}):(0,c.jsx)(n.Redirect,{href:t.ENTRY[t.APP_VARIANT]})}},1278,[30,34,846,1279,1334,25]); -__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Pe}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:G,subHeader:Le,noVoice:We=!1}={}){const Oe=(0,P.default)(),Ve=g??Oe.width,Ue=Oe.height,Ke=Ve<700,qe=Ve>=Ue,Ye=!Ke&&qe&&Ve>=600,Qe=Ye,Je=Math.round(Math.min(520,Math.max(Ve>=1e3?448:280,.3*Ve))),Xe=S.default.useRef(null),Ze=S.default.useRef(0),[et,tt]=(0,v.useState)({w:0,h:0}),lt=(0,q.useOwner)(e=>e.site),st=(0,V.useRestaurant)(lt);(0,me.useAlertWatcher)(lt,{enabled:!e});const it=(0,V.useOrders)(lt),ot=(0,V.useBookings)(lt),nt=(0,V.useEvents)(lt),at=(0,V.useStore)(e=>e.skipMinutes),rt=(0,V.useStore)(e=>e.clock.mode),dt=(0,V.useNow)(5e3),ct=(0,q.useOwner)(e=>e.staff),ut=(0,q.useOwner)(e=>e.attendance),ht=(0,q.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,Q.ensureAttendance)((0,F.ymd)(dt),dt)},[(0,F.ymd)(dt)]);const gt=ut.filter(e=>e.in&&!e.out&&dt.getTime()-new Date(e.in).getTime()<72e6&&dt.getTime()>=new Date(e.in).getTime()),bt=Ee(ct.find(e=>e.id===gt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,bt,!e);const yt=(0,F.ymd)(dt),pt=(0,T.useTravelDay)('display',yt),xt=(0,Y.useFrontDoor)(yt,qe),ft=(0,J.useDisplaySettings)(lt),mt=ft.privacy,jt=(0,ne.useSaverSync)(),wt=(0,J.usePlan)(lt),kt=(0,J.useFloor)(e=>e.live[lt]),It=(0,je.useBlocks)(e=>e.blocks),[Dt,vt]=(0,v.useState)('plan'),[St,Ct]=(0,v.useState)('all'),[Tt,$t]=(0,v.useState)(null),[Bt,Rt]=(0,v.useState)(null),[Lt,Wt]=(0,v.useState)(null),[zt,Mt]=(0,v.useState)(!1),[Ht,Pt]=(0,v.useState)(!1),[Et,At]=(0,v.useState)(null),[Ot,Nt]=(0,v.useState)(!1),[_t,Gt]=(0,v.useState)(!1),[Ft,Vt]=(0,v.useState)(null),[Ut,Kt]=(0,v.useState)(null),[qt,Yt]=(0,v.useState)(null),Qt=S.default.useRef(0),Jt=e=>{Qt.current=Date.now(),Yt(e)};S.default.useEffect(()=>{if(!qt)return;const e=setInterval(()=>{Date.now()-Qt.current>=De.DAY_IDLE_MS&&Yt(null)},5e3);return()=>clearInterval(e)},[qt]);const Xt=(0,V.useWaitlist)(lt),Zt=(0,V.useStore)(e=>e.walkIns[lt]??0),[el,tl]=(0,v.useState)(!1),[ll,sl]=(0,v.useState)(!1),[il,ol]=(0,v.useState)(!1);(0,N.useReviewAlerts)(lt);const[nl,al]=(0,v.useState)({view:0,content:0}),[rl,dl]=(0,v.useState)(null);S.default.useEffect(()=>{rl&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:rl,timeoutMs:4500,big:!0,testID:'floor-toast'}),dl(null))},[rl]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[cl,ul]=(0,v.useState)(null),hl=S.default.useRef(0),[gl,bl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!cl)return;hl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-hl.current;if(e>=Pe)return ul(null),void dl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');bl(e>=105e3?Math.ceil((Pe-e)/1e3):null)},1e3);return()=>clearInterval(e)},[cl]);const yl=e=>e.date!==yt?Wt({title:`Guest details \xb7 ${(0,De.dayWord)(e.date,yt)} ${e.time}`,body:(0,He.jsx)(He.Fragment,{children:(0,ye.bookingDetails)(e)})}):Wt({title:`Guest details \xb7 ${e.time}`,body:(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Fe,{rid:lt,id:e.id,turnBase:st.settings.turnMins}),e.walkIn?null:(0,He.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Wt(null),At(e.id)},style:{minHeight:56}}),e.walkIn?(0,He.jsx)(ue.CancelWalkInButton,{rid:lt,b:e,big:!0,onDone:e=>{Wt(null),dl(e)}}):null,e.walkIn?(0,He.jsx)(ue.ReinstateWalkInButton,{rid:lt,b:e,today:yt,onDone:e=>{Wt(null),dl(e)}}):null,(0,ye.bookingDetails)(e)]})}),pl=ot.filter(e=>e.date===yt).sort((e,t)=>e.time.localeCompare(t.time)),xl=pl.filter(e=>!['cancelled','noshow'].includes(e.status)),fl=it.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),ml=(0,v.useMemo)(()=>(0,d.forecastToday)(st,ot,it,nt,dt),[st,ot,it,nt,dt.getTime()/6e4|0]),jl=(0,je.closedAreasAt)(It,lt,yt,(0,F.hm)(dt)),wl=[...jl].join(','),kl=(0,v.useMemo)(()=>(0,X.floorView)(wt,ot,it,kt??{},dt,st.settings.turnMins,jl),[wt,ot,it,kt,dt.getTime(),wl]),Il=(0,be.hoursFor)(st,dt),Dl=Il?.open??new Date(`${yt}T12:00:00`),vl=Il?.close??new Date(`${yt}T21:00:00`),Sl=(0,F.addMins)(Dl,-Dl.getMinutes()),Cl=(0,F.addMins)(vl,90),Tl=e=>new Date(`${yt}T${e}:00`),$l=(0,je.blocksOn)(It,lt,yt).map(e=>({from:Tl(e.from),to:Tl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(st,dt,yt)),Bl=Object.keys(kl).filter(e=>'blocked'===kl[e]?.status),Rl=qt&&qt!==yt?qt:yt,Ll=Rl!==yt,Wl=(0,De.dayWord)(Rl,yt),zl=/^(Today|Yesterday|Tomorrow)$/.test(Wl),Ml=Ll?(0,De.bookingsForDay)(ot,Rl,yt).sort((e,t)=>e.time.localeCompare(t.time)):pl,Hl=(0,F.parseYmd)(Rl);Hl.setHours(12);const Pl=Ll?(0,be.hoursFor)(st,Hl):Il,El=Pl?.open??new Date(`${Rl}T12:00:00`),Al=Pl?.close??new Date(`${Rl}T21:00:00`),Ol=e=>new Date(`${Rl}T${e}:00`),Nl=[...Ll?(0,je.blocksOn)(It,lt,Rl).map(e=>({from:Ol(e.from),to:Ol(e.to),label:e.reason??'Paused'})):$l,...Ll?(0,i.queuedServicePauses)(st,Hl,Rl):[]],_l=(0,i.queuedServiceSessions)(st,Hl),Gl=l.IS_QUEUED_VENUE&&(void 0===_l||!_l.length),Fl=(0,He.jsxs)(H.default,{testID:"queued-hours-gate",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:void 0===_l?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,He.jsx)(A.Muted,{children:s.queuedVenues[lt]?.hours.note})]}),Vl=Ll?Pl||Ml.length?RlLl?(0,X.dayFloorView)(wt,Ml,Rl):kl,[Ll,wt,Ml,Rl,kl]),[Kl,ql]=(0,v.useState)(null),Yl=Ll?Ml.filter(e=>!['cancelled','noshow'].includes(e.status)):xl,Ql=Yl.reduce((e,t)=>e+t.partySize,0),Jl=(0,c.coversSplit)(Yl,Rl),Xl=(0,ve.cancelledDayTally)(ot,Rl),Zl=(0,Se.cancellationsFor)(ot,Rl,e=>e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)','')),es=(0,ve.cancelledTallyWords)(Xl,zl?Wl.toLowerCase():Ll?`on ${Wl}`:'today'),ts=It.filter(e=>e.rid===lt&&e.date===Rl&&!e.removedAt),ls=(0,Ie.chartBands)(ts,60*El.getHours()+El.getMinutes(),60*Al.getHours()+Al.getMinutes()),ss=new Set((0,Ie.blockedHours)(ls)),is=dt.getHours()+(dt.getMinutes()>=30?1:0),os=ml.hours.filter(e=>e.hour>=is&&!ss.has(e.hour)),ns=os.reduce((e,t)=>e+t.coversHigh,0),as=os.reduce((e,t)=>e+t.coversLow,0),rs=Math.round((as+ns)/2),ds=!ml.example&&ml.open&&ml.enough&&ns>0?`Usually ${(0,d.coversRange)(rs,rs)} more`:void 0,cs=async(e,t)=>{const l=kl[e]?.booking;if(!l||e===t)return;const s=kl[t]?.status;if(s&&!['free','soon'].includes(s))return void dl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${X.STATUS[s].label.toLowerCase()}. Pick a free table.`);await V.repo.bookings.update(l.id,{table:t});const i=kt?.[e]?.stage;J.useFloor.getState().setLive(lt,t,{stage:i??'seated',dirty:!1}),J.useFloor.getState().setLive(lt,e,{stage:void 0,dirty:!0}),dl(`${(0,ae.privName)(l,mt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},us=Ut?ot.find(e=>e.id===Ut.id):void 0,hs=Ut&&us?(()=>{const e=us.walkIn?(0,ae.privName)(us,mt):Ee(us.name),t=(0,ge.seatsOf)(wt,Ut.tables).total,l=(0,ge.seatLine)(t,us.partySize),s=(0,ge.pickClashes)(us,Ut.tables,ot.filter(e=>e.date===us.date),st.settings.turnMins),i=(0,ge.tableKey)(Ut.tables)!==(0,ge.tableKey)((0,J.tablesOf)(us.table));return(0,He.jsxs)(H.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:U.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,padding:10},children:[(0,He.jsxs)(H.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,De.dayWord)(us.date,yt)} ${us.time}. Tap tables on the plan to add or take them off. ${(0,ge.tablesWords)(Ut.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,De.dayWord)(us.date,yt)," ",us.time]}),(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[(0,ge.tablesWords)(Ut.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,He.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,He.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,ge.tablesWords)(Ut.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(us){try{await(0,he.saveBookingTables)(lt,us,Ut.tables),dl((0,ge.savedWords)(e,us.partySize,Ut.tables,t))}catch(t){dl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Kt(null)}else Kt(null)}}),(0,He.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Kt(null)})]})]})})():null,gs=wt.areas.filter(e=>wt.tables.some(t=>t.areaId===e.id)),bs=e=>{const t=wt.tables.filter(t=>t.areaId===e);return Ll?`${t.filter(e=>!Ul[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(kl[e.name]?.status??'free')).length}/${t.length} free`},ys='all'===St||gs.some(e=>e.id===St)?St:'all',ps=e=>(0,He.jsx)(Z.FloorCanvas,{plan:wt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Ye,big:!0,view:Ul,privacy:mt,turnBase:st.settings.turnMins,highlight:Ut?Ut.tables:Bt?[Bt]:void 0,onTap:e=>{return t=e.name,void(Ut?Kt(e=>e?{...e,tables:(0,ge.toggleTable)(e.tables,t)}:e):Ll?ql(t):Bt?(t!==Bt&&cs(Bt,t),Rt(null)):$t(t));var t},onDrop:(e,t)=>Ut||Ll?void 0:cs(e.name,t.name)}),xs=Ke?1:qe||gs.length>2?2:1,fs=e=>{const t=wt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ms=[];for(let e=0;e{const t=(0,Z.areaBounds)(wt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,Z.minReadableScale)(wt,e.id)}}),et.w,et.h):null,ws=e=>(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',height:ee.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:bs(e.id)})]}),ks=(0,He.jsx)(H.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-et.w)>1||Math.abs(l-et.h)>1)&&tt({w:t,h:l})},children:js?(0,He.jsx)(M.default,{style:{flex:1},scrollEnabled:js.scroll,showsVerticalScrollIndicator:js.scroll,contentContainerStyle:{gap:ee.GRID_GAP},children:js.rows.map((e,t)=>(0,He.jsx)(H.default,{style:{height:js.rowHeights[t],flexDirection:'row',gap:ee.GRID_GAP},children:e.map(e=>{const t=gs.find(t=>t.id===e);return(0,He.jsxs)(H.default,{testID:`area-cell-${e}`,style:{width:js.cellW,gap:2},children:[ws(t),(0,He.jsx)(H.default,{style:{flex:1},children:ps(e)})]},e)})},t))}):null}),Is=(0,He.jsxs)(H.default,{testID:"venue-plan",style:{flex:Ke?void 0:1,gap:10,minWidth:0},children:[(0,He.jsx)(a.TableNumberWarning,{plan:wt}),wt.tables.length?null:(0,He.jsxs)(H.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,He.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,He.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,He.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,He.jsx)(_e,{chipId:"all",compact:!Ke,label:"Whole venue",selected:'all'===ys,onPress:()=>Ct('all')},"__all"),...gs.map(e=>(0,He.jsx)(_e,{chipId:e.id,compact:!Ke,label:`${e.name}${(0,te.areaMarks)(e)}`,colour:(0,U.brandColour)(e.colour),sub:Ke?jl.has(e.id)?'closed':ys===e.id?bs(e.id):void 0:void 0,selected:ys===e.id,onPress:()=>Ct(e.id)},e.id))];return Ke?(0,He.jsx)(H.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,He.jsx)(M.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;al(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>al(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:nl.view>0&&nl.content>0&&nl.content<=nl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:nl.view>0&&nl.content<=nl.view+1?'100%':void 0},children:e})})(),(0,He.jsx)(h.FloorLegend,{}),hs,Bt?(0,He.jsxs)(A.Row,{gap:8,style:{backgroundColor:U.colours.goldTint,borderRadius:10,padding:8},children:[(0,He.jsxs)(A.T,{weight:"semibold",colour:U.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Bt),": tap the new table."]}),(0,He.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Rt(null)})]}):null,'all'===ys&&Ye?ks:'all'===ys?(0,He.jsx)(H.default,{style:{flex:Ke?void 0:1,gap:12,minHeight:Qe?void 0:360},children:ms.map((e,t)=>(0,He.jsxs)(H.default,{style:{flex:Ke?void 0:Math.max(.3,...e.map(e=>fs(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,He.jsxs)(H.default,{style:{flex:1,gap:2},children:[Ke?(0,He.jsxs)(H.default,{style:{alignItems:'center',gap:4},children:[(0,He.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{center:!0,children:bs(e.id)})]}):(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{children:bs(e.id)})]}),(0,He.jsx)(H.default,{style:Ke?{height:Math.max(280,Math.round((Ve-40)*fs(e.id)))}:{flex:1},children:ps(e.id)})]},e.id)),e.length{if(Ll)return void Vt(e.id);const t=(0,J.tablesOf)(e.table)[0];t&&kl[t]?$t(t):yl(e)}},Rl)}),vs='timeline'===Dt,Ss=Ll?(0,He.jsxs)(H.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,backgroundColor:U.colours.goldTint},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:zl?`Showing ${Wl} \xb7 ${(0,F.niceDate)((0,F.parseYmd)(Rl))}`:`Showing ${(0,De.dayWord)(Rl,yt)}`}),(0,He.jsx)(H.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${es}. Showing ${(0,De.dayLong)(Rl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,He.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Kt(null),Jt(null)},style:{minHeight:44}})]}):null,Cs=(0,He.jsx)(H.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:Ke?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===vs;return(0,He.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},onPress:()=>vt(e),style:{flex:Ke?1:void 0,minHeight:Ke?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?U.colours.gold:'transparent',...$e.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,He.jsx)(A.T,{size:Ke?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ts=(0,u.useBookingWrite)(),$s=e=>(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Be.BigAction,{premium:!0,label:"Walk-in",onPress:xt.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"New booking",onPress:xt.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"Edit booking",onPress:()=>Pt(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint})]});(0,Me.useDisplayNotices)(lt,!e);const Bs=Ke?180:168,[Rs,Ls]=(0,v.useState)(Bs),Ws=S.default.useRef(Bs),zs=S.default.useRef(null),Ms=S.default.useRef(null),Hs=()=>{const e=zs.current,t=Ms.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ue<820?8:12,o=44+(Ue<820?4:8),n=i>Ws.current?Math.ceil(i-Ws.current):ke.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Bs,Math.floor(t-s-l)-n-o));Math.abs(Ws.current-a)>=2&&(Ws.current=a,Ls(a))})})};S.default.useEffect(()=>{const e=setTimeout(Hs,60);return()=>clearTimeout(e)},[Ve,Ue]);const Ps=(0,He.jsxs)(H.default,{ref:Ms,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),Hs()},style:{flexDirection:'row',flexWrap:Ve>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:Ke?12:6,justifyContent:Ke?'center':void 0,borderTopWidth:1,borderTopColor:U.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,He.jsx)(ze.DisplayClockButton,{}),(0,He.jsx)(se.HoldToEdit,{quiet:!0,onUnlock:()=>{bl(null),ul({at:Date.now()})},onHint:()=>dl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,He.jsx)(we.BlockBookingsButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,display:!0,day:Rl}),wt.areas.some(e=>e.outdoor)?(0,He.jsx)(we.CloseGardenButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,short:!0}):null,(0,He.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>ol(!0),style:({pressed:e})=>({...$e.look.quiet(e),flexGrow:1}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,He.jsx)(p.GiftQrButton,{rid:lt,venue:st.name})]}),Es=fl.length?(0,He.jsxs)(H.default,{testID:"takeaway-panel",style:[$e.look.panel,{overflow:'hidden'}],children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,He.jsxs)(A.T,{size:12,colour:U.colours.muted,children:[fl.length," live"]})]}),(0,He.jsx)(H.default,{style:{padding:10},children:(0,He.jsx)(Ge,{list:fl,me:bt,compact:!0,bookings:ot})})]}):null,As=(Te.DueToday,Ll?Ml:pl.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Os=Ll?zl?`${Wl}\u2019s guests`:`Guests ${Wl}`:'Today\u2019s guests',Ns=(0,He.jsxs)(He.Fragment,{children:[0===As.length?(0,He.jsx)(A.Muted,{children:Ll?Rl{const t=(0,K.isSeatedHighlight)(e.status,{otherDay:Ll}),l=(0,re.guestRowText)(e,{name:e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)',''),seated:t}),s=t?K.SEATED_FG:U.colours.text,i=t?K.SEATED_MUTED:U.colours.muted,o=t?K.SEATED_FG:U.colours.gold,n=l.depositWarn?U.colours.amber:t?K.SEATED_FG:U.colours.goldLight;return(0,He.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:Ll?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Gt(!1),Vt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,K.seatedHighlightStyle)({backgroundColor:e?U.colours.goldLight:U.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:U.colours.hairline,backgroundColor:e?U.colours.tilePressed:'transparent'},children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,He.jsx)(H.default,{style:{paddingTop:2},children:(0,He.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':U.colours.amber,ink:t?U.colours.gold:U.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,He.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,He.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,He.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,He.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,He.jsx)(H.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,He.jsx)(de.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,He.jsx)(Ce.CancellationsSection,{items:Zl,dayWord:Ll?zl?Wl.toLowerCase():`on ${Wl}`:'today'})]}),_s=(0,He.jsx)(M.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Ns}),Gs=W.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Gt(!1)}}),Fs=(0,He.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Os}, ${As.length}`,accessibilityState:{expanded:_t},'aria-expanded':_t,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Gt(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:_t?U.colours.gold:U.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?U.colours.tilePressed:_t?U.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,He.jsx)(A.T,{size:16,weight:"bold",colour:U.colours.gold,children:As.length}),(0,He.jsx)(H.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(H.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,He.jsxs)(A.T,{size:13,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,children:[Os," ",_t?'\u2039':'\u203a']})})})]}),Vs=_t?(0,He.jsxs)(H.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,He.jsxs)(H.default,{testID:"guests-drawer",...Gs.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ve)),backgroundColor:U.colours.surface,borderRightWidth:1,borderColor:U.colours.gold,borderRadius:14,...$e.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Os.toUpperCase()," (",As.length,")"]}),Xl.count?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:es}):null,(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Os}`,onPress:()=>Gt(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:18,colour:U.colours.muted,children:"\u2715"})})]}),_s]}),(0,He.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Os}`,accessibilityRole:"button",onPress:()=>Gt(!1),style:{flex:1}})]}):null,Us=Gl?Fl:l.IS_KIRKTON&&!Object.values(st.kitchenHours??{}).some(Boolean)?(0,He.jsxs)(H.default,{testID:"kirkton-hours-to-confirm",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,He.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,He.jsx)(ke.DayGraph,{busyThreshold:(0,t.venueBusy)(st,ot,dt).busy,todays:Ml,open:El,close:Al,now:dt,turnBase:st.settings.turnMins,blocks:ts,pauses:Nl,compact:Ke,dense:!Ke,height:Ye?Rs:Bs,forecastNote:Ll?void 0:ds,emptyText:Vl,past:Rl{Ll?Gt(!0):vt('timeline')},Qs=(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',padding:Ue<820?8:12,paddingTop:Ue<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[pt?null:Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[pt?null:Ss,pt?(0,He.jsx)(M.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"})}):vs?Ds:Is,Vs]}),(0,He.jsxs)(H.default,{testID:"display-side",style:{width:Je,gap:Ue<820?4:8,minHeight:0},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:$s(!1)}),(0,He.jsx)(H.default,{style:{flexShrink:0},children:Cs}),pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:Ue<820,snug:Ue<820,tight:Ue<700,aside:`${Yl.length} ${1===Yl.length?'table':'tables'} booked${fl.length?` \xb7 ${fl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{ref:zs,testID:"day-graph-slot",onLayout:Hs,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Ks}),(0,He.jsxs)(M.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,He.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,He.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),Es,(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt})]})]})]});return(0,He.jsxs)(E.SafeAreaView,{style:{flex:1,backgroundColor:U.colours.bg},onTouchStart:()=>{Qt.current=Date.now()},onMouseDown:()=>{Qt.current=Date.now()},children:[Ke?(0,He.jsxs)(H.default,{style:{flex:1},children:[(0,He.jsxs)(M.default,{ref:Xe,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,He.jsx)(H.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,He.jsx)(f.ExitButton,{})}),(0,He.jsx)(_.RestaurantLogo,{rid:lt,size:64}),(0,He.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:st.name}),(0,He.jsx)(_.PoweredBy,{}),(0,He.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,He.jsx)(H.default,{accessible:!0,accessibilityLabel:`Current time ${(0,F.hm)(dt)}`,children:(0,He.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:U.colours.goldLight,children:(0,F.hm)(dt)})}),(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:"m"}),(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:"m"}),G]}),Le,qs,(0,He.jsx)(H.default,{testID:"phone-glance",style:{width:'100%'},children:(0,He.jsx)(Ne,{phone:!0,split:Jl,items:[{label:`Tables \xb7 ${Wl}`,value:Yl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Wl}`,value:Ql,testID:'badge-covers'},{label:'Takeaway',value:fl.length,alert:fl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Mt(!0)}]})}),(0,He.jsx)(H.default,{testID:"primary-actions",style:{gap:8},children:$s(!0)}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),Cs,(0,He.jsx)(H.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:vs?Ds:Is}),(0,He.jsxs)(H.default,{onLayout:e=>{Ze.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[$e.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,He.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:U.colours.goldLight,accessibilityRole:"header",children:[Os," (",As.length,")"]}),(0,He.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{gap:4},children:Ns})]}),Es,Ks,(0,He.jsx)(H.default,{testID:"covers-dock",children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Xe.current?.scrollTo({y:Ze.current,animated:!0})})}),(0,He.jsxs)(H.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,He.jsx)(A.T,{center:!0,size:14,colour:mt?U.colours.muted:U.colours.amber,children:mt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,He.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,He.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ps]}),e?null:(0,He.jsx)(H.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:U.colours.hairline},children:(0,He.jsx)(R.VoiceSlot,{size:56})})]}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ve>=1e3?18:14,paddingVertical:Ue<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...$e.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,He.jsx)(H.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,He.jsx)(_.RestaurantBrand,{rid:st.id,size:Ve<900?32:40,beside:!0})}),(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,He.jsx)(A.T,{size:Ve<900?18:21,weight:"semibold",colour:U.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,F.hm)(dt)}),Ve>=900?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:(0,F.niceDate)(dt)}):null]})]}),pt?(0,He.jsx)(H.default,{style:{width:220}}):(0,He.jsx)(H.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:qs}),(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:Ve<900?'xs':Ve<1100||Ue<700?'s':'m'}),(0,He.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.muted,children:"?"})}),'simulated'===rt?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>at(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:11,colour:U.colours.muted,children:"+15"})}):null,e?null:(0,He.jsx)(f.ExitButton,{}),G,We?null:(0,He.jsx)(R.VoiceSlot,{size:44})]})]}),Le,pt?null:(0,He.jsxs)(H.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,He.jsx)(Ne,{splitOnly:!0,split:Jl,items:[]}),(0,He.jsx)(H.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ve>=1e3?18:14)+(e?0:52)+('simulated'===rt?52:0),zIndex:4},children:(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:Ve<1100||Ue<700?'s':'m'})})]}),Ye?Qs:(Js=(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"front-door-bar",style:{gap:10},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:$s(!1)}),Cs]}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),pt?(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"}):(0,He.jsx)(He.Fragment,{children:(0,He.jsxs)(H.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Ss,vs?Ds:Is,Vs]})]})}),Es,pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Bs+ke.DAY_GRAPH_CHROME},children:Ks})]}),(0,He.jsx)(M.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:Js})),Ps]}),(0,He.jsx)(j.SoldOutStrip,{rid:lt,by:bt,onOpen:()=>ol(!0)}),(0,He.jsx)(w.SoldOutSheet,{visible:il,onClose:()=>ol(!1),rid:lt,by:bt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,He.jsx)(y.TableOrderCue,{rid:lt}),xt.elements,Ht?(0,He.jsx)(b.EditBookingPicker,{rid:lt,today:yt,who:bt,hidePrivate:!0,onClose:()=>Pt(!1)}):null,Et?(0,He.jsx)(b.EditBookingSheet,{rid:lt,id:Et,who:bt,hidePrivate:!0,onClose:()=>At(null)}):null,Tt?(0,He.jsx)(ye.TableSheet,{rid:lt,name:Tt,view:kl,plan:wt,todays:pl,now:dt,privacy:mt,turnBase:st.settings.turnMins,onClose:()=>$t(null),onWalkIn:e=>xt.openWalkInAt(e),onMove:e=>Rt(e),onDetails:yl}):null,Kl?(()=>{const e=Ul[Kl],t=e?.dayBookings??[];return(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>ql(null),title:`${(0,r.tableNumbers)(Kl)} \xb7 ${zl?Wl:(0,De.dayLong)(Rl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${zl?Wl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${zl?Wl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,ae.privName)(e,mt):Ee(e.name);return(0,He.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,ge.tablesWords)((0,J.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{ql(null),Vt(e.id)},style:{minHeight:56}},e.id)}),(0,He.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>ql(null),style:{minHeight:56}})]})})():null,Ft?(()=>{const e=ot.find(e=>e.id===Ft);return e?(0,He.jsx)(ce.GuestActionsSheet,{rid:lt,b:e,name:e.walkIn?(0,ae.privName)(e,mt):Ee(e.name),view:kl,now:dt,otherDay:e.date!==yt,turnBase:st.settings.turnMins,onClose:()=>Vt(null),onDetails:yl,onDone:dl,onPickOnPlan:(e,t)=>{Gt(!1),vt('plan'),Ct('all'),Kt({id:e.id,tables:t})}}):null})():null,Lt?(0,He.jsx)(ye.DetailsPanel,{title:Lt.title,onClose:()=>Wt(null),children:Lt.body}):null,Ot?(0,He.jsx)(ye.ServiceSummary,{r:st,todays:pl,orders:it,waitlistAll:Xt,walkInCount:Zt,onClose:()=>Nt(!1)}):null,el?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>tl(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,He.jsx)(h.FloorLegend,{}),(0,He.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>tl(!1)})]}):null,ll?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>sl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,He.jsx)(O.ReviewsSection,{rid:lt,mode:"read",venueName:st.name}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>sl(!1)})]}):null,zt?(0,He.jsxs)(ye.DetailsPanel,{title:"Takeaway",onClose:()=>Mt(!1),children:[(0,He.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,He.jsx)(Ge,{list:fl,me:bt,bookings:ot})]}):null,cl?(0,He.jsx)(H.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:U.colours.bg},children:(0,He.jsx)(le.PlanDesigner,{initial:wt,venue:st.name,mode:"display",startStep:"arrange",onActivity:()=>{hl.current=Date.now(),null!==gl&&bl(null)},notice:null!==gl?`Locking again in ${gl} s \xb7 touch to keep editing`:null,onSave:e=>{J.useFloor.getState().setPlan(lt,e),ul(null),dl('Table plan saved. Editing is locked again.')},onCancel:()=>{ul(null),dl('No changes kept. Editing is locked again.')}},cl.at)}):null,e?null:(0,He.jsx)(oe.Screensaver,{rid:lt,idleMins:ft.idleMins,pinOn:ft.pinOn,wake:ft,tonightCards:ft.tonightCards,cfg:jt}),e?null:(0,He.jsx)(xe.PrintHost,{rid:lt}),e?null:(0,He.jsx)(pe.AlertHost,{variant:"display",rid:lt,skipTakeaway:!0}),e?null:(0,He.jsx)(B.SeatAllergenReminder,{rid:lt}),e?null:(0,He.jsx)(fe.TakeawayTakeover,{rid:lt,me:bt})]});var Js};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),z=e(_r(_d[31])),M=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=_r(_d[35]),A=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),ze=_r(_d[85]),Me=_r(_d[86]),He=_r(_d[87]);const Pe=12e4,Ee=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Oe=e=>e.slotTime?(0,F.hm)(new Date(e.slotTime)):'ASAP';function Ne({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,He.jsxs)(H.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,He.jsx)(H.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,He.jsxs)(H.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,He.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?U.colours.amber:U.colours.text,children:e.value}),(0,He.jsx)(A.T,{size:l?14:12,colour:U.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,He.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,He.jsx)(H.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,He.jsx)(A.T,{size:14,colour:U.colours.muted,children:"No Covers yet"}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:U.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,He.jsxs)(H.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:U.colours.gold},children:[(0,He.jsx)(H.default,{style:{width:`${s.walkInPct}%`,backgroundColor:U.colours.gold}}),(0,He.jsx)(H.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function _e({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,He.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,He.jsx)(H.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,He.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?U.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,He.jsx)(A.T,{size:12,colour:U.colours.muted,children:l}):null]})}function Ge({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,We.statusBlock)(e,t,(0,We.linkedBooking)(e,s));return e.length?(0,He.jsx)(H.default,{style:{gap:8},children:e.map(e=>(0,He.jsxs)(H.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:U.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?U.colours.ok:e.allergies.length?U.colours.red:U.colours.gold},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Oe(e)," \xb7 ",Ee(e.customerName)]}),(0,He.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,He.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:U.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,G.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,He.jsx)(Le.AllergyChain,{o:e,me:t,compact:!0}):null,(0,He.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,He.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>V.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,He.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,He.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'collected',t)}):null,(0,He.jsx)(xe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,He.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Fe({rid:e,id:t,turnBase:l}){const s=(0,V.useBookings)(e).find(e=>e.id===t);return s?(0,He.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1279,[1121,5,6,1280,798,822,1094,829,1120,1281,1282,1283,1091,1115,1284,1285,1287,1288,1289,1130,977,1099,1290,34,1073,1148,1033,1087,1116,1291,380,402,295,102,426,36,794,1186,1190,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1292,1107,1293,1296,1298,1301,1304,1300,1305,1307,1308,1112,1093,1095,852,1310,1175,1311,1185,1177,1011,1316,1324,1326,1076,1114,1328,1329,1330,1143,1331,1142,1136,838,1332,1333,25]); +__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Ee}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:F,subHeader:We,noVoice:Me=!1}={}){const Ne=(0,E.default)(),Ue=g??Ne.width,Ke=Ne.height,qe=Ue<700,Ye=Ue>=Ke,Qe=!qe&&Ye&&Ue>=600,Je=Qe,Xe=Math.round(Math.min(520,Math.max(Ue>=1e3?448:280,.3*Ue))),Ze=S.default.useRef(null),et=S.default.useRef(0),[tt,lt]=(0,v.useState)({w:0,h:0}),st=(0,Y.useOwner)(e=>e.site),it=(0,U.useRestaurant)(st);(0,je.useAlertWatcher)(st,{enabled:!e});const ot=(0,U.useOrders)(st),nt=(0,U.useBookings)(st),at=(0,U.useEvents)(st),rt=(0,U.useStore)(e=>e.skipMinutes),dt=(0,U.useStore)(e=>e.clock.mode),ct=(0,U.useNow)(5e3),ut=(0,Y.useOwner)(e=>e.staff),ht=(0,Y.useOwner)(e=>e.attendance),gt=(0,Y.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,J.ensureAttendance)((0,V.ymd)(ct),ct)},[(0,V.ymd)(ct)]);const bt=ht.filter(e=>e.in&&!e.out&&ct.getTime()-new Date(e.in).getTime()<72e6&&ct.getTime()>=new Date(e.in).getTime()),yt=Oe(ut.find(e=>e.id===bt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,yt,!e);const pt=(0,V.ymd)(ct),xt=(0,T.useTravelDay)('display',pt),ft=(0,Q.useFrontDoor)(pt,Ye),mt=(0,X.useDisplaySettings)(st),jt=mt.privacy,wt=(0,ae.useSaverSync)(),kt=(0,X.usePlan)(st),It=(0,X.useFloor)(e=>e.live[st]),Dt=(0,we.useBlocks)(e=>e.blocks),[vt,St]=(0,v.useState)('plan'),[Ct,Tt]=(0,v.useState)(!1),[$t,Bt]=(0,v.useState)('all'),[Rt,Lt]=(0,v.useState)(null),[Wt,Mt]=(0,v.useState)(null),[zt,Ht]=(0,v.useState)(null),[Pt,Et]=(0,v.useState)(!1),[Ot,At]=(0,v.useState)(!1),[Nt,_t]=(0,v.useState)(null),[Gt,Ft]=(0,v.useState)(!1),[Vt,Ut]=(0,v.useState)(!1),[Kt,qt]=(0,v.useState)(null),[Yt,Qt]=(0,v.useState)(null),[Jt,Xt]=(0,v.useState)(null),Zt=S.default.useRef(0),el=e=>{Zt.current=Date.now(),Xt(e)};S.default.useEffect(()=>{if(!Jt)return;const e=setInterval(()=>{Date.now()-Zt.current>=ve.DAY_IDLE_MS&&Xt(null)},5e3);return()=>clearInterval(e)},[Jt]);const tl=(0,U.useWaitlist)(st),ll=(0,U.useStore)(e=>e.walkIns[st]??0),[sl,il]=(0,v.useState)(!1),[ol,nl]=(0,v.useState)(!1),[al,rl]=(0,v.useState)(!1);(0,_.useReviewAlerts)(st);const[dl,cl]=(0,v.useState)({view:0,content:0}),[ul,hl]=(0,v.useState)(null);S.default.useEffect(()=>{ul&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:ul,timeoutMs:4500,big:!0,testID:'floor-toast'}),hl(null))},[ul]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[gl,bl]=(0,v.useState)(null),yl=S.default.useRef(0),[pl,xl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!gl)return;yl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-yl.current;if(e>=Ee)return bl(null),void hl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');xl(e>=105e3?Math.ceil((Ee-e)/1e3):null)},1e3);return()=>clearInterval(e)},[gl]);const fl=e=>e.date!==pt?Ht({title:`Guest details \xb7 ${(0,ve.dayWord)(e.date,pt)} ${e.time}`,body:(0,Pe.jsx)(Pe.Fragment,{children:(0,pe.bookingDetails)(e)})}):Ht({title:`Guest details \xb7 ${e.time}`,body:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ve,{rid:st,id:e.id,turnBase:it.settings.turnMins}),e.walkIn?null:(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Ht(null),_t(e.id)},style:{minHeight:56}}),e.walkIn?(0,Pe.jsx)(he.CancelWalkInButton,{rid:st,b:e,big:!0,onDone:e=>{Ht(null),hl(e)}}):null,e.walkIn?(0,Pe.jsx)(he.ReinstateWalkInButton,{rid:st,b:e,today:pt,onDone:e=>{Ht(null),hl(e)}}):null,(0,pe.bookingDetails)(e)]})}),ml=nt.filter(e=>e.date===pt).sort((e,t)=>e.time.localeCompare(t.time)),jl=ml.filter(e=>!['cancelled','noshow'].includes(e.status)),wl=ot.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),kl=(0,v.useMemo)(()=>(0,d.forecastToday)(it,nt,ot,at,ct),[it,nt,ot,at,ct.getTime()/6e4|0]),Il=(0,we.closedAreasAt)(Dt,st,pt,(0,V.hm)(ct)),Dl=[...Il].join(','),vl=(0,v.useMemo)(()=>(0,Z.floorView)(kt,nt,ot,It??{},ct,it.settings.turnMins,Il),[kt,nt,ot,It,ct.getTime(),Dl]),Sl=(0,ye.hoursFor)(it,ct),Cl=Sl?.open??new Date(`${pt}T12:00:00`),Tl=Sl?.close??new Date(`${pt}T21:00:00`),$l=(0,V.addMins)(Cl,-Cl.getMinutes()),Bl=(0,V.addMins)(Tl,90),Rl=e=>new Date(`${pt}T${e}:00`),Ll=(0,we.blocksOn)(Dt,st,pt).map(e=>({from:Rl(e.from),to:Rl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(it,ct,pt)),Wl=Object.keys(vl).filter(e=>'blocked'===vl[e]?.status),Ml=Jt&&Jt!==pt?Jt:pt,zl=Ml!==pt,Hl=(0,ve.dayWord)(Ml,pt),Pl=/^(Today|Yesterday|Tomorrow)$/.test(Hl),El=zl?(0,ve.bookingsForDay)(nt,Ml,pt).sort((e,t)=>e.time.localeCompare(t.time)):ml,Ol=(0,V.parseYmd)(Ml);Ol.setHours(12);const Al=zl?(0,ye.hoursFor)(it,Ol):Sl,Nl=Al?.open??new Date(`${Ml}T12:00:00`),_l=Al?.close??new Date(`${Ml}T21:00:00`),Gl=e=>new Date(`${Ml}T${e}:00`),Fl=[...zl?(0,we.blocksOn)(Dt,st,Ml).map(e=>({from:Gl(e.from),to:Gl(e.to),label:e.reason??'Paused'})):Ll,...zl?(0,i.queuedServicePauses)(it,Ol,Ml):[]],Vl=(0,i.queuedServiceSessions)(it,Ol),Ul=l.IS_QUEUED_VENUE&&(void 0===Vl||!Vl.length),Kl=(0,Pe.jsxs)(P.default,{testID:"queued-hours-gate",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:void 0===Vl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Pe.jsx)(A.Muted,{children:s.queuedVenues[st]?.hours.note})]}),ql=zl?Al||El.length?Mlzl?(0,Z.dayFloorView)(kt,El,Ml):vl,[zl,kt,El,Ml,vl]),[Ql,Jl]=(0,v.useState)(null),Xl=zl?El.filter(e=>!['cancelled','noshow'].includes(e.status)):jl,Zl=Xl.reduce((e,t)=>e+t.partySize,0),es=(0,c.coversSplit)(Xl,Ml),ts=(0,Se.cancelledDayTally)(nt,Ml),ls=(0,Ce.cancellationsFor)(nt,Ml,e=>e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)','')),ss=(0,Se.cancelledTallyWords)(ts,Pl?Hl.toLowerCase():zl?`on ${Hl}`:'today'),is=Dt.filter(e=>e.rid===st&&e.date===Ml&&!e.removedAt),os=(0,De.chartBands)(is,60*Nl.getHours()+Nl.getMinutes(),60*_l.getHours()+_l.getMinutes()),ns=new Set((0,De.blockedHours)(os)),as=ct.getHours()+(ct.getMinutes()>=30?1:0),rs=kl.hours.filter(e=>e.hour>=as&&!ns.has(e.hour)),ds=rs.reduce((e,t)=>e+t.coversHigh,0),cs=rs.reduce((e,t)=>e+t.coversLow,0),us=Math.round((cs+ds)/2),hs=!kl.example&&kl.open&&kl.enough&&ds>0?`Usually ${(0,d.coversRange)(us,us)} more`:void 0,gs=async(e,t)=>{const l=vl[e]?.booking;if(!l||e===t)return;const s=vl[t]?.status;if(s&&!['free','soon'].includes(s))return void hl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${Z.STATUS[s].label.toLowerCase()}. Pick a free table.`);await U.repo.bookings.update(l.id,{table:t});const i=It?.[e]?.stage;X.useFloor.getState().setLive(st,t,{stage:i??'seated',dirty:!1}),X.useFloor.getState().setLive(st,e,{stage:void 0,dirty:!0}),hl(`${(0,re.privName)(l,jt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},bs=Yt?nt.find(e=>e.id===Yt.id):void 0,ys=Yt&&bs?(()=>{const e=bs.walkIn?(0,re.privName)(bs,jt):Oe(bs.name),t=(0,be.seatsOf)(kt,Yt.tables).total,l=(0,be.seatLine)(t,bs.partySize),s=(0,be.pickClashes)(bs,Yt.tables,nt.filter(e=>e.date===bs.date),it.settings.turnMins),i=(0,be.tableKey)(Yt.tables)!==(0,be.tableKey)((0,X.tablesOf)(bs.table));return(0,Pe.jsxs)(P.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:K.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,padding:10},children:[(0,Pe.jsxs)(P.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,ve.dayWord)(bs.date,pt)} ${bs.time}. Tap tables on the plan to add or take them off. ${(0,be.tablesWords)(Yt.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,ve.dayWord)(bs.date,pt)," ",bs.time]}),(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[(0,be.tablesWords)(Yt.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,Pe.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,Pe.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,be.tablesWords)(Yt.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(bs){try{await(0,ge.saveBookingTables)(st,bs,Yt.tables),hl((0,be.savedWords)(e,bs.partySize,Yt.tables,t))}catch(t){hl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Qt(null)}else Qt(null)}}),(0,Pe.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Qt(null)})]})]})})():null,ps=kt.areas.filter(e=>kt.tables.some(t=>t.areaId===e.id)),xs=e=>{const t=kt.tables.filter(t=>t.areaId===e);return zl?`${t.filter(e=>!Yl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(vl[e.name]?.status??'free')).length}/${t.length} free`},fs='all'===$t||ps.some(e=>e.id===$t)?$t:'all',ms=e=>(0,Pe.jsx)(ee.FloorCanvas,{plan:kt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Qe,big:!0,view:Yl,privacy:jt,turnBase:it.settings.turnMins,highlight:Yt?Yt.tables:Wt?[Wt]:void 0,onTap:e=>{return t=e.name,void(Yt?Qt(e=>e?{...e,tables:(0,be.toggleTable)(e.tables,t)}:e):zl?Jl(t):Wt?(t!==Wt&&gs(Wt,t),Mt(null)):Lt(t));var t},onDrop:(e,t)=>Yt||zl?void 0:gs(e.name,t.name)}),js=qe?1:Ye||ps.length>2?2:1,ws=e=>{const t=kt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ks=[];for(let e=0;e{const t=(0,ee.areaBounds)(kt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ee.minReadableScale)(kt,e.id)}}),tt.w,tt.h):null,Ds=e=>(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',height:te.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:xs(e.id)})]}),vs=(0,Pe.jsx)(P.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-tt.w)>1||Math.abs(l-tt.h)>1)&<({w:t,h:l})},children:Is?(0,Pe.jsx)(H.default,{style:{flex:1},scrollEnabled:Is.scroll,showsVerticalScrollIndicator:Is.scroll,contentContainerStyle:{gap:te.GRID_GAP},children:Is.rows.map((e,t)=>(0,Pe.jsx)(P.default,{style:{height:Is.rowHeights[t],flexDirection:'row',gap:te.GRID_GAP},children:e.map(e=>{const t=ps.find(t=>t.id===e);return(0,Pe.jsxs)(P.default,{testID:`area-cell-${e}`,style:{width:Is.cellW,gap:2},children:[Ds(t),(0,Pe.jsx)(P.default,{style:{flex:1},children:ms(e)})]},e)})},t))}):null}),Ss=(0,Pe.jsxs)(P.default,{testID:"venue-plan",style:{flex:qe?void 0:1,gap:10,minWidth:0},children:[(0,Pe.jsx)(a.TableNumberWarning,{plan:kt}),kt.tables.length?null:(0,Pe.jsxs)(P.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Pe.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Pe.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,Pe.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Pe.jsx)(Ge,{chipId:"all",compact:!qe,label:"Whole venue",selected:'all'===fs,onPress:()=>Bt('all')},"__all"),...ps.map(e=>(0,Pe.jsx)(Ge,{chipId:e.id,compact:!qe,label:`${e.name}${(0,le.areaMarks)(e)}`,colour:(0,K.brandColour)(e.colour),sub:qe?Il.has(e.id)?'closed':fs===e.id?xs(e.id):void 0:void 0,selected:fs===e.id,onPress:()=>Bt(e.id)},e.id))];return qe?(0,Pe.jsx)(P.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Pe.jsx)(H.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;cl(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>cl(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:dl.view>0&&dl.content>0&&dl.content<=dl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:dl.view>0&&dl.content<=dl.view+1?'100%':void 0},children:e})})(),(0,Pe.jsx)(h.FloorLegend,{}),ys,Wt?(0,Pe.jsxs)(A.Row,{gap:8,style:{backgroundColor:K.colours.goldTint,borderRadius:10,padding:8},children:[(0,Pe.jsxs)(A.T,{weight:"semibold",colour:K.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Wt),": tap the new table."]}),(0,Pe.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Mt(null)})]}):null,'all'===fs&&Qe?vs:'all'===fs?(0,Pe.jsx)(P.default,{style:{flex:qe?void 0:1,gap:12,minHeight:Je?void 0:360},children:ks.map((e,t)=>(0,Pe.jsxs)(P.default,{style:{flex:qe?void 0:Math.max(.3,...e.map(e=>ws(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Pe.jsxs)(P.default,{style:{flex:1,gap:2},children:[qe?(0,Pe.jsxs)(P.default,{style:{alignItems:'center',gap:4},children:[(0,Pe.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{center:!0,children:xs(e.id)})]}):(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{children:xs(e.id)})]}),(0,Pe.jsx)(P.default,{style:qe?{height:Math.max(280,Math.round((Ue-40)*ws(e.id)))}:{flex:1},children:ms(e.id)})]},e.id)),e.length{if(zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},Ml)}),Ts='timeline'===vt,$s=Ct?(0,Pe.jsx)(W.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Tt(!1),supportedOrientations:['landscape','portrait'],children:(0,Pe.jsxs)(P.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:K.colours.bg,padding:10,gap:8},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Pe.jsx)(z.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Tt(!1),style:{minHeight:64,minWidth:180,paddingHorizontal:22,borderRadius:16,borderWidth:2,borderColor:K.colours.goldLight,backgroundColor:K.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Pe.jsx)(P.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Pe.jsx)(A.T,{size:22,weight:"semibold",colour:K.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${zl?(0,ve.dayLong)(Ml):'Today'}`})}),(0,Pe.jsx)(P.default,{style:{minWidth:180}})]}),Ul?Kl:(0,Pe.jsx)(P.default,{style:{flex:1,minHeight:0},children:(0,Pe.jsx)(oe.Timeline,{hideNow:!0,plan:kt,bookings:zl?El:ml,now:zl?Nl:ct,privacy:jt,turnBase:it.settings.turnMins,t0:zl?(0,V.addMins)(Nl,-Nl.getMinutes()):$l,t1:zl?(0,V.addMins)(_l,90):Bl,pauses:zl?Fl:Ll,blockedTables:zl?[]:Wl,onOpen:e=>{if(Tt(!1),zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},`full-${Ml}`)})]})}):null,Bs=zl?(0,Pe.jsxs)(P.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,backgroundColor:K.colours.goldTint},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:Pl?`Showing ${Hl} \xb7 ${(0,V.niceDate)((0,V.parseYmd)(Ml))}`:`Showing ${(0,ve.dayWord)(Ml,pt)}`}),(0,Pe.jsx)(P.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${ss}. Showing ${(0,ve.dayLong)(Ml)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Pe.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Qt(null),el(null)},style:{minHeight:44}})]}):null,Rs=(0,Pe.jsx)(P.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:qe?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(Ts||Ct);return(0,Pe.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},accessibilityHint:'timeline'===e?'Opens the timeline over the whole screen':void 0,onPress:()=>{'timeline'===e?(St('plan'),Tt(!0)):(Tt(!1),St('plan'))},style:{flex:qe?1:void 0,minHeight:qe?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?K.colours.gold:'transparent',...Be.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,Pe.jsx)(A.T,{size:qe?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ls=(0,u.useBookingWrite)(),Ws=e=>(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Walk-in",onPress:ft.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"New booking",onPress:ft.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Edit booking",onPress:()=>At(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint})]});(0,He.useDisplayNotices)(st,!e);const Ms=qe?180:168,[zs,Hs]=(0,v.useState)(Ms),Ps=S.default.useRef(Ms),Es=S.default.useRef(null),Os=S.default.useRef(null),As=()=>{const e=Es.current,t=Os.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ke<820?8:12,o=44+(Ke<820?4:8),n=i>Ps.current?Math.ceil(i-Ps.current):Ie.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Ms,Math.floor(t-s-l)-n-o));Math.abs(Ps.current-a)>=2&&(Ps.current=a,Hs(a))})})};S.default.useEffect(()=>{const e=setTimeout(As,60);return()=>clearTimeout(e)},[Ue,Ke]);const Ns=(0,Pe.jsxs)(P.default,{ref:Os,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),As()},style:{flexDirection:'row',flexWrap:Ue>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:qe?12:6,justifyContent:qe?'center':void 0,borderTopWidth:1,borderTopColor:K.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Pe.jsx)(ze.DisplayClockButton,{}),(0,Pe.jsx)(ie.HoldToEdit,{quiet:!0,onUnlock:()=>{xl(null),bl({at:Date.now()})},onHint:()=>hl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Pe.jsx)(ke.BlockBookingsButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,display:!0,day:Ml}),kt.areas.some(e=>e.outdoor)?(0,Pe.jsx)(ke.CloseGardenButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,short:!0}):null,(0,Pe.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>rl(!0),style:({pressed:e})=>({...Be.look.quiet(e),flexGrow:1}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,Pe.jsx)(p.GiftQrButton,{rid:st,venue:it.name})]}),_s=wl.length?(0,Pe.jsxs)(P.default,{testID:"takeaway-panel",style:[Be.look.panel,{overflow:'hidden'}],children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Pe.jsxs)(A.T,{size:12,colour:K.colours.muted,children:[wl.length," live"]})]}),(0,Pe.jsx)(P.default,{style:{padding:10},children:(0,Pe.jsx)(Fe,{list:wl,me:yt,compact:!0,bookings:nt})})]}):null,Gs=($e.DueToday,zl?El:ml.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Fs=zl?Pl?`${Hl}\u2019s guests`:`Guests ${Hl}`:'Today\u2019s guests',Vs=(0,Pe.jsxs)(Pe.Fragment,{children:[0===Gs.length?(0,Pe.jsx)(A.Muted,{children:zl?Ml{const t=(0,q.isSeatedHighlight)(e.status,{otherDay:zl}),l=(0,de.guestRowText)(e,{name:e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)',''),seated:t}),s=t?q.SEATED_FG:K.colours.text,i=t?q.SEATED_MUTED:K.colours.muted,o=t?q.SEATED_FG:K.colours.gold,n=l.depositWarn?K.colours.amber:t?q.SEATED_FG:K.colours.goldLight;return(0,Pe.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:zl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Ut(!1),qt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,q.seatedHighlightStyle)({backgroundColor:e?K.colours.goldLight:K.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:K.colours.hairline,backgroundColor:e?K.colours.tilePressed:'transparent'},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Pe.jsx)(P.default,{style:{paddingTop:2},children:(0,Pe.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':K.colours.amber,ink:t?K.colours.gold:K.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Pe.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,Pe.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,Pe.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,Pe.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,Pe.jsx)(P.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Pe.jsx)(ce.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,Pe.jsx)(Te.CancellationsSection,{items:ls,dayWord:zl?Pl?Hl.toLowerCase():`on ${Hl}`:'today'})]}),Us=(0,Pe.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Vs}),Ks=M.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Ut(!1)}}),qs=(0,Pe.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Fs}, ${Gs.length}`,accessibilityState:{expanded:Vt},'aria-expanded':Vt,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Ut(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:Vt?K.colours.gold:K.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?K.colours.tilePressed:Vt?K.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Pe.jsx)(A.T,{size:16,weight:"bold",colour:K.colours.gold,children:Gs.length}),(0,Pe.jsx)(P.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(P.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Pe.jsxs)(A.T,{size:13,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,children:[Fs," ",Vt?'\u2039':'\u203a']})})})]}),Ys=Vt?(0,Pe.jsxs)(P.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Pe.jsxs)(P.default,{testID:"guests-drawer",...Ks.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ue)),backgroundColor:K.colours.surface,borderRightWidth:1,borderColor:K.colours.gold,borderRadius:14,...Be.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Fs.toUpperCase()," (",Gs.length,")"]}),ts.count?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:ss}):null,(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Fs}`,onPress:()=>Ut(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:18,colour:K.colours.muted,children:"\u2715"})})]}),Us]}),(0,Pe.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Fs}`,accessibilityRole:"button",onPress:()=>Ut(!1),style:{flex:1}})]}):null,Qs=Ul?Kl:l.IS_KIRKTON&&!Object.values(it.kitchenHours??{}).some(Boolean)?(0,Pe.jsxs)(P.default,{testID:"kirkton-hours-to-confirm",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Pe.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,Pe.jsx)(Ie.DayGraph,{busyThreshold:(0,t.venueBusy)(it,nt,ct).busy,todays:El,open:Nl,close:_l,now:ct,turnBase:it.settings.turnMins,blocks:is,pauses:Fl,compact:qe,dense:!qe,height:Qe?zs:Ms,forecastNote:zl?void 0:hs,emptyText:ql,past:Ml{zl?Ut(!0):Tt(!0)},ei=(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',padding:Ke<820?8:12,paddingTop:Ke<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[xt?null:qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[xt?null:Bs,xt?(0,Pe.jsx)(H.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"})}):Ts?Cs:Ss,$s,Ys]}),(0,Pe.jsxs)(P.default,{testID:"display-side",style:{width:Xe,gap:Ke<820?4:8,minHeight:0},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Ws(!1)}),(0,Pe.jsx)(P.default,{style:{flexShrink:0},children:Rs}),xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:Ke<820,snug:Ke<820,tight:Ke<700,aside:`${Xl.length} ${1===Xl.length?'table':'tables'} booked${wl.length?` \xb7 ${wl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{ref:Es,testID:"day-graph-slot",onLayout:As,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Js}),(0,Pe.jsxs)(H.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,Pe.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Pe.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),_s,(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt})]})]})]});return(0,Pe.jsxs)(O.SafeAreaView,{style:{flex:1,backgroundColor:K.colours.bg},onTouchStart:()=>{Zt.current=Date.now()},onMouseDown:()=>{Zt.current=Date.now()},children:[qe?(0,Pe.jsxs)(P.default,{style:{flex:1},children:[(0,Pe.jsxs)(H.default,{ref:Ze,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Pe.jsx)(P.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Pe.jsx)(f.ExitButton,{})}),(0,Pe.jsx)(G.RestaurantLogo,{rid:st,size:64}),(0,Pe.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:it.name}),(0,Pe.jsx)(G.PoweredBy,{}),(0,Pe.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Pe.jsx)(P.default,{accessible:!0,accessibilityLabel:`Current time ${(0,V.hm)(ct)}`,children:(0,Pe.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:K.colours.goldLight,children:(0,V.hm)(ct)})}),(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:"m"}),(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:"m"}),F]}),We,Xs,(0,Pe.jsx)(P.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Pe.jsx)(_e,{phone:!0,split:es,items:[{label:`Tables \xb7 ${Hl}`,value:Xl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Hl}`,value:Zl,testID:'badge-covers'},{label:'Takeaway',value:wl.length,alert:wl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Et(!0)}]})}),(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{gap:8},children:Ws(!0)}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),Rs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[Ts?Cs:Ss,$s]}),(0,Pe.jsxs)(P.default,{onLayout:e=>{et.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Be.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Pe.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:K.colours.goldLight,accessibilityRole:"header",children:[Fs," (",Gs.length,")"]}),(0,Pe.jsx)(P.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{gap:4},children:Vs})]}),_s,Js,(0,Pe.jsx)(P.default,{testID:"covers-dock",children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Ze.current?.scrollTo({y:et.current,animated:!0})})}),(0,Pe.jsxs)(P.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Pe.jsx)(A.T,{center:!0,size:14,colour:jt?K.colours.muted:K.colours.amber,children:jt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Pe.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,Pe.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ns]}),e?null:(0,Pe.jsx)(P.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:K.colours.hairline},children:(0,Pe.jsx)(R.VoiceSlot,{size:56})})]}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ue>=1e3?18:14,paddingVertical:Ke<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Be.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,Pe.jsx)(P.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Pe.jsx)(G.RestaurantBrand,{rid:it.id,size:Ue<900?32:40,beside:!0})}),(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Pe.jsx)(A.T,{size:Ue<900?18:21,weight:"semibold",colour:K.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,V.hm)(ct)}),Ue>=900?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:(0,V.niceDate)(ct)}):null]})]}),xt?(0,Pe.jsx)(P.default,{style:{width:220}}):(0,Pe.jsx)(P.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:Xs}),(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:Ue<900?'xs':Ue<1100||Ke<700?'s':'m'}),(0,Pe.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.muted,children:"?"})}),'simulated'===dt?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>rt(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:11,colour:K.colours.muted,children:"+15"})}):null,e?null:(0,Pe.jsx)(f.ExitButton,{}),F,Me?null:(0,Pe.jsx)(R.VoiceSlot,{size:44})]})]}),We,xt?null:(0,Pe.jsxs)(P.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,Pe.jsx)(_e,{splitOnly:!0,split:es,items:[]}),(0,Pe.jsx)(P.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ue>=1e3?18:14)+(e?0:52)+('simulated'===dt?52:0),zIndex:4},children:(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:Ue<1100||Ke<700?'s':'m'})})]}),Qe?ei:(ti=(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Ws(!1)}),Rs]}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),xt?(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"}):(0,Pe.jsx)(Pe.Fragment,{children:(0,Pe.jsxs)(P.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Bs,Ts?Cs:Ss,$s,Ys]})]})}),_s,xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Ms+Ie.DAY_GRAPH_CHROME},children:Js})]}),(0,Pe.jsx)(H.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:ti})),Ns]}),(0,Pe.jsx)(j.SoldOutStrip,{rid:st,by:yt,onOpen:()=>rl(!0)}),(0,Pe.jsx)(w.SoldOutSheet,{visible:al,onClose:()=>rl(!1),rid:st,by:yt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Pe.jsx)(y.TableOrderCue,{rid:st}),ft.elements,Ot?(0,Pe.jsx)(b.EditBookingPicker,{rid:st,today:pt,who:yt,hidePrivate:!0,onClose:()=>At(!1)}):null,Nt?(0,Pe.jsx)(b.EditBookingSheet,{rid:st,id:Nt,who:yt,hidePrivate:!0,onClose:()=>_t(null)}):null,Rt?(0,Pe.jsx)(pe.TableSheet,{rid:st,name:Rt,view:vl,plan:kt,todays:ml,now:ct,privacy:jt,turnBase:it.settings.turnMins,onClose:()=>Lt(null),onWalkIn:e=>ft.openWalkInAt(e),onMove:e=>Mt(e),onDetails:fl}):null,Ql?(()=>{const e=Yl[Ql],t=e?.dayBookings??[];return(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>Jl(null),title:`${(0,r.tableNumbers)(Ql)} \xb7 ${Pl?Hl:(0,ve.dayLong)(Ml)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${Pl?Hl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${Pl?Hl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,re.privName)(e,jt):Oe(e.name);return(0,Pe.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,be.tablesWords)((0,X.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Jl(null),qt(e.id)},style:{minHeight:56}},e.id)}),(0,Pe.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>Jl(null),style:{minHeight:56}})]})})():null,Kt?(()=>{const e=nt.find(e=>e.id===Kt);return e?(0,Pe.jsx)(ue.GuestActionsSheet,{rid:st,b:e,name:e.walkIn?(0,re.privName)(e,jt):Oe(e.name),view:vl,now:ct,otherDay:e.date!==pt,turnBase:it.settings.turnMins,onClose:()=>qt(null),onDetails:fl,onDone:hl,onPickOnPlan:(e,t)=>{Ut(!1),St('plan'),Bt('all'),Qt({id:e.id,tables:t})}}):null})():null,zt?(0,Pe.jsx)(pe.DetailsPanel,{title:zt.title,onClose:()=>Ht(null),children:zt.body}):null,Gt?(0,Pe.jsx)(pe.ServiceSummary,{r:it,todays:ml,orders:ot,waitlistAll:tl,walkInCount:ll,onClose:()=>Ft(!1)}):null,sl?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>il(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Pe.jsx)(h.FloorLegend,{}),(0,Pe.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>il(!1)})]}):null,ol?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>nl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Pe.jsx)(N.ReviewsSection,{rid:st,mode:"read",venueName:it.name}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>nl(!1)})]}):null,Pt?(0,Pe.jsxs)(pe.DetailsPanel,{title:"Takeaway",onClose:()=>Et(!1),children:[(0,Pe.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Pe.jsx)(Fe,{list:wl,me:yt,bookings:nt})]}):null,gl?(0,Pe.jsx)(P.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:K.colours.bg},children:(0,Pe.jsx)(se.PlanDesigner,{initial:kt,venue:it.name,mode:"display",startStep:"arrange",onActivity:()=>{yl.current=Date.now(),null!==pl&&xl(null)},notice:null!==pl?`Locking again in ${pl} s \xb7 touch to keep editing`:null,onSave:e=>{X.useFloor.getState().setPlan(st,e),bl(null),hl('Table plan saved. Editing is locked again.')},onCancel:()=>{bl(null),hl('No changes kept. Editing is locked again.')}},gl.at)}):null,e?null:(0,Pe.jsx)(ne.Screensaver,{rid:st,idleMins:mt.idleMins,pinOn:mt.pinOn,wake:mt,tonightCards:mt.tonightCards,cfg:wt}),e?null:(0,Pe.jsx)(fe.PrintHost,{rid:st}),e?null:(0,Pe.jsx)(xe.AlertHost,{variant:"display",rid:st,skipTakeaway:!0}),e?null:(0,Pe.jsx)(B.SeatAllergenReminder,{rid:st}),e?null:(0,Pe.jsx)(me.TakeawayTakeover,{rid:st,me:yt})]});var ti};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),M=e(_r(_d[31])),z=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=e(_r(_d[35])),O=_r(_d[36]),A=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),Me=_r(_d[85]),ze=_r(_d[86]),He=_r(_d[87]),Pe=_r(_d[88]);const Ee=12e4,Oe=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Ne=e=>e.slotTime?(0,V.hm)(new Date(e.slotTime)):'ASAP';function _e({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,Pe.jsxs)(P.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,Pe.jsx)(P.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,Pe.jsxs)(P.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,Pe.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?K.colours.amber:K.colours.text,children:e.value}),(0,Pe.jsx)(A.T,{size:l?14:12,colour:K.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Pe.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,Pe.jsx)(P.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,Pe.jsx)(A.T,{size:14,colour:K.colours.muted,children:"No Covers yet"}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:K.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,Pe.jsxs)(P.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:K.colours.gold},children:[(0,Pe.jsx)(P.default,{style:{width:`${s.walkInPct}%`,backgroundColor:K.colours.gold}}),(0,Pe.jsx)(P.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function Ge({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,Pe.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,Pe.jsx)(P.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,Pe.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?K.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,Pe.jsx)(A.T,{size:12,colour:K.colours.muted,children:l}):null]})}function Fe({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,Me.statusBlock)(e,t,(0,Me.linkedBooking)(e,s));return e.length?(0,Pe.jsx)(P.default,{style:{gap:8},children:e.map(e=>(0,Pe.jsxs)(P.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:K.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?K.colours.ok:e.allergies.length?K.colours.red:K.colours.gold},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Ne(e)," \xb7 ",Oe(e.customerName)]}),(0,Pe.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,Pe.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:K.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,F.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Pe.jsx)(We.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Pe.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Pe.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>U.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Pe.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Pe.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Pe.jsx)(fe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Pe.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Ve({rid:e,id:t,turnBase:l}){const s=(0,U.useBookings)(e).find(e=>e.id===t);return s?(0,Pe.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1279,[1121,5,6,1280,798,822,1094,829,1120,1281,1282,1283,1091,1115,1284,1285,1287,1288,1289,1130,977,1099,1290,34,1073,1148,1033,1087,1116,1291,395,380,402,295,102,426,36,794,1186,1190,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1292,1107,1293,1296,1298,1301,1304,1300,1305,1307,1308,1112,1093,1095,852,1310,1175,1311,1185,1177,1011,1316,1324,1326,1076,1114,1328,1329,1330,1143,1331,1142,1136,838,1332,1333,25]); __d(function(g,_r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.queuedServiceSessions=u,e.queuedServicePauses=function(n,t,s){const i=u(n,t);return i?i.slice(1).flatMap((n,t)=>{const u=i[t][1],r=n[0];return u!!t.walkIn||'walk-in'===t.source},1281,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useBookingWrite=function(){const t=(0,s.useSignedIn)(),c=(0,n.canChangeBookings)(t);return{ok:c,hint:c?void 0:n.BOOKING_VIEW_ONLY,lock:s=>c?{disabled:!1,accessibilityLabel:s}:{disabled:!0,accessibilityLabel:s,accessibilityHint:n.BOOKING_VIEW_ONLY}}};var n=r(d[0]),s=r(d[1])},1282,[1012,1100]); @@ -1463,7 +1463,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";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LaunchWelcome=function({p:e,onDone:t}){(0,r.useEffect)(()=>{if(!z||document.getElementById('cc-launch-css'))return;const e=document.createElement('style');e.id='cc-launch-css',e.textContent=I,document.head.appendChild(e)},[]),(0,r.useEffect)(()=>{if(z)return document.documentElement.classList.add('cc-welcome'),()=>document.documentElement.classList.remove('cc-welcome')},[]);const[o,k]=(0,r.useState)(P()?0:3),[O,N]=(0,r.useState)('main'),[W,H]=(0,r.useState)(''),[M,_]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(o<=0)return;const e=setTimeout(()=>k(e=>e-1),300);return()=>clearTimeout(e)},[o]);const B=(0,f.useAvatars)(t=>!!t.photos[e.id]),V=(0,b.useStore)(e=>e.restaurants[0]?.name??'Your venue').toUpperCase(),G=(0,x.useOwner)(t=>t.hourly[e.id]),K=(0,x.useOwner)(t=>t.staff.find(t=>t.id===e.id)),$=(0,y.useSync)(e=>e.mode),q='live'===$||'offline'===$,J=K?.salaried||e.salaried?'Salaried':null!=G?`\xa3${(G/100).toFixed(2)} an hour${K?.noTax?' \xb7 no-tax code':''}`:'connecting'===$?'Loading\u2026':'Ask your manager',Q='staff'!==e.app&&'staff'!==p.APP_VARIANT?(0,j.appUrl)('staff'):null,X=`AN-${String(v.ROSTER.findIndex(t=>t.id===e.id)+1).padStart(2,'0')}`,Z=j.APP_NAME['staff'===p.APP_VARIANT?'staff':e.app],ee=L['staff'===p.APP_VARIANT&&'staff'!==e.app?'Staff':e.level]??L.Staff;return(0,C.jsxs)(h.default,{testID:"invite-welcome",style:[u.default.absoluteFill,{backgroundColor:(0,n.soutersSurface)('#000'),zIndex:1e3}],children:[(0,C.jsxs)(h.default,{...R('space'),pointerEvents:"none",children:[(0,C.jsx)(h.default,{...R('stars1')}),(0,C.jsx)(h.default,{...R('stars2')})]}),o>0?(0,C.jsxs)(l.default,{testID:"invite-countdown",accessibilityLabel:"Skip intro",onPress:()=>k(0),style:{flex:1,alignItems:'center',justifyContent:'center',gap:10},children:[(0,C.jsxs)(E,{colour:w.colours.muted,children:[V," \xb7 COVER CHARGE"]}),(0,C.jsx)(h.default,{...R('count'),children:(0,C.jsx)(T.T,{size:120,weight:"bold",colour:A,children:o})},o),(0,C.jsx)(E,{children:"GETTING YOU ON BOARD"})]}):'selfie'===O?(0,C.jsx)(F,{p:e,onClose:e=>{N('main'),e?(H('Avatar saved. Looking good!'),_(e=>e+1)):H('')}}):(0,C.jsxs)(c.default,{contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsxs)(h.default,{...R('rise1'),style:{alignItems:'center',gap:2},children:[(0,C.jsxs)(E,{children:[V," \xb7 ",Z.toUpperCase()]}),(0,C.jsx)(T.T,{size:20,colour:w.colours.muted,center:!0,style:{marginTop:10},children:"Welcome aboard,"}),(0,C.jsx)(T.T,{size:42,weight:"bold",center:!0,style:{lineHeight:50},children:e.name})]}),(0,C.jsxs)(h.default,{...R('reveal'),style:{marginVertical:8},children:[(0,C.jsx)(h.default,{...R('orbit'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:156})})]},M),W?(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:w.colours.ok,center:!0,children:W}):null,(0,C.jsx)(h.default,{...R('rise2'),style:{alignSelf:'stretch'},children:(0,C.jsxs)(h.default,{testID:"invite-crew-card",...R('card'),style:{borderRadius:20,borderWidth:1,borderColor:'rgba(207,164,95,0.55)',overflow:'hidden',padding:18,gap:12},children:[(0,C.jsx)(h.default,{...R('sheen'),pointerEvents:"none"}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},children:[(0,C.jsx)(E,{children:"CREW ID"}),(0,C.jsx)(T.T,{size:15,weight:"semibold",colour:w.colours.muted,style:{letterSpacing:1.5},children:X})]}),(0,C.jsx)(h.default,{style:{height:2,backgroundColor:A,opacity:.7,borderRadius:1}}),(0,C.jsx)(Y,{k:"NAME",v:e.name}),(0,C.jsx)(Y,{k:"ROLE",v:(0,j.levelJob)(e.level,e.job)}),(0,C.jsx)(Y,{k:"APP",v:Z}),'owner'!==e.role?(0,C.jsx)(h.default,{testID:"invite-pay",children:(0,C.jsx)(Y,{k:"PAY",v:J})}):null,(0,C.jsx)(Y,{k:"ACCESS",v:'Owner'===e.level?'Everything':'Manager'===e.level?'Manager':'Supervisor'===e.level?'Supervisor':'Head Chef'===e.level?'Kitchen lead':'Team member'}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,C.jsx)(h.default,{...R('blink'),style:{width:10,height:10,borderRadius:5,backgroundColor:w.colours.ok}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.ok,children:"Signed in on this phone"})]})]})}),(0,C.jsxs)(h.default,{...R('rise3'),style:{alignSelf:'stretch',gap:10},children:[(0,C.jsx)(E,{children:"WHAT YOU CAN DO"}),ee.map(e=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'flex-start'},children:[(0,C.jsx)(T.T,{size:16,colour:A,children:"\u25c6"}),(0,C.jsx)(T.T,{size:16,style:{flex:1},children:e})]},e))]}),z?(0,C.jsxs)(h.default,{testID:"invite-avatar-offer",...R('rise4'),style:{alignSelf:'stretch',gap:12,borderRadius:20,padding:18,borderWidth:1,borderColor:'rgba(255,255,255,0.14)',backgroundColor:'rgba(255,255,255,0.03)'},children:[(0,C.jsx)(E,{children:"YOUR AVATAR \xb7 OPTIONAL"}),(0,C.jsx)(T.T,{size:16,children:B?'You made your own avatar from a photo.':'Keep this one, choose an original icon, or make your own from a photo.'}),(0,C.jsx)(D,{kind:"ghost",label:B?'Choose another avatar':'Choose my avatar',testID:"invite-avatar-make",onPress:()=>{H(''),N('selfie')}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.muted,children:"Your photo stays on this phone. It\u2019s turned into your avatar here; only the finished avatar is shared with your team."})]}):null,(0,C.jsx)(h.default,{style:{alignSelf:'stretch',gap:10,marginTop:4},children:(0,C.jsx)(D,{label:B?'Get started':'Skip, keep this one and get started',testID:"invite-get-started",onPress:t})}),(0,s.inPhoneApp)()?null:(0,C.jsxs)(h.default,{style:{alignSelf:'stretch',gap:6,borderRadius:16,padding:16,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:[(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:A,children:"Tip: add it to your Home screen"}),(0,C.jsxs)(T.T,{size:15,children:[U()," It then opens like a normal app and remembers you."]})]}),Q?(0,C.jsx)(l.default,{accessibilityRole:"link",onPress:()=>{z&&window.location.assign(Q)},children:(0,C.jsx)(T.T,{size:15,colour:A,center:!0,children:"Also open CoverCharge for Staff (your clock-in, rota and pay) \u203a"})}):null,(0,C.jsx)(T.T,{size:14,colour:w.colours.muted,center:!0,children:q?'Connected: bookings, orders and stock are shared live with the rest of the team. Your pay is only visible to you and your managers.':'Connecting\u2026 if there\u2019s no signal, what you enter is kept on this phone and shared once you\u2019re back online.'})]})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]),s=_r(d[3]),o=e(_r(d[4]));_r(d[5]);var l=e(_r(d[6])),c=e(_r(d[7])),u=e(_r(d[8])),h=e(_r(d[9])),p=_r(d[10]),f=_r(d[11]),x=_r(d[12]),b=_r(d[13]),y=_r(d[14]),j=_r(d[15]),v=_r(d[16]),k=_r(d[17]),w=_r(d[18]),S=_r(d[19]),T=_r(d[20]),C=_r(d[21]);const A=w.colours.gold,I="\n[data-cc=\"space\"]{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;background:radial-gradient(ellipse at 50% 115%,#2a1f0c 0%,#0a0805 38%,#000 70%)}\n[data-cc=\"stars1\"],[data-cc=\"stars2\"]{position:absolute;top:-50%;left:-50%;width:200%;height:200%;will-change:transform}\n[data-cc=\"stars1\"]{background-image:radial-gradient(1.2px 1.2px at 23px 41px,#fff,transparent),radial-gradient(1px 1px at 97px 13px,#fff9,transparent),radial-gradient(1.4px 1.4px at 151px 120px,#f5e6c8,transparent),radial-gradient(1px 1px at 61px 163px,#fffa,transparent),radial-gradient(1.2px 1.2px at 183px 77px,#fff8,transparent);background-size:211px 199px;animation:cc-drift 90s linear infinite;opacity:.75}\n[data-cc=\"stars2\"]{background-image:radial-gradient(2px 2px at 40px 60px,#CFA45F,transparent),radial-gradient(1.6px 1.6px at 250px 210px,#fff,transparent),radial-gradient(1.8px 1.8px at 330px 40px,#fffc,transparent);background-size:397px 367px;animation:cc-drift2 60s linear infinite,cc-twinkle 3.2s ease-in-out infinite alternate;opacity:.8}\n@keyframes cc-drift{to{transform:translate3d(-211px,199px,0)}}\n@keyframes cc-drift2{to{transform:translate3d(-397px,367px,0)}}\n@keyframes cc-twinkle{from{opacity:.45}to{opacity:.95}}\n[data-cc=\"count\"]{animation:cc-count .32s cubic-bezier(.2,.8,.2,1) both}\n@keyframes cc-count{from{opacity:0;transform:scale(1.9)}to{opacity:1;transform:scale(1)}}\n[data-cc=\"reveal\"]{animation:cc-reveal .75s cubic-bezier(.2,.9,.25,1.25) both}\n@keyframes cc-reveal{0%{opacity:0;transform:scale(.35) rotate(-12deg)}100%{opacity:1;transform:scale(1) rotate(0)}}\n[data-cc=\"halo\"]{border-radius:999px;box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 38px 6px rgba(207,164,95,.35);animation:cc-glow 2.6s ease-in-out infinite}\n@keyframes cc-glow{0%,100%{box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 30px 4px rgba(207,164,95,.28)}50%{box-shadow:0 0 0 2px rgba(207,164,95,1),0 0 52px 10px rgba(207,164,95,.5)}}\n[data-cc=\"orbit\"]{position:absolute;top:-14px;left:-14px;right:-14px;bottom:-14px;border-radius:999px;border:1px dashed rgba(207,164,95,.45);animation:cc-spin 14s linear infinite}\n@keyframes cc-spin{to{transform:rotate(360deg)}}\n[data-cc=\"rise1\"],[data-cc=\"rise2\"],[data-cc=\"rise3\"],[data-cc=\"rise4\"]{animation:cc-rise .5s cubic-bezier(.2,.8,.2,1) both}\n[data-cc=\"rise2\"]{animation-delay:.12s}[data-cc=\"rise3\"]{animation-delay:.24s}[data-cc=\"rise4\"]{animation-delay:.36s}\n@keyframes cc-rise{from{opacity:0;transform:translate3d(0,18px,0)}to{opacity:1;transform:none}}\n[data-cc=\"btn\"]{transition:transform .12s ease,box-shadow .2s ease,filter .2s ease;cursor:pointer}\n[data-cc=\"btn\"]:hover{filter:brightness(1.08)}\n[data-cc=\"btnp\"]{transition:transform .12s ease,box-shadow .2s ease;cursor:pointer;box-shadow:0 0 0 1px rgba(207,164,95,.9),0 8px 30px rgba(207,164,95,.35)}\n[data-cc=\"btnp\"]:hover{box-shadow:0 0 0 1px #CFA45F,0 8px 44px rgba(207,164,95,.6)}\n[data-cc=\"card\"]{background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.02));backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}\n[data-cc=\"sheen\"]{position:absolute;top:0;bottom:0;width:40%;left:-60%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.10),transparent);animation:cc-sheen 3.8s ease-in-out 1s infinite}\n@keyframes cc-sheen{0%{left:-60%}35%,100%{left:130%}}\n[data-cc=\"scan\"]{position:absolute;left:0;right:0;height:4px;background:linear-gradient(90deg,transparent,#CFA45F,#fff,#CFA45F,transparent);box-shadow:0 0 18px 4px rgba(207,164,95,.75);animation:cc-scan .9s ease-in-out infinite alternate}\n@keyframes cc-scan{from{top:2%}to{top:96%}}\n[data-cc=\"grid\"]{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(rgba(207,164,95,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(207,164,95,.18) 1px,transparent 1px);background-size:22px 22px}\n[data-cc=\"blink\"]{animation:cc-blink 1s steps(2,start) infinite}\n@keyframes cc-blink{to{visibility:hidden}}\nhtml.cc-welcome #cc-install-hint{display:none !important}\n@media (prefers-reduced-motion: reduce){[data-cc]{animation:none !important;transition:none !important}}\n",R=e=>({dataSet:{cc:e}}),z='undefined'!=typeof document,P=()=>z&&'function'==typeof window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches,O=()=>{try{z&&navigator.vibrate?.(12)}catch{}};function D({label:e,onPress:t,kind:n="primary",testID:r,disabled:s}){const o='primary'===n;return(0,C.jsx)(l.default,{testID:r,accessibilityRole:"button",accessibilityLabel:e,disabled:s,onPress:()=>{O(),t()},...R(o&&!s?'btnp':'btn'),style:({pressed:e})=>[{alignSelf:'stretch',minHeight:56,borderRadius:28,alignItems:'center',justifyContent:'center',paddingHorizontal:20,backgroundColor:o?A:'rgba(255,255,255,0.04)',borderWidth:o?0:1.5,borderColor:A,opacity:s?.45:1,transform:[{scale:e?.96:1}]}],children:(0,C.jsx)(T.T,{size:18,weight:"semibold",colour:o?'#0B0B0B':A,center:!0,children:e})})}const E=({children:e,colour:t=A})=>(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:t,style:{letterSpacing:2.2},children:e}),L={Owner:['Takings, sales, labour cost and payroll','Bookings (Tables and Covers), orders, the rota and team chat','Every setting, plus the Assistant for quick answers'],Manager:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],Supervisor:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],'Head Chef':['Stock, costings, prep, ordering and the specials board','Food safety checks, allergens and live tickets','Your own clock-in, rota and pay in the Staff app'],Staff:['Clock in and out, see your rota, swap shifts, ask for time off','Team chat, food safety checks and the accident book','Your own hours, pay and tips (only yours)']};function U(){const e=z?navigator.userAgent:'';return/iPhone|iPad|iPod/.test(e)?'In Safari, tap Share (the square with an arrow), then Add to Home Screen.':/SamsungBrowser/.test(e)?'Tap the menu, then Add page to, then Home screen.':'In Chrome, tap \u22ee then Add to Home screen (or Install app).'}const Y=({k:e,v:t})=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'baseline'},children:[(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:w.colours.muted,numberOfLines:1,style:{width:74,letterSpacing:1.2},children:e}),(0,C.jsx)(T.T,{size:18,weight:"semibold",style:{flex:1},children:t})]});function F({p:e,onClose:s}){const[u,p]=(0,r.useState)('choose'),[x,b]=(0,r.useState)(null),[y,j]=(0,r.useState)(null),[v,I]=(0,r.useState)(!1),[z,L]=(0,r.useState)(''),U=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{U.current&&URL.revokeObjectURL(U.current)},[]);const Y=async e=>{L('');const t=await(0,k.pickPhoto)(e);if(!t)return;U.current&&URL.revokeObjectURL(U.current);const n=URL.createObjectURL(t);U.current=n,b(n),I(!1),p('scan');const r=Date.now();try{const e=await(0,k.styliseOnDevice)(t),n=P()?0:Math.max(0,1300-(Date.now()-r));setTimeout(()=>{j(e),p('reveal'),O()},n)}catch{L("That photo couldn't be opened. Try another one (JPEG or PNG)."),p('choose')}},F=({children:e})=>(0,C.jsx)(h.default,{style:{width:236,height:236,borderRadius:118,overflow:'hidden',borderWidth:2,borderColor:A,alignItems:'center',justifyContent:'center',backgroundColor:(0,n.soutersSurface)('#050505')},children:e});return(0,C.jsxs)(c.default,{testID:"invite-avatar-step",contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsx)(E,{children:"MAKE YOUR AVATAR"}),(0,C.jsx)(T.T,{size:28,weight:"bold",center:!0,children:'choose'===u?'Choose your look':'scan'===u?'Scanning\u2026':`Looking good, ${e.name}`}),'choose'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(F,{children:[(0,C.jsx)(h.default,{style:{opacity:.55},children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:200,ring:!1})}),(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"})]})})}),(0,C.jsx)(T.T,{size:16,center:!0,colour:w.colours.muted,children:"Take a selfie or pick a photo. Your phone turns it into a space-age avatar. The photo never leaves this phone and isn\u2019t kept."}),(0,C.jsx)(D,{label:"Take a selfie",testID:"avatar-selfie",onPress:()=>Y(!0)}),(0,C.jsx)(D,{kind:"ghost",label:"Upload a photo",testID:"avatar-upload",onPress:()=>Y(!1)}),(0,C.jsx)(h.default,{style:{width:'100%',minWidth:0},children:(0,C.jsx)(t.AvatarOptions,{onSelect:t=>{f.useAvatars.getState().setOwn(e.id,e.id,t.dataUrl,e.name)?s(!0):L('Could not save your avatar. Try again.')}})})]}):'scan'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(F,{children:[x?(0,C.jsx)(o.default,{source:{uri:x},style:{width:236,height:236},accessibilityLabel:"Your photo"}):null,(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('scan'),pointerEvents:"none"})]})}),(0,C.jsx)(E,{colour:w.colours.muted,children:"MAKING YOUR AVATAR ON THIS PHONE"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:y?(0,C.jsx)(o.default,{testID:"avatar-result",source:{uri:y},style:{width:220,height:220,borderRadius:110},accessibilityLabel:"Your new avatar"}):null})}),(0,C.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityState:{checked:v},accessibilityLabel:"I agree to use this avatar",testID:"avatar-consent",onPress:()=>{O(),I(!v)},style:{alignSelf:'stretch',flexDirection:'row',gap:12,alignItems:'flex-start',padding:14,borderRadius:16,borderWidth:1.5,borderColor:v?A:'rgba(255,255,255,0.2)'},children:[(0,C.jsx)(h.default,{style:{width:28,height:28,borderRadius:8,borderWidth:2,borderColor:A,backgroundColor:v?A:'transparent',alignItems:'center',justifyContent:'center'},children:v?(0,C.jsx)(T.T,{size:17,weight:"bold",colour:"#111",children:"\u2713"}):null}),(0,C.jsx)(T.T,{size:15,style:{flex:1},children:"I\u2019m happy for this avatar, made from my photo, to be shown to my team in CoverCharge. Only the finished avatar is shared; my photo isn\u2019t uploaded or kept, and a manager can reset my avatar."})]}),(0,C.jsx)(D,{label:"Use this avatar",testID:"avatar-save",disabled:!v,onPress:()=>{if(!y)return;f.useAvatars.getState().setOwn(e.id,e.id,y,e.name)?(U.current&&URL.revokeObjectURL(U.current),U.current=null,s(!0)):L("Couldn't save the avatar. Please try again.")}}),(0,C.jsx)(D,{kind:"ghost",label:"Try another photo",onPress:()=>{j(null),p('choose')}})]}),z?(0,C.jsx)(T.T,{size:15,colour:w.colours.red,center:!0,children:z}):null,'scan'!==u?(0,C.jsx)(l.default,{testID:"invite-avatar-done",accessibilityRole:"button",onPress:()=>{O(),s(!1)},style:({pressed:e})=>({padding:12,transform:[{scale:e?.96:1}]}),children:(0,C.jsx)(T.T,{size:17,weight:"semibold",colour:w.colours.text,children:"Skip, keep this one"})}):null]})}},1380,[927,798,34,1072,336,236,402,295,41,102,846,924,865,800,985,997,15,793,840,899,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}),_e.StaffHome=function({go:e}){const L=(0,m.useInStaffApp)(),{now:N,meId:A,me:O,r:R,today:z}=(0,m.useCtx)(3e4),H=(0,s.useTravelDay)('staff',z),P=(0,h.useOwner)(e=>e.shifts),F=(0,h.useOwner)(e=>e.attendance),_=(0,h.useOwner)(e=>e.staffCanViewSuppliers),E=(0,h.useOwner)(e=>e.quickLinks),W=(0,h.useOwner)(e=>e.chat),q=(0,h.useOwner)(e=>e.swaps),V=(0,h.useOwner)(e=>e.leave),G=P.filter(e=>e.staffId===A&&e.published&&e.date>=z).sort((e,s)=>e.date.localeCompare(s.date)||e.start-s.start),U=G.find(e=>e.date===z),Y=F.filter(e=>e.staffId===A&&e.in&&!e.out&&N.getTime()-new Date(e.in).getTime()<72e6).sort((e,s)=>s.in.localeCompare(e.in))[0],Q=(0,x.usePay)(A,0),K=(0,b.useOrders)(R.id),J=(0,b.useBookings)(R.id),X=K.filter(e=>(0,T.LIVE)(e)&&e.allergies.length&&(0,k.nextStep)(e,(0,k.linkedBooking)(e,J))),Z=J.filter(e=>e.date===z&&['confirmed','seated'].includes(e.status)&&(0,k.bookingNeedsAction)(e,K.filter(T.LIVE))),ee=J.filter(e=>(0,S.undoKind)(e,z)||e.walkIn&&'cancelled'===e.status&&e.date===z).sort((e,s)=>e.time.localeCompare(s.time)).slice(0,12),se=W.filter(e=>'all'===e.ch&&e.pinned&&!e.removed).slice(-1)[0],te=q.filter(e=>e.fromId===A&&'open'===e.status).length+V.filter(e=>e.staffId===A&&'pending'===e.status).length,ie=[['Clock in / out',()=>e('more','clock')],['My rota, swaps & time off',()=>e('more','rota')],['Staff chat',()=>e('chat')],['Recipe cards',()=>e('more','recipecards')],['My hours & pay',()=>e('more','mypay')],['My tips',()=>e('more','mytips')],['Post to social (draft)',()=>e('more','social')],..._?[['Suppliers',()=>e('more','suppliers')]]:[]];return!L&&H?(0,v.jsxs)(o.default,{style:{gap:10},children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(s.DayView,{rid:R.id,day:H,today:z,app:"staff"})]}):(0,v.jsxs)(o.default,{style:{gap:10},children:[L?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(t.CoversToday,{rid:R.id})]}),(0,v.jsxs)(r.Card,{highlight:u.colours.accentBorder,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.Row,{gap:10,style:{flex:1},children:[(0,v.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"My avatar",onPress:()=>e('more','avatar'),children:(0,v.jsx)(C.StaffAvatar,{id:A,size:52})}),(0,v.jsxs)(r.T,{size:18,weight:"bold",children:["Hi ",O.replace(' (example)','').split(' ')[0]]})]}),(0,v.jsx)(r.Badge,{kind:"gold",label:L?R.name:'Staff app preview'})]}),(0,v.jsx)(r.Muted,{children:L?`${N.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})}`:'This is what staff will see in the separate Staff app.'})]}),(0,v.jsx)(M.StaffTipsTile,{rid:R.id,today:z,onPress:()=>e('more','mytips')}),(0,v.jsxs)(r.Card,{highlight:Y?u.colours.ok:void 0,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{weight:"semibold",children:Y?`On shift since ${(0,c.hm)(new Date(Y.in))}`:'Not clocked in'}),Y?(0,v.jsx)(r.Badge,{kind:"ok",label:(0,m.hmDur)(Math.max(0,Math.round((N.getTime()-new Date(Y.in).getTime())/6e4)))}):null]}),U?(0,v.jsxs)(r.Muted,{children:["Today on the rota: ",(0,m.fmtH)(U.start),"\u2013",(0,m.fmtH)(U.end)]}):G[0]?(0,v.jsxs)(r.Muted,{children:["Next on the rota: ",m.DAY3[G[0].day]," ",Number(G[0].date.slice(8))," ",(0,m.fmtH)(G[0].start),"\u2013",(0,m.fmtH)(G[0].end)]}):(0,v.jsx)(r.Muted,{children:"No shifts on the rota this week."}),(0,v.jsx)(r.Button,{small:!0,kind:Y?'secondary':'success',label:Y?'Clock out':'Clock in',onPress:()=>e('more','clock')})]}),A?(0,v.jsx)($.RequestTimeOff,{meId:A,me:O,testID:"staff-home-time-off"}):null,(0,v.jsx)(p.ShellfishTile,{rid:R.id,by:O.replace(' (example)',''),app:"staff"}),ee.length?(0,v.jsx)(r.Card,{children:(0,v.jsxs)(o.default,{testID:"staff-seated-today",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Seated and finished today (",ee.length,")"]}),(0,v.jsx)(r.Muted,{children:"Seated someone by mistake? Tap Unseat: they go back to Booked and their tables are freed. Finished or No-show by mistake? Tap Undo."}),ee.map(e=>{const s=e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;return(0,v.jsxs)(o.default,{testID:(0,f.isSeatedHighlight)(e.status)?`staff-seated-row-${e.id}`:`staff-done-row-${e.id}`,style:(0,f.isSeatedHighlight)(e.status)?{gap:6,padding:10,borderRadius:12,marginTop:4,...(0,f.seatedHighlightStyle)()}:{gap:6,borderTopWidth:1,borderTopColor:u.colours.hairline,paddingTop:8,opacity:'finished'===e.status||'noshow'===e.status?.7:1},children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.T,{size:17,weight:"semibold",colour:(0,f.isSeatedHighlight)(e.status)?f.SEATED_FG:u.colours.text,children:[e.time," \xb7 ",s]}),(0,v.jsx)(r.Badge,{kind:'noshow'===e.status?'red':'seated'===e.status?'ok':'neutral',label:'noshow'===e.status?'No-show':'seated'===e.status?'Seated':'Finished'})]}),(0,v.jsxs)(r.Muted,{children:[e.table?(0,I.tableCardLabel)(e.table):'No table'," \xb7 ",e.ref]}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsxs)(r.Row,{wrap:!0,gap:6,children:['seated'===e.status?(0,v.jsx)(r.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${s}`,onPress:()=>(0,B.finishBookingNow)(R.id,e)}):null,e.walkIn?(0,v.jsx)(a.CancelWalkInButton,{rid:R.id,b:e,small:!0}):null,e.walkIn?(0,v.jsx)(a.ReinstateWalkInButton,{rid:R.id,b:e,today:z,small:!0}):null,(0,v.jsx)(S.BookingUndo,{b:e,rid:R.id,today:z,who:s})]})]},e.id)})]})}):null,X.length+Z.length?(0,v.jsxs)(o.default,{testID:"staff-allergy-signoffs",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Allergy sign-offs (",X.length+Z.length,")"]}),(0,v.jsx)(r.Muted,{children:"Tap Sign off for your step. Your name and the time are recorded."}),X.map(e=>(0,v.jsx)(j.AllergyChain,{o:e,me:O},e.id)),Z.map(e=>(0,v.jsxs)(o.default,{accessible:!0,accessibilityLabel:`Booking ${e.time}, ${e.name}, ${e.partySize}${e.table?`, ${(0,D.tableNumbersA11y)(e.table)}`:''}`,style:{gap:4},children:[(0,v.jsxs)(r.Muted,{children:["Booking ",e.time," \xb7 ",e.name," (",e.partySize,")",e.table?` \xb7 ${(0,I.tablesLabel)(e.table)}`:'']}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsx)(j.BookingAllergyChain,{b:e,me:O}),(0,v.jsx)(o.default,{style:{flexDirection:'row'},children:(0,v.jsx)(w.WhatsAppGuest,{b:e,rid:R.id,kind:"auto"})})]},e.id))]}):null,se?(0,v.jsxs)(r.Card,{onPress:()=>e('chat'),children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{size:12,weight:"semibold",colour:u.colours.gold,children:"\ud83d\udccc PINNED IN ALL STAFF"}),(0,v.jsx)(r.Muted,{children:"Open chat \u203a"})]}),(0,v.jsx)(r.T,{size:14,children:se.text})]}):null,(0,v.jsxs)(r.Card,{children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Hours this pay period"}),(0,v.jsxs)(r.T,{size:18,weight:"semibold",colour:u.colours.goldLight,children:[(0,m.hmDur)(Q.paid)," paid hours"]})]}),te?(0,v.jsx)(r.Card,{onPress:()=>e('more','rota'),children:(0,v.jsxs)(r.T,{size:14,children:["You have ",te," request",te>1?'s':''," waiting for a manager \u203a"]})}):null,(0,y.visibleLinks)(E,'staff').length?(0,v.jsxs)(o.default,{testID:"quick-links",style:{gap:6},children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Quick links"}),(0,v.jsx)(y.QuickLinksRow,{compact:!0})]}):null,L?null:(0,v.jsx)(o.default,{style:{gap:6},children:ie.map(([e,s])=>(0,v.jsx)(r.Button,{kind:"secondary",label:e,onPress:s},e))})]})};var s=_r(d[0]),t=_r(d[1]),a=_r(d[2]),l=_r(d[3]);_r(d[4]);var n=e(_r(d[5])),o=e(_r(d[6])),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),f=_r(d[11]),p=_r(d[12]),m=_r(d[13]),x=_r(d[14]),y=_r(d[15]),j=_r(d[16]),b=_r(d[17]),w=_r(d[18]),k=_r(d[19]),T=_r(d[20]),C=_r(d[21]),S=_r(d[22]),I=_r(d[23]),D=_r(d[24]),B=_r(d[25]),M=_r(d[26]),$=_r(d[27]),v=_r(d[28])},1381,[1148,1073,1112,1089,34,402,102,794,865,827,840,1090,1142,1100,1145,1367,1136,850,1149,838,1147,899,1360,1014,829,1096,1154,1159,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1382,[30,34,846,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,"default",{enumerable:!0,get:function(){return q}});var t=r(_d[0]),s=r(_d[1]);r(_d[2]),r(_d[3]);var n=r(_d[4]),o=r(_d[5]),u=r(_d[6]),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=e(r(_d[10])),p=e(r(_d[11]));r(_d[12]);var y=e(r(_d[13])),h=e(r(_d[14])),S=r(_d[15]),_=r(_d[16]),O=r(_d[17]),P=r(_d[18]),j=r(_d[19]),v=r(_d[20]),b=r(_d[21]),x=r(_d[22]),A=r(_d[23]),w=r(_d[24]),E=r(_d[25]),C=r(_d[26]);r(_d[27]);var I=r(_d[28]),k=r(_d[29]),R=r(_d[30]),H=r(_d[31]),T=r(_d[32]),F=r(_d[33]),B=r(_d[34]),V=r(_d[35]),N=r(_d[36]);const G=r(_d[37]),L=r(_d[38]),M=r(_d[39]),U=r(_d[40]);function q(){const[e]=(0,n.useFonts)({Poppins_400Regular:G,Poppins_500Medium:L,Poppins_600SemiBold:M,Poppins_700Bold:U}),[t,E]=(0,d.useState)(v.useStore.persist.hasHydrated()),[T,F]=(0,d.useState)(x.useOwner.persist.hasHydrated()),B=t&&T;(0,d.useEffect)(()=>{const e=v.useStore.persist.onFinishHydration(()=>E(!0)),t=x.useOwner.persist.onFinishHydration(()=>F(!0));return v.useStore.persist.hasHydrated()&&E(!0),x.useOwner.persist.hasHydrated()&&F(!0),()=>{e(),t()}},[]),(0,d.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===(0,S.venueKey)(v.useStore.persist.getOptions().name??'')&&(0,C.quietly)(()=>v.useStore.persist.rehydrate()),e.key===(0,S.venueKey)(b.useFloor.persist.getOptions().name??'')&&(0,C.quietly)(()=>b.useFloor.persist.rehydrate()),e.key===(0,S.venueKey)(o.useBlocks.persist.getOptions().name??'')&&(0,C.quietly)(()=>o.useBlocks.persist.rehydrate())};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,d.useEffect)(()=>{B&&x.useOwner.getState().syncRoster()},[B]),(0,d.useEffect)(()=>{B&&(0,s.startAppSync)()},[B]);const V=e&&B,q=(0,w.useSignedOutGate)(),D=(0,u.usePathname)(),K=V&&!(0,O.isAllowedPath)(D||'/');return(0,d.useEffect)(()=>{if(!K)return;const e=setTimeout(()=>u.router.replace(O.ENTRY[O.APP_VARIANT]),0);return()=>clearTimeout(e)},[K,D]),(0,d.useEffect)(()=>{V&&l.hideAsync().catch(()=>{})},[V]),V?(0,N.jsxs)(j.SafeAreaProvider,{children:[(0,N.jsx)(c.StatusBar,{style:"light"}),q?(0,N.jsx)(h.default,{style:{flex:1,backgroundColor:A.colours.bg}}):(0,N.jsx)(h.default,{style:{flex:1},children:(0,N.jsx)(u.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:A.colours.bg}}})}),K&&!q?(0,N.jsx)(h.default,{style:[y.default.absoluteFill,{backgroundColor:A.colours.bg}]}):null,K||q||O.IS_CAR?null:(0,N.jsx)(R.VoiceHost,{}),q?null:(0,N.jsx)(I.SyncBadge,{}),K||q||O.IS_CAR?null:(0,N.jsx)(k.PushPrompt,{}),O.IS_CAR?(0,N.jsx)(P.CarGate,{}):(0,N.jsx)(w.InviteGate,{}),K||q?null:(0,N.jsx)(H.SliderHost,{})]}):(0,N.jsxs)(h.default,{style:{flex:1,backgroundColor:A.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[_.HERO_LOGOS[S.VENUE_RID]?(0,N.jsx)(p.default,{source:_.HERO_LOGOS[S.VENUE_RID],accessibilityLabel:"Venue logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,N.jsx)(f.default,{color:A.colours.gold})]})}T.PITCH&&(globalThis.__pitch={useSaverCfg:V.useSaverCfg,useSync:s.useSync,seedInvitePairsForQA:t.seedInvitePairsForQA,appVariant:O.APP_VARIANT,useStore:v.useStore,useOwner:x.useOwner,useFloor:b.useFloor,useBlocks:o.useBlocks,useSession:E.useSession,useCashUp:F.useCashUp,seedPitch:B.seedPitch},setTimeout(()=>{try{(0,B.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),E.START_INVITE,l.preventAutoHideAsync().catch(()=>{})},1383,[1384,985,795,1335,1386,1011,30,1413,496,34,385,336,236,41,102,5,847,846,1415,36,848,1014,865,840,1374,997,1010,1418,1419,1420,1421,1099,2,1024,1441,1304,25,1442,1443,1444,1445]); +__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,"default",{enumerable:!0,get:function(){return q}});var t=r(_d[0]),s=r(_d[1]);r(_d[2]),r(_d[3]);var n=r(_d[4]),o=r(_d[5]),u=r(_d[6]),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=e(r(_d[10])),p=e(r(_d[11]));r(_d[12]);var y=e(r(_d[13])),h=e(r(_d[14])),S=r(_d[15]),_=r(_d[16]),O=r(_d[17]),P=r(_d[18]),j=r(_d[19]),v=r(_d[20]),b=r(_d[21]),x=r(_d[22]),A=r(_d[23]),w=r(_d[24]),E=r(_d[25]),C=r(_d[26]);r(_d[27]);var I=r(_d[28]),k=r(_d[29]),R=r(_d[30]),H=r(_d[31]),T=r(_d[32]),F=r(_d[33]),B=r(_d[34]),V=r(_d[35]),N=r(_d[36]);const G=r(_d[37]),L=r(_d[38]),M=r(_d[39]),U=r(_d[40]);function q(){const[e]=(0,n.useFonts)({Poppins_400Regular:G,Poppins_500Medium:L,Poppins_600SemiBold:M,Poppins_700Bold:U}),[t,E]=(0,d.useState)(v.useStore.persist.hasHydrated()),[T,F]=(0,d.useState)(x.useOwner.persist.hasHydrated()),B=t&&T;(0,d.useEffect)(()=>{const e=v.useStore.persist.onFinishHydration(()=>E(!0)),t=x.useOwner.persist.onFinishHydration(()=>F(!0));return v.useStore.persist.hasHydrated()&&E(!0),x.useOwner.persist.hasHydrated()&&F(!0),()=>{e(),t()}},[]),(0,d.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===(0,S.venueKey)(v.useStore.persist.getOptions().name??'')&&(0,C.quietly)(()=>v.useStore.persist.rehydrate()),e.key===(0,S.venueKey)(b.useFloor.persist.getOptions().name??'')&&(0,C.quietly)(()=>b.useFloor.persist.rehydrate()),e.key===(0,S.venueKey)(o.useBlocks.persist.getOptions().name??'')&&(0,C.quietly)(()=>o.useBlocks.persist.rehydrate())};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,d.useEffect)(()=>{B&&x.useOwner.getState().syncRoster()},[B]),(0,d.useEffect)(()=>{B&&(0,s.startAppSync)()},[B]);const V=e&&B,q=(0,w.useSignedOutGate)(),D=(0,u.usePathname)(),K=V&&!(0,O.isAllowedPath)(D||'/');return(0,d.useEffect)(()=>{if(!K)return;const e=setTimeout(()=>u.router.replace(O.ENTRY[O.APP_VARIANT]),0);return()=>clearTimeout(e)},[K,D]),(0,d.useEffect)(()=>{V&&l.hideAsync().catch(()=>{})},[V]),V?(0,N.jsxs)(j.SafeAreaProvider,{children:[(0,N.jsx)(c.StatusBar,{style:"light"}),q?(0,N.jsx)(h.default,{style:{flex:1,backgroundColor:A.colours.bg}}):(0,N.jsx)(h.default,{style:{flex:1},children:(0,N.jsx)(u.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:A.colours.bg}}})}),K&&!q?(0,N.jsx)(h.default,{style:[y.default.absoluteFill,{backgroundColor:A.colours.bg}]}):null,K||q||O.IS_CAR?null:(0,N.jsx)(R.VoiceHost,{}),q?null:(0,N.jsx)(I.SyncBadge,{}),K||q||O.IS_CAR?null:(0,N.jsx)(k.PushPrompt,{}),O.IS_CAR?(0,N.jsx)(P.CarGate,{}):(0,N.jsx)(w.InviteGate,{}),K||q?null:(0,N.jsx)(H.SliderHost,{})]}):(0,N.jsxs)(h.default,{style:{flex:1,backgroundColor:A.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[_.HERO_LOGOS[S.VENUE_RID]?(0,N.jsx)(p.default,{source:_.HERO_LOGOS[S.VENUE_RID],accessibilityLabel:"Venue logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,N.jsx)(f.default,{color:A.colours.gold})]})}T.PITCH&&(globalThis.__pitch={useSaverCfg:V.useSaverCfg,useSync:s.useSync,seedInvitePairsForQA:t.seedInvitePairsForQA,appVariant:O.APP_VARIANT,useStore:v.useStore,useOwner:x.useOwner,useFloor:b.useFloor,useBlocks:o.useBlocks,useSession:E.useSession,useCashUp:F.useCashUp,seedPitch:B.seedPitch},setTimeout(()=>{try{(0,B.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),E.START_INVITE,l.preventAutoHideAsync().catch(()=>{})},1383,[1384,985,795,1335,1386,1011,30,1413,496,34,385,336,236,41,102,5,847,846,1415,36,848,1014,865,840,1374,997,1010,1419,1420,1421,1422,1099,2,1024,1442,1304,25,1443,1444,1445,1446]); __d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"inviteCache",{enumerable:!0,get:function(){return j}}),_e.refreshLinkPhones=P,_e.linkedSinceText=I,_e.refreshInvites=A,_e.useInviteStatus=function(){const[,e]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const n=()=>e(e=>e+1);return v.add(n),A(),()=>{v.delete(n)}},[]),x},Object.defineProperty(_e,"when",{enumerable:!0,get:function(){return C}}),_e.inviteStateText=function(e,n=Date.now()){return'used'===e?.state?'Previous link used. Current app links are prepared automatically.':e?.devices?`Signed in on ${e.devices} device${1===e.devices?'':'s'}`:'Personal Android and iPhone links'},_e.seedInvitePairsForQA=function(n,t,s){if(!e.PITCH)throw new Error('QA only');w.set(`${n}:${t}`,s),S()},Object.defineProperty(_e,"installSteps",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"installMessage",{enumerable:!0,get:function(){return D}}),_e.InviteLinkControls=function({m:e,actorRole:s}){const o=(0,u.useSync)(e=>e.venueId),b=(0,u.useSync)(e=>'staff'===e.kind&&!!e.venueId),x=(0,u.useSync)(e=>e.perms.includes('*')||e.perms.includes('roles.manage')),j=b&&e.active&&!e.name.includes('(example)')&&('owner'===s||x||'manager'===s&&'owner'!==e.role&&!e.ownerAccess),A=`${o}:${e.id}`,B=(0,f.useSession)(e=>e.meId),T=(0,y.useOwner)(e=>B?e.staff.find(e=>e.id===B):void 0),E=!B||!!T&&(0,k.ownJobManagesLinks)(T),[,z]=(0,t.useState)(0),[O,_]=(0,t.useState)(''),[W,U]=(0,t.useState)(!1),[Z,F]=(0,t.useState)(null),[G,N]=(0,t.useState)(null),[Q,Y]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{if(!j)return;const n=()=>z(e=>e+1);v.add(n),P(),M(A,e.id);const t=setInterval(()=>{M(A,e.id)},3e4),s=()=>{M(A,e.id)};return'undefined'!=typeof window&&window.addEventListener('focus',s),()=>{v.delete(n),clearInterval(t),'undefined'!=typeof window&&window.removeEventListener('focus',s)}},[j,A,e.id]),!j)return null;const J=w.get(A),q=async n=>{try{await(0,u.revokeStaffAppLink)(n),w.delete(A),N(null),_('Link revoked. Existing signed-in sessions are unchanged.'),await M(A,e.id),Z&&F(await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}};return(0,m.jsxs)(l.default,{testID:`invite-${e.id}`,style:{gap:10},children:[(()=>{const n=I(L[e.id]);return n?(0,m.jsxs)(l.default,{testID:`invite-phone-${e.id}`,style:{gap:8,padding:12,borderRadius:10,borderWidth:1,borderColor:h.colours.gold,backgroundColor:h.colours.bg,alignItems:'center'},children:[(0,m.jsx)(d.T,{center:!0,weight:"semibold",colour:h.colours.goldLight,testID:`invite-phone-since-${e.id}`,children:n}),(0,m.jsxs)(d.Muted,{center:!0,size:13,children:["Another phone that opens ",e.name,"\u2019s link is asked to see a manager."]}),E?Q?(0,m.jsxs)(l.default,{style:{gap:8,alignItems:'center',width:'100%'},children:[(0,m.jsxs)(d.T,{center:!0,size:15,children:["Reset ",e.name,"\u2019s phone? Their link will link to the next phone that opens it. Phones already signed in stay signed in."]}),(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Yes, reset phone",testID:`invite-reset-yes-${e.id}`,style:{minHeight:44},accessibilityLabel:`Yes, reset ${e.name}'s phone`,onPress:async()=>{try{await(0,u.resetStaffLinkPhone)(e.id),await P(),_(`Phone reset. ${e.name}\u2019s link will link to the next phone that opens it.`)}catch(e){_(String(e.message))}finally{Y(!1)}}}),(0,m.jsx)(d.Button,{label:"Cancel",kind:"ghost",style:{minHeight:44},testID:`invite-reset-no-${e.id}`,onPress:()=>Y(!1)})]})]}):(0,m.jsx)(d.Button,{label:"Reset phone",kind:"secondary",testID:`invite-reset-${e.id}`,style:{minHeight:44},accessibilityLabel:`Reset phone for ${e.name}. Asks to confirm.`,onPress:()=>Y(!0)}):(0,m.jsx)(d.Muted,{center:!0,size:13,testID:`invite-reset-managers-only-${e.id}`,children:"Only a manager or owner can reset a phone or switch a link off."})]}):null})(),['android','iphone'].map(t=>{const s='android'===t?'Android app':'iPhone web app',o=J?.[t],u=(0,c.currentAppLink)(o)&&o?(0,c.personalAppUrl)(t,o):null;return(0,m.jsxs)(l.default,{testID:`invite-${t}-${e.id}`,style:{gap:6,padding:10,borderRadius:10,borderWidth:1,borderColor:h.colours.gold,backgroundColor:h.colours.bg},children:[(0,m.jsx)(d.T,{center:!0,weight:"semibold",children:s}),u&&o?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n.Text,{selectable:!0,accessibilityLabel:`${e.name}, ${s} personal link`,testID:`invite-link-${t}-${e.id}`,style:{color:h.colours.goldLight,fontSize:14,textAlign:'center',width:'100%'},children:o.shortCode?`Short link: ${o.shortCode}`:"Secure personal link \u2014 Copy or Share"}),(0,m.jsx)(d.Muted,{center:!0,size:13,children:H(t)}),(0,m.jsx)(d.Muted,{center:!0,size:13,children:"Works for good on the first phone that opens it."}),(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Copy",kind:"secondary",style:{minHeight:44,minWidth:44},accessibilityLabel:`Copy ${e.name}'s ${s} link`,testID:`invite-copy-${t}-${e.id}`,onPress:async()=>_(await(0,p.copyText)(D(u,e.name,t))?'Link and install steps copied':'Select and copy the link.')}),(0,m.jsx)(d.Button,{label:"Share",style:{minHeight:44,minWidth:44},accessibilityLabel:`Share ${e.name}'s ${s} link`,testID:`invite-share-${t}-${e.id}`,onPress:async()=>_(await R(u,e.name,t))}),E?(0,m.jsx)(d.Button,{label:"Revoke link",kind:"ghost",style:{minHeight:44},accessibilityLabel:`Revoke ${e.name}'s ${s} link`,onPress:()=>N(o.id)}):null]})]}):(0,m.jsx)(d.Muted,{children:$.has(A)?'Cannot load the current link. Reconnecting automatically.':'Preparing current link\u2026'})]},t)}),G&&E?(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Confirm revoke link",accessibilityLabel:`Confirm revoke link for ${e.name}`,style:{minHeight:44},onPress:()=>{q(G)}}),(0,m.jsx)(d.Button,{label:"Cancel",kind:"ghost",style:{minHeight:44},onPress:()=>N(null)})]}):null,O?(0,m.jsx)(d.T,{center:!0,size:14,children:O}):null,(0,m.jsx)(d.Button,{label:W?"Making new links\u2026":"Make new app links",testID:`invite-new-${e.id}`,accessibilityLabel:`Make new Android and iPhone app links for ${e.name}`,disabled:W,onPress:async()=>{if(!W){U(!0);try{const n=await(0,u.refreshStaffAppLinks)(e.id);w.set(A,n),$.delete(A),S(),_('New links ready. Links already sent keep working. Signed-in phones stay signed in.'),Z&&F(await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}finally{U(!1)}}}}),(0,m.jsxs)(d.Muted,{center:!0,size:13,children:["Share privately with ",e.name,". Links never expire. Each link works on the first phone that opens it; Reset phone lets it link to a new one."]}),(0,m.jsx)(d.Button,{label:Z?'Hide previous links':'Manage previous links',kind:"ghost",style:{minHeight:44},accessibilityLabel:`Manage all previous app links for ${e.name}`,onPress:async()=>{try{F(Z?null:await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}}}),Z?.map(n=>(0,m.jsxs)(l.default,{style:{gap:4},children:[(0,m.jsxs)(d.Muted,{center:!0,size:13,children:['legacy'===n.platform?'Previous app link':'android'===n.platform?'Android app':'iPhone'," \xb7 ",C(n.createdAt)," \xb7 ",n.revokedAt?'Revoked':n.usedAt?'Used for sign-in':'Unused']}),!n.revokedAt&&E?(0,m.jsx)(d.Button,{label:"Revoke this link",kind:"ghost",style:{minHeight:44},accessibilityLabel:`Revoke ${e.name}'s ${n.platform} link from ${C(n.createdAt)}`,onPress:()=>N(n.id)}):null]},n.id))]})};var e=r(_d[0]),n=r(_d[1]),t=r(_d[2]);r(_d[3]),r(_d[4]);var s,o=r(_d[5]),l=(s=o)&&s.__esModule?s:{default:s},d=r(_d[6]),c=r(_d[7]),u=r(_d[8]),h=r(_d[9]),p=r(_d[10]),f=r(_d[11]),y=r(_d[12]),k=r(_d[13]),m=r(_d[14]);const w=new Map,b=new Map,v=new Set,$=new Map,S=()=>v.forEach(e=>e());let x=null;const j=()=>x;let L={};async function P(){return L=await(0,u.staffLinkPhones)(),S(),L}function I(e){if(!e||!e.phones)return null;const n=new Date(e.since).toLocaleDateString('en-GB',{timeZone:'Europe/London',day:'numeric',month:'short',year:'numeric'});return e.phones>1?`Linked to ${e.phones} phones, the first since ${n}`:`Linked to a phone since ${n}`}async function A(){return x=await(0,u.readInviteStatus)(),S(),x}const C=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZoneName:'short'}):'';async function M(n,t){if(e.PITCH&&w.has(n))return;if(b.has(n))return b.get(n);const s=(async()=>{try{w.set(n,await(0,u.ensureStaffAppLinks)(t)),$.delete(n)}catch(e){w.delete(n),$.set(n,String(e.message||e))}finally{b.delete(n),S()}})();return b.set(n,s),s}const H=e=>'android'===e?'Tap the link, download the app, allow installation, then open it. It signs you in.':'Open in Safari and tap Open app. In the app, tap Share, Add to Home Screen, then open it from your Home Screen.',D=(e,n,t)=>`${n} \u2014 ${'android'===t?'Android app':'iPhone web app'}\n${e}\n${H(t)}`;async function R(e,n,t){const s=D(e,n,t);try{if('undefined'!=typeof navigator&&navigator.share)return await navigator.share({title:`CoverCharge for ${n}`,text:s,url:e}),'Share opened'}catch(e){if('AbortError'===e.name)return'Share cancelled'}return await(0,p.copyText)(s)?'Link and install steps copied. Paste them into a private message.':'Select and copy the link.'}},1384,[2,796,34,236,383,102,794,1385,985,840,1151,997,865,988,25]); __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IOS_WEB",{enumerable:!0,get:function(){return t}}),e.getPageSlug=n,e.personalGetUrl=o,e.siteRootFromLocation=s,e.mintPersonalUrl=function(t,c,h){const p=s();if(p)return o({origin:p.origin,basePath:p.basePath,staffId:t,name:c,token:h});return`get/${n(c)||n(t)}.html?v=2#i=${encodeURIComponent(h)}`},e.currentAppLink=function(t,n=Date.now()){return!!t&&/^[A-Za-z0-9_-]{16,64}$/.test(t.token)&&Date.parse(t.expiresAt)>n},e.personalAppUrl=function(t,n){if(n.shortCode&&/^[A-Za-z0-9_-]{10}$/.test(n.shortCode)){const t=s()??{origin:'https://covercharge-apps.static.hf.space',basePath:'/'};return`${t.origin}${t.basePath}s.html#${n.shortCode}`}if(n.url)try{const t=new URL(n.url);if('https:'===t.protocol&&'covercharge-apps.static.hf.space'===t.hostname&&/^\/(?:(?:kirkmichael|wildings)\/)?get\/[a-z0-9-]+\.html$/.test(t.pathname))return t.href}catch{}const o=s()??{origin:'https://covercharge-apps.static.hf.space',basePath:'/'},c=['owner','chef'].includes(n.app)?n.app:'staff',h=`i=${encodeURIComponent(n.token)}${'iphone'===t?`&d=${encodeURIComponent(n.device||'')}`:''}`;return`${o.origin}${o.basePath}get/${t}.html?a=${c}${'android'===t?'&v=2':'&v=61'}#${h}`};const t=new Set(['st-jack','st-agate','st-lenny','st-james','st-lillie','st-bisto','st-gordon','st-cameron','st-mia','st-emily','st-gabrielle','st-harvey','st-tracy','st-eilidh','st-finn']);function n(t){return(t.startsWith('st-')||t.startsWith('ow-')||t.startsWith('ch-')?t.replace(/^(st|ow|ch)-/,''):t.replace(/\s*\(.*?\)\s*/g,' ').trim().split(/\s+/)[0]||t).toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'staff'}function o(t){const o=t.origin.replace(/\/$/,'');let s=(t.basePath||'/').replace(/\/?$/,'/');s.startsWith('/')||(s='/'+s);return`${o}${s}get/${n(t.name)||n(t.staffId)}.html?v=2#i=${encodeURIComponent(t.token)}`}function s(t){try{if(!(t||'undefined'!=typeof window&&window.location))return null;const n=new URL(t||window.location.href),o=n.pathname.match(/^(.*?\/)(?:owner|staff|chef|display|customer)-app(?:\/|$)/);return{origin:n.origin,basePath:o?o[1]:'/'}}catch{return null}}},1385,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return o.useFonts}});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var o=r(d[2])},1386,[1387,1410,1412]); @@ -1495,43 +1495,44 @@ __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,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},1412,[34,1387]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},1413,[1414]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preventAutoHideAsync=async function(){return!1},e.setOptions=function(n){},e.hide=function(){},e.hideAsync=async function(){}},1414,[]); -__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.CarGate=function(){const e=(0,c.useSession)(e=>e.meId),[s,o]=(0,t.useState)(c.useSession.persist.hasHydrated());return(0,t.useEffect)(()=>{const e=c.useSession.persist.onFinishHydration(()=>o(!0));return c.useSession.persist.hasHydrated()&&o(!0),e},[]),s?e||h.PITCH?null:(0,j.jsx)(I,{}):(0,j.jsx)(n.default,{style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=e(_r(d[1])),n=e(_r(d[2])),s=e(_r(d[3])),o=_r(d[4]),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),f=_r(d[10]),p=_r(d[11]),y=_r(d[12]),j=_r(d[13]);let b=null,w=null;async function M(e){return!e&&w&&Date.now()-w.at<6e4&&new Date(w.r.expiresAt).getTime()-Date.now()>12e4?w.r:b||(b=(0,u.carPairStart)().then(e=>(e.ok&&(w={r:e,at:Date.now()}),e)).finally(()=>{b=null}),b)}function I(){const{width:e,height:c}=(0,s.default)(),[h,b]=(0,t.useState)(null),[w,I]=(0,t.useState)('starting'),[T,D]=(0,t.useState)(''),[k,C]=(0,t.useState)(0),z=(0,t.useRef)(!1),S=(0,t.useCallback)(async(e=!0)=>{if(z.current)return;z.current=!0,I('starting'),D('');const t=await M(e);if(z.current=!1,!t.ok)return I('error'),void D(t.error);b({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),I('waiting')},[]);(0,t.useEffect)(()=>{S(!1)},[]),(0,t.useEffect)(()=>{if(!h||'waiting'!==w)return;const e=setInterval(async()=>{C(Math.max(0,Math.round((h.until-Date.now())/1e3)));('expired'===await(0,u.carPairPoll)(h.id)||Date.now()>h.until)&&I('expired')},3e3);return()=>clearInterval(e)},[h,w]);const P=Math.min(120,Math.max(64,Math.round(Math.min(e/9,c/7)))),H=h?.code??'',v=H?`${H.slice(0,3)} ${H.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,j.jsx)(n.default,{testID:"car-pairing",style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:(0,j.jsxs)(n.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:c<820?10:16},children:[(0,j.jsx)(l.RestaurantLogo,{rid:x.VENUE_RID,size:c<820?64:88}),(0,j.jsx)(o.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,j.jsx)(y.ParkedOnly,{}),'waiting'===w||'starting'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,j.jsx)(n.default,{testID:"car-code",accessible:!0,accessibilityLabel:H?`Car code ${(0,p.spokenCode)(H)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,j.jsx)(o.T,{center:!0,size:P,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:P/8,lineHeight:1.2*P},children:v})}),H?(0,j.jsx)(o.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,j.jsxs)(n.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,j.jsx)(o.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,j.jsx)(n.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,j.jsx)(o.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{S()},style:{minHeight:64,minWidth:200}})})]}):'expired'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{S()},style:{minHeight:64,minWidth:280}})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,j.jsx)(o.Muted,{center:!0,children:T}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{S()},style:{minHeight:64,minWidth:240}})]}),T&&'error'!==w?(0,j.jsx)(o.T,{center:!0,colour:f.colours.amber,children:T}):null,(0,j.jsx)(o.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})})}},1415,[34,41,102,426,794,847,997,985,2,5,840,1416,1417,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=32;const l=s=>s.split('').join(' ')},1416,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1417,[34,102,794,840,25]); -__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1418,[986,857,856,985]); -__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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1419,[798,796,34,1343,1015,402,102,846,985,1007,1014,5,840,794,1287,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1420,[796,34,236,402,102,840,985,1045,2,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.VoiceHost=function(){const e=(0,f.useVoiceTarget)(),t=(0,f.useVoiceSlot)(e=>e.rect);g.PITCH&&(globalThis.__voiceExpect={app:e?.app??null,on:!!e?.on,slot:!!t});if(!e?.on||!t)return null;const n=(0,P.jsx)(X,{app:e.actions,ui:e.app},e.actions);if('undefined'!=typeof document){const{createPortal:e}=_r(d[33]);return e(n,document.body)}return n};var t=_r(d[0]),n=_r(d[1]),o=_r(d[2]),r=e(_r(d[3])),s=e(_r(d[4])),i=e(_r(d[5])),a=e(_r(d[6]));_r(d[7]);var l=e(_r(d[8])),c=e(_r(d[9])),u=e(_r(d[10])),h=e(_r(d[11])),p=_r(d[12]),f=_r(d[13]),g=_r(d[14]),y=_r(d[15]),m=e(y),w=_r(d[16]),x=_r(d[17]),b=_r(d[18]),v=_r(d[19]),k=_r(d[20]),j=_r(d[21]),T=_r(d[22]),R=_r(d[23]),C=_r(d[24]),S=_r(d[25]),I=_r(d[26]),M=_r(d[27]),E=_r(d[28]),H=_r(d[29]),z=_r(d[30]),D=_r(d[31]),P=_r(d[32]);const A='How many people?',$=['covers','partySize'],W=200,_=16e3,B=31e3,O='That took too long, so I stopped waiting. Hold the button and try again, or tap Type instead.',V='Something went wrong there. Hold the button and try again, or tap Type instead.',F='The microphone is blocked. Allow it in the browser\u2019s site settings, or tap the button to type instead.';function L(e,t){return'cap'===e?t?.message||E.REACHED_TEXT:'identity'===e||'app'===e?'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.':'not-allowed'===e?F:'audio-capture'===e?'I couldn\u2019t use the microphone on this device. Check nothing else is using it, then hold the button again, or tap Type instead.':'busy'===e?'Speech to text is busy just now. Hold the button and try again in a moment, or tap Type instead.':'soon'===e?'Speech to text is switching on soon. For now, tap the button to type instead.':'long'===e?'That was longer than 30 seconds. Hold the button and say it more briefly, or tap Type instead.':'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.'}function N({colour:e,size:t=34}){return(0,P.jsxs)(m.default,{width:t,height:t,viewBox:"0 0 24 24",children:[(0,P.jsx)(y.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:e}),(0,P.jsx)(y.Path,{d:"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7",stroke:e,strokeWidth:2,strokeLinecap:"round",fill:"none"})]})}const G={owner:['\u201cWalk-in fridge 3 degrees\u201d','\u201cMark the lobster sold out\u201d','\u201cHow many Covers tonight?\u201d','\u201cAdd blue roll to the Booker list\u201d'],staff:['\u201cMessage the team: running 10 minutes late\u201d','\u201cRead my messages\u201d','\u201cWhen\u2019s my next shift?\u201d','\u201cWhat are today\u2019s specials?\u201d','\u201cDoes the fish supper contain gluten?\u201d'],chef:['\u201cFreezer minus 19\u201d','\u201cMark the soup sold out\u201d','\u201cRead the orders\u201d','\u201cAdd onions to the Bidfood list\u201d'],display:['\u201cWalk-in fridge 3 degrees\u201d','\u201cRead the orders\u201d','\u201cAny room for 6 at 8?\u201d','\u201cRead the shift notes\u201d']};function X({app:e,ui:g}){const y=(0,w.useCtx)(6e4),m=(0,b.useOwner)(e=>e.staff),X=(0,I.useVoiceNav)(e=>e.go),{height:U}=(0,u.default)(),q=(0,f.useVoiceSlot)(e=>e.rect),K=q.size,Y=x.ROSTER.find(e=>'chef'===e.app),J='display'===e?'Main Display':'chef'===e?m.find(e=>e.id===Y?.id)?.name??'Head Chef':y.me,Q='display'===e?'display':'chef'===e?Y?.id??'chef':y.meId,Z={rid:y.rid,today:y.today,go:(e,t)=>X?.(e,t),app:e,who:J.replace(' (example)',''),whoId:Q,role:'owner'===g?y.role:e};(0,o.useEffect)(()=>{try{(0,T.setVenueWords)((0,R.venueKeyterms)(y.rid))}catch{}},[y.rid,m]);const[ee,te]=(0,o.useState)('idle'),[ne,oe]=(0,o.useState)(''),[re,se]=(0,o.useState)(0),[ie,ae]=(0,o.useState)(null),[le,de]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(''),[he,pe]=(0,o.useState)(!1),fe=(0,o.useRef)(null),ge=(0,o.useRef)(0),ye=(0,o.useRef)(null),me=(0,o.useRef)(Z);me.current=Z;const we=(0,o.useRef)(ie);we.current=ie;const xe=(0,o.useRef)(y.now);xe.current=y.now;const be=e=>{ae(e),te('answer')},ve=be,ke=async e=>{const t=++ge.current;let n;te('working');try{n=await(0,j.runAction)(e.id,e.params,me.current,!0)}catch{n={status:'error',message:V}}t===ge.current&&((0,H.buzz)([20,40,20]),ve({text:'needs_confirmation'===n.status?n.preview:n.message,tone:'error'===n.status?'warn':'ok'}))},je=()=>ve({text:'Cancelled. Nothing was changed.',tone:'info'}),Te=async(e,t,n)=>{const o=++ge.current,r={...e.params,[e.field]:t};let s;te('working');try{s=await(0,j.runAction)(e.id,r,me.current,!1)}catch{s={status:'error',message:V}}o===ge.current&&('needs_confirmation'===s.status?ve({heard:n,text:s.preview,pending:{id:e.id,params:r,preview:s.preview}}):ve({heard:n,text:s.message,tone:'error'===s.status?'warn':'ok'}))},Re=async(e,t)=>{const n=ge.current,o=e=>{n===ge.current&&be(e)};try{await Ce(e,o,t)}catch{o({heard:e.trim()||void 0,text:V,tone:'warn'})}},Ce=async(t,n,o)=>{const r=t.trim(),s=me.current;if(!r)return void n({text:'I didn\u2019t catch that. Hold the button while you speak, then let go.',tone:'info'});const i=we.current?.pending;if(i){const e=(0,H.yesNo)(r);if('yes'===e)return void await ke(i);if('no'===e)return void je()}const a=we.current?.ask;if(a){const e=(0,D.coversAnswer)(r);if(e&&e<=30)return void await Te(a,e,r)}te('working');const l=(0,j.matchIntent)(r,s.today,{app:e,rid:s.rid,whoId:s.whoId}),c=xe.current;if(!E.voiceUsage.allowed(s.rid,'action'===l.kind?l.action.id:null,c))return void n({heard:r,text:E.REACHED_TEXT,tone:'info'});E.voiceUsage.record(s.rid,c);const u=E.voiceUsage.get(s.rid,c),h=u.reached?E.REACHED_TEXT:u.warn?(0,E.WARN_TEXT)(u):void 0,p=e=>n({...e,note:h});if('action'===l.kind){const e=l.action,t=e.params.filter(e=>e.required&&(void 0===l.params[e.name]||''===l.params[e.name]||'[]'===l.params[e.name]));if(1===t.length&&$.includes(t[0].name))return void p({heard:r,text:A,ask:{id:e.id,params:l.params,field:t[0].name},tone:'info'});if(t.length)return void p({heard:r,text:e.preview(l.params,s)+(/\?$/.test(e.preview(l.params,s))||/couldn|didn/.test(e.preview(l.params,s))?'':` I still need: ${t.map(e=>e.description.toLowerCase()).join('; ')}.`)+' Hold the button and try again.',tone:'warn'});const n=await(0,j.runAction)(e.id,l.params,s,!1);return void('needs_confirmation'===n.status?p({heard:r,text:n.preview,pending:{id:e.id,params:l.params,preview:n.preview}}):p({heard:r,text:n.message,tone:'error'===n.status?'warn':'ok'}))}const f=` ${r.toLowerCase()} `,g=e=>{const t=(0,j.actionById)(e);if(!t)return 0;try{return t.match?t.match(f):t.keywords.filter(e=>f.includes(e)).length}catch{return 0}},y=()=>(0,j.toolSpecs)().filter(t=>{const n=(0,j.actionById)(t.function.name);return!!n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))}).map((e,t)=>({t:e,i:t,s:g(e.function.name)})).sort((e,t)=>t.s-e.s||e.i-t.i).slice(0,60).map(e=>e.t),m=async t=>{if('call'===t.kind){const n=(0,j.actionById)(t.name);if(n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))){const e=n.params.filter(e=>e.required&&(void 0===t.args[e.name]||''===t.args[e.name]));if(1===e.length&&$.includes(e[0].name))return p({heard:r,text:A,ask:{id:n.id,params:t.args,field:e[0].name},tone:'info'}),!0;const o=await(0,j.runAction)(n.id,t.args,s,!1);return'needs_confirmation'===o.status?p({heard:r,text:o.preview,pending:{id:n.id,params:t.args,preview:o.preview}}):p({heard:r,text:o.message,tone:'error'===o.status?'warn':'ok'}),!0}}return'text'===t.kind&&(p({heard:r,text:(0,j.moneySafe)(e,s.role)?(0,j.noMoney)(t.text):t.text,tone:'info'}),!0)};if('help'===l.kind){const t=l.ids.map(C.helpById).filter(Boolean)[0];if(!(((0,S.searchHelp)(C.HELP,r,1)[0]?.score??0)>=2.5)){const n=await(0,T.askServer)(e,r,y(),o);if(await m(n))return;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(`${t.title}. ${t.body}`)?void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}.`,tone:'info'}):void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}. This guide might help: ${t.title}.`,help:l.ids,tone:'info'})}const n=`${t.title}. ${t.body}`;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(n)?void p({heard:r,text:'That isn\u2019t shown here. Ask a manager in the Managers app.',tone:'info'}):void p({heard:r,text:n,help:l.ids,tone:'info'})}await m(await(0,T.askServer)(e,r,y(),o))||p({heard:r,text:T.SOON_TEXT+' '+G[e].slice(0,2).join(' or ')+'.',tone:'info'})},Se=()=>{fe.current?.abort(),fe.current=null,ye.current?.(),ye.current=null,se(0)};(0,o.useEffect)(()=>()=>{fe.current?.abort(),ye.current?.()},[]);const Ie=async()=>{if(!(0,H.canListen)())return de(!0),void ve({text:(0,H.tabletWithoutMic)()?'This Display tablet app needs an update before it can use the microphone. For now, type below.':'This browser can\u2019t record speech. Type instead below.',tone:'info'});if((0,H.desktopStt)()){if(!(0,M.micExplainedFor)(g))return void pe(!0)}else{const e=await(0,H.micPermission)();if('granted'===e)(0,M.setMicExplainedFor)(g);else{if('denied'===e)return de(!0),void ve({text:F,tone:'warn'});if(!(0,M.micExplainedFor)(g))return void pe(!0)}}if(!He.current.holding&&!Ee.current)return;const t=++ge.current;(0,H.buzz)(35),oe(''),ae(null),de(!1),te('listening');if(fe.current=(0,H.listen)(oe,(e,n,o)=>{if(ye.current?.(),ye.current=null,se(0),fe.current=null,t===ge.current){if('not-allowed'!==n&&'service-not-allowed'!==n)return'stt-failed'===n?(ve({text:'Speech to text didn\u2019t start on this Mac. Type instead below; restarting the app usually fixes it.',tone:'warn'}),void de(!0)):void(n?ve({text:L(n,o),tone:'cap'===n?'info':'warn'}):Re(e,o?.receipt));ve({text:(0,H.desktopStt)()?'The microphone is blocked for CoverCharge. Open System Settings \u203a Privacy & Security \u203a Microphone, switch on CoverCharge for Mac, then try again. Or type instead.':F,tone:'warn'})}},e,se),!fe.current)return te('idle'),void de(!0);if((0,H.desktopStt)()){const e=await(0,H.levelMeter)(se);fe.current?ye.current=e:e()}},Me=()=>{fe.current&&(te('working'),fe.current.stop(),ye.current?.(),ye.current=null,se(0))},Ee=(0,o.useRef)(!1),He=(0,o.useRef)({timer:0,holding:!1}),ze=(0,o.useRef)(Ie);ze.current=Ie;const De=(0,o.useRef)(Me);De.current=Me;const Pe=(0,o.useMemo)(()=>a.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>{const e=He.current;e.holding=!1,(0,M.micExplainedFor)(g)&&(0,H.warmMic)(),e.timer=setTimeout(()=>{e.holding=!0,ze.current()},W)},onPanResponderRelease:()=>{const e=He.current;if(clearTimeout(e.timer),e.holding)return e.holding=!1,void De.current();(0,H.disarmMic)(),de(!0),te(e=>'idle'===e?'answer':e)},onPanResponderTerminate:()=>{const e=He.current;clearTimeout(e.timer),e.holding&&(e.holding=!1,De.current())}}),[e]);(0,o.useRef)(ee).current=ee,(0,o.useEffect)(()=>z.useVoiceKeys.subscribe((e,t)=>{const n=e.last;if(!n||n.n===t.last?.n)return;const o=!!fe.current;'start'!==n.cmd||o?'stop'===n.cmd?(Ee.current=!1,o&&De.current()):'toggle'===n.cmd?o?(Ee.current=!1,De.current()):(Ee.current=!0,ze.current()):'type'===n.cmd&&(de(!0),te(e=>'idle'===e?'answer':e)):(Ee.current=!0,ze.current())}),[]);const Ae=K>=64,$e=(0,o.useRef)(new s.default.Value(0)).current;(0,o.useEffect)(()=>{if('listening'!==ee)return $e.stopAnimation(),void $e.setValue(0);const e=s.default.loop(s.default.timing($e,{toValue:1,duration:1100,easing:i.default.out(i.default.quad),useNativeDriver:!1}));return e.start(),()=>e.stop()},[ee]);const We='listening'===ee,Be='answer'===ee&&(ie||le)||'working'===ee||We,Oe=()=>{ge.current++,Se(),ae(null),de(!1),ue(''),te('idle')};(0,o.useEffect)(()=>{if('working'!==ee&&'listening'!==ee)return;const e=ge.current,t=setTimeout(()=>{e===ge.current&&('listening'!==ee?(ge.current++,Se(),de(!0),be({heard:ne&&!/\u2026$/.test(ne)?ne:void 0,text:O,tone:'warn'})):De.current())},'working'===ee?_:B);return()=>clearTimeout(t)},[ee]);const Ve=()=>{const e=ce.trim();e&&(ue(''),oe(e),ge.current++,Re(e))},Fe='fixed',Le={top:q.y+K+8},Ne=$e.interpolate({inputRange:[0,1],outputRange:[1,1.7]}),Ge=$e.interpolate({inputRange:[0,1],outputRange:[.6,0]}),Xe='warn'===ie?.tone?k.colours.amber:ie?.pending?k.colours.gold:k.colours.border;return(0,P.jsxs)(P.Fragment,{children:[Be?(0,P.jsx)(h.default,{testID:"voice-panel",style:[{position:Fe,left:12,right:12,alignItems:'flex-end',zIndex:60},Le],pointerEvents:"box-none",children:(0,P.jsxs)(h.default,{style:{width:'100%',maxWidth:Ae?720:520,backgroundColor:k.colours.surface,borderRadius:16,borderWidth:2,borderColor:Xe,padding:Ae?20:14,gap:10,maxHeight:U*(Ae?.78:.6)},children:[(0,P.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.gold,accessibilityRole:"header",children:We?Ae?'Listening\u2026 let go (or press \u2318\u21e7G) to send':'Listening\u2026 let go to send':'working'===ee?'Working on it\u2026':ie?.pending?'Please confirm':'Voice assistant'}),(0,P.jsx)(l.default,{testID:"voice-close",accessibilityRole:"button",accessibilityLabel:"Close voice assistant",hitSlop:12,onPress:Oe,style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:20,colour:k.colours.muted,children:"\u2715"})})]}),(0,P.jsx)(v.T,{testID:"voice-reply-mode",size:14,colour:k.colours.muted,children:"Text replies only"}),We?(0,P.jsxs)(h.default,{style:{gap:8},children:[(0,P.jsx)(h.default,{style:{height:10,borderRadius:5,backgroundColor:k.colours.surface2,overflow:'hidden'},children:(0,P.jsx)(h.default,{testID:"voice-level",style:{width:`${Math.round(8+92*re)}%`,height:10,backgroundColor:k.colours.ok}})}),(0,P.jsx)(v.T,{size:16,children:ne||'Say it now\u2026'})]}):null,'working'===ee?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(r.default,{color:k.colours.gold}),(0,P.jsx)(v.T,{size:15,colour:k.colours.muted,children:ne?/\u2026$/.test(ne)?ne:`\u201c${ne}\u201d`:''})]}):null,'working'===ee||We?(0,P.jsx)(v.Button,{testID:"voice-stop",kind:"secondary",label:"Cancel",onPress:()=>{ge.current++,Se(),de(!1),be({text:'Stopped. Nothing was changed.',tone:'info'})},style:{minHeight:48}}):null,'answer'===ee&&ie?(0,P.jsxs)(c.default,{style:{maxHeight:U*(Ae?.55:.36)},contentContainerStyle:{gap:8},children:[ie.heard?(0,P.jsx)(h.default,{testID:"voice-heard",accessible:!0,accessibilityLabel:`I heard: ${ie.heard}`,children:(0,P.jsxs)(v.T,{size:Ae?16:14,colour:k.colours.muted,children:["I heard: \u201c",ie.heard,"\u201d"]})}):null,ie.note?(0,P.jsx)(h.default,{testID:"voice-usage-note",children:(0,P.jsx)(v.T,{size:13,colour:k.colours.amber,children:ie.note})}):null,(0,P.jsx)(h.default,{testID:"voice-answer",children:(0,P.jsx)(v.T,{size:Ae?24:18,weight:ie.pending?'semibold':'regular',children:ie.text})}),ie.help&&'owner'===e&&X?ie.help.slice(0,3).map(e=>{const t=(0,C.helpById)(e);return t?(0,P.jsx)(v.Button,{small:!0,kind:"secondary",label:`Open help: ${t.title}`,onPress:()=>{X('more','help'),Oe()}},e):null}):null]}):null,'answer'===ee&&ie?.ask?(0,P.jsx)(h.default,{testID:"voice-how-many",style:{flexDirection:'row',flexWrap:'wrap',gap:10},children:[1,2,3,4,5,6,7,8].map(e=>(0,P.jsx)(l.default,{testID:`voice-covers-${e}`,accessibilityRole:"button",accessibilityLabel:1===e?'1 person':`${e} people`,onPress:()=>{Te(ie.ask,e)},style:{width:Ae?96:72,height:Ae?96:72,borderRadius:14,backgroundColor:k.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:Ae?40:32,weight:"semibold",colour:k.colours.onGold,children:e})},e))}):null,'answer'===ee&&ie?.pending?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(v.Button,{testID:"voice-confirm",kind:"success",label:"Confirm",onPress:()=>{ke(ie.pending)},style:{flex:1,minHeight:56}}),(0,P.jsx)(v.Button,{testID:"voice-cancel",kind:"secondary",label:"Cancel",onPress:je,style:{flex:1,minHeight:56}})]}):null,'answer'!==ee||ie?.pending?null:(0,P.jsxs)(h.default,{style:{gap:6},children:[le||!(0,H.canListen)()?(0,P.jsxs)(v.Row,{gap:8,children:[(0,P.jsx)(n.TextInput,{testID:"voice-type",value:ce,onChangeText:ue,onSubmitEditing:Ve,placeholder:"Type instead\u2026",placeholderTextColor:k.colours.muted,autoFocus:!0,returnKeyType:"send",style:{flex:1,minWidth:0,width:0,minHeight:48,borderRadius:10,borderWidth:1,borderColor:k.colours.border,backgroundColor:k.colours.surface2,color:k.colours.text,paddingHorizontal:12,fontFamily:k.fonts.regular,fontSize:16}}),(0,P.jsx)(v.Button,{testID:"voice-send",kind:"success",label:"Ask",onPress:Ve,disabled:!ce.trim()})]}):(0,P.jsx)(l.default,{accessibilityRole:"button",onPress:()=>de(!0),children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"Type instead"})}),ie?null:(0,P.jsxs)(v.T,{size:Ae?15:13,colour:k.colours.muted,children:[Ae?'Hold Space (or the gold button) and speak, or press \u2318\u21e7G to start and again to send. ':'Hold the gold button and speak, for example ',Ae?`For example ${G[e].join(', ')}.`:`${G[e].join(', ')}.`]}),'owner'===g&&'owner'===e?(0,P.jsx)(l.default,{testID:"voice-open-assistant",accessibilityRole:"button",onPress:()=>{Oe(),p.useAssistantUi.getState().setOpen(!0)},style:{minHeight:44,justifyContent:'center'},children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"\u2726 Open the Assistant (ideas, history and longer requests) \u203a"})}):null]})]})}):null,(0,P.jsxs)(h.default,{style:{position:Fe,left:`clamp(0px, ${q.x}px, calc(100vw - ${K}px))`,top:q.y,width:K,height:K,zIndex:61},pointerEvents:"box-none",children:[We?(0,P.jsx)(s.default.View,{pointerEvents:"none",style:{position:'absolute',left:0,top:0,width:K,height:K,borderRadius:K/2,borderWidth:4,borderColor:k.colours.ok,opacity:Ge,transform:[{scale:Ne}]}}):null,We?(0,P.jsx)(h.default,{pointerEvents:"none",style:{position:'absolute',left:-6,top:-6,width:K+12,height:K+12,borderRadius:(K+12)/2,borderWidth:3+Math.round(7*re),borderColor:k.colours.ok}}):null,(0,P.jsx)(h.default,{testID:"voice-button",accessible:!0,accessibilityRole:"button",accessibilityLabel:'owner'===g&&'owner'===e?'Voice assistant and Assistant. Hold to talk, let go to send. Tap to type or open the Assistant.':'Voice assistant. Hold to talk, let go to send. Tap to type instead.',...Pe.panHandlers,style:[{width:K,height:K,borderRadius:K/2,alignItems:'center',justifyContent:'center',backgroundColor:We?k.colours.ok:k.colours.gold,borderWidth:2,borderColor:k.colours.bg},{userSelect:'none',WebkitUserSelect:'none',WebkitTouchCallout:'none',touchAction:'none',cursor:'pointer'}],children:['kirkton','abbotsford'].includes(t.VENUE_RID)?(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.onGold,children:'working'===ee?'Wait':'Talk'}):'working'===ee?(0,P.jsx)(r.default,{color:k.colours.onGold,size:"large"}):(0,P.jsx)(N,{colour:k.colours.onGold,size:Math.round(.5*K)})})]}),(0,P.jsx)(v.Sheet,{visible:he,onClose:()=>{(0,M.setMicExplainedFor)(g),pe(!1)},title:"Talk to CoverCharge",testID:"voice-explain",children:(0,P.jsxs)(h.default,{style:{gap:10},children:[(0,P.jsxs)(v.T,{children:["Hold the gold button, say what you need, then let go. For example ",G[e].slice(0,3).join(', '),"."]}),(0,P.jsx)(v.T,{children:(0,H.desktopStt)()?'Your Mac will now ask once to let CoverCharge use the microphone. It only listens while you hold the button.':'Your device will now ask once to use the microphone. It only listens while you hold the button, for up to 30 seconds.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:(0,H.desktopStt)()?'On this Mac, speech is turned into text on the Mac itself, so what you say isn\u2019t sent anywhere. CoverCharge doesn\u2019t keep the audio.':'What you say while holding is sent to Grok (xAI) to be turned into text. CoverCharge doesn\u2019t keep the audio.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:"The helper replies in text only, never aloud. Any change is shown in text first, with Confirm and Cancel buttons; you can also say \u201cyes\u201d. Orders to suppliers, messages and payments are only ever saved as drafts for the owner."}),(0,P.jsx)(v.Button,{testID:"voice-allow",kind:"success",label:"Allow microphone",onPress:async()=>{(0,M.setMicExplainedFor)(g),pe(!1);const e=!!(0,H.desktopStt)()||await(0,H.askMic)();if((0,H.desktopStt)()){(await(0,H.levelMeter)(()=>{}))()}ve(e?{text:'Ready. Now hold the button and speak.',tone:'ok'}:{text:F,tone:'warn'})}}),(0,P.jsx)(v.Button,{kind:"secondary",label:"Type instead",onPress:()=>{(0,M.setMicExplainedFor)(g),pe(!1),de(!0),te('answer')}})]})})]})}},1421,[5,796,34,385,283,364,380,236,402,295,426,102,1422,1116,2,900,1100,15,865,794,840,1423,930,1437,1433,1434,1438,1117,1439,929,1440,1436,25,277]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ASSISTANT_AVAILABLE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"useAssistantUi",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"AssistantFab",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"AssistantSheet",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"AssistantPage",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"AssistantSettings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"AssistantPlanCard",{enumerable:!0,get:function(){return c}});const t=!1,n={getState:()=>({open:!1,setOpen:t=>{}})},u=()=>null,s=()=>null,l=()=>null,o=()=>null,c=()=>null},1422,[]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1423,[1424,1098,829,1427,1428,865,848,1014,1432,1433,1434,1430,1429,1435,1436,1012,1013]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1424,[1425,1426,1038]); -__d(function(g,r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_LABEL",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HISTORY_NOTE",{enumerable:!0,get:function(){return o}}),e.validPastDate=n,Object.defineProperty(e,"ukHistoryDate",{enumerable:!0,get:function(){return s}}),e.parseHistoryInput=function(t){const o=t.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(o))return o;const n=/^(\d{1,2})[\s/.-]+(\d{1,2})[\s/.-]+(\d{4})$/.exec(o);if(!n)return;const s=`${n[3]}-${n[2].padStart(2,'0')}-${n[1].padStart(2,'0')}`,d=new Date(s+'T12:00:00Z');return Number.isNaN(d.getTime())||d.toISOString().slice(0,10)!==s?void 0:s},e.exactHistoryDate=function(t,o){if(1!==(t.match(/\b(?:\d{4}-\d{2}-\d{2}|\d{1,2}\/\d{1,2}\/\d{4}|\d{1,2}(?:st|nd|rd|th)?\s+[a-z]+\s+\d{4})\b/gi)??[]).length)return;const s=t.match(/\b(\d{4}-\d{2}-\d{2})\b/);let d=s?.[1];if(!d){const o=t.match(/\b(\d{1,2})\/(\d{1,2})\/(\d{4})\b/);o&&(d=`${o[3]}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`)}if(!d){const o=t.toLowerCase().match(/\b(\d{1,2})(?:st|nd|rd|th)?\s+(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)\s+(\d{4})\b/),n=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'];o&&(d=`${o[3]}-${String(n.indexOf(o[2].slice(0,3))+1).padStart(2,'0')}-${o[1].padStart(2,'0')}`)}return d&&n(d,o)?d:void 0},Object.defineProperty(e,"historyDateLabel",{enumerable:!0,get:function(){return d}}),e.bookingDayText=function(t){const n=`Booked covers on ${d(t.date)}: ${null===t.booked_covers?'not recorded':t.booked_covers}.`,s=t.bookings.map(t=>`${t.time??'Time not recorded'}: party size ${null===t.covers?'not recorded':`${t.covers} Covers`}; ${t.table?`table ${t.table}`:'table not recorded'}; ${t.status??'status not recorded'}${t.counted?'':', excluded from Booked covers'}.`);return[n,...s,t.historical_records?"Includes previous booking system history (incomplete).":'',o,t.bookings.length?'':'No booking records found; incomplete history does not prove there were no bookings.',t.missing_covers?`${t.missing_covers} booking records have no party size; left blank.`:''].filter(Boolean).join(' ')};const t='Includes previous booking system history (incomplete)',o='Recovered booking records, not confirmed attendance. Cancelled bookings are shown but excluded from Booked covers.';function n(t,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;const n=new Date(t+'T12:00:00Z');return!Number.isNaN(n.getTime())&&n.toISOString().slice(0,10)===t&&t{const[o,n,s]=t.split('-');return`${s} ${n} ${o}`};const d=t=>new Date(t+'T12:00:00Z').toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'Europe/London'})},1425,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.historyAccess=c,_e.lookupBookingDay=l,_e.useHistoricalBookingDay=function(t,o,u,y=0){const k=(0,s.useSync)(e=>[e.kind,e.venueId,e.venueSlug,e.perms.join(',')].join(':')),f=c(t),h=f&&(0,n.validPastDate)(o,u)?`${k}:${o}:${y}`:'',[w,p]=(0,e.useState)({key:'',data:null,error:''});return(0,e.useEffect)(()=>{if(!h)return void p({key:'',data:null,error:''});let e=!0;return l(t,o).then(t=>{e&&p({key:h,data:t,error:''})}).catch(t=>{e&&p({key:h,data:null,error:t.message})}),()=>{e=!1}},[h,t,o]),{allowed:f,data:h&&w.key===h?w.data:null,error:h&&w.key===h?w.error:''}};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]);function c(e){const n=s.useSync.getState();return'owner'===t.APP_VARIANT&&'staff'===n.kind&&n.venueSlug===e&&!!n.venueId&&(n.perms.includes('*')||n.perms.includes('staff.manage'))}async function l(e,t){if(!c(e))throw new Error('Sign in to the Managers app with manager or owner access to Look back.');if(!(0,n.validPastDate)(t,(0,o.venueYmd)(new Date)))throw new Error('Choose an exact past date, with day, month and year.');const l=(0,u.getSupabase)(),{data:y,error:k}=await l.rpc('historical_booking_day',{p_venue:s.useSync.getState().venueId,p_date:t});if(k||!y||!Array.isArray(y.bookings))throw new Error('Booking history could not be loaded. Reconnect and try again.');return y}},1426,[34,846,1425,827,985,931]); -__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"niceDay",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"appNow",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"num",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"tableIn",{enumerable:!0,get:function(){return L}}),e.resolveTable=q,Object.defineProperty(e,"tokensOf",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"hm",{enumerable:!0,get:function(){return x}}),e.findBooking=A,Object.defineProperty(e,"staffOf",{enumerable:!0,get:function(){return me}}),Object.defineProperty(e,"findCard",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(e,"allergenList",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(e,"OPS_VOICE_ACTIONS",{enumerable:!0,get:function(){return ye}});var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),o=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),d=_r(_d[7]),l=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),b=_r(_d[11]),p=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]);const f=t=>{const[n,r,a]=t.split('-').map(Number);return new Date(n,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},y=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},k=(t,n)=>n.test(t),w=t=>t.who??('display'===t.app?'Main Display':'Assistant'),v={a:1,an:1,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,fifteen:15,twenty:20,half:.5},S=t=>null==t||''===t?void 0:'number'==typeof t?t:v[String(t).toLowerCase()]??(Number.isFinite(Number(t))?Number(t):void 0),$=['owner','staff','display'],C=['owner','staff','chef','display'],I=['staff'],N=/\btables?\s+([a-z]?\d{1,3}[a-z]?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/i,L=t=>{const n=t.match(N);return n?String(S(n[1])??n[1]).toUpperCase():void 0};function q(t,n){const r=String(n??'').replace(/^tables?\s+/i,'').trim();if(!r)return;const a=String(S(r)??r).toLowerCase(),o=(0,s.planOf)(t),i=[...new Set([...(o?.tables??[]).map(t=>t.name),...Object.keys(s.useFloor.getState().live[t]??{})])];return i.find(t=>t.toLowerCase()===a)??(o?.tables??[]).find(t=>(t.label??'').toLowerCase()===a)?.name??i.find(t=>t.toLowerCase().replace(/[^0-9a-z]/g,'').replace(/^t(?=\d)/,'')===a.replace(/[^0-9a-z]/g,''))}const O=(t,n)=>s.useFloor.getState().live[t]?.[n]??{},_=new Set(['the','and','for','table','booking','party','seat','seated','cancel','move','mark','finished','show','arrived','here','has','have','they','them','who','with','from','tonight','today','please','change','confirm','decline','request','people','covers','guests','their','into','onto','done','left','gone']),D=t=>t.toLowerCase().replace(/[^a-z0-9: ]/g,' ').split(/\s+/).filter(t=>t.length>2&&!_.has(t)),x=t=>{const n=t.match(/\b(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/i);if(!n)return null;let r=Number(n[1]);return'pm'===n[3]?.toLowerCase()&&r<12&&(r+=12),!n[3]&&r>=1&&r<=11&&(r+=12),`${String(r).padStart(2,'0')}:${n[2]??'00'}`};function A(t,n,r,a,o){const d=String(r??'').toLowerCase(),l=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status)&&!/walk-?in/i.test(r.name??'')),c=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status));if(!d&&!o)return;const u=c.find(t=>t.ref&&d.includes(t.ref.toLowerCase()));if(u)return u;const b=D(d),p=l.filter(t=>D(t.name).some(t=>b.includes(t)));if(1===p.length)return p[0];if(o){const t=c.filter(t=>(0,s.tablesOf)(t.table).some(t=>t.toLowerCase()===o.toLowerCase())),n=p.length?t.filter(t=>p.includes(t)):t;if(n.length)return n.sort((t,n)=>('seated'===t.status?-1:1)-('seated'===n.status?-1:1))[0]}const h=/\d/.test(d.replace(N,''))?x(d.replace(N,'')):null;if(h){const t=(p.length?p:l).filter(t=>t.time===h);if(1===t.length)return t[0]}return p.length?p.sort((t,n)=>t.time.localeCompare(n.time))[0]:void 0}const j=t=>`${t.name}, ${t.partySize} at ${t.time}${t.table?`, table ${t.table}`:''}`,M=[{name:'booking',type:'string',required:!0,description:'Guest name, booking reference or time, as said'},{name:'table',type:'string',description:'Table, if said'}],T=t=>({booking:t,table:L(t)}),P='I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.';function z(t,n,r,a,i,s,d,l=""){return{id:t,apps:$,title:n,risk:'change',params:M,keywords:[],description:`${n}: today\u2019s booking by guest name, reference, table or time.${l}`,match:t=>k(t,i)?7:0,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return r?`${s}: ${j(r)}?${l}`:P},run:async(t,n)=>{const i=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return i?(await o.repo.bookings.setStatus(i.id,r),d&&await d(i,n,t),`Done: ${i.name} ${'noshow'===r?'marked as a no-show':'cancelled'===r?'cancelled':'finished'===r?'finished':r}.`):"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d."}}}const F=(t,n)=>(0,s.tablesOf)(n).forEach(n=>s.useFloor.getState().setLive(t,n,{stage:'seated',dirty:!1})),B={id:'seat_booking',apps:$,title:'Seat a booking',risk:'change',params:M,keywords:[],description:'Seat a guest with a booking today (at their booked table, or the table said). Walk-ins use add_walkin.',match:t=>!k(t,/\b(seat|sit)\b/)||k(t,/\b(walk.?in|walkin|no booking)\b/)||k(t,/\b(\d+|one|two|three|four|five|six|seven|eight|nine|ten) (people|covers|guests)\b/)?k(t,/\b(have|has|are|is) (arrived|here)\b/)?7:0:7,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']),o=q(n.rid,t.table)??r?.table;if(!r)return P;const i=o?O(n.rid,(0,s.tablesOf)(o)[0]):{};return`Seat ${r.name}, ${r.partySize} at ${r.time}${o?`, at table ${o}`:' (no table yet)'}?${i.blocked?` ${(0,a.tableNumbers)(o)} is marked blocked.`:i.dirty?` ${(0,a.tableNumbers)(o)} still needs clearing.`:i.stage?` ${(0,a.tableNumbers)(o)} already has people seated.`:''}`},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const a=q(n.rid,t.table);return t.table&&!a?`Nothing changed: there\u2019s no table ${t.table} on the plan.`:(a&&a!==r.table&&await o.repo.bookings.update(r.id,{table:a}),await o.repo.bookings.setStatus(r.id,'seated'),F(n.rid,a??r.table),`Done: ${r.name} seated${a??r.table?` at table ${a??r.table}`:''}.`)}},E=z('finish_booking','Finish a table (party left)','finished',['seated'],/\b(finished|have left|has left|left|gone|paid and gone|party left|they'?re done)\b/,'Mark finished',(t,n)=>{(0,s.tablesOf)(t.table).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0}))},' The table is then marked as needing clearing.'),R=z('no_show','Mark a no-show','noshow',['confirmed','pending'],/\b(no.?show|didn'?t (turn up|show|come)|not (turned|turning) up)\b/,'Mark as a no-show'),H=z('cancel_booking','Cancel a booking','cancelled',['confirmed','pending'],/^(?!.*\b(shifts?|orders?|rota)\b).*(\bcancel+(ed)?\b.*\b(booking|reservation|table for|party)\b|\bcancel\s+(?!that\b|it\b|this\b|now\b|please\b)[a-z]{3,})/,'Cancel the booking',void 0,' The guest is not messaged from here.'),W={id:'move_booking',apps:$,title:'Move a booking to another table',risk:'change',params:[M[0],{name:'table',type:'string',required:!0,description:'New table'}],keywords:[],description:'Give a booking today a different table (seated parties move too).',match:t=>k(t,/\b(move|put|switch|change)\b/)&&k(t,/\btables?\b/)&&!k(t,/\b(shift|rota)\b/)?7:0,parse:t=>{const n=[...t.matchAll(new RegExp(N.source,'gi'))],r=n[n.length-1];return{booking:t,table:r?String(S(r[1])??r[1]).toUpperCase():void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),o=q(n.rid,t.table);return r?o?`Move ${j(r)} to table ${o}?${O(n.rid,o).stage||O(n.rid,o).blocked?` ${(0,a.tableNumbers)(o)} is not free.`:''}`:`There\u2019s no table ${t.table??''} on the plan.`:P},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),a=q(n.rid,t.table);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";if(!a)return'Nothing changed: I couldn\u2019t find that table on the plan.';const i=r.table;return await o.repo.bookings.update(r.id,{table:a,tableSetHere:!0}),'seated'===r.status&&((0,s.tablesOf)(i).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0})),F(n.rid,a)),`Done: ${r.name} moved to table ${a}.`}},G={id:'change_booking',apps:['owner','staff'],title:'Change a booking\u2019s time or party size',risk:'change',params:[M[0],{name:'time',type:'time',description:'New time HH:mm'},{name:'covers',type:'integer',description:'New party size'}],keywords:[],description:'Change the time or the number of people on a booking today. The guest is not messaged from here.',match:t=>k(t,/\b(change|make it|now|instead|update|actually)\b/)&&k(t,/\b(booking|reservation|party)\b/)&&k(t,/\b(\d|one|two|three|four|five|six|seven|eight|nine|ten)\b/)?6:0,parse:t=>{const n=t.toLowerCase(),r=n.match(/\b(?:to|for|now|of)\s+(\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\s*(?:people|covers|guests|pax)?\b(?!\s*[:.]\d)(?!\s*(?:am|pm|o'?clock))/),a=n.match(/\b(?:to|at)\s+(\d{1,2}(?::\d{2})?\s*(?:am|pm)|\d{1,2}:\d{2}|\d{1,2}\s*o'?clock)/);return{booking:t,covers:r&&/people|covers|guests|pax|party|for/.test(n)&&!a?.[1]?.startsWith(r[1])?S(r[1]):void 0,time:a?x(a[1].replace(/o'?clock/,''))??void 0:void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);return r?t.time||t.covers?`Change ${j(r)} to ${[t.covers?`${t.covers} people`:'',t.time?`${t.time}`:''].filter(Boolean).join(' at ')}? The guest is not messaged from here.`:`What should change on ${r.name}\u2019s booking? Say the new time or number of people.`:P},run:async(t,r)=>{const a=A(r.rid,r.today,t.booking,['confirmed','pending']);if(!a)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const i=S(t.covers);if(!(null==t.covers||i&&(0,n.validParty)(i)))return`Nothing changed: ${n.PARTY_RULE}`;const s=t.time?x(String(t.time)):null;return i||s?(await o.repo.bookings.update(a.id,{...i?{partySize:i}:{},...s?{time:s}:{}}),`Done: ${a.name} is now ${i??a.partySize} at ${s??a.time}.`):'Nothing changed.'}},U={id:'decide_booking',apps:['owner'],title:'Accept or decline a booking request',risk:'change',params:[M[0],{name:'outcome',type:'string',required:!0,description:'confirmed or declined',enum:['confirmed','declined']}],keywords:[],description:'Accept or decline a booking request that is waiting (the same as the Accept / Decline buttons).',match:t=>k(t,/\b(accept|approve|confirm|decline|reject|turn down)\b/)&&k(t,/\b(booking|request|reservation)\b/)?7:0,parse:t=>({booking:t,outcome:/\b(decline|reject|turn down)\b/i.test(t)?'declined':'confirmed'}),preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?`${'declined'===t.outcome?'Decline':'Accept'} the request from ${r.name}, ${r.partySize} on ${f(r.date)} at ${r.time}?`:'I couldn\u2019t find a waiting request with that name.'},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?(await o.repo.bookings.decide(r.id,'declined'===t.outcome?'declined':'confirmed',w(n)),`Done: ${r.name}\u2019s request ${'declined'===t.outcome?'declined':'accepted'}.`):'Nothing changed: I couldn\u2019t find a waiting request with that name.'}},V=[{name:'table',type:'string',required:!0,description:'Table name or number'}],Y={id:'table_cleared',apps:$,title:'Mark a table cleared',risk:'change',params:V,keywords:[],description:'Mark a table cleared and free (after clearing it down).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(cleared|clear(ed)? down|is clean|wiped|reset|is free|is ready|ready again)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} cleared and free?${O(n.rid,r).stage?' People are still marked as seated there.':''}`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!1,stage:void 0}),`Done: table ${r} is free.`):'Nothing changed: I couldn\u2019t find that table.'}},J={id:'table_needs_clearing',apps:$,title:'Mark a table as needing clearing',risk:'change',params:V,keywords:[],description:'Mark a table as needing clearing (dirty).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(needs? (clearing|clearing down|a clean|wiping)|dirty|to be cleared)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} as needing clearing?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!0,stage:void 0}),`Done: table ${r} needs clearing.`):'Nothing changed: I couldn\u2019t find that table.'}},K={id:'block_table',apps:$,title:'Block or unblock a table',risk:'change',params:[...V,{name:'blocked',type:'string',required:!0,description:'yes to block, no to unblock',enum:['yes','no']}],keywords:[],description:'Block a table (not used tonight) or unblock it.',match:t=>k(t,/\b(un.?block|block|out of use|not in use|close)\b/)&&k(t,/\btables?\b/)&&!k(t,/\barea\b/)?8:0,parse:t=>({table:L(t),blocked:/\b(un.?block|back in use|open)\b/i.test(t)?'no':'yes'}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`${'no'===t.blocked?'Unblock':'Block'} table ${r}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{blocked:'no'!==t.blocked}),`Done: table ${r} ${'no'===t.blocked?'unblocked':'blocked'}.`):'Nothing changed: I couldn\u2019t find that table.'}},Q={mains:'mains',main:'mains',dessert:'dessert',desserts:'dessert',pudding:'dessert',bill:'bill',check:'bill',seated:'seated',starters:'seated'},X={id:'table_stage',apps:$,title:'Set a table\u2019s course',risk:'change',params:[...V,{name:'stage',type:'string',required:!0,description:'seated, mains, dessert or bill',enum:['seated','mains','dessert','bill']}],keywords:[],description:'Set where a seated table is: seated (starters), mains, dessert or bill.',match:t=>k(t,/\btables?\b/)&&k(t,/\b(on|at|having|wants?|asked for|ready for|onto)\b.*\b(mains?|desserts?|pudding|bill|check)\b/)?8:0,parse:t=>{const n=t.toLowerCase().match(/\b(mains?|desserts?|pudding|bill|check|starters)\b/);return{table:L(t),stage:n?Q[n[1]]:void 0}},preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Set table ${r} to ${t.stage}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table),a=Q[String(t.stage??'').toLowerCase()];return r&&a?(s.useFloor.getState().setLive(n.rid,r,{stage:a,dirty:!1}),`Done: table ${r} is on ${a}.`):'Nothing changed: say the table and mains, dessert or bill.'}},Z=t=>/\b(how many|how much|what'?s|what is|what are|any|have we got|do we have|are there|is there)\b|\?\s*$/.test(t),ee=t=>/\b(roast|chickens?|beef)\b/.test(t)&&!/\b(sold out|86|off the menu|menu|dish|special|allerg)/.test(t)&&Object.values(d.useShellStore.getState().items).some(t=>t.some(t=>t.active&&(0,l.isRoastItem)(t))),te=t=>(d.useShellStore.getState().items[t]??[]).filter(t=>t.active),ne=(t,n)=>{const r=String(n??'').toLowerCase();return te(t).find(t=>[t.name,t.plural,t.key].some(t=>t&&new RegExp(`\\b${t.toLowerCase().replace(/[^a-z0-9 ]/g,'')}`).test(r)))},re={id:'shellfish_count',apps:C,title:'Shellfish count: sold, delivery or recount',risk:'change',params:[{name:'item',type:'string',required:!0,description:'Item, e.g. lobster'},{name:'qty',type:'string',required:!0,description:'How many (\xbd allowed for half items)'},{name:'mode',type:'string',required:!0,description:'sold, delivery or count',enum:['sold','delivery','count']}],keywords:[],description:'Record shellfish (or other counted stock) sold, a delivery in, or a recount (sets the count).',match:t=>!k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)&&!ee(t)||k(t,/\b(allerg|contain|chat|message|tell|text|post)/)||Z(t)||!k(t,/\b(\d+|\xbd|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|sold|deliver(ed|y)?|came in|arrived|got in|count(ed)?|recount)\b/)?0:7,parse:(n,r)=>{const a=n.toLowerCase(),o=a.match(/\b(\d+(?:\.5)?|\xbd|a half|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|fifteen|twenty)\b/),i=/\b(deliver(ed|y)?|came in|arrived|got in|received)\b/.test(a)?'delivery':/\b(count|we have|we'?ve got|there are|recount|left in)\b/.test(a)?'count':'sold',s=ne(r.rid,a);return s&&(0,t.fishInStone)(r.rid,s)?{item:s.name,qty:(0,t.parseStoneAmount)(n),mode:i}:{item:s?.name??n,qty:o?'\xbd'===o[1]||/half/.test(o[1])?.5:S(o[1]):1,mode:i}},preview:(n,a)=>{const o=ne(a.rid,n.item);if(!o||'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'I couldn\u2019t find that item in the shellfish counts.';if((0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||!Number.isInteger(2*r))return'Use stone in half-stone steps, for example one and a half stone.';const i=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,s=(0,t.fromStone)(r,o.unit),l='count'===n.mode?s:'delivery'===n.mode?i+s:i-s;return`${o.name}: ${n.mode} ${(0,t.stoneSpeech)(r)}, after ${(0,t.stoneSpeech)((0,t.toStone)(Math.max(0,l),o.unit))}?`}const i=S(n.qty)??0,s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c='count'===n.mode?i:'delivery'===n.mode?s+i:s-i;return`${'count'===n.mode?`Set ${o.plural||o.name} to ${(0,l.fmtCount)(i)}`:'delivery'===n.mode?`Add a delivery of ${(0,l.fmtCount)(i)} ${o.plural||o.name}`:`Record ${(0,l.fmtCount)(i)} ${1===i?o.name:o.plural||o.name} sold`} (now ${(0,l.fmtCount)(s)}, after ${(0,l.fmtCount)(Math.max(0,c))})?`},run:(n,a)=>{const o=ne(a.rid,n.item);if(o&&'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'Nothing changed: that item is not in Head Chef stock.';if(o&&(0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||r>500||!Number.isInteger(2*r))return'Nothing changed: use stone in half-stone steps.';const i=(0,t.fromStone)(r,o.unit),s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,l='count'===n.mode?i-s:'delivery'===n.mode?i:-i;return s+l<0?`Nothing changed: only ${(0,t.stoneSpeech)((0,t.toStone)(s,o.unit))} left.`:(l&&d.shellfish.append({rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner',delta:l,reason:'count'===n.mode?'count':'delivery'===n.mode?'delivery':'sold'}),`Done: ${o.name}, ${(0,t.stoneSpeech)((0,t.toStone)(s+l,o.unit))} left.`)}const i=S(n.qty);if(!o||null==i||!(i>=0)||i>500)return'Nothing changed: say the item and how many.';if('half'!==o.unit&&i%1)return`Nothing changed: ${o.plural||o.name} are counted whole.`;const s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c={rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner'};return'count'===n.mode?(i!==s&&d.shellfish.append({...c,delta:i-s,reason:'count'}),`Done: ${o.plural||o.name} counted at ${(0,l.fmtCount)(i)}.`):'delivery'===n.mode?i<=0?'Nothing changed.':(d.shellfish.append({...c,delta:i,reason:'delivery'}),`Done: ${(0,l.fmtCount)(i)} in. ${(0,l.fmtCount)(s+i)} now.`):s(k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)||ee(t))&&Z(t)&&!k(t,/\b(allerg|contain)/)?8:0,parse:(t,n)=>({item:ne(n.rid,t)?.name}),preview:()=>'Shellfish left',run:(n,a)=>{const o=(0,d.venueCounts)(d.useShellStore.getState(),a.rid),i=ne(a.rid,n.item),s=(i?[i]:te(a.rid).filter(t=>!(0,l.isRoastItem)(t)||(0,l.isSundayIn)(new Date))).filter(t=>'chef'!==a.app||(0,r.chefCanSee)(a.rid,t));return s.length?s.map(n=>`${n.plural||n.name}: ${(0,t.fishInStone)(a.rid,n)?(0,t.stoneSpeech)((0,t.toStone)(o[n.key]??0,n.unit)):(0,l.fmtCount)(o[n.key]??0)} left`).join('. ')+'.':'No shellfish counts are set up here.'}},oe={accept:'acknowledged',preparing:'preparing',ready:'ready',collected:'collected'},ie=(t,n)=>{const r=String(n??'').toLowerCase(),a=i.useStore.getState().orders.filter(n=>n.restaurantId===t&&!['closed','cancelled','collected','served'].includes(n.status));return a.find(t=>t.ref&&r.includes(t.ref.toLowerCase()))??a.find(t=>{const n=r.match(/\b(?:number|no\.?|order)\s*(\d{1,4})\b/);return!!n&&t.ref.replace(/\D/g,'').endsWith(n[1])})??(()=>{const t=a.filter(t=>D(t.customerName??'').some(t=>D(r).includes(t)));return 1===t.length?t[0]:void 0})()},se={id:'order_status',apps:C,title:'Move an order on: accept, preparing, ready or collected',risk:'change',params:[{name:'order',type:'string',required:!0,description:'Order reference, number or customer name'},{name:'status',type:'string',required:!0,description:'accept, preparing, ready or collected',enum:['accept','preparing','ready','collected']}],keywords:[],description:'Accept a takeaway or table order, or mark it preparing, ready or collected (the same as the order buttons).',match:t=>k(t,/\b(orders?|takeaways?|collection|ticket)\b/)&&k(t,/\b(accept|ready|collected|picked up|preparing|start(ed)?|on it)\b/)&&!k(t,/\b(read|any|list|what)\b/)?7:0,parse:t=>{const n=t.toLowerCase();return{order:t,status:/\baccept/.test(n)?'accept':/\b(collected|picked up)\b/.test(n)?'collected':/\bready\b/.test(n)?'ready':'preparing'}},preview:(t,n)=>{const r=ie(n.rid,t.order);return r?`Mark order ${r.ref} for ${r.customerName} as ${'accept'===t.status?'accepted':t.status}?`:'I couldn\u2019t find that order. Say the order number or the name.'},run:async(t,n)=>{const r=ie(n.rid,t.order),a=oe[String(t.status)];if(!r||!a)return'Nothing changed: I couldn\u2019t find that order.';if('acknowledged'===a){return await o.repo.orders.accept(r.id,w(n))?`Done: order ${r.ref} accepted.`:`Order ${r.ref} was already accepted.`}return await o.repo.orders.setStatus(r.id,a,w(n)),`Done: order ${r.ref} is ${a}.`}},de={id:'order_list_add',apps:C,title:'Add to an order list',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What we need'},{name:'qty',type:'integer',description:'How many (default 1)'},{name:'list',type:'string',description:'Which list (supplier), if said'}],keywords:[],description:'Add an item to an order list (or add to the quantity if it is already on it). Nothing is ordered from the supplier.',match:t=>k(t,/\b(add|put)\b.*\b(to|on)\b.*\b(order|shopping|cash and carry|list)\b|\bwe need (more )?\w+/)&&!k(t,/\b(chat|message|tell|text|post|shift|rota)\b/)?6:0,parse:t=>{const n=t.toLowerCase().replace(/[.?!]+$/,'').match(/\b(?:add|put|need(?: more)?)\s+(?:(\d+|an?|one|two|three|four|five|six|seven|eight|nine|ten|twelve|twenty)\s+)?(.+?)(?:\s+(?:to|on)\s+(?:the\s+)?(.+?)(?:\s+(?:order|list|order list))*)?$/);return n?{qty:S(n[1])??1,item:n[2].replace(/^(?:some|more)\s+/,'').trim(),list:n[3]?.replace(/\b(order|list|shopping)\b/g,'').trim()||void 0}:{item:t}},preview:(t,n)=>{const r=c.useOrderLists.getState().lists.filter(t=>t.rid===n.rid),a=String(t.list??'').toLowerCase(),o=a&&r.find(t=>t.name.toLowerCase().includes(a))||r[0];return o?`Add ${t.qty??1} ${t.item} to ${o.name}? Nothing is ordered from the supplier.`:'There are no order lists yet. Set one up in Order lists.'},run:(t,n)=>{const r=c.useOrderLists.getState(),a=r.lists.filter(t=>t.rid===n.rid),o=String(t.list??'').toLowerCase(),i=o&&a.find(t=>t.name.toLowerCase().includes(o))||a[0],s=String(t.item??'').trim().slice(0,60),d=Math.max(1,Math.min(99,Math.round(S(t.qty)??1)));if(!i||s.length<2)return'Nothing changed: say what we need.';const l={id:n.whoId??'assistant',name:w(n)},u=r.items.find(t=>t.rid===n.rid&&t.listId===i.id&&'open'===t.status&&t.name.toLowerCase()===s.toLowerCase());return u?(r.bump(u.id,d,l),`Done: added ${d} more ${s} on ${i.name}.`):(r.addItem(n.rid,{listId:i.id,name:s,qty:d,unit:'',addedBy:l.id,addedByName:l.name}),`Done: ${d} ${s} added to ${i.name}.`)}},le={in:'Clock you in',out:'Clock you out',break_start:'Start your break',break_end:'End your break'};function ce(t,n,r){return{id:t,apps:I,title:le[n].replace('you','me').replace('your','my'),risk:'change',params:[],keywords:[],description:`${le[n]} now (only for the person signed in; the same location check as the Clock tab).`,match:t=>k(t,r)?8:0,preview:()=>`${le[n]} now?`,run:async(t,r)=>{if(!r.whoId)return'Sign in to the Staff app first.';const a=y().toISOString(),o=await(0,b.clockAction)(n,{rid:r.rid,staffId:r.whoId,date:r.today,at:a});return o.ok?'Done: '+{in:'clocked in',out:'clocked out',break_start:'break started',break_end:'break ended'}[n]+` at ${new Date(a).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}.`+(o.warn?' '+o.warn:''):'Nothing changed: '+o.message}}}const ue=ce('clock_in','in',/\bclock (me )?in\b|\bclocking in\b|\bstart(ing)? my shift\b/),be=ce('clock_out','out',/\bclock (me )?out\b|\bclocking out\b|\b(finish|end)(ing)? my shift\b/),pe=ce('break_start','break_start',/\b(start|starting|taking|take|going on|begin)( my| a)? break\b|\bon (my )?break now\b/),he=ce('break_end','break_end',/\b(end|ending|finish|finished|back from)( my| a| the)? break\b|\bback from break\b/),me=t=>{const n=u.useOwner.getState().staff,r=String(t??'').toLowerCase();return n.find(n=>n.id===t)?.id??n.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>D(r).includes(t)))?.id},ge=(t,n)=>{if(!(0,p.hasRecipeCards)())return;const r=D(String(n??''));let a;for(const n of(0,p.recipeCards)().list(t)){const t=D(n.dish).filter(t=>r.includes(t)).length;t&&t>(a?.s??0)&&(a={c:n,s:t})}return a?.c},fe=t=>{const n=m.ALLERGENS.filter(n=>t[n.id]).map(n=>('may'===t[n.id]?'may contain ':'')+n.label.toLowerCase());return n.length?n.join(', '):'none of the 14 allergens'},ye=[B,E,R,H,W,G,U,Y,J,K,X,re,ae,se,de,ue,be,pe,he,{id:'decide_leave',apps:['owner'],title:'Approve or decline a holiday request',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff member id or first name'},{name:'outcome',type:'string',required:!0,description:'approved or declined',enum:['approved','declined']}],keywords:[],description:'Approve or decline someone\u2019s waiting holiday (leave) request.',match:t=>k(t,/\b(approve|accept|decline|reject|ok|okay)\b/)&&k(t,/\b(holiday|leave|time off|day off|days off)\b/)?7:0,parse:t=>{const n=t.toLowerCase(),r=u.useOwner.getState().staff.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>new RegExp(`\\b${t}\\b`).test(n)));return{staffId:r?.id,outcome:/\b(decline|reject|refuse)\b/.test(n)?'declined':'approved'}},preview:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status),o=n.staff.find(t=>t.id===r)?.name.replace(' (example)','');return a?`${'declined'===t.outcome?'Decline':'Approve'} ${o}\u2019s holiday, ${f(a.from)}${a.to!==a.from?` to ${f(a.to)}`:''}?`:`There\u2019s no waiting holiday request${o?` from ${o}`:''}.`},run:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status);return a?(n.setLeave(a.id,'declined'===t.outcome?'declined':'approved'),`Done: holiday ${'declined'===t.outcome?'declined':'approved'}.`):'Nothing changed: no waiting request found.'}},{id:'allergen_signoff',apps:['chef'],title:'Sign off a dish\u2019s allergens',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'}],keywords:[],description:'Head chef signs off a recipe card (its allergens). The allergens are read back first.',match:t=>k(t,/\bsign(ed)?.?off\b|\bapprove\b.*\b(card|recipe|allergens?)\b/)?8:0,parse:t=>({dish:t}),preview:(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?`${r.dish} can\u2019t be signed off yet: ${a}`:`Sign off ${r.dish}? Allergens: ${fe(r.allergens)}.`},run:async(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'Nothing changed: I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?'Nothing changed: '+a:(await(0,p.recipeCards)().signOff(r.id,{name:w(n),role:'head-chef'}),`Done: ${r.dish} signed off.`)}}]},1427,[982,1098,804,829,848,800,1014,981,983,1025,865,1071,856,832,830]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.spokenDate=j,Object.defineProperty(_e,"GAP_VOICE_ACTIONS",{enumerable:!0,get:function(){return be}});var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),l=_r(_d[12]),f=_r(_d[13]),u=_r(_d[14]),m=_r(_d[15]),g=_r(_d[16]),y=_r(_d[17]),b=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),S=_r(_d[21]),$=_r(_d[22]);const v=(e,t)=>t.test(e),I=e=>e.who??('display'===e.app?'Main Display':'Assistant'),N=e=>(e??'').replace(' (example)',''),A=e=>String(e).padStart(2,'0'),D=()=>{const e=(0,$.appNow)();return`${A(e.getHours())}:${A(e.getMinutes())}`},C=['owner','staff','display'],T=['owner'],q=['staff','owner'],O=['owner','chef'],_=e=>`\u201c${e}\u201d`,x=(e,t)=>n.useOwner.getState().sys(e,t,(0,$.appNow)().toISOString()),M=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],R=e=>`${A(Math.floor(e))}:${A(Math.round(e%1*60))}`,L=['january','february','march','april','may','june','july','august','september','october','november','december'];function j(e,t){const a=e.toLowerCase(),r=a.match(new RegExp(`\\b(\\d{1,2})(?:st|nd|rd|th)?(?:\\s+of)?\\s+(${L.join('|')})\\b`))??a.match(new RegExp(`\\b(${L.join('|')})\\s+(\\d{1,2})(?:st|nd|rd|th)?\\b`));if(r){const e=Number(/\d/.test(r[1])?r[1]:r[2]),a=L.indexOf(/\d/.test(r[1])?r[2]:r[1]);let n=Number(t.slice(0,4));return`${n}-${A(a+1)}-${A(e)}`e.active)){const r=[N(e.name).split(' ')[0],e.nickname].filter(Boolean).map(e=>e.toLowerCase()),n=Math.min(...r.map(e=>{const a=t.match(new RegExp(`\\b${e.replace(/[^a-z']/g,'')}\\b`));return a?.index??1/0}));n<1/0&&a.push({s:e,at:n})}return a.sort((e,t)=>e.at-t.at).map(e=>e.s)}const F=e=>n.useOwner.getState().staff.find(t=>t.id===e),E=e=>F(e)??W(String(e??''))[0],U=e=>a.useStore.getState().waitlist.filter(t=>t.restaurantId===e&&('waiting'===t.status||'notified'===t.status)).sort((e,t)=>e.number-t.number);function z(e,t){const a=String(t??'').toLowerCase(),r=U(e);if(!r.length)return;const n=a.match(/(?:#|number|no\.?)\s*(\d{1,3})\b/);if(n)return r.find(e=>e.number===Number(n[1]));const i=(0,$.tokensOf)(a).filter(e=>!['waitlist','wait','list','off','remove','told','ready','next'].includes(e)),s=r.filter(e=>(0,$.tokensOf)(e.name).some(e=>i.includes(e)));return s.length?s[0]:/\b(next|first)\b/.test(a)||1===r.length?r[0]:void 0}const Y=e=>`waitlist number ${e.number}, ${e.name}, party of ${e.partySize}`;function B(e,t){const n=a.useStore.getState(),i=n.restaurants.find(t=>t.id===e);if(!i)return;const s=(0,$.appNow)(),o=(0,l.ymdOf)(s),d=r.useFloor.getState(),c=d.plans[e]??(0,r.seedPlan)(e),h=n.bookings.filter(t=>t.restaurantId===e),p=(0,w.closedAreasAt)(w.useBlocks.getState().blocks,e,o,D()),f=(0,b.floorView)(c,h,n.orders.filter(t=>t.restaurantId===e),d.live[e]??{},s,i.settings.turnMins,p);return(0,b.suggestTable)(c,h.filter(e=>e.date===o),f,t,s,(0,b.turnFor)(t,i.settings.turnMins))?.table}const P=/\bwait ?(ing )?list\b|\bwaiting\b/,H=[{name:'who',type:'string',required:!0,description:'Waitlist number or name, as said (or "next")'}],K={id:'waitlist_seat',apps:C,title:'Seat someone from the waitlist',risk:'change',params:[...H,{name:'table',type:'string',required:!1,description:'Table (else the best free table)'}],keywords:[],description:'Seat a waiting party from the waitlist at a table (the suggested table unless one is said), like the Seat button.',match:e=>v(e,P)&&v(e,/\bseat\b|\bsit\b/)?9:0,parse:e=>({who:e,table:(0,$.tableIn)(e)}),preview:(e,t)=>{const a=z(t.rid,e.who);if(!a)return'I couldn\u2019t find that party on the waitlist. Say their number or name.';const r=(0,$.resolveTable)(t.rid,e.table)??B(t.rid,a.partySize);return r?`Seat ${Y(a)}, at table ${r}?`:`There\u2019s no free table for ${a.partySize} right now. Say a table to seat them anyway.`},run:async(e,a)=>{const n=z(a.rid,e.who);if(!n)return'Nothing changed: I couldn\u2019t find that party on the waitlist.';const i=(0,$.resolveTable)(a.rid,e.table)??B(a.rid,n.partySize);return i?(await t.repo.waitlist.setStatus(n.id,'seated'),await t.repo.bookings.seatWalkIn(a.rid,n.partySize,i,`From waitlist #${n.number}`),(0,r.tablesOf)(i).forEach(e=>r.useFloor.getState().setLive(a.rid,e,{stage:'seated',dirty:!1})),`Done: waitlist number ${n.number} seated at table ${i}.`):'Nothing changed: there\u2019s no free table for them. Say a table.'}};function V(e,t){if(!e.whoId)return;const a=n.useOwner.getState().shifts.filter(t=>t.staffId===e.whoId&&!1!==t.published&&t.date>=e.today).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start),r=j(String(t??''),e.today);return r?a.find(e=>e.date===r):a[0]}const G=e=>`${(0,$.niceDay)(e.date)}, ${R(e.start)} to ${R(e.end)}`,Q=/\b(approve|accept|decline|reject|okay|ok)\b/,Z='I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d.';function J(e,t){const a=e.toLowerCase(),r=a.match(/\bfrom\s+(.+?)\s+(?:to|until|till)\s+(.+)$/);if(r){const e=j(r[1],t),a=j(r[2],t)??e;return{from:e,to:a&&e&&a'open'===e.status&&(!r||e.kind===r)),s=W(String(e??'')).map(e=>e.id);return s.length?i.find(e=>s.includes(e.fromId)&&(!e.toId||1===s.length||s.includes(e.toId)))??i.find(e=>s.includes(e.fromId)||e.toId&&s.includes(e.toId)):1===i.length?i[0]:void 0}const ee=(t,a)=>'chef'!==a?.app||(0,e.chefCanSee)(a.rid,t)&&(0,e.chefCanSee)(a.rid,i.useSafety.getState().points.find(e=>e.id===t.pointId)),te=(e,t)=>{const a=i.useSafety.getState().entries.filter(a=>(0,l.ymdOf)(new Date(a.at))===e&&ee(a,t));return{n:a.length,bad:a.filter(e=>!e.ok).length,fixed:a.filter(e=>!e.ok&&e.corrective).length}},ae=/\b(food safety|safety diary|diary|haccp|safe methods|sfbb)\b/;function re(e,t){const a=(0,m.weekStart)(new Date(e+'T12:00:00')),r=new Date(a+'T00:00:00').getTime(),n=r+6048e5,s=i.useSafety.getState().entries.filter(e=>{const a=new Date(e.at).getTime();return a>=r&&a!e.ok).length,actions:s.filter(e=>!e.ok&&e.corrective).length,daysSigned:o.filter(e=>{const t=new Date(e.date+'T00:00:00').getTime();return t>=r&&te.test(t))?.[1]??'Other',location:s?s[1].replace(/^the /,''):'Not said',firstAid:o?o[1]:'',what:e.trim().replace(/^(?:please\s+)?(?:record|log|report|add|write up|put in the accident book)\s+(?:an?\s+)?(?:accident|near miss|injury)?\s*(?:in the accident book)?\s*[:,-]?\s*/i,'').replace(/^\w/,e=>e.toUpperCase())||e.trim()}}function se(e,t){const a=(0,d.ukClock)((0,$.appNow)()),r=new Date(`${a.ymd}T12:00:00Z`).getUTCDay(),n=(0,$.tokensOf)(String(t??'')).filter(e=>!['tick','ticked','task','off','mark','done','did','finished','completed','ive','i\u2019ve','list'].includes(e)),i=e=>(0,$.tokensOf)(e).filter(e=>n.some(t=>t===e||t.length>3&&e.startsWith(t.slice(0,4)))).length,h=e.whoId?(0,o.tasksFor)((0,s.tasksOf)(e.rid,e.whoId),r):[];let p=h.map(e=>({t:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.t;const l='chef'===e.app?['all','kitchen']:'staff'===e.app?['all','foh']:['all','foh','kitchen'],f=p?void 0:c.useReminders.getState().reminders.filter(t=>t.rid===e.rid&&!t.removed&&!t.paused&&t.days.includes(a.dow)&&l.includes(t.audience)).map(e=>({r:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.r;return{ymd:a.ymd,task:p,rem:f}}const oe=e=>a.useStore.getState().menu.filter(t=>t.restaurantId===e);function de(e,t){const a=(0,$.tokensOf)(String(t??''));let r;for(const t of oe(e)){const e=(0,$.tokensOf)(t.name).filter(e=>a.includes(e)).length;e&&e>(r?.s??0)&&(r={m:t,s:e})}return r?.m}const ce=e=>{const t=e.match(/\xa3\s?(\d+(?:\.\d{1,2})?)|\b(\d+(?:\.\d{2}))\b|\b(\d+)\s*(?:pounds|quid)(?:\s*(\d{1,2}))?/i);if(t)return t[1]?Number(t[1]):t[2]?Number(t[2]):Number(t[3])+(t[4]?Number(t[4])/100:0)},he={gram:'g',grams:'g',g:'g',kilo:'kg',kilos:'kg',kg:'kg',ml:'ml',millilitres:'ml',litre:'l',litres:'l',l:'l',tablespoon:'tbsp',tablespoons:'tbsp',tbsp:'tbsp',teaspoon:'tsp',teaspoons:'tsp',tsp:'tsp',pinch:'pinch',slice:'slice',slices:'slices',whole:'whole'};function pe(e){const t=e.match(/\badd\s+(\d+(?:\.\d+)?|a|an|one|two|three|four|five|six|half)\s*(grams?|g|kilos?|kg|ml|millilitres|litres?|l|tablespoons?|tbsp|teaspoons?|tsp|pinch|slices?|whole)?\s+(?:of\s+)?(.+?)\s+(?:to|into|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*$/i);if(t)return{qty:String((0,$.num)(t[1])??t[1]),unit:t[2]?he[t[2].toLowerCase()]??t[2]:'',name:t[3].trim(),dish:t[4]}}const le={in:'Clock {n} in',out:'Clock {n} out',break_start:'Start a break for {n}',break_end:'End {n}\u2019s break'},fe=e=>null==e?'not entered':`\xa3${e.toLocaleString('en-GB',{minimumFractionDigits:2,maximumFractionDigits:2})}`,ue=e=>'owner'===e.app&&'staff'!==e.role,me=['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];function ge(e){if(/\bweekdays?\b/.test(e))return[1,2,3,4,5];if(/\bweekends?\b/.test(e))return[0,6];const t=me.map((t,a)=>new RegExp(`\\b${t}s?\\b`).test(e)?a:-1).filter(e=>e>=0);return t.length?t:[0,1,2,3,4,5,6]}const ye={all:'everyone on shift',foh:'front of house',kitchen:'the kitchen'},be=[K,{id:'waitlist_remove',apps:C,title:'Take someone off the waitlist',risk:'change',params:H,keywords:[],description:'Take a party off the waitlist (they left or no longer need a table), like the Remove button. It stays in the records.',match:e=>v(e,P)&&v(e,/\b(remove|take .*off|cross .*off|strike .*off|gave up|have left|has left|left|gone)\b/)&&!v(e,/\b(seat|told|ready)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Take ${Y(a)}, off the waitlist?`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,a)=>{const r=z(a.rid,e.who);return r?(await t.repo.waitlist.setStatus(r.id,'removed'),`Done: number ${r.number} is off the waitlist.`):'Nothing changed: I couldn\u2019t find that party.'}},{id:'waitlist_told',apps:C,title:'Mark a waiting party as told their table is ready',risk:'change',params:H,keywords:[],description:'Record that a waiting party has been told their table is ready, like the Mark as told button. No text is sent.',match:e=>v(e,P)&&v(e,/\b(told|tell|let .* know|notif|ready|called)\b/)&&!v(e,/\b(seat|remove)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Mark ${Y(a)}, as told their table is ready? No text is sent from here.`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,n)=>{const i=z(n.rid,e.who);if(!i)return'Nothing changed: I couldn\u2019t find that party.';const s=a.useStore.getState().restaurants.find(e=>e.id===n.rid);return r.useFloor.getState().logSms(n.rid,(0,$.appNow)().toISOString(),`#${i.number} ${i.partySize}: Your table at ${s?.name??'the restaurant'} is ready.`),await t.repo.waitlist.setStatus(i.id,'notified'),`Done: number ${i.number} marked as told. No text was sent.`}},{id:'request_cover',apps:q,title:'Ask for cover for my shift',risk:'change',params:[{name:'day',type:'string',required:!1,description:'Day or date of your shift (else your next shift)'}],keywords:[],description:'Ask the team to cover one of your own shifts, like the Ask for cover button. A \u201cCover needed\u201d note goes in the team chat.',match:e=>v(e,/\bcover\b/)&&v(e,/\b(my|me)\b/)&&v(e,/\b(shift|ask|need|someone|anyone|can)\b/)&&!v(e,Q)?9:0,parse:e=>({day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day);return a?`Ask for cover for your shift on ${G(a)}? A \u201cCover needed\u201d note goes in the team chat.`:Z},run:(e,t)=>{const a=V(t,e.day);return a&&t.whoId?n.useOwner.getState().swaps.some(e=>e.shiftId===a.id&&'open'===e.status)?'There\u2019s already an open request for that shift.':(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,kind:'cover',note:'Can anyone cover?'}),x('all',`Cover needed: ${M[a.day]} ${R(a.start)}\u2013${R(a.end)} (${N(F(t.whoId)?.name??t.who)})`),`Done: cover asked for ${G(a)}. A manager approves it once someone takes it.`):"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_swap',apps:q,title:'Ask to swap my shift with someone',risk:'change',params:[{name:'with',type:'string',required:!0,description:'Who you agreed to swap with (first name)'},{name:'day',type:'string',required:!1,description:'Day or date of your shift'}],keywords:[],description:'Ask a manager to approve swapping one of your shifts with a colleague you agreed it with, like the Swap with button.',match:e=>v(e,/\bswap\b/)&&!v(e,Q)?9:0,parse:(e,t)=>({with:W(e).find(e=>e.id!==t?.whoId)?.id,day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day),r=E(e.with);return r&&r.id!==t.whoId?a?`Ask to swap your shift on ${G(a)} with ${N(r.name)}? A manager still approves it.`:Z:'Who are you swapping with? Say their first name.'},run:(e,t)=>{const a=V(t,e.day),r=E(e.with);return a&&t.whoId?r&&r.id!==t.whoId?(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,toId:r.id,kind:'swap',note:'Agreed between us'}),`Done: swap with ${N(r.name)} asked for. A manager approves it.`):'Nothing changed: say who you\u2019re swapping with.':"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_holiday',apps:q,title:'Ask for holiday',risk:'change',params:[{name:'from',type:'string',required:!0,description:'First day off, YYYY-MM-DD'},{name:'to',type:'string',required:!0,description:'Last day off, YYYY-MM-DD'},{name:'reason',type:'string',required:!1,description:'Reason (default Holiday)'}],keywords:[],description:'Send your own holiday (time off) request to a manager, like the Send request button.',match:e=>v(e,/\b(holiday|time off|day off|days off|annual leave|leave)\b/)&&v(e,/\b(request|book|ask|want|need|like|have|put in|take|off)\b/)&&!v(e,Q)&&!v(e,/\b(who|how many|when is)\b/)?8:0,parse:(e,t)=>{const a=J(e,t?.today??(0,l.ymdOf)((0,$.appNow)())),r=e.match(/\b(?:for|because)\s+(?:a |an |my )?([a-z][a-z ]{2,40}?)\s*$/i);return{...a,reason:r&&!/\b(from|to|monday|tuesday|wednesday|thursday|friday|saturday|sunday|tomorrow|\d)/i.test(r[1])?r[1]:void 0}},preview:(e,t)=>t.whoId?`Ask for ${e.reason??'holiday'} from ${(0,$.niceDay)(String(e.from))}${e.to!==e.from?` to ${(0,$.niceDay)(String(e.to))}`:''}? A manager approves it.`:'Sign in first so I know who\u2019s asking.',run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const a=e=>/^\d{4}-\d{2}-\d{2}$/.test(String(e));return!a(e.from)||!a(e.to)||String(e.to)v(e,Q)&&v(e,/\b(swap|cover|swaps)\b/)?9:0,parse:e=>({who:e,outcome:/\b(decline|reject|refuse|no)\b/i.test(e)?'declined':'approved'}),preview:e=>{const t=X(e.who);if(!t)return'I couldn\u2019t find that open swap or cover request. Say the name on it.';const a=n.useOwner.getState().shifts.find(e=>e.id===t.shiftId),r=N(F(t.fromId)?.name),i=N(F(t.toId)?.name),s='swap'===t.kind?`${r}\u2019s swap with ${i}`:t.toId?`${i} covering ${r}`:`${r}\u2019s cover request`;return'declined'===e.outcome||t.toId?`${'declined'===e.outcome?'Decline':'Approve'} ${s}${a?` for ${G(a)}`:''}?${'declined'===e.outcome?'':' The shift moves and a note goes in the team chat.'}`:`Nobody has taken ${r}\u2019s cover yet, so it can\u2019t be approved. You can decline it.`},run:e=>{const t=X(e.who);if(!t)return'Nothing changed: no open request found.';if('declined'!==e.outcome&&!t.toId)return'Nothing changed: nobody has taken that cover yet.';const a=n.useOwner.getState(),r=a.shifts.find(e=>e.id===t.shiftId);if(a.setSwap(t.id,'declined'===e.outcome?'declined':'approved'),'declined'===e.outcome)return'Done: request declined.';const i=e=>N(F(e)?.name);return x('all','swap'===t.kind?`Shift swap: ${i(t.fromId)} \u2194 ${i(t.toId)} approved`:`Cover approved: ${i(t.toId)} covers ${i(t.fromId)}${r?` (${M[r.day]} ${R(r.start)}\u2013${R(r.end)})`:''}`),'Done: approved and posted in the team chat.'}},{id:'sign_safety_day',apps:O,title:'Sign today\u2019s food safety diary',risk:'change',params:[],keywords:[],description:'Sign today\u2019s food safety diary: the opening and closing checks were done and the safe methods were followed, like the diary Sign button. Today only.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,ae)&&!v(e,/\bweek(ly)?\b/)?9:0,preview:(e,t)=>{const a=(i.useSafety.getState().daySigns??[]).find(e=>e.date===t.today);if(a)return`Today\u2019s diary is already signed by ${a.by}.`;const r=te(t.today,t);return`Sign today\u2019s food safety diary as ${I(t)}: the opening and closing checks were done and the safe methods were followed today? Today: ${r.n} checks, ${r.bad} out of range${r.bad?`, ${r.fixed} with an action`:''}.`},run:(e,t)=>'staff'===t.role?'Nothing changed: only a manager or the head chef signs the diary.':(i.useSafety.getState().daySigns??[]).some(e=>e.date===t.today)?'It\u2019s already signed today.':(i.useSafety.getState().signDay({date:t.today,by:N(I(t)),byId:t.whoId??'',at:(0,$.appNow)().toISOString()}),'Done: today\u2019s diary signed.')},{id:'sign_safety_week',apps:O,title:'Sign off this week\u2019s food safety review',risk:'change',params:[],keywords:[],description:'Weekly food safety review: reads the six statements back; Confirm means yes to all six. If any reading is out of range without an action, it must be done on screen with a note.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,/\bweek(ly)?\b/)&&(v(e,ae)||v(e,/\b(review|safety|checks)\b/))?9:0,preview:(e,t)=>{const{week:a,summary:r}=re(t.today,t),n=(i.useSafety.getState().weekly??[]).find(e=>e.week===a);if(n)return`This week is already signed off by ${n.by}.`;const s=`Week of ${(0,$.niceDay)(a)}: ${r.entries} checks, ${r.outOfRange} out of range, ${r.actions} with an action, diary signed ${r.daysSigned} of 7 days.`;return r.actions`${t+1}. ${e}.`).join(' ')} Sign off the week?`},run:(e,t)=>{if('staff'===t.role)return'Nothing changed: only a manager or the head chef signs off the week.';const{week:a,summary:r}=re(t.today,t);return(i.useSafety.getState().weekly??[]).some(e=>e.week===a)?'This week is already signed off.':r.actions!0),note:'Signed by voice: yes to all.',summary:r}),'Done: week signed off.')}},{id:'record_accident',title:'Record an accident or near miss',risk:'change',params:[{name:'what',type:'string',required:!0,description:'What happened, in the speaker\u2019s words'},{name:'person',type:'string',required:!1,description:'Who was hurt'},{name:'location',type:'string',required:!1,description:'Where'},{name:'injury',type:'string',required:!1,description:'The injury'},{name:'firstAid',type:'string',required:!1,description:'First aid given'}],keywords:[],description:'Add an entry to the accident book (accident or near miss) with what was said; every field is read back first.',match:e=>v(e,/\baccident book\b/)?10:v(e,/\b(accident|injur(y|ed)|near miss|hurt|cut (him|her|them|my)self|burn(ed|t)? (him|her|them|my)self|slipped|tripped|fell over|scalded)\b/)&&v(e,/\b(record|log|report|write|add|book|had|there was|has|have|just)\b/)&&!v(e,/\b(how many|show|read)\b/)?8:0,parse:e=>{const t=ie(e);return{what:t.what,person:t.person,location:t.location,firstAid:t.firstAid}},preview:e=>{const t=ie(String(e.what)),a=String(e.person??t.person),r=String(e.location??t.location);return`Add to the accident book: when, today at ${D()}; who, ${a} (${t.personType}); where, ${r}; type, ${t.category}; what happened, ${_(t.what)}; injury, ${e.injury?String(e.injury):'Near miss'===t.category?'none (near miss)':'not recorded'}; first aid, ${e.firstAid||t.firstAid||'none recorded'}; reported by you. Check it before you confirm; you can add more in the Accident book.`},run:(e,t)=>{const a=ie(String(e.what)),r='Near miss'===a.category,n=(0,$.appNow)();return i.useSafety.getState().addAccident({when:`${(0,l.ymdOf)(n)}T${D()}`,location:String(e.location??a.location),person:String(e.person??a.person),personType:a.personType,category:a.category,what:a.what,injury:String(e.injury??'')||(r?'None (near miss)':'Not recorded'),firstAid:String(e.firstAid||a.firstAid||'')||'None recorded',witnesses:'None',reportedBy:N(I(t)),reportedById:t.whoId??'',app:'staff'===t.app?'staff':'chef'===t.app?'chef':'managers'}),'Done: added to the accident book.'+(/(hospital|fracture|broke|unconscious|ambulance)/i.test(a.what)?' This may need reporting under RIDDOR; check the Accident book.':'')}},{id:'tick_task',apps:['staff','chef','owner'],title:'Tick off one of my tasks',risk:'change',params:[{name:'task',type:'string',required:!0,description:'The task or reminder, as said'}],keywords:[],description:'Tick off one of today\u2019s daily tasks (yours), or mark a venue reminder like \u201cchairs up\u201d as done, like the tick and Done buttons.',match:e=>v(e,/\btick(ed)?( off)?\b|\bmark .* (as )?done\b|\b(i'?ve|i have|we'?ve) (done|finished|completed)\b|\b(task|reminder) (is )?done\b|\bdone the\b/)&&!v(e,/\b(shift|break|order|table|booking|clock)\b/)?7:0,parse:e=>({task:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I tick your tasks.';const{ymd:a,task:r,rem:n}=se(t,e.task);return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?`${_(r.text)} is already ticked today.`:`Tick off today\u2019s task ${_(r.text)}?`:n?`Mark the reminder ${_(n.text)} as done for today?`:'I couldn\u2019t find that in today\u2019s tasks. Say a word from the task.'},run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const{ymd:a,task:r,rem:n}=se(t,e.task),i={id:t.whoId,name:N(I(t))};return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?'Already ticked today.':(s.useDailyTasks.getState().toggleTick(t.rid,t.whoId,r.id,a,i),`Done: ${_(r.text)} ticked.`):n?(c.useReminders.getState().markDone({rid:t.rid,reminderId:n.id,forDate:a,at:(0,$.appNow)().toISOString(),staffRef:t.whoId,staffName:i.name}),`Done: ${_(n.text)} marked done.`):'Nothing changed: I couldn\u2019t find that task.'}},{id:'add_dish',apps:T,title:'Add a dish to the menu',risk:'change',params:[{name:'name',type:'string',required:!0,description:'Dish name'},{name:'section',type:'string',required:!1,description:'Menu section'},{name:'price',type:'string',required:!0,description:'Price in pounds'},{name:'description',type:'string',required:!1,description:'Short description'}],keywords:[],description:'Add a new dish to the menu, like Manage \u203a Add dish. It stays off the menu until the head chef signs off its recipe card.',match:e=>v(e,/\b(add|new|put)\b/)&&v(e,/\b(dish|menu item|to the menu|on the menu|onto the menu)\b/)&&!v(e,/\b(special|specials|sold out|order list)\b/)?8:0,parse:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t?.rid),n=e.toLowerCase(),i=e.match(/\b(?:called|named)\s+(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i)??e.match(/\b(?:add|put)\s+(?:a |an |the )?(?:new )?(?:dish\s+)?(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i),s=r?.sections.find(e=>n.includes(e.toLowerCase())||n.includes(e.toLowerCase().replace(/s$/,''))),o=ce(e);return{name:i?.[1]?.replace(/^(?:a |an )?(?:new )?dish\s*/i,'').trim(),section:s,price:null!=o?String(o):void 0}},preview:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=String(e.section??r?.sections[0]??'Mains');return`Add ${_(String(e.name))} to ${n} at \xa3${Number(e.price).toFixed(2)}${e.description?`, described as ${_(String(e.description))}`:''}? It stays off the menu until the head chef signs off its recipe card.`},run:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=Number(e.price),i=String(e.name??'').trim();return i.length<2||!Number.isFinite(n)||n<=0?'Nothing changed: I need a dish name and a price.':de(t.rid,i)?.name.toLowerCase()===i.toLowerCase()?'That dish is already on the menu.':(a.useStore.getState().addMenuItem({restaurantId:t.rid,section:String(e.section??r?.sections[0]??'Mains'),name:i,description:String(e.description??''),price:n,dietary:[],allergens:{},prepMins:10,soldOut:!1,signOff:null}),`Done: ${i} added. The head chef needs to add its recipe card and sign off the allergens before it shows.`)}},{id:'edit_dish',apps:T,title:'Rename a dish or change its description',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name now'},{name:'field',type:'string',required:!0,description:'name or description',enum:['name','description']},{name:'value',type:'string',required:!0,description:'The new name or description'}],keywords:[],description:'Rename a dish or change its menu description, like Manage \u203a Save dish. Renaming changes its recipe card, so the head chef signs it off again.',match:e=>v(e,/\brename\b|\b(change|update|set|edit)\b.*\b(description|name)\b|\bdescri(be|ption)\b.*\bas\b/)&&!v(e,/\b(price|booking|special|my name)\b/)?8:0,parse:e=>{const t=e.match(/\brename\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i);if(t)return{dish:t[1],field:'name',value:t[2].trim()};const a=e.match(/\bname of\s+(?:the\s+)?(.+?)\s+to\s+(.+)$/i);if(a)return{dish:a[1],field:'name',value:a[2].trim()};const r=e.match(/\bdescription (?:of|for)\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i)??e.match(/\b(?:describe|change|update|set)\s+(?:the\s+)?(.+?)(?:'s|\u2019s)?\s+(?:description\s+)?(?:to|as)\s+(.+)$/i);return r?{dish:r[1],field:'description',value:r[2].trim()}:{dish:e}},preview:(e,t)=>{const a=de(t.rid,e.dish);return a?'name'===e.field?`Rename ${_(a.name)} to ${_(String(e.value))}? Its recipe card changes too, so the head chef signs it off again.`:`Change the description of ${a.name} to ${_(String(e.value))}?`:'I couldn\u2019t find that dish on the menu.'},run:(e,t)=>{const r=de(t.rid,e.dish),n=String(e.value??'').trim();return r?n.length<2?'Nothing changed: say the new wording.':(a.useStore.getState().updateMenuItem(r.id,'name'===e.field?{name:n}:{description:n}),'name'===e.field?`Done: renamed to ${n}.`:`Done: description of ${r.name} changed.`):'Nothing changed: I couldn\u2019t find that dish.'}},{id:'add_recipe_ingredient',apps:['chef'],title:'Add an ingredient to a recipe card',risk:'change',params:[{name:'text',type:'string',required:!0,description:'e.g. add 50 grams of butter to the haggis'}],keywords:[],description:'Add an ingredient line to a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\badd\b/)&&v(e,/\b(ingredient|recipe|card)\b|\badd\s+\d+\s*(g|grams?|kg|ml|tbsp|tsp)\b/)&&!v(e,/\b(step|method|order list|special)\b/)?8:0,parse:e=>({text:e}),preview:(e,t)=>{const a=pe(String(e.text));if(!a)return'Say it like \u201cadd 50 grams of butter to the haggis\u201d.';const r=(0,$.findCard)(t.rid,a.dish);return r?`Add ${[a.qty,a.unit].filter(Boolean).join(' ')} ${a.name} to ${r.dish}\u2019s recipe card?${r.signOff?' It\u2019s signed off now, so it will need signing off again.':''} Check its allergens on the card.`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=pe(String(e.text)),r=a&&(0,$.findCard)(t.rid,a.dish);return a&&r?(await(0,y.recipeCards)().update(r.id,{ingredients:[...r.ingredients,{id:(0,k.uuid)(),name:a.name,qty:a.qty,unit:a.unit}]},{name:N(I(t)),role:'head-chef'}),`Done: ${a.name} added to ${r.dish}.${r.signOff?' It needs signing off again.':''}`):'Nothing changed: I couldn\u2019t find that recipe card.'}},{id:'add_recipe_step',apps:['chef'],title:'Add a method step to a recipe card',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'},{name:'step',type:'string',required:!0,description:'The step wording'}],keywords:[],description:'Add a method step to the end of a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\b(add|new)\b/)&&v(e,/\b(step|method)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:to|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*[:,]\s*(.+)$/i)??e.match(/\bstep\s+(?:to|for)\s+(?:the\s+)?(.+?)\s+(?:saying|that says|reading)\s+(.+)$/i);return t?{dish:t[1],step:t[2].trim()}:{dish:e}},preview:(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0;return a?`Add step ${a.steps.length+1} to ${a.dish}: ${_(String(e.step))}?${a.signOff?' It will need signing off again.':''}`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0,r=String(e.step??'').trim();return!a||r.length<3?'Nothing changed: I need the dish and the step.':(await(0,y.recipeCards)().update(a.id,{steps:[...a.steps,r]},{name:N(I(t)),role:'head-chef'}),`Done: step added to ${a.dish}.`)}},{id:'manager_clock',apps:T,title:'Clock someone in or out (manager correction)',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff first name or id'},{name:'action',type:'string',required:!0,description:'in, out, break_start or break_end',enum:['in','out','break_start','break_end']},{name:'reason',type:'string',required:!0,description:'Why (at least 3 letters)'}],keywords:[],description:'A manager clocks a member of staff in or out, or starts or ends their break, now, with a reason, like the Clock tab\u2019s manager buttons. It is marked as a manager correction.',match:e=>v(e,/\bclock\s+\w+\s+(in|out)\b|\bclock (in|out)\s+[a-z]+\b|\b(start|end)\s+(a |the )?break for\b|\b(end|finish)\s+\w+'?s break\b/)&&!v(e,/\b(me|myself|my|who|is|are|has)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=W(e)[0],r=e.match(/\b(?:reason|because|as)\b[:,]?\s*(.+)$/i),n=/\bbreak\b/.test(t)?/\b(end|finish|back)\b/.test(t)?'break_end':'break_start':/\bout\b/.test(t)?'out':'in';return{staffId:a?.id,action:n,reason:r?.[1]?.trim()}},preview:e=>{const t=E(e.staffId);return t?`${le[e.action??'in'].replace('{n}',N(t.name))} now, at ${D()}? Reason: ${_(String(e.reason))}. It\u2019s marked as a manager correction.`:'Who? Say their first name.'},run:(e,t)=>{const a=E(e.staffId);if(!a)return'Nothing changed: I couldn\u2019t tell who.';const r=e.action??'in',n=(0,g.managerClockAction)(r,{rid:t.rid,staffId:a.id,date:t.today,at:(0,$.appNow)().toISOString()},{id:t.whoId??'manager',name:N(I(t))},String(e.reason??''));return n.ok?`Done: ${N(a.name)} ${{in:'clocked in',out:'clocked out',break_start:'on a break',break_end:'back from break'}[r]} at ${D()}.${n.warn?' '+n.warn:''}`:'Nothing changed: '+n.message}},{id:'tips_pot',apps:T,title:'What\u2019s in the tips pot',risk:'look',params:[],keywords:[],description:'Managers only: the confirmed tips held for the team since the last payout (the Tips pot card).',match:e=>v(e,/\btips? (pot|jar|so far|held|this (period|fortnight|month|week))\b|\bin the tips\b|\bhow much (have we got |is there )?in tips\b|\bwhat are the tips\b|\bhow much (are|is) (the )?tips\b/)&&!v(e,/\b(pay|payout|split|share out)\b/)?8:0,preview:()=>'Tips pot',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const r=h.useCashUp.getState(),n=a.useStore.getState().restaurants.find(e=>e.id===t.rid),i=(0,f.payFor)(t.rid,n?.settings.pay,u.useOnboard.getState().answers).pay,s=(0,p.tipsPot)(r.tips.filter(e=>e.rid===t.rid),r.pot.filter(e=>e.rid===t.rid),(0,l.tipsPeriod)(i,t.today).start,t.today);return`The tips pot holds ${fe(s.total)} from ${(0,$.niceDay)(s.from)} to today, from ${s.days.length} confirmed cash-up${1===s.days.length?'':'s'}.${s.lastPayout?` Last paid out through ${(0,$.niceDay)(s.lastPayout.throughDate)}.`:''}`}},{id:'cash_up_summary',apps:T,title:'Read the latest cash-up',risk:'look',params:[{name:'day',type:'string',required:!1,description:'Day (else the latest)'}],keywords:[],description:'Managers only: the latest (or a named day\u2019s) cash-up: gross takings, tips and who confirmed it.',match:e=>v(e,/\bcash.?up\b|\btakings\b|\bhow much did we take\b/)&&!v(e,/\b(add|enter|start|do the|unlock|edit)\b/)?8:0,parse:(e,t)=>({day:j(e.replace(/\btonight\b/i,'today'),t?.today??(0,l.ymdOf)((0,$.appNow)()))??(/\b(last night|yesterday)\b/i.test(e)?'yesterday':void 0)}),preview:()=>'Cash-up read-out',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const a=new Date(t.today+'T12:00:00');a.setDate(a.getDate()-1);const r='yesterday'===e.day?(0,l.ymdOf)(a):e.day,n=h.useCashUp.getState().cashUps.filter(e=>e.rid===t.rid&&(!r||e.date===r)).sort((e,t)=>t.date.localeCompare(e.date)),i=n[0];return i?`Cash-up for ${(0,$.niceDay)(i.date)}: gross takings ${fe((0,p.grossOf)(i.vals))}, tips ${fe((0,p.combinedTips)(i.vals))} (cash and card). ${i.confirmedAt?`Confirmed${i.confirmedBy?` by ${i.confirmedBy}`:''}.`:'Not confirmed yet.'}`:r?`There\u2019s no cash-up for ${(0,$.niceDay)(r)}.`:'There\u2019s no cash-up yet.'}},{id:'table_note',apps:C,title:'Add a note to a table',risk:'change',params:[{name:'table',type:'string',required:!0,description:'Table'},{name:'note',type:'string',required:!0,description:'The note (say \u201cclear\u201d to remove it)'}],keywords:[],description:'Put a short note on a table on the floor plan (e.g. \u201chigh chair\u201d, \u201cbirthday\u201d), like the table sheet\u2019s Note.',match:e=>v(e,/\btables?\s+\w+/)&&v(e,/\bnote\b/)&&!v(e,/\bshift note\b/)?9:0,parse:e=>{const t=e.match(/\bnote\b(?:\s+(?:on|for|to)\s+tables?\s+\w+)?\s*(?:[:,-]|saying|that says|that|says|reading)?\s*(.+)$/i),a=/\b(clear|remove|delete) (the )?note\b/i.test(e);return{table:(0,$.tableIn)(e),note:a?'clear':t?.[1]?.replace(/^(?:on|for|to)?\s*tables?\s+\w+\s*[:,-]?\s*/i,'').trim()}},preview:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);return a?'clear'===e.note?`Clear the note on table ${a}?`:`Note on table ${a}: ${_(String(e.note))}?`:'Which table?'},run:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);if(!a)return'Nothing changed: I couldn\u2019t find that table.';const n='clear'===e.note?'':String(e.note??'').trim().slice(0,80);return(0,r.tablesOf)(a).forEach(e=>r.useFloor.getState().setLive(t.rid,e,{note:n||void 0})),n?`Done: note on table ${a}.`:`Done: note cleared on table ${a}.`}},{id:'log_lost_property',apps:T,title:'Log lost property',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What was found'},{name:'where',type:'string',required:!1,description:'Where it was found'}],keywords:[],description:'Add an item to the lost property log (held), like Extras \u203a Lost property \u203a Add.',match:e=>v(e,/\blost property\b|\b(found|someone left|left behind|handed in)\b\s+(a|an|some|their|his|her)\b|\b(a|an)\s+\w+(\s+\w+)?\s+(was )?(left behind|handed in)\b/)&&!v(e,/\b(how many|what'?s in|list|read|returned)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:found|left(?: behind)?|handed in|log|add)\s+(?:a |an |some |their |his |her )?(.+?)(?=\s+(?:at|on|in|under|by|near|from)\s|[,.]|$)/i)??e.match(/\b(?:a|an)\s+(.+?)\s+(?:was )?(?:left behind|handed in)/i),a=e.match(/\s(?:at|on|in|under|by|near)\s+(?:the\s+)?(table\s+\w+|bar|toilets?|coat ?rack|cloakroom|door|entrance|terrace|garden|car park|dining room|booth\s+\w+|[a-z]+ table)\b/i);return{item:t?.[1]?.replace(/^(?:lost property|to lost property)\s*:?\s*/i,'').trim(),where:a?.[1]}},preview:e=>`Log lost property: ${_(String(e.item))}, found ${e.where?`at ${e.where}`:'(place not noted)'}, today at ${D()}? It\u2019s marked as held.`,run:(e,t)=>{const a=String(e.item??'').trim();if(a.length<2)return'Nothing changed: say what was found.';const r=(0,$.appNow)();return n.useOwner.getState().addLost({item:a,where:String(e.where??'').trim()||'Not noted',foundAt:`${(0,l.ymdOf)(r)} ${D()}`,foundBy:N(I(t))}),`Done: ${a} logged as held.`}},{id:'add_reminder',apps:T,title:'Add a venue reminder for staff',risk:'change',params:[{name:'text',type:'string',required:!0,description:'What it says'},{name:'time',type:'string',required:!0,description:'HH:MM, UK time'},{name:'days',type:'string',required:!1,description:'Days (default every day)'},{name:'audience',type:'string',required:!1,description:'all, foh or kitchen',enum:['all','foh','kitchen']}],keywords:[],description:'Add a venue reminder shown to staff on shift at a time on chosen days, like Settings \u203a Advanced \u203a Reminders \u203a Add.',match:e=>v(e,/\b(remind|reminder)\b/)&&v(e,/\b(add|set|new|create|every|daily|weekdays?|weekends?|at \d)\b/)&&!v(e,/\b(me|my)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=/\b(kitchen|chefs?)\b/.test(t)?'kitchen':/\b(front of house|foh|floor|waiters?|servers?)\b/.test(t)?'foh':'all',r=e.match(/\bremind(?:er)?\s+(?:for\s+)?(?:everyone|all staff|staff|the team|the kitchen|kitchen|front of house|foh|the floor|chefs?)?\s*(?:to|that|:)\s+(.+?)(?=\s+(?:at\s+\d|every\b|on\s+(?:mon|tue|wed|thu|fri|sat|sun)|daily|weekdays?|weekends?)|$)/i)??e.match(/\breminder\s*(?:saying|that says|:)\s*(.+?)(?=\s+(?:at\s+\d|every\b|daily)|$)/i),n=e.match(/\bat\s+(\d{1,2}(?:[:.]\d{2})?\s*(?:am|pm)?)/i);return{text:r?.[1]?.trim(),time:n?(0,$.hm)(n[1])??void 0:void 0,days:ge(t).join(','),audience:a}},preview:e=>{const t=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number),a=String(e.text??''),r=a.charAt(0).toUpperCase()+a.slice(1);return`Add a reminder for ${ye[e.audience??'all']}: ${_(r)}, ${7===t.length?'every day':'every '+t.map(e=>me[e].replace(/^\w/,e=>e.toUpperCase())).join(', ')} at ${e.time} (UK time)?`},run:(e,t)=>{const a=String(e.text??'').trim(),r=String(e.time??'');if(a.length<2||!/^\d{2}:\d{2}$/.test(r))return'Nothing changed: I need the wording and a time like 21:00.';const n=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number).filter(e=>e>=0&&e<=6).sort();return c.useReminders.getState().ensure(t.rid),c.useReminders.getState().add(t.rid,{text:a.charAt(0).toUpperCase()+a.slice(1),days:n,time:r,audience:e.audience??'all'}),'Done: reminder added.'}}]},1428,[804,848,800,1014,865,1019,1029,1030,1002,1001,1024,13,1049,1050,1051,1020,1071,856,1079,1011,839,1429,1427]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.dishesFor=R,_e.findDish=E,_e.allergensSaid=M,_e.timeFrom=Y,_e.coversFrom=G,_e.dateFrom=Z,_e.nameFrom=$,Object.defineProperty(_e,"VOICE_ACTIONS",{enumerable:!0,get:function(){return X}});var e=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),s=_r(_d[7]),d=_r(_d[8]),l=_r(_d[9]),c=_r(_d[10]),p=_r(_d[11]),u=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]),f=_r(_d[15]),g=_r(_d[16]),b=_r(_d[17]),y=_r(_d[18]);const w=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},v=e=>String(e).padStart(2,'0'),k=e=>e.getFullYear()+'-'+v(e.getMonth()+1)+'-'+v(e.getDate()),S=e=>{const[t,r,a]=e.split('-').map(Number);return new Date(t,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},N=(e,t)=>t.test(e),I=(e,t)=>e+' '+t+(1===e?'':'s'),A={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},T=e=>null==e?void 0:A[e.toLowerCase()]??(Number.isFinite(Number(e))?Number(e):void 0),x=e=>e.who??('display'===e.app?'Main Display':'Assistant'),D={owner:'Managers',staff:'Staff',chef:'Head Chef',display:'Main Display'},C=e=>D[e.app??'owner'],O=new Set(['the','and','with','our','for']),L=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').split(/\s+/).filter(e=>e.length>2&&!O.has(e));function R(e){const t=i.useStore.getState(),r=(0,c.resolveMenu)(t.menu.filter(t=>t.restaurantId===e&&!t.hidden)).map(e=>({kind:'menu',id:e.id,name:e.name,allergens:e.allergens,soldOut:e.soldOut,price:e.price,signedOff:!!e.signOff})),a=l.useSpecials.getState().current[e];return[...r,...(a?.items??[]).map(e=>({kind:'special',id:e.id,name:e.name,allergens:e.allergens,price:e.price,signedOff:!!a?.allergenCheck}))]}const _=e=>e.replace(/s$/,'');function E(e,t){const r=new Set(L(e).map(_)),a=e.toLowerCase();let n;for(const e of R(t)){const t=L(e.name);if(!t.length)continue;const o=t.filter(e=>r.has(_(e))).length;if(!o)continue;const i=o/t.length+.25*o+(a.includes(e.name.toLowerCase())?2:0);(o>=Math.min(2,t.length)||t.length<=3)&&(!n||i>n.s)&&(n={d:e,s:i})}return n?.d}const F=[[/\b(gluten|wheat|coeliac|celiac|barley|rye)\b/,['gluten']],[/\bpeanuts?\b/,['peanuts']],[/\b(tree ?nuts?|almonds?|walnuts?|hazelnuts?|cashews?|pecans?|pistachios?)\b/,['treenuts']],[/\bnuts?\b/,['peanuts','treenuts']],[/\b(dairy|milk|lactose|cheese|cream|butter)\b/,['milk']],[/\beggs?\b/,['eggs']],[/\b(shellfish|crustaceans?|prawns?|crab|langoustines?)\b/,['crustaceans']],[/\b(molluscs?|mussels?|oysters?|squid|scallops?|clams?)\b/,['molluscs']],[/\bfish\b/,['fish']],[/\b(soya|soy)\b/,['soya']],[/\bcelery\b/,['celery']],[/\bmustard\b/,['mustard']],[/\bsesame\b/,['sesame']],[/\b(sulphites?|sulfites?|sulphur)\b/,['sulphites']],[/\blupin\b/,['lupin']]];function M(e){const t=new Set;for(const[r,a]of F)r.test(e)&&a.forEach(e=>t.add(e));return[...t]}const q=e=>p.ALLERGENS.find(t=>t.id===e)?.short??e,z='Always check the signed-off recipe card and tell the kitchen about any allergy.';function B(t,r){if('chef'===r?.app&&(0,e.isAnchorage)(r.rid)&&(0,e.isBarFridge)(t))return[];const a=d.useSafety.getState().points.filter(t=>'chef'!==r?.app||(0,e.chefCanSee)(r.rid,t)),n=/\b(done|complete|completed|finished|ok|okay|checked)\b/i.test(t);return(0,f.parseQuick)(t,a).filter(e=>e.point).map(e=>{const t=(0,f.isTempKind)(e.point.kind);return{pointId:e.point.id,value:t?e.value:null,done:t?void 0:n}})}const j=e=>{try{return JSON.parse(String(e.readings??'[]'))}catch{return[]}};function H(e){const t=d.useSafety.getState().points.find(t=>t.id===e.pointId);return t?(0,f.isTempKind)(t.kind)?null==e.value?t.name+': no temperature heard':t.name+': '+e.value+'\xb0C '+((0,f.inRange)(t,e.value)?'(safe)':'OUT OF RANGE (safe: '+(0,f.limitText)(t)+')'):t.name+': '+(e.done?'done':'NOT done'):'?'}function Y(e){const t=e.match(/\b(?:at|around|about)\s+(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})[:.](\d{2})\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})()\s*(am|pm)\b/);if(!t){const t=e.match(new RegExp("\\bhalf (?:past )?(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b"));if(!t)return;let r=T(t[1])??0;return r>=1&&r<=10&&(r+=12),v(r)+':30'}let r=Number(t[1]);const a=Number(t[2]||0),n=t[3];return'pm'===n&&r<12&&(r+=12),'am'===n&&12===r&&(r=0),!n&&r>=1&&r<=10&&(r+=12),r>23||a>59?void 0:v(r)+':'+v(a)}function G(e){const r=e.match(new RegExp("\\b(?:table for|party of|for|of)\\s+(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))"))??e.match(new RegExp("\\b(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\s*(?:covers|people|guests|adults|of us)\\b")),a=T(r?.[1]);return a&&(0,t.validParty)(a)?a:void 0}const P=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function Z(e,t){const r=new Date(t+'T12:00:00');if(/\btomorrow\b/.test(e))return r.setDate(r.getDate()+1),k(r);const a=P.findIndex(t=>e.includes(t));if(a>=0){const t=(r.getDay()+6)%7;return r.setDate(r.getDate()+((a-t+7)%7||(/\bnext\b/.test(e)?7:0))),k(r)}return t}function U(e,t,r,a){const n=i.useStore.getState(),o=n.restaurants.find(t=>t.id===e),d=s.useFloor.getState().plans[e]??(0,s.seedPlan)(e),l=o?.settings.turnMins??90,c=n.bookings.filter(r=>r.restaurantId===e&&r.date===t);return(0,u.freeTablesAt)(d,c,a,new Date(t+'T'+r+':00'),(0,u.turnFor)(a,l),l)}const K=(e,t)=>{const[r,a]=e.split(':').map(Number),n=60*r+a+t;return v(Math.floor(n/60))+':'+v(n%60)},W=e=>e.replace(/^\w/,e=>e.toUpperCase());function $(e){const t=e.match(/\b(?:under|name of|named|called)\s+([A-Za-z][A-Za-z'\u2019-]+(?:\s+[A-Z][A-Za-z'\u2019-]+)?)/i)??e.match(/\bname(?:'s| is)?\s+([A-Za-z][A-Za-z'\u2019-]+)/i);return t?W(t[1]):void 0}const J=e=>!/\b(how do i|how do you|where do i|how to)\b/.test(e),V=e=>!['collected','served','closed','cancelled'].includes(e.status),Q=e=>e.toUpperCase().replace(/[\s-]/g,''),X=[{id:'next_table_free',title:'When is the next table free?',risk:'look',description:'Estimate when the next table frees up, and how long a walk-in for 2 or 4 would wait.',params:[],keywords:['next table','table free'],match:e=>N(e,/\b(next|soonest|first)\b.*\btables?\b.*\b(free|ready|available|clear)\b|\bhow long\b.*\b(wait|walk)|\bwait(ing)? (time|for a table)\b|\bwhen\b.*\btable\b.*\b(free|ready)\b/)?4:0,preview:()=>'Next table free',run:(e,t)=>{const r=i.useStore.getState(),a=w(),n=k(a),o=r.restaurants.find(e=>e.id===t.rid);if(!o)return'I can\u2019t see this venue\u2019s tables yet.';const d=s.useFloor.getState(),l=d.plans[t.rid]??(0,s.seedPlan)(t.rid),c=r.bookings.filter(e=>e.restaurantId===t.rid),p=(0,m.closedAreasAt)(m.useBlocks.getState().blocks,t.rid,n,v(a.getHours())+':'+v(a.getMinutes())),f=(0,u.floorView)(l,c,r.orders.filter(e=>e.restaurantId===t.rid),d.live[t.rid]??{},a,o.settings.turnMins,p);return(0,h.nextFreeSentence)((0,h.nextTablesFree)(o,f,c.filter(e=>e.date===n),a,c),a)+' It\u2019s an estimate.'}},{id:'log_check',title:'Log a temperature or kitchen check',risk:'change',description:'Record fridge, freezer, cooking, cooling, hot-hold or delivery temperatures, or a cleaning or kitchen check, in the food safety log. Out-of-range readings are flagged.',params:[{name:'readings',type:'string',required:!0,description:'JSON list of {pointId, value in \xb0C or null, done for non-temperature checks}'}],keywords:['fridge','freezer','temperature','probe'],match:e=>J(e)&&N(e,/\b(fridges?|freezers?|walk.?in|cold room|temps?|temperatures?|degrees|probe|core temp|hot hold|cooling|cleaning|clean down|deep clean)\b/)&&(!N(e,/\b(seat|seated|party|covers?|people|guests?|table \w+|walk.?ins? (of|for)|just arrived)\b/)||N(e,/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus)\b/))?3:0,parse:(e,t)=>({readings:JSON.stringify(B(e,t))}),preview:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));return n.length?'Log in the food safety log: '+n.map(H).join('; ')+'?':'I didn\u2019t catch which fridge, freezer or check. Try \u201cwalk-in fridge 3 degrees\u201d.'},run:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));if(!n.length)return'Nothing logged: I didn\u2019t catch which unit or check.';if(n.some(e=>{const t=a.find(t=>t.id===e.pointId);return!!t&&(0,f.isTempKind)(t.kind)&&null==e.value}))return'Nothing logged: a temperature was missing. Say the number, for example \u201cfreezer minus 19\u201d.';const o=w().toISOString(),i='chef'===r.app?'chef':'owner'===r.app?'managers':'staff',s=n.filter(e=>a.some(t=>t.id===e.pointId)).map(e=>{const t=a.find(t=>t.id===e.pointId),n=(0,f.isTempKind)(t.kind),s=n?(0,f.inRange)(t,e.value):!!e.done,d=['display'===r.app?'Logged on the Main Display.':'',s?'':'Out of range: add the corrective action.'].filter(Boolean).join(' ');return{pointId:t.id,name:t.name,kind:t.kind,at:o,by:x(r),byId:r.whoId??'voice-'+(r.app??'owner'),app:i,value:n?e.value:void 0,done:n?void 0:!!e.done,ok:s,source:'voice',note:d||void 0}});d.useSafety.getState().addEntries(s);const l=s.filter(e=>!e.ok);return l.length?'Logged. '+l.map(e=>e.name+' is OUT OF RANGE').join(', ')+'. Check it now and add what you did in the food safety log.':'Logged: '+s.map(e=>e.name+' '+(null!=e.value?e.value+'\xb0C':'done')).join(', ')+'. All fine.'}},{id:'allergen_info',title:'Allergen question',risk:'look',description:'Answer allergen questions from the recipe cards and the menu: what a dish contains or may contain, or which dishes are free of an allergen.',params:[{name:'dish',type:'string',description:'Dish name'},{name:'allergens',type:'string',description:'Comma-separated allergen ids'}],keywords:['allergen','allergy','contain'],match:e=>!N(e,/(allergens?|allerg(y|ic|ies)|contains?|coeliac|celiac|safe for|free from|.free\b|intoleran)/)||N(e,/\b(sold out|price|draft)\b/)||N(e,/\btables?\b.*\bfree\b|\bfree\b.*\btables?\b/)?0:3,parse:(e,t)=>{const r=E(e,t.rid);let a=e.toLowerCase();if(r)for(const e of L(r.name))a=a.replace(new RegExp('\\b'+e+'\\b','g'),' ');return{dish:r?.name,allergens:M(a).join(',')}},preview:e=>'Allergens'+(e.dish?' in '+e.dish:''),run:(e,t)=>{const r=R(t.rid),a=e.dish?r.find(t=>t.name===e.dish):void 0,n=String(e.allergens??'').split(',').filter(Boolean);if(a){const e=p.ALLERGENS.filter(e=>'contains'===a.allergens[e.id]).map(e=>e.short),t=p.ALLERGENS.filter(e=>'may'===a.allergens[e.id]).map(e=>e.short);return(n.length?n.map(e=>'contains'===a.allergens[e]?a.name+' CONTAINS '+q(e)+'.':'may'===a.allergens[e]?a.name+' MAY CONTAIN '+q(e)+'.':'No '+q(e)+' is listed for '+a.name+'.').join(' '):a.name+' contains '+(e.length?e.join(', '):'none of the 14 allergens')+(t.length?', and may contain '+t.join(', '):'')+'.')+(a.signedOff?'':' Its allergens are NOT signed off yet.')+' '+z}if(n.length){const e=r.filter(e=>!e.soldOut&&n.every(t=>!e.allergens[t])),t=r.filter(e=>n.some(t=>'contains'===e.allergens[t]));return e.length+(1===e.length?' dish has':' dishes have')+' no '+n.map(q).join(' or ')+' listed'+(e.length?', for example '+e.slice(0,5).map(e=>e.name).join(', '):'')+'. '+t.length+' contain it. '+z}return'Which dish, or which allergen? For example \u201cdoes the fish supper contain gluten?\u201d.'}},{id:'set_sold_out',title:'Mark a dish sold out or back on',risk:'change',description:'Mark a menu dish sold out or back on. A reminder for staff: it shows on the Display and in the Sold out list.',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'soldOut',type:'string',required:!0,description:'yes = sold out, no = back on',enum:['yes','no']}],keywords:['sold out','back on','86'],match:e=>N(e,/\b(sold out|run out|ran out|out of stock|86|eighty.?six|back on|available again|back in stock|un.?86|none left)\b/)?4:0,parse:(e,t)=>{const r=E(e,t.rid),a=/\b(back on|available again|back in stock|un.?86)\b/i.test(e);return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,soldOut:a?'no':'yes'}},preview:e=>e.itemId?'Mark '+e.name+' '+('no'===e.soldOut?'back on':'sold out')+'?':e.name?e.name+' is on the Specials board; change it there.':'I couldn\u2019t find that dish on the menu.',run:async e=>e.itemId?(await o.repo.menu.updateItem(String(e.itemId),{soldOut:'no'!==e.soldOut}),'Done: '+e.name+' is '+('no'===e.soldOut?'back on':'sold out')+'.'):'Nothing changed: I couldn\u2019t find that dish on the menu.'},{id:'change_price',apps:['owner'],title:'Change a menu price',risk:'change',description:'Change the price of a menu dish (managers only).',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'pence',type:'integer',required:!0,description:'New price in pence'}],keywords:['price'],match:e=>N(e,/\b(price|charge|cost)\b/)&&N(e,/(\xa3|\d|pound)/)&&!N(e,/\b(special|offer)\b/)?3:0,parse:(e,t)=>{const r=E(e,t.rid),a=e.match(/\b(?:to|at)\s*\xa3?\s*(\d{1,3})(?:[.:](\d{1,2}))?/i)??e.match(/\xa3\s*(\d{1,3})(?:\.(\d{1,2}))?/)??e.match(/(\d{1,3})\s*pounds?(?:\s*(\d{1,2}))?/i),n=a?100*Number(a[1])+Number((a[2]??'0').padEnd(2,'0')):void 0;return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,pence:n,old:r?.price??void 0}},preview:e=>e.itemId?'Change '+e.name+' from '+(null!=e.old?(0,g.gbp)(Number(e.old)):'its current price')+' to '+(null!=e.pence?(0,g.gbp)(Number(e.pence)):'?')+'?':'I couldn\u2019t find that dish on the menu.',run:async(e,t)=>{if(t.role&&!['owner','manager'].includes(t.role))return'Only managers can change prices.';const r=Number(e.pence);return e.itemId&&r>0&&r<1e5?(await o.repo.menu.updateItem(String(e.itemId),{price:r}),'Done: '+e.name+' is now '+(0,g.gbp)(r)+'.'):'Nothing changed: I need the dish and a price.'}},{id:'draft_special',apps:['owner','chef'],title:'Draft a special',risk:'draft',description:'Save a special as a draft for the owner to approve. It goes on the Specials board only after its allergens are checked.',params:[{name:'text',type:'string',required:!0,description:'The special, e.g. \u201cHake with mussels, \xa318\u201d'}],keywords:['special'],match:e=>N(e,/\bspecials?\b/)&&N(e,/\b(add|new|put|draft|today'?s|tonight'?s|change|set)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\bspecials?\b(?:\s*(?:board|is|are|to|:))?\s*/i,'').trim()||e}),preview:e=>'Save a draft special: \u201c'+e.text+'\u201d. Its allergens get checked before it goes on the board.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'special',title:'New special',lines:[String(e.text),'Add its allergens and post it on the Specials board when approved.'],by:x(t),app:C(t)}),'Saved as a draft special for the owner to approve. It isn\u2019t on the board yet.')},{id:'check_availability',title:'Check table availability',risk:'look',description:'Check whether a table is free for a party at a date and time, and suggest nearby times if not.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'}],keywords:['availability','table for','free table'],match:e=>N(e,/\b(availability|available|space|room for|any room|got room|any tables?|got a table|free table|have we got|is there a table|can we fit|fit in)\b/)&&!N(e,/\b(sold|back on|allerg)/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r)}},preview:e=>'Check a table for '+(e.covers??'?')+' at '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'today'),run:(e,t)=>{const r=Number(e.covers),a=String(e.time),n=String(e.date??t.today),o=U(t.rid,n,a,r);if(o.length)return'Yes, there\u2019s room for '+r+' at '+a+' on '+S(n)+'. Best fit: table '+o[0].table+(o[0].area?' ('+o[0].area+')':'')+'.';const i=[];for(const e of[-30,30,-60,60,-90,90]){const o=K(a,e);if(U(t.rid,n,o,r).length&&i.push(o),i.length>=3)break}return'No table for '+r+' at '+a+' on '+S(n)+'.'+(i.length?' Free nearby: '+i.sort().join(', ')+'.':' Nothing free within 90 minutes either.')}},{id:'draft_booking',title:'Take a booking (draft)',risk:'draft',description:'Take a booking as a DRAFT for the owner to confirm in Bookings. The guest confirmation is only sent from there.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'},{name:'name',type:'string',description:'Guest name'}],keywords:['book','booking','reserve'],match:e=>N(e,/\b(book|booking|reserve|reservation)\b/)&&!N(e,/\b(availability|any tables?|have we got|is there|how many|move|cancel|booker)\b/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r),name:$(e)}},preview:(e,t)=>{const r=e.covers&&e.time?U(t.rid,String(e.date??t.today),String(e.time),Number(e.covers)):[],a=e.covers&&e.time?r.length?' Table '+r[0].table+' is free.':' NO table is free then.':'';return'Draft booking: '+(e.name??'guest')+', '+(e.covers??'?')+' covers, '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'?')+'.'+a+' The owner confirms it in Bookings; nothing is sent to the guest now.'},run:(e,r)=>(0,t.validParty)(Number(e.covers))?(b.useDrafts.getState().add({rid:r.rid,kind:'booking',title:'Booking: '+(e.name??'guest')+', '+e.covers+' covers',lines:[S(String(e.date))+' at '+e.time,'Take their phone number when you confirm it in Bookings.'],data:{covers:e.covers,date:e.date,time:e.time,name:e.name},by:x(r),app:C(r)}),'Saved as a draft booking for the owner to confirm. No confirmation has been sent.'):`Nothing saved. ${t.PARTY_RULE} How many people?`},{id:'add_waitlist',title:'Add to the waitlist',risk:'change',description:'Add a party to the waitlist. Nobody is messaged.',params:[{name:'name',type:'string',description:'Name'},{name:'covers',type:'integer',required:!0,description:'Party size'}],keywords:['waitlist','waiting list'],match:e=>N(e,/\b(wait ?list|waiting list|queue)\b/)?4:0,parse:e=>({name:$(e)??e.match(/\badd\s+([A-Z][a-z'\u2019-]+)\b/)?.[1],covers:G(e.toLowerCase())}),preview:e=>'Add '+(e.name??'a guest')+', '+(e.covers??'?')+' covers, to the waitlist?',run:async(e,r)=>{const a=Number(e.covers);if(!(0,t.validParty)(a))return`Nothing added: how many people? ${t.PARTY_RULE}`;return'Done: '+(await o.repo.waitlist.join(r.rid,String(e.name??'Guest'),a)).name+' is on the waitlist. Nobody has been messaged.'}},{id:'read_orders',title:'Read out orders',risk:'look',description:'Read out the live orders and takeaways.',params:[],keywords:['orders'],match:e=>N(e,/\b(orders?|takeaways?|tickets?|collections?)\b/)&&N(e,/\b(read|what|any|list|how many|open|live|waiting|outstanding|pending|due|next)\b/)&&!N(e,/\b(shopping|booker|bidfood|supplier)\b/)?3:0,preview:()=>'Read out the live orders',run:(e,t)=>{const a=i.useStore.getState().orders.filter(e=>e.restaurantId===t.rid&&V(e)).sort((e,t)=>(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt));if(!a.length)return'No live orders right now.';const n=a.filter(e=>'takeaway'===e.type).length;return I(a.length,'live order')+' ('+n+' takeaway). '+a.slice(0,6).map(e=>{return('takeaway'===e.type?'Takeaway ':(0,r.tableNumbers)(e.tableNo)+' ')+e.ref+' for '+e.customerName+', '+I(e.lines.reduce((e,t)=>e+t.qty,0),'item')+', '+e.status+(e.slotTime?', due '+(t=e.slotTime,new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})):'')+(e.allergies.length?', HAS ALLERGIES':'');var t}).join('. ')+(a.length>6?'. And '+(a.length-6)+' more.':'.')}},{id:'day_numbers',title:'Covers, sales and forecast',risk:'look',description:'How many covers are booked today and tomorrow, sales through CoverCharge so far today, and the forecast for the rest of today.',params:[],keywords:['covers','sales','forecast'],match:e=>N(e,/\b(covers|sales|takings|revenue|forecast|how busy|busy tonight|expected|how many (people|guests|bookings))\b/)&&!N(e,/\b(walk|seat|wait ?list|add|book (a|for|in))\b/)?3:0,preview:()=>'Today\u2019s covers, sales and forecast',run:(e,t)=>{const r=i.useStore.getState(),n=w(),o=k(n),s=r.restaurants.find(e=>e.id===t.rid),d=r.bookings.filter(e=>e.restaurantId===t.rid),l=d.filter(e=>e.date===o&&['confirmed','seated','finished'].includes(e.status)),c=l.reduce((e,t)=>e+t.partySize,0),p=l.filter(e=>e.walkIn).reduce((e,t)=>e+t.partySize,0),u=new Date(n);u.setDate(u.getDate()+1);const h=k(u),m=d.filter(e=>e.date===h&&['confirmed','pending'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),f=r.orders.filter(e=>e.restaurantId===t.rid),b=f.filter(e=>e.createdAt.slice(0,10)===o&&'cancelled'!==e.status),y=b.reduce((e,t)=>e+t.subtotal,0);let v='';if(s){const e=(0,a.forecastToday)(s,d,f,r.events,n);v=e.open?e.enough?' Forecast for the rest of today: about '+e.restOfDay.covers+' covers ('+(0,a.coversRange)(e.restOfDay.low,e.restOfDay.high,!1)+')'+(e.example?', example figures.':'.'):' No forecast yet: not enough history ('+e.restOfDay.booked+' covers booked for the rest of today).':''}return'Today: '+c+' covers booked or seated'+(p?', including '+p+' walk-in':'')+'. '+I(b.length,'order')+' through CoverCharge so far'+('display'===t.app||'staff'===t.app||'staff'===t.role?'.':', '+(0,g.gbp)(y)+' before tips (till sales aren\u2019t included).')+v+' Tomorrow: '+m+' covers booked so far.'}},{id:'supplier_list',title:'Add to a Booker or Bidfood shopping list',risk:'draft',description:'Add items to a DRAFT shopping list for Booker or Bidfood for the owner to check and order on the supplier\u2019s site. Never places an order.',params:[{name:'supplier',type:'string',required:!0,description:'Supplier',enum:['booker','bidfood']},{name:'items',type:'string',required:!0,description:'Items separated by semicolons'}],keywords:['booker','bidfood','shopping list'],match:e=>N(e,/\b(booker|bidfood|bid food)\b/)?4:N(e,/\b(shopping list|order list|we need more|we'?re low on|running low)\b/)?3:0,parse:e=>({supplier:/\bbid ?food\b/i.test(e)?'bidfood':'booker',items:e.replace(/\b(to|on|onto)\s+(the\s+)?(booker|bidfood|bid food)?\s*(shopping\s+|order\s+)?list\b.*$/i,'').replace(/\b(from|at)\s+(booker|bidfood|bid food)\b/i,'').replace(/[,.]?\s*\b(put|add|stick)\s+(it|them|that|those)\b.*$/i,'').replace(/^.*?\b(add|need|order|get|put|low on)\b\s*/i,'').trim().split(/\s*(?:,|\band\b)\s*/i).map(e=>e.trim()).filter(Boolean).join('; ')}),preview:e=>'Add to the draft '+('bidfood'===e.supplier?'Bidfood':'Booker')+' list: '+String(e.items??'').split('; ').join(', ')+'. Nothing is ordered; the owner checks it and orders on the supplier\u2019s site.',run:(e,t)=>{const r=String(e.items??'').split('; ').filter(Boolean);if(!r.length)return'Nothing added: which items?';const a=b.useDrafts.getState().addToList(t.rid,'bidfood'===e.supplier?'bidfood':'booker',r,x(t),C(t));return'Added to the draft '+a.title+' ('+I(a.lines.length,'item')+'). Nothing has been ordered.'}},{id:'draft_offer',title:'Draft an offer',risk:'draft',description:'Save an offer or promotion as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The offer'}],keywords:['offer','promotion'],match:e=>N(e,/\b(offer|promotion|promo|deal|discount|happy hour|two for one|2 for 1)\b/)&&N(e,/\b(draft|create|make|set up|new|add|run|do)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\b(?:offer|promotion|promo|deal)\b\s*(?:for|of|:)?\s*/i,'').trim()||e}),preview:e=>'Save a draft offer for the owner to approve: \u201c'+e.text+'\u201d. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'offer',title:'New offer',lines:[String(e.text)],by:x(t),app:C(t)}),'Saved as a draft offer for the owner to approve. Nothing was published or sent.')},{id:'draft_event',title:'Draft an event',risk:'draft',description:'Save an event (quiz, live music, tasting night) as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The event'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['event'],match:e=>N(e,/\b(event|quiz|live music|tasting|gig|party night|music night|open mic|ceilidh)\b/)&&N(e,/\b(draft|create|make|plan|set up|new|add|put on|run)\b/)?3:0,parse:(e,t)=>({text:e.replace(/^.*?\b(?:draft|create|make|plan|set up|add|put on|run)\b\s*(?:an?|the)?\s*(?:new\s+)?(?:event)?\s*(?:for|:)?\s*/i,'').trim()||e,date:/\b(tomorrow|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i.test(e)?Z(e.toLowerCase(),t.today):void 0}),preview:e=>'Save a draft event for the owner to approve: \u201c'+e.text+'\u201d'+(e.date?' on '+S(String(e.date)):'')+'. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'event',title:'New event',lines:[String(e.text),...e.date?[S(String(e.date))]:[]],data:{date:e.date},by:x(t),app:C(t)}),'Saved as a draft event for the owner to approve. Nothing was published or sent.')},{id:'card_balance',apps:['owner','chef'],title:'Gift card or stamp card balance',risk:'look',description:'Look up a gift card balance by its code, or a summary of stamp cards.',params:[{name:'code',type:'string',description:'Gift card code'},{name:'kind',type:'string',description:'gift or stamp',enum:['gift','stamp']}],keywords:['gift card','voucher','stamp card'],match:e=>N(e,/\b(gift ?cards?|gift vouchers?|vouchers?|stamp ?cards?|stamps|loyalty)\b/)?3:0,parse:e=>{const t=e.toUpperCase().replace(/\b(GIFT|CARDS?|VOUCHERS?|BALANCE|CHECK|WHAT'?S|WHAT|THE|ON|IS|CODE|FOR|OF|HOW|MUCH|LEFT|STAMPS?|A)\b/g,' ').match(/[A-Z0-9][A-Z0-9 -]{3,}[A-Z0-9]/);return{kind:/stamp|loyalty/i.test(e)?'stamp':'gift',code:t?Q(t[0]):void 0}},preview:e=>'stamp'===e.kind?'Stamp cards':'Gift card '+(e.code??''),run:(e,t)=>{const r=i.useStore.getState();if('stamp'===e.kind&&(0,n.staffServer)())return(0,n.loyaltySummary)().then(e=>I(e.members,'guest')+' have stamp cards here; '+I(e.rewardsReady,'reward')+' ready to use. To check one guest, open Stamp card and find or scan them.',()=>'I couldn\u2019t reach the stamp cards just now. Try again in a moment.');if('stamp'===e.kind){const e=r.stampCards.filter(e=>e.restaurantId===t.rid),a=e.reduce((e,t)=>e+t.rewardsAvailable,0);return I(e.length,'guest')+' have stamp cards here; '+I(a,'reward')+' ready to claim. To check one guest, scan their card in Stamp cards.'}if(!e.code)return'Read me the code on the gift card, letter by letter.';const a=String(e.code),o=r.giftCards.filter(e=>e.restaurantId===t.rid).find(e=>Q(e.code)===a||a.length>=4&&Q(e.code).includes(a));return o?'Gift card '+o.code+': '+(0,g.gbp)(o.balance)+' left of '+(0,g.gbp)(o.initial)+'.':'I couldn\u2019t find a gift card with that code. Check it and try again.'}},{id:'feedback_summary',title:'Summarise feedback',risk:'look',description:'Summarise the last 7 days of guest ratings and comments.',params:[],keywords:['feedback','reviews'],match:e=>N(e,/\b(feedback|reviews?|ratings?|complaints?|comments?|what are (guests|people) saying)\b/)?3:0,preview:()=>'Summarise this week\u2019s feedback',run:(e,t)=>{const r=w().getTime()-6048e5,a=i.useStore.getState().ratings.filter(e=>e.restaurantId===t.rid&&new Date(e.createdAt).getTime()>=r);if(!a.length)return'No guest feedback in the last 7 days.';const n=a.reduce((e,t)=>e+t.stars,0)/a.length,o=a.filter(e=>e.stars<=3&&e.comment).slice(0,2),s=a.filter(e=>e.stars>=5&&e.comment).slice(0,1);return I(a.length,'rating')+' in the last 7 days, averaging '+n.toFixed(1)+' stars.'+(s.length?' Best: \u201c'+s[0].comment+'\u201d.':'')+(o.length?' To look at: '+o.map(e=>'\u201c'+e.comment+'\u201d ('+e.stars+' stars)').join('; ')+'.':' No low scores.')}},{id:'shift_note',title:'Leave a shift note',risk:'change',description:'Leave a note for the next shift.',params:[{name:'text',type:'string',required:!0,description:'The note'}],keywords:['shift note','handover'],match:e=>N(e,/\b(shift note|leave a note|note for|handover|tell the next shift|let the next shift know|note that)\b/)&&!N(e,/\b(read|any notes|what notes)\b/)?4:0,parse:e=>({text:e.replace(/^.*?\b(?:shift note|leave a note|note for (?:the )?(?:next shift|tomorrow|tonight|morning|evening)|handover note|handover|tell the next shift|let the next shift know|note that)\b\s*(?:that|:|,|for the next shift)?\s*/i,'').trim()||e}),preview:e=>'Leave a shift note: \u201c'+e.text+'\u201d?',run:(e,t)=>(y.useShiftNotes.getState().add({rid:t.rid,text:String(e.text),by:x(t),app:C(t)}),'Shift note saved. It shows on the Shift notes screen.')},{id:'read_shift_notes',title:'Read shift notes',risk:'look',description:'Read out the latest open shift notes.',params:[],keywords:['notes'],match:e=>N(e,/\b(read|any|what|latest)\b.*\b(shift notes?|notes|handover)\b/)?5:0,preview:()=>'Read the latest shift notes',run:(e,t)=>{const r=y.useShiftNotes.getState().notes.filter(e=>e.rid===t.rid&&!e.done).slice(0,5);return r.length?r.map(e=>e.by+', '+new Date(e.at).toLocaleString('en-GB',{weekday:'short',hour:'2-digit',minute:'2-digit'})+': '+e.text).join('. '):'No open shift notes.'}}]},1429,[804,1098,829,1120,1206,848,800,1014,1019,989,831,830,1079,1080,1011,1020,836,1430,1431]); -__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return f}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},d=r(_d[1]),n=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},f=(0,d.create)()((0,n.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,d,n,o,f)=>{const p=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===d&&'draft'===e.status);if(p){const t={...p,lines:[...p.lines,...n]};return e(e=>({drafts:e.drafts.map(e=>e.id===p.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:d,title:('bidfood'===d?'Bidfood':'Booker')+" shopping list",lines:n,by:o,app:f})},decide:(t,s,d)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:d,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,n.createJSONStorage)(()=>s.default)}))},1430,[808,815,818]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1431,[808,815,818]); -__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,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1432,[798,34,283,364,236,402,102,815,794,840,25]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return a}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],o=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from Bidfood or Booker',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add Bidfood or Booker for this venue, with your account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add Bidfood or Add Booker (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and Booker or Bidfood lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cwalk-in fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, Booker and Bidfood shopping lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cwalk-in fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Take a picture of the taking sheet, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Take a picture of the taking sheet, or upload a spreadsheet',keywords:['cash up','photo','spreadsheet','csv','excel','xlsx','camera','sheet','gross','card','cash','tips','takings'],body:'In Cash up & sales tap Take a picture of the taking sheet: the camera opens and the figures are filled in from the photo. Check every figure beside the photo (gross, card, cash, tips, food and drink), change anything that is wrong, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. If the photo can\u2019t be read, type the figures in.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'The taking sheet buttons are here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display then shows a Buy a gift card button with a large QR code. Guests buy on your website; the Display shows no prices or balances.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per person, the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Upload cash up sheet. Your phone camera opens; take a photo of the paper sheet (you can add several). The review screen shows the photo beside the figures. Automatic reading isn\u2019t switched on yet, so type each figure from the photo; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],a=t=>o.find(o=>o.id===t)},1433,[]); -__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1434,[]); -__d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return x}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]);const i=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},h=e=>String(e).padStart(2,'0'),c=e=>e.getFullYear()+'-'+h(e.getMonth()+1)+'-'+h(e.getDate()),d=e=>{const t=new Date(e);return h(t.getHours())+':'+h(t.getMinutes())},l=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return h(Math.floor(t/60))+':'+h(t%60)},u=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),h=new Date(i());return h.setDate(h.getDate()+1),e===c(h)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},m=(e,t)=>t.test(e),p=e=>(e??'').replace(' (example)',''),f=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),b=['staff'],k=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],w={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function y(e,t){return'all'===e||(0,n.inChannel)(e,t)}function S(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:p(e.name),nickname:e.nickname},o))}const v=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>m(e,/\bkitchen (chat|group|channel)\b/)&&!m(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:b,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>m(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&m(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!m(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=S(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:p(o.name)};const h=k.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(w[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=f(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||y(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(w[s]??'the team chat')+'.'):'You can\u2019t post in '+(w[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:b,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>m(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=f(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||y(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),l=e=>'system'===e.from?'CoverCharge':p(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return l(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(w[t]??t))+' at ')+d(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:b,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>m(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&m(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!m(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=i(),h=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>h)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+u(c.date,s)+', '+l(c.start)+' to '+l(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>u(e.date,s)+' '+l(e.start)+'\u2013'+l(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:b,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>m(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),h=a.today,c=o.getHours()+o.getMinutes()/60,u=s.shifts.find(e=>e.staffId===a.whoId&&e.published&&e.date===h);return n?'You\u2019re clocked in since '+d(n.in)+'.'+(u?' Your shift ends at '+l(u.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':u&&u.end>c?'You\u2019re not clocked in. Your shift today is '+l(u.start)+' to '+l(u.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(u?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:b,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>m(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const h=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+d(e.start)+'. Breaks today: '+h+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return h?'You\u2019ve had '+h+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:b,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>m(e,/\bspecials?\b/)&&!m(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:b,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>m(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],x=new Set(['log_check','allergen_info','next_table_free',...v.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1435,[800,865,989,836,1429,1032]); -__d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1436,[]); -__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_KEYTERMS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"MAX_APP_KEYTERMS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"VENUE_WORDS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"cleanTerm",{enumerable:!0,get:function(){return u}}),e.venueKeyterms=function(l){const b=[],f=new Set,h=t=>{const a=u(t??''),n=a.toLowerCase();a.length>=2&&!f.has(n)&&b.lengtht.active).forEach(t=>h(String(t.name).split(/\s+/)[0]))}catch{}try{(n.useFloor.getState().plans[l]??(0,n.seedPlan)(l)).areas.forEach(t=>h(t.name))}catch{}try{s.forEach(h)}catch{}try{a.useStore.getState().menu.filter(t=>!t.restaurantId||t.restaurantId===l).forEach(t=>h(t.name))}catch{}return b};var t=r(d[0]),a=r(d[1]),n=r(d[2]);const l=100,c=80,o=['walk-in','covers','table','seat','seated','clear','cleared','needs clearing','block','unblock','waitlist','lobster','crab','langoustines','scallops','sold out','no-show','Sitooterie','Beer Garden','Main Restaurant','party of','people'],s=['table one','table two','table three','table four','table five','table six','table seven','table eight','table nine','table ten','table eleven','table twelve'],u=t=>t.replace(/\([^)]*\)/g,' ').replace(/[^\p{L}\p{N} '&.-]/gu,' ').replace(/\s+/g,' ').trim().slice(0,50).trim()},1437,[865,800,1014]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useVoiceNav",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(()=>({go:null}))},1438,[815]); -__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_TASKS_PER_MONTH",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"VOICE_WARN_AT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"VOICE_FAIR_USAGE",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"monthKey",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"voiceUsage",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"REACHED_TEXT",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"WARN_TEXT",{enumerable:!0,get:function(){return v}}),_e.useVoiceUsage=function(e,t=new Date){const n=h(n=>n.used[e]?.[f(t)]??0);return _(n)};var e,t=r(_d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(_d[1]),s=r(_d[2]);const u=1e3,c=.8,d='Fair usage: 1,000 voice tasks a month per venue',l=new Set(['log_check']),f=(e=new Date)=>e.getFullYear()+'-'+String(e.getMonth()+1).padStart(2,'0'),h=(0,o.create)()((0,s.persist)(e=>({used:{},add:(t,n)=>e(e=>({used:{...e.used,[t]:{[n]:(e.used[t]?.[n]??0)+1}}}))}),{name:'covercharge-voice-usage-v1',version:1,storage:(0,s.createJSONStorage)(()=>n.default)})),_=e=>{const t=e/u;return{used:e,limit:u,pct:t,warn:t>=c,reached:e>=u,line:'Voice assistant: '+e.toLocaleString('en-GB')+' of 1,000 tasks used this month, resets on the 1st'}},b={get:(e,t=new Date)=>_(h.getState().used[e]?.[f(t)]??0),allowed:(e,t,n=new Date)=>null!=t&&l.has(t)||!b.get(e,n).reached,record:(e,t=new Date)=>h.getState().add(e,f(t))},p='This venue has used its fair-usage allowance of 1,000 voice tasks for this month. It starts again on the 1st. Food safety logging still works, and the owner can contact CoverCharge if you need more.',v=e=>e.line+'. That\u2019s '+Math.round(100*e.pct)+'% of this venue\u2019s fair-usage allowance.'},1439,[808,815,818]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useVoiceKeys",{enumerable:!0,get:function(){return e}}),_e.installVoiceKeys=function(){if('undefined'==typeof window||!window.addEventListener)return()=>{};let n=!1;const o=o=>(o.metaKey||o.ctrlKey)&&o.shiftKey&&'g'===o.key.toLowerCase()?(o.preventDefault(),void(o.repeat||e.getState().send('toggle'))):!o.metaKey&&!o.ctrlKey||o.shiftKey||'/'!==o.key?void('Space'!==o.code||o.metaKey||o.ctrlKey||o.altKey||t(o.target)||(o.preventDefault(),o.repeat||n||(n=!0,e.getState().send('start')))):(o.preventDefault(),void e.getState().send('type')),s=t=>{'Space'===t.code&&n&&(t.preventDefault(),n=!1,e.getState().send('stop'))},l=()=>{n&&(n=!1,e.getState().send('stop'))};return window.addEventListener('keydown',o,!0),window.addEventListener('keyup',s,!0),window.addEventListener('blur',l),()=>{window.removeEventListener('keydown',o,!0),window.removeEventListener('keyup',s,!0),window.removeEventListener('blur',l)}};const e=(0,r(d[0]).create)((e,t)=>({last:null,send:n=>e({last:{cmd:n,n:(t().last?.n??0)+1}})})),t=e=>{const t=e?.tagName;return'INPUT'===t||'TEXTAREA'===t||'SELECT'===t||!!e?.isContentEditable}},1440,[815]); -__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=u(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),k=[],A=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);if(i.includes(c))continue;k.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0});const u='st-jack'===t?{auto:'rota'}:{};d=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:f(d,23.5)}:void 0,...u}):d===y&&e<=m&&A.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:f(d,u.auto?e:e-.05),inSite:!0,...u})}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!k.some(e=>e.staffId===t.staffId&&e.date===t.date)),...k],attendance:[...S.attendance,...A]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:f(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:f((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',u=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,f=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1441,[848,800,865,1024,15,997,846]); -__d(function(e,o,s,p,t,a,n){"use strict";t.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},1442,[]); -__d(function(e,o,s,p,c,t,d){"use strict";c.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},1443,[]); -__d(function(o,e,s,p,f,t,d){"use strict";f.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},1444,[]); -__d(function(o,s,e,p,d,t,n){"use strict";d.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},1445,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1446,[30,34,846,25]); -__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 t.Head}});const t=(n=r(d[0]),c=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(c,t)||Object.defineProperty(c,t,{enumerable:!0,get:function(){return n[t]}})}),n);var n,c},1447,[1448]); -__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var c in n)Object.defineProperty(t,c,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,c).get})})(e,{get Head(){return u},get default(){return s}});const n=r(d[1]),c=r(d[2]);function o({children:c}){return(0,t().jsx)(n.Helmet,{children:c})}const u=({children:n})=>(0,c.useIsFocused)()?(0,t().jsx)(o,{children:n}):null;u.Provider=n.HelmetProvider;const s=u},1448,[25,1449,591]); -__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>fe,HelmetData:()=>se,HelmetProvider:()=>oe}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[0])),T=u(r(d[0])),A=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(A||{}),O={rel:["amphtml","canonical","alternate"]},C={type:["application/ld+json"]},w={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x=Object.values(A),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},$=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",k="defaultTitle",S="defer",E="encodeSpecialCharacters",M="onChangeClientState",P="titleTemplate",H="prioritizeSeoTags",D=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},L=t=>{let n=D(t,"title");const s=D(t,P);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=D(t,k);return n||i||void 0},I=t=>D(t,M)||(()=>{}),U=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),N=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;it.push(n));const l=Object.keys(o);for(let t=0;t{if(Array.isArray(t)&&t.length)for(let s=0;sArray.isArray(t)?t.join(""):t,z=(t,n)=>{const s=Object.keys(t);for(let i=0;iArray.isArray(t)?t.reduce((t,s)=>(z(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},F=(t,n)=>({...t,[n]:void 0}),Y=["noscript","script","style"],K=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),G=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${K(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),W=(t,n,s,i)=>{const o=G(s),l=R(n);return o?`<${t} ${j}="true" ${o}>${K(l,i)}`:`<${t} ${j}="true">${K(l,i)}`},J=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${K(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===Y.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}`}`},""),Q=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),V=(t,n,s)=>{const i=Q(s,{key:n,[j]:!0});return[T.default.createElement("title",i,n)]},X=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),T.default.createElement(t,i)}),Z=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>V(0,n.title,n.titleAttributes),toString:()=>W(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Q(n),toString:()=>G(n)};default:return{toComponent:()=>X(t,n),toString:()=>J(t,n,s)}}},ee=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=B(t,w),l=B(n,O),c=B(s,C);return{priorityMethods:{toComponent:()=>[...X("meta",o.priority),...X("link",l.priority),...X("script",c.priority)],toString:()=>`${Z("meta",o.priority,i)} ${Z("link",l.priority,i)} ${Z("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},te=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=ee(t)),{priority:T,base:Z("base",n,i),bodyAttributes:Z("bodyAttributes",s,i),htmlAttributes:Z("htmlAttributes",o,i),link:Z("link",y,i),meta:Z("meta",f,i),noscript:Z("noscript",l,i),script:Z("script",b,i),style:Z("style",c,i),title:Z("title",{title:p,titleAttributes:u},i)}},re=[],ne=!("undefined"==typeof window||!window.document||!window.document.createElement),se=class{instances=[];canUseDOM=ne;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?re:this.instances,add:t=>{(this.canUseDOM?re:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?re:this.instances).indexOf(t);(this.canUseDOM?re:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=te({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ie=b.default.createContext({}),oe=class t extends b.Component{static canUseDOM=ne;constructor(n){super(n),this.helmetData=new se(this.props.context||{},t.canUseDOM)}render(){return b.default.createElement(ie.Provider,{value:this.helmetData.value},this.props.children)}},ae=r(d[0]),le=(t,n)=>{if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;const s=Object.keys(t),i=Object.keys(n);return s.length===i.length&&s.every(s=>Object.prototype.hasOwnProperty.call(n,s)&&t[s]===n[s])},ce=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},pe=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},ue=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=R(t)),pe("title",n)},de=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;pe("body",i),pe("html",o),ue(f,b);const T={baseTag:ce("base",s),linkTags:ce("link",l),metaTags:ce("meta",c),noscriptTags:ce("noscript",p),scriptTags:ce("script",h),styleTags:ce("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},he=null,me=t=>{he&&cancelAnimationFrame(he),t.defer?he=requestAnimationFrame(()=>{de(t,()=>{he=null})}):(de(t),he=null)},ye=class extends ae.Component{rendered=!1;shouldComponentUpdate(t){return!le(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:N(["href"],o),bodyAttributes:U("bodyAttributes",o),defer:D(o,S),encode:D(o,E),htmlAttributes:U("htmlAttributes",o),linkTags:q("link",["rel","href"],o),metaTags:q("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:q("noscript",["innerHTML"],o),onChangeClientState:I(o),scriptTags:q("script",["src","innerHTML"],o),styleTags:q("style",["cssText"],o),title:L(o),titleAttributes:U("titleAttributes",o),prioritizeSeoTags:_(o,H)});var o;oe.canUseDOM?me(i):te&&(s=te(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},fe=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(F(this.props,"helmetData"),F(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){if(!x.some(n=>t.type===n))throw new Error("function"==typeof t.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`);if(n&&"string"!=typeof n&&(!Array.isArray(n)||n.some(t=>"string"!=typeof t)))throw new Error(`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`} ) Refer to our API for more information.`);return!0}mapChildrenToProps(t,n){let s={};return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[$[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof se)){i=new se(i.context,!0),delete s.helmetData}return i?y.default.createElement(ye,{...s,context:i.value}):y.default.createElement(ie.Consumer,null,t=>y.default.createElement(ye,{...s,context:t}))}}},1449,[34,172]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1450,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";function t(){const e=r(d[0]);return t=function(){return e},e}function e(){const t=r(d[1]);return e=function(){return t},t}function n(){const t=f(r(d[2]));return n=function(){return t},t}function o(){const t=r(d[3]);return o=function(){return t},t}Object.defineProperty(_e,"__esModule",{value:!0}),Object.defineProperty(_e,"renderRootComponent",{enumerable:!0,get:function(){return y}});const u=f(r(d[4]));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}function f(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=c(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var s=u?Object.getOwnPropertyDescriptor(t,f):null;s&&(s.get||s.set)?Object.defineProperty(o,f,s):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o}function s(t){if('[object Object]'!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function p(t){return t&&'object'==typeof t&&'string'==typeof t.name&&'string'==typeof t.message}function l(t){return p(t)?t:s(t)?new Error(JSON.stringify(t)):new Error(String(t))}function y(c){try{setTimeout(()=>{u._internal_preventAutoHideAsync?.()}),n().startTransition(()=>{(0,e().registerRootComponent)(c)})}catch(n){u.hideAsync();const c=l(n);(0,e().registerRootComponent)(()=>(0,t().jsx)(o().View,{})),console.error(c),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw c})}}},1451,[25,499,34,270,651]); +__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.CarGate=function(){const e=(0,u.useSession)(e=>e.meId),[t,o]=(0,r.useState)(u.useSession.persist.hasHydrated());return(0,r.useEffect)(()=>{const e=u.useSession.persist.onFinishHydration(()=>o(!0));return u.useSession.persist.hasHydrated()&&o(!0),e},[]),t?e||x.PITCH?null:(0,b.jsx)(T,{}):(0,b.jsx)(s.default,{style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=_r(d[1]),n=e(_r(d[2])),s=e(_r(d[3])),o=e(_r(d[4])),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),f=_r(d[11]),y=_r(d[12]),j=_r(d[13]),b=_r(d[14]);let w=null,M=null;async function I(e){return!e&&M&&Date.now()-M.at<6e4&&new Date(M.r.expiresAt).getTime()-Date.now()>12e4?M.r:w||(w=(0,h.carPairStart)().then(e=>(e.ok&&(M={r:e,at:Date.now()}),e)).finally(()=>{w=null}),w)}function T(){const{width:e,height:u}=(0,o.default)(),[x,w]=(0,r.useState)(null),[M,T]=(0,r.useState)('starting'),[C,D]=(0,r.useState)(''),[k,z]=(0,r.useState)(0),S=(0,r.useRef)(!1),P=(0,r.useCallback)(async(e=!0)=>{if(S.current)return;S.current=!0,T('starting'),D('');const t=await I(e);if(S.current=!1,!t.ok)return T('error'),void D(t.error);w({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),T('waiting')},[]);(0,r.useEffect)(()=>{P(!1)},[]),(0,r.useEffect)(()=>{if(!x||'waiting'!==M)return;const e=setInterval(async()=>{z(Math.max(0,Math.round((x.until-Date.now())/1e3)));('expired'===await(0,h.carPairPoll)(x.id)||Date.now()>x.until)&&T('expired')},3e3);return()=>clearInterval(e)},[x,M]);const H=Math.min(120,Math.max(64,Math.round(Math.min(e/9,u/7)))),v=x?.code??'',F=v?`${v.slice(0,3)} ${v.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,b.jsxs)(s.default,{testID:"car-pairing",style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:[(0,b.jsx)(t.CarFullscreenButton,{place:"corner"}),(0,b.jsxs)(s.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:u<820?10:16},children:[(0,b.jsx)(c.RestaurantLogo,{rid:p.VENUE_RID,size:u<820?64:88}),(0,b.jsx)(l.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,b.jsx)(j.ParkedOnly,{}),'waiting'===M||'starting'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,b.jsx)(s.default,{testID:"car-code",accessible:!0,accessibilityLabel:v?`Car code ${(0,y.spokenCode)(v)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,b.jsx)(l.T,{center:!0,size:H,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:H/8,lineHeight:1.2*H},children:F})}),v?(0,b.jsx)(l.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,b.jsxs)(s.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,b.jsx)(l.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,b.jsx)(s.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,b.jsx)(l.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{P()},style:{minHeight:64,minWidth:200}})})]}):'expired'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{P()},style:{minHeight:64,minWidth:280}})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,b.jsx)(l.Muted,{center:!0,children:C}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{P()},style:{minHeight:64,minWidth:240}})]}),C&&'error'!==M?(0,b.jsx)(l.T,{center:!0,colour:f.colours.amber,children:C}):null,(0,b.jsx)(l.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})]})}},1415,[1416,34,41,102,426,794,847,997,985,2,5,840,1417,1418,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,"FS_KEY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"FS_BUTTON_H",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"NOT_ALLOWED",{enumerable:!0,get:function(){return b}}),_e.useCarViewport=function(){(0,t.useEffect)(()=>{if(!u)return;const e=document.documentElement,t=document.body,n=[e.style.cssText,t.style.cssText];for(const n of[e.style,t.style])n.height='100%',n.margin='0',n.overflow='hidden',n.overscrollBehavior='none',n.touchAction='manipulation';return()=>{e.style.cssText=n[0],t.style.cssText=n[1]}},[])},_e.CarFullscreenButton=function({place:e="rail",width:E}){const[x,p]=(0,t.useState)(y),[L,T]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!u)return;const e=()=>{const e=y();p(e),e||v.set(f,null)};document.addEventListener('fullscreenchange',e),document.addEventListener('webkitfullscreenchange',e);let t='1'===v.get(f)&&!y();const n=()=>{t&&(t=!1,w())};return t&&(document.addEventListener('click',n,!0),document.addEventListener('touchend',n,!0)),()=>{document.removeEventListener('fullscreenchange',e),document.removeEventListener('webkitfullscreenchange',e),document.removeEventListener('click',n,!0),document.removeEventListener('touchend',n,!0)}},[]),(0,t.useEffect)(()=>{if(!L)return;const e=setTimeout(()=>T(null),9e3);return()=>clearTimeout(e)},[L]);const F=(0,t.useCallback)(async()=>{if(T(null),y()){v.set(f,null);try{await((document.exitFullscreen??document.webkitExitFullscreen)?.call(document))}catch{}return}const e=window.innerHeight;await w()?(v.set(f,'1'),setTimeout(()=>{(!y()||window.innerHeight<=e+8)&&T(b)},900)):T(b)},[]);if(!u)return null;const k=x?'Exit full screen':'Full screen',j='corner'===e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{testID:"car-fullscreen",accessibilityRole:"button",accessibilityLabel:k,accessibilityHint:x?'Shows the browser bar again':'Hides the browser bar, if the car allows it',onPress:()=>{F()},style:[{minHeight:h,minWidth:j?220:void 0,width:j?void 0:E,alignSelf:j?void 0:'center',justifyContent:'center',alignItems:'center',paddingHorizontal:12,borderRadius:14,borderWidth:2,borderColor:o.colours.goldLight,backgroundColor:x?'#1d1708':o.colours.gold},j?{position:'fixed',top:12,right:12,zIndex:1200}:null],children:(0,s.jsx)(l.T,{size:j?20:17,weight:"bold",colour:x?o.colours.goldLight:'#1a1407',center:!0,numberOfLines:1,children:k})}),L?(0,s.jsx)(c.default,{testID:"car-fullscreen-msg",accessible:!0,accessibilityLiveRegion:"assertive",accessibilityLabel:L,style:{position:'fixed',top:j?76:12,right:j?12:220,maxWidth:420,zIndex:1300,padding:14,borderRadius:14,borderWidth:1.5,borderColor:o.colours.amber,backgroundColor:'#1d1708'},children:(0,s.jsx)(l.T,{size:17,center:!0,colour:"#FFE2A8",children:L})}):null]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),c=e(r(d[3])),l=r(d[4]),o=r(d[5]),s=r(d[6]);const u='undefined'!=typeof document,f='cc-car-fullscreen',h=56,b='The car\u2019s browser kept its address bar, so full screen isn\u2019t available here. The car screen already uses all the space it is given.',v={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}},y=()=>u&&!(!document.fullscreenElement&&!document.webkitFullscreenElement);async function w(){const e=document.documentElement,t=e.requestFullscreen??e.webkitRequestFullscreen;if(!t)return!1;try{return await t.call(e,{navigationUI:'hide'}),!0}catch{return!1}}},1416,[34,236,402,102,794,840,25]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=64;const l=s=>s.split('').join(' ')},1417,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1418,[34,102,794,840,25]); +__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1419,[986,857,856,985]); +__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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1420,[798,796,34,1343,1015,402,102,846,985,1007,1014,5,840,794,1287,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1421,[796,34,236,402,102,840,985,1045,2,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.VoiceHost=function(){const e=(0,f.useVoiceTarget)(),t=(0,f.useVoiceSlot)(e=>e.rect);g.PITCH&&(globalThis.__voiceExpect={app:e?.app??null,on:!!e?.on,slot:!!t});if(!e?.on||!t)return null;const n=(0,P.jsx)(X,{app:e.actions,ui:e.app},e.actions);if('undefined'!=typeof document){const{createPortal:e}=_r(d[33]);return e(n,document.body)}return n};var t=_r(d[0]),n=_r(d[1]),o=_r(d[2]),r=e(_r(d[3])),s=e(_r(d[4])),i=e(_r(d[5])),a=e(_r(d[6]));_r(d[7]);var l=e(_r(d[8])),c=e(_r(d[9])),u=e(_r(d[10])),h=e(_r(d[11])),p=_r(d[12]),f=_r(d[13]),g=_r(d[14]),y=_r(d[15]),m=e(y),w=_r(d[16]),x=_r(d[17]),b=_r(d[18]),v=_r(d[19]),k=_r(d[20]),j=_r(d[21]),T=_r(d[22]),R=_r(d[23]),C=_r(d[24]),S=_r(d[25]),I=_r(d[26]),M=_r(d[27]),E=_r(d[28]),H=_r(d[29]),z=_r(d[30]),D=_r(d[31]),P=_r(d[32]);const A='How many people?',$=['covers','partySize'],W=200,_=16e3,B=31e3,O='That took too long, so I stopped waiting. Hold the button and try again, or tap Type instead.',V='Something went wrong there. Hold the button and try again, or tap Type instead.',F='The microphone is blocked. Allow it in the browser\u2019s site settings, or tap the button to type instead.';function L(e,t){return'cap'===e?t?.message||E.REACHED_TEXT:'identity'===e||'app'===e?'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.':'not-allowed'===e?F:'audio-capture'===e?'I couldn\u2019t use the microphone on this device. Check nothing else is using it, then hold the button again, or tap Type instead.':'busy'===e?'Speech to text is busy just now. Hold the button and try again in a moment, or tap Type instead.':'soon'===e?'Speech to text is switching on soon. For now, tap the button to type instead.':'long'===e?'That was longer than 30 seconds. Hold the button and say it more briefly, or tap Type instead.':'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.'}function N({colour:e,size:t=34}){return(0,P.jsxs)(m.default,{width:t,height:t,viewBox:"0 0 24 24",children:[(0,P.jsx)(y.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:e}),(0,P.jsx)(y.Path,{d:"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7",stroke:e,strokeWidth:2,strokeLinecap:"round",fill:"none"})]})}const G={owner:['\u201cWalk-in fridge 3 degrees\u201d','\u201cMark the lobster sold out\u201d','\u201cHow many Covers tonight?\u201d','\u201cAdd blue roll to the Booker list\u201d'],staff:['\u201cMessage the team: running 10 minutes late\u201d','\u201cRead my messages\u201d','\u201cWhen\u2019s my next shift?\u201d','\u201cWhat are today\u2019s specials?\u201d','\u201cDoes the fish supper contain gluten?\u201d'],chef:['\u201cFreezer minus 19\u201d','\u201cMark the soup sold out\u201d','\u201cRead the orders\u201d','\u201cAdd onions to the Bidfood list\u201d'],display:['\u201cWalk-in fridge 3 degrees\u201d','\u201cRead the orders\u201d','\u201cAny room for 6 at 8?\u201d','\u201cRead the shift notes\u201d']};function X({app:e,ui:g}){const y=(0,w.useCtx)(6e4),m=(0,b.useOwner)(e=>e.staff),X=(0,I.useVoiceNav)(e=>e.go),{height:U}=(0,u.default)(),q=(0,f.useVoiceSlot)(e=>e.rect),K=q.size,Y=x.ROSTER.find(e=>'chef'===e.app),J='display'===e?'Main Display':'chef'===e?m.find(e=>e.id===Y?.id)?.name??'Head Chef':y.me,Q='display'===e?'display':'chef'===e?Y?.id??'chef':y.meId,Z={rid:y.rid,today:y.today,go:(e,t)=>X?.(e,t),app:e,who:J.replace(' (example)',''),whoId:Q,role:'owner'===g?y.role:e};(0,o.useEffect)(()=>{try{(0,T.setVenueWords)((0,R.venueKeyterms)(y.rid))}catch{}},[y.rid,m]);const[ee,te]=(0,o.useState)('idle'),[ne,oe]=(0,o.useState)(''),[re,se]=(0,o.useState)(0),[ie,ae]=(0,o.useState)(null),[le,de]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(''),[he,pe]=(0,o.useState)(!1),fe=(0,o.useRef)(null),ge=(0,o.useRef)(0),ye=(0,o.useRef)(null),me=(0,o.useRef)(Z);me.current=Z;const we=(0,o.useRef)(ie);we.current=ie;const xe=(0,o.useRef)(y.now);xe.current=y.now;const be=e=>{ae(e),te('answer')},ve=be,ke=async e=>{const t=++ge.current;let n;te('working');try{n=await(0,j.runAction)(e.id,e.params,me.current,!0)}catch{n={status:'error',message:V}}t===ge.current&&((0,H.buzz)([20,40,20]),ve({text:'needs_confirmation'===n.status?n.preview:n.message,tone:'error'===n.status?'warn':'ok'}))},je=()=>ve({text:'Cancelled. Nothing was changed.',tone:'info'}),Te=async(e,t,n)=>{const o=++ge.current,r={...e.params,[e.field]:t};let s;te('working');try{s=await(0,j.runAction)(e.id,r,me.current,!1)}catch{s={status:'error',message:V}}o===ge.current&&('needs_confirmation'===s.status?ve({heard:n,text:s.preview,pending:{id:e.id,params:r,preview:s.preview}}):ve({heard:n,text:s.message,tone:'error'===s.status?'warn':'ok'}))},Re=async(e,t)=>{const n=ge.current,o=e=>{n===ge.current&&be(e)};try{await Ce(e,o,t)}catch{o({heard:e.trim()||void 0,text:V,tone:'warn'})}},Ce=async(t,n,o)=>{const r=t.trim(),s=me.current;if(!r)return void n({text:'I didn\u2019t catch that. Hold the button while you speak, then let go.',tone:'info'});const i=we.current?.pending;if(i){const e=(0,H.yesNo)(r);if('yes'===e)return void await ke(i);if('no'===e)return void je()}const a=we.current?.ask;if(a){const e=(0,D.coversAnswer)(r);if(e&&e<=30)return void await Te(a,e,r)}te('working');const l=(0,j.matchIntent)(r,s.today,{app:e,rid:s.rid,whoId:s.whoId}),c=xe.current;if(!E.voiceUsage.allowed(s.rid,'action'===l.kind?l.action.id:null,c))return void n({heard:r,text:E.REACHED_TEXT,tone:'info'});E.voiceUsage.record(s.rid,c);const u=E.voiceUsage.get(s.rid,c),h=u.reached?E.REACHED_TEXT:u.warn?(0,E.WARN_TEXT)(u):void 0,p=e=>n({...e,note:h});if('action'===l.kind){const e=l.action,t=e.params.filter(e=>e.required&&(void 0===l.params[e.name]||''===l.params[e.name]||'[]'===l.params[e.name]));if(1===t.length&&$.includes(t[0].name))return void p({heard:r,text:A,ask:{id:e.id,params:l.params,field:t[0].name},tone:'info'});if(t.length)return void p({heard:r,text:e.preview(l.params,s)+(/\?$/.test(e.preview(l.params,s))||/couldn|didn/.test(e.preview(l.params,s))?'':` I still need: ${t.map(e=>e.description.toLowerCase()).join('; ')}.`)+' Hold the button and try again.',tone:'warn'});const n=await(0,j.runAction)(e.id,l.params,s,!1);return void('needs_confirmation'===n.status?p({heard:r,text:n.preview,pending:{id:e.id,params:l.params,preview:n.preview}}):p({heard:r,text:n.message,tone:'error'===n.status?'warn':'ok'}))}const f=` ${r.toLowerCase()} `,g=e=>{const t=(0,j.actionById)(e);if(!t)return 0;try{return t.match?t.match(f):t.keywords.filter(e=>f.includes(e)).length}catch{return 0}},y=()=>(0,j.toolSpecs)().filter(t=>{const n=(0,j.actionById)(t.function.name);return!!n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))}).map((e,t)=>({t:e,i:t,s:g(e.function.name)})).sort((e,t)=>t.s-e.s||e.i-t.i).slice(0,60).map(e=>e.t),m=async t=>{if('call'===t.kind){const n=(0,j.actionById)(t.name);if(n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))){const e=n.params.filter(e=>e.required&&(void 0===t.args[e.name]||''===t.args[e.name]));if(1===e.length&&$.includes(e[0].name))return p({heard:r,text:A,ask:{id:n.id,params:t.args,field:e[0].name},tone:'info'}),!0;const o=await(0,j.runAction)(n.id,t.args,s,!1);return'needs_confirmation'===o.status?p({heard:r,text:o.preview,pending:{id:n.id,params:t.args,preview:o.preview}}):p({heard:r,text:o.message,tone:'error'===o.status?'warn':'ok'}),!0}}return'text'===t.kind&&(p({heard:r,text:(0,j.moneySafe)(e,s.role)?(0,j.noMoney)(t.text):t.text,tone:'info'}),!0)};if('help'===l.kind){const t=l.ids.map(C.helpById).filter(Boolean)[0];if(!(((0,S.searchHelp)(C.HELP,r,1)[0]?.score??0)>=2.5)){const n=await(0,T.askServer)(e,r,y(),o);if(await m(n))return;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(`${t.title}. ${t.body}`)?void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}.`,tone:'info'}):void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}. This guide might help: ${t.title}.`,help:l.ids,tone:'info'})}const n=`${t.title}. ${t.body}`;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(n)?void p({heard:r,text:'That isn\u2019t shown here. Ask a manager in the Managers app.',tone:'info'}):void p({heard:r,text:n,help:l.ids,tone:'info'})}await m(await(0,T.askServer)(e,r,y(),o))||p({heard:r,text:T.SOON_TEXT+' '+G[e].slice(0,2).join(' or ')+'.',tone:'info'})},Se=()=>{fe.current?.abort(),fe.current=null,ye.current?.(),ye.current=null,se(0)};(0,o.useEffect)(()=>()=>{fe.current?.abort(),ye.current?.()},[]);const Ie=async()=>{if(!(0,H.canListen)())return de(!0),void ve({text:(0,H.tabletWithoutMic)()?'This Display tablet app needs an update before it can use the microphone. For now, type below.':'This browser can\u2019t record speech. Type instead below.',tone:'info'});if((0,H.desktopStt)()){if(!(0,M.micExplainedFor)(g))return void pe(!0)}else{const e=await(0,H.micPermission)();if('granted'===e)(0,M.setMicExplainedFor)(g);else{if('denied'===e)return de(!0),void ve({text:F,tone:'warn'});if(!(0,M.micExplainedFor)(g))return void pe(!0)}}if(!He.current.holding&&!Ee.current)return;const t=++ge.current;(0,H.buzz)(35),oe(''),ae(null),de(!1),te('listening');if(fe.current=(0,H.listen)(oe,(e,n,o)=>{if(ye.current?.(),ye.current=null,se(0),fe.current=null,t===ge.current){if('not-allowed'!==n&&'service-not-allowed'!==n)return'stt-failed'===n?(ve({text:'Speech to text didn\u2019t start on this Mac. Type instead below; restarting the app usually fixes it.',tone:'warn'}),void de(!0)):void(n?ve({text:L(n,o),tone:'cap'===n?'info':'warn'}):Re(e,o?.receipt));ve({text:(0,H.desktopStt)()?'The microphone is blocked for CoverCharge. Open System Settings \u203a Privacy & Security \u203a Microphone, switch on CoverCharge for Mac, then try again. Or type instead.':F,tone:'warn'})}},e,se),!fe.current)return te('idle'),void de(!0);if((0,H.desktopStt)()){const e=await(0,H.levelMeter)(se);fe.current?ye.current=e:e()}},Me=()=>{fe.current&&(te('working'),fe.current.stop(),ye.current?.(),ye.current=null,se(0))},Ee=(0,o.useRef)(!1),He=(0,o.useRef)({timer:0,holding:!1}),ze=(0,o.useRef)(Ie);ze.current=Ie;const De=(0,o.useRef)(Me);De.current=Me;const Pe=(0,o.useMemo)(()=>a.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>{const e=He.current;e.holding=!1,(0,M.micExplainedFor)(g)&&(0,H.warmMic)(),e.timer=setTimeout(()=>{e.holding=!0,ze.current()},W)},onPanResponderRelease:()=>{const e=He.current;if(clearTimeout(e.timer),e.holding)return e.holding=!1,void De.current();(0,H.disarmMic)(),de(!0),te(e=>'idle'===e?'answer':e)},onPanResponderTerminate:()=>{const e=He.current;clearTimeout(e.timer),e.holding&&(e.holding=!1,De.current())}}),[e]);(0,o.useRef)(ee).current=ee,(0,o.useEffect)(()=>z.useVoiceKeys.subscribe((e,t)=>{const n=e.last;if(!n||n.n===t.last?.n)return;const o=!!fe.current;'start'!==n.cmd||o?'stop'===n.cmd?(Ee.current=!1,o&&De.current()):'toggle'===n.cmd?o?(Ee.current=!1,De.current()):(Ee.current=!0,ze.current()):'type'===n.cmd&&(de(!0),te(e=>'idle'===e?'answer':e)):(Ee.current=!0,ze.current())}),[]);const Ae=K>=64,$e=(0,o.useRef)(new s.default.Value(0)).current;(0,o.useEffect)(()=>{if('listening'!==ee)return $e.stopAnimation(),void $e.setValue(0);const e=s.default.loop(s.default.timing($e,{toValue:1,duration:1100,easing:i.default.out(i.default.quad),useNativeDriver:!1}));return e.start(),()=>e.stop()},[ee]);const We='listening'===ee,Be='answer'===ee&&(ie||le)||'working'===ee||We,Oe=()=>{ge.current++,Se(),ae(null),de(!1),ue(''),te('idle')};(0,o.useEffect)(()=>{if('working'!==ee&&'listening'!==ee)return;const e=ge.current,t=setTimeout(()=>{e===ge.current&&('listening'!==ee?(ge.current++,Se(),de(!0),be({heard:ne&&!/\u2026$/.test(ne)?ne:void 0,text:O,tone:'warn'})):De.current())},'working'===ee?_:B);return()=>clearTimeout(t)},[ee]);const Ve=()=>{const e=ce.trim();e&&(ue(''),oe(e),ge.current++,Re(e))},Fe='fixed',Le={top:q.y+K+8},Ne=$e.interpolate({inputRange:[0,1],outputRange:[1,1.7]}),Ge=$e.interpolate({inputRange:[0,1],outputRange:[.6,0]}),Xe='warn'===ie?.tone?k.colours.amber:ie?.pending?k.colours.gold:k.colours.border;return(0,P.jsxs)(P.Fragment,{children:[Be?(0,P.jsx)(h.default,{testID:"voice-panel",style:[{position:Fe,left:12,right:12,alignItems:'flex-end',zIndex:60},Le],pointerEvents:"box-none",children:(0,P.jsxs)(h.default,{style:{width:'100%',maxWidth:Ae?720:520,backgroundColor:k.colours.surface,borderRadius:16,borderWidth:2,borderColor:Xe,padding:Ae?20:14,gap:10,maxHeight:U*(Ae?.78:.6)},children:[(0,P.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.gold,accessibilityRole:"header",children:We?Ae?'Listening\u2026 let go (or press \u2318\u21e7G) to send':'Listening\u2026 let go to send':'working'===ee?'Working on it\u2026':ie?.pending?'Please confirm':'Voice assistant'}),(0,P.jsx)(l.default,{testID:"voice-close",accessibilityRole:"button",accessibilityLabel:"Close voice assistant",hitSlop:12,onPress:Oe,style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:20,colour:k.colours.muted,children:"\u2715"})})]}),(0,P.jsx)(v.T,{testID:"voice-reply-mode",size:14,colour:k.colours.muted,children:"Text replies only"}),We?(0,P.jsxs)(h.default,{style:{gap:8},children:[(0,P.jsx)(h.default,{style:{height:10,borderRadius:5,backgroundColor:k.colours.surface2,overflow:'hidden'},children:(0,P.jsx)(h.default,{testID:"voice-level",style:{width:`${Math.round(8+92*re)}%`,height:10,backgroundColor:k.colours.ok}})}),(0,P.jsx)(v.T,{size:16,children:ne||'Say it now\u2026'})]}):null,'working'===ee?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(r.default,{color:k.colours.gold}),(0,P.jsx)(v.T,{size:15,colour:k.colours.muted,children:ne?/\u2026$/.test(ne)?ne:`\u201c${ne}\u201d`:''})]}):null,'working'===ee||We?(0,P.jsx)(v.Button,{testID:"voice-stop",kind:"secondary",label:"Cancel",onPress:()=>{ge.current++,Se(),de(!1),be({text:'Stopped. Nothing was changed.',tone:'info'})},style:{minHeight:48}}):null,'answer'===ee&&ie?(0,P.jsxs)(c.default,{style:{maxHeight:U*(Ae?.55:.36)},contentContainerStyle:{gap:8},children:[ie.heard?(0,P.jsx)(h.default,{testID:"voice-heard",accessible:!0,accessibilityLabel:`I heard: ${ie.heard}`,children:(0,P.jsxs)(v.T,{size:Ae?16:14,colour:k.colours.muted,children:["I heard: \u201c",ie.heard,"\u201d"]})}):null,ie.note?(0,P.jsx)(h.default,{testID:"voice-usage-note",children:(0,P.jsx)(v.T,{size:13,colour:k.colours.amber,children:ie.note})}):null,(0,P.jsx)(h.default,{testID:"voice-answer",children:(0,P.jsx)(v.T,{size:Ae?24:18,weight:ie.pending?'semibold':'regular',children:ie.text})}),ie.help&&'owner'===e&&X?ie.help.slice(0,3).map(e=>{const t=(0,C.helpById)(e);return t?(0,P.jsx)(v.Button,{small:!0,kind:"secondary",label:`Open help: ${t.title}`,onPress:()=>{X('more','help'),Oe()}},e):null}):null]}):null,'answer'===ee&&ie?.ask?(0,P.jsx)(h.default,{testID:"voice-how-many",style:{flexDirection:'row',flexWrap:'wrap',gap:10},children:[1,2,3,4,5,6,7,8].map(e=>(0,P.jsx)(l.default,{testID:`voice-covers-${e}`,accessibilityRole:"button",accessibilityLabel:1===e?'1 person':`${e} people`,onPress:()=>{Te(ie.ask,e)},style:{width:Ae?96:72,height:Ae?96:72,borderRadius:14,backgroundColor:k.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:Ae?40:32,weight:"semibold",colour:k.colours.onGold,children:e})},e))}):null,'answer'===ee&&ie?.pending?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(v.Button,{testID:"voice-confirm",kind:"success",label:"Confirm",onPress:()=>{ke(ie.pending)},style:{flex:1,minHeight:56}}),(0,P.jsx)(v.Button,{testID:"voice-cancel",kind:"secondary",label:"Cancel",onPress:je,style:{flex:1,minHeight:56}})]}):null,'answer'!==ee||ie?.pending?null:(0,P.jsxs)(h.default,{style:{gap:6},children:[le||!(0,H.canListen)()?(0,P.jsxs)(v.Row,{gap:8,children:[(0,P.jsx)(n.TextInput,{testID:"voice-type",value:ce,onChangeText:ue,onSubmitEditing:Ve,placeholder:"Type instead\u2026",placeholderTextColor:k.colours.muted,autoFocus:!0,returnKeyType:"send",style:{flex:1,minWidth:0,width:0,minHeight:48,borderRadius:10,borderWidth:1,borderColor:k.colours.border,backgroundColor:k.colours.surface2,color:k.colours.text,paddingHorizontal:12,fontFamily:k.fonts.regular,fontSize:16}}),(0,P.jsx)(v.Button,{testID:"voice-send",kind:"success",label:"Ask",onPress:Ve,disabled:!ce.trim()})]}):(0,P.jsx)(l.default,{accessibilityRole:"button",onPress:()=>de(!0),children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"Type instead"})}),ie?null:(0,P.jsxs)(v.T,{size:Ae?15:13,colour:k.colours.muted,children:[Ae?'Hold Space (or the gold button) and speak, or press \u2318\u21e7G to start and again to send. ':'Hold the gold button and speak, for example ',Ae?`For example ${G[e].join(', ')}.`:`${G[e].join(', ')}.`]}),'owner'===g&&'owner'===e?(0,P.jsx)(l.default,{testID:"voice-open-assistant",accessibilityRole:"button",onPress:()=>{Oe(),p.useAssistantUi.getState().setOpen(!0)},style:{minHeight:44,justifyContent:'center'},children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"\u2726 Open the Assistant (ideas, history and longer requests) \u203a"})}):null]})]})}):null,(0,P.jsxs)(h.default,{style:{position:Fe,left:`clamp(0px, ${q.x}px, calc(100vw - ${K}px))`,top:q.y,width:K,height:K,zIndex:61},pointerEvents:"box-none",children:[We?(0,P.jsx)(s.default.View,{pointerEvents:"none",style:{position:'absolute',left:0,top:0,width:K,height:K,borderRadius:K/2,borderWidth:4,borderColor:k.colours.ok,opacity:Ge,transform:[{scale:Ne}]}}):null,We?(0,P.jsx)(h.default,{pointerEvents:"none",style:{position:'absolute',left:-6,top:-6,width:K+12,height:K+12,borderRadius:(K+12)/2,borderWidth:3+Math.round(7*re),borderColor:k.colours.ok}}):null,(0,P.jsx)(h.default,{testID:"voice-button",accessible:!0,accessibilityRole:"button",accessibilityLabel:'owner'===g&&'owner'===e?'Voice assistant and Assistant. Hold to talk, let go to send. Tap to type or open the Assistant.':'Voice assistant. Hold to talk, let go to send. Tap to type instead.',...Pe.panHandlers,style:[{width:K,height:K,borderRadius:K/2,alignItems:'center',justifyContent:'center',backgroundColor:We?k.colours.ok:k.colours.gold,borderWidth:2,borderColor:k.colours.bg},{userSelect:'none',WebkitUserSelect:'none',WebkitTouchCallout:'none',touchAction:'none',cursor:'pointer'}],children:['kirkton','abbotsford'].includes(t.VENUE_RID)?(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.onGold,children:'working'===ee?'Wait':'Talk'}):'working'===ee?(0,P.jsx)(r.default,{color:k.colours.onGold,size:"large"}):(0,P.jsx)(N,{colour:k.colours.onGold,size:Math.round(.5*K)})})]}),(0,P.jsx)(v.Sheet,{visible:he,onClose:()=>{(0,M.setMicExplainedFor)(g),pe(!1)},title:"Talk to CoverCharge",testID:"voice-explain",children:(0,P.jsxs)(h.default,{style:{gap:10},children:[(0,P.jsxs)(v.T,{children:["Hold the gold button, say what you need, then let go. For example ",G[e].slice(0,3).join(', '),"."]}),(0,P.jsx)(v.T,{children:(0,H.desktopStt)()?'Your Mac will now ask once to let CoverCharge use the microphone. It only listens while you hold the button.':'Your device will now ask once to use the microphone. It only listens while you hold the button, for up to 30 seconds.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:(0,H.desktopStt)()?'On this Mac, speech is turned into text on the Mac itself, so what you say isn\u2019t sent anywhere. CoverCharge doesn\u2019t keep the audio.':'What you say while holding is sent to Grok (xAI) to be turned into text. CoverCharge doesn\u2019t keep the audio.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:"The helper replies in text only, never aloud. Any change is shown in text first, with Confirm and Cancel buttons; you can also say \u201cyes\u201d. Orders to suppliers, messages and payments are only ever saved as drafts for the owner."}),(0,P.jsx)(v.Button,{testID:"voice-allow",kind:"success",label:"Allow microphone",onPress:async()=>{(0,M.setMicExplainedFor)(g),pe(!1);const e=!!(0,H.desktopStt)()||await(0,H.askMic)();if((0,H.desktopStt)()){(await(0,H.levelMeter)(()=>{}))()}ve(e?{text:'Ready. Now hold the button and speak.',tone:'ok'}:{text:F,tone:'warn'})}}),(0,P.jsx)(v.Button,{kind:"secondary",label:"Type instead",onPress:()=>{(0,M.setMicExplainedFor)(g),pe(!1),de(!0),te('answer')}})]})})]})}},1422,[5,796,34,385,283,364,380,236,402,295,426,102,1423,1116,2,900,1100,15,865,794,840,1424,930,1438,1434,1435,1439,1117,1440,929,1441,1437,25,277]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ASSISTANT_AVAILABLE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"useAssistantUi",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"AssistantFab",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"AssistantSheet",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"AssistantPage",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"AssistantSettings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"AssistantPlanCard",{enumerable:!0,get:function(){return c}});const t=!1,n={getState:()=>({open:!1,setOpen:t=>{}})},u=()=>null,s=()=>null,l=()=>null,o=()=>null,c=()=>null},1423,[]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1424,[1425,1098,829,1428,1429,865,848,1014,1433,1434,1435,1431,1430,1436,1437,1012,1013]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1425,[1426,1427,1038]); +__d(function(g,r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_LABEL",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HISTORY_NOTE",{enumerable:!0,get:function(){return o}}),e.validPastDate=n,Object.defineProperty(e,"ukHistoryDate",{enumerable:!0,get:function(){return s}}),e.parseHistoryInput=function(t){const o=t.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(o))return o;const n=/^(\d{1,2})[\s/.-]+(\d{1,2})[\s/.-]+(\d{4})$/.exec(o);if(!n)return;const s=`${n[3]}-${n[2].padStart(2,'0')}-${n[1].padStart(2,'0')}`,d=new Date(s+'T12:00:00Z');return Number.isNaN(d.getTime())||d.toISOString().slice(0,10)!==s?void 0:s},e.exactHistoryDate=function(t,o){if(1!==(t.match(/\b(?:\d{4}-\d{2}-\d{2}|\d{1,2}\/\d{1,2}\/\d{4}|\d{1,2}(?:st|nd|rd|th)?\s+[a-z]+\s+\d{4})\b/gi)??[]).length)return;const s=t.match(/\b(\d{4}-\d{2}-\d{2})\b/);let d=s?.[1];if(!d){const o=t.match(/\b(\d{1,2})\/(\d{1,2})\/(\d{4})\b/);o&&(d=`${o[3]}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`)}if(!d){const o=t.toLowerCase().match(/\b(\d{1,2})(?:st|nd|rd|th)?\s+(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)\s+(\d{4})\b/),n=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'];o&&(d=`${o[3]}-${String(n.indexOf(o[2].slice(0,3))+1).padStart(2,'0')}-${o[1].padStart(2,'0')}`)}return d&&n(d,o)?d:void 0},Object.defineProperty(e,"historyDateLabel",{enumerable:!0,get:function(){return d}}),e.bookingDayText=function(t){const n=`Booked covers on ${d(t.date)}: ${null===t.booked_covers?'not recorded':t.booked_covers}.`,s=t.bookings.map(t=>`${t.time??'Time not recorded'}: party size ${null===t.covers?'not recorded':`${t.covers} Covers`}; ${t.table?`table ${t.table}`:'table not recorded'}; ${t.status??'status not recorded'}${t.counted?'':', excluded from Booked covers'}.`);return[n,...s,t.historical_records?"Includes previous booking system history (incomplete).":'',o,t.bookings.length?'':'No booking records found; incomplete history does not prove there were no bookings.',t.missing_covers?`${t.missing_covers} booking records have no party size; left blank.`:''].filter(Boolean).join(' ')};const t='Includes previous booking system history (incomplete)',o='Recovered booking records, not confirmed attendance. Cancelled bookings are shown but excluded from Booked covers.';function n(t,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;const n=new Date(t+'T12:00:00Z');return!Number.isNaN(n.getTime())&&n.toISOString().slice(0,10)===t&&t{const[o,n,s]=t.split('-');return`${s} ${n} ${o}`};const d=t=>new Date(t+'T12:00:00Z').toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'Europe/London'})},1426,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.historyAccess=c,_e.lookupBookingDay=l,_e.useHistoricalBookingDay=function(t,o,u,y=0){const k=(0,s.useSync)(e=>[e.kind,e.venueId,e.venueSlug,e.perms.join(',')].join(':')),f=c(t),h=f&&(0,n.validPastDate)(o,u)?`${k}:${o}:${y}`:'',[w,p]=(0,e.useState)({key:'',data:null,error:''});return(0,e.useEffect)(()=>{if(!h)return void p({key:'',data:null,error:''});let e=!0;return l(t,o).then(t=>{e&&p({key:h,data:t,error:''})}).catch(t=>{e&&p({key:h,data:null,error:t.message})}),()=>{e=!1}},[h,t,o]),{allowed:f,data:h&&w.key===h?w.data:null,error:h&&w.key===h?w.error:''}};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]);function c(e){const n=s.useSync.getState();return'owner'===t.APP_VARIANT&&'staff'===n.kind&&n.venueSlug===e&&!!n.venueId&&(n.perms.includes('*')||n.perms.includes('staff.manage'))}async function l(e,t){if(!c(e))throw new Error('Sign in to the Managers app with manager or owner access to Look back.');if(!(0,n.validPastDate)(t,(0,o.venueYmd)(new Date)))throw new Error('Choose an exact past date, with day, month and year.');const l=(0,u.getSupabase)(),{data:y,error:k}=await l.rpc('historical_booking_day',{p_venue:s.useSync.getState().venueId,p_date:t});if(k||!y||!Array.isArray(y.bookings))throw new Error('Booking history could not be loaded. Reconnect and try again.');return y}},1427,[34,846,1426,827,985,931]); +__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"niceDay",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"appNow",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"num",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"tableIn",{enumerable:!0,get:function(){return L}}),e.resolveTable=q,Object.defineProperty(e,"tokensOf",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"hm",{enumerable:!0,get:function(){return x}}),e.findBooking=A,Object.defineProperty(e,"staffOf",{enumerable:!0,get:function(){return me}}),Object.defineProperty(e,"findCard",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(e,"allergenList",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(e,"OPS_VOICE_ACTIONS",{enumerable:!0,get:function(){return ye}});var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),o=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),d=_r(_d[7]),l=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),b=_r(_d[11]),p=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]);const f=t=>{const[n,r,a]=t.split('-').map(Number);return new Date(n,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},y=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},k=(t,n)=>n.test(t),w=t=>t.who??('display'===t.app?'Main Display':'Assistant'),v={a:1,an:1,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,fifteen:15,twenty:20,half:.5},S=t=>null==t||''===t?void 0:'number'==typeof t?t:v[String(t).toLowerCase()]??(Number.isFinite(Number(t))?Number(t):void 0),$=['owner','staff','display'],C=['owner','staff','chef','display'],I=['staff'],N=/\btables?\s+([a-z]?\d{1,3}[a-z]?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/i,L=t=>{const n=t.match(N);return n?String(S(n[1])??n[1]).toUpperCase():void 0};function q(t,n){const r=String(n??'').replace(/^tables?\s+/i,'').trim();if(!r)return;const a=String(S(r)??r).toLowerCase(),o=(0,s.planOf)(t),i=[...new Set([...(o?.tables??[]).map(t=>t.name),...Object.keys(s.useFloor.getState().live[t]??{})])];return i.find(t=>t.toLowerCase()===a)??(o?.tables??[]).find(t=>(t.label??'').toLowerCase()===a)?.name??i.find(t=>t.toLowerCase().replace(/[^0-9a-z]/g,'').replace(/^t(?=\d)/,'')===a.replace(/[^0-9a-z]/g,''))}const O=(t,n)=>s.useFloor.getState().live[t]?.[n]??{},_=new Set(['the','and','for','table','booking','party','seat','seated','cancel','move','mark','finished','show','arrived','here','has','have','they','them','who','with','from','tonight','today','please','change','confirm','decline','request','people','covers','guests','their','into','onto','done','left','gone']),D=t=>t.toLowerCase().replace(/[^a-z0-9: ]/g,' ').split(/\s+/).filter(t=>t.length>2&&!_.has(t)),x=t=>{const n=t.match(/\b(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/i);if(!n)return null;let r=Number(n[1]);return'pm'===n[3]?.toLowerCase()&&r<12&&(r+=12),!n[3]&&r>=1&&r<=11&&(r+=12),`${String(r).padStart(2,'0')}:${n[2]??'00'}`};function A(t,n,r,a,o){const d=String(r??'').toLowerCase(),l=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status)&&!/walk-?in/i.test(r.name??'')),c=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status));if(!d&&!o)return;const u=c.find(t=>t.ref&&d.includes(t.ref.toLowerCase()));if(u)return u;const b=D(d),p=l.filter(t=>D(t.name).some(t=>b.includes(t)));if(1===p.length)return p[0];if(o){const t=c.filter(t=>(0,s.tablesOf)(t.table).some(t=>t.toLowerCase()===o.toLowerCase())),n=p.length?t.filter(t=>p.includes(t)):t;if(n.length)return n.sort((t,n)=>('seated'===t.status?-1:1)-('seated'===n.status?-1:1))[0]}const h=/\d/.test(d.replace(N,''))?x(d.replace(N,'')):null;if(h){const t=(p.length?p:l).filter(t=>t.time===h);if(1===t.length)return t[0]}return p.length?p.sort((t,n)=>t.time.localeCompare(n.time))[0]:void 0}const j=t=>`${t.name}, ${t.partySize} at ${t.time}${t.table?`, table ${t.table}`:''}`,M=[{name:'booking',type:'string',required:!0,description:'Guest name, booking reference or time, as said'},{name:'table',type:'string',description:'Table, if said'}],T=t=>({booking:t,table:L(t)}),P='I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.';function z(t,n,r,a,i,s,d,l=""){return{id:t,apps:$,title:n,risk:'change',params:M,keywords:[],description:`${n}: today\u2019s booking by guest name, reference, table or time.${l}`,match:t=>k(t,i)?7:0,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return r?`${s}: ${j(r)}?${l}`:P},run:async(t,n)=>{const i=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return i?(await o.repo.bookings.setStatus(i.id,r),d&&await d(i,n,t),`Done: ${i.name} ${'noshow'===r?'marked as a no-show':'cancelled'===r?'cancelled':'finished'===r?'finished':r}.`):"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d."}}}const F=(t,n)=>(0,s.tablesOf)(n).forEach(n=>s.useFloor.getState().setLive(t,n,{stage:'seated',dirty:!1})),B={id:'seat_booking',apps:$,title:'Seat a booking',risk:'change',params:M,keywords:[],description:'Seat a guest with a booking today (at their booked table, or the table said). Walk-ins use add_walkin.',match:t=>!k(t,/\b(seat|sit)\b/)||k(t,/\b(walk.?in|walkin|no booking)\b/)||k(t,/\b(\d+|one|two|three|four|five|six|seven|eight|nine|ten) (people|covers|guests)\b/)?k(t,/\b(have|has|are|is) (arrived|here)\b/)?7:0:7,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']),o=q(n.rid,t.table)??r?.table;if(!r)return P;const i=o?O(n.rid,(0,s.tablesOf)(o)[0]):{};return`Seat ${r.name}, ${r.partySize} at ${r.time}${o?`, at table ${o}`:' (no table yet)'}?${i.blocked?` ${(0,a.tableNumbers)(o)} is marked blocked.`:i.dirty?` ${(0,a.tableNumbers)(o)} still needs clearing.`:i.stage?` ${(0,a.tableNumbers)(o)} already has people seated.`:''}`},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const a=q(n.rid,t.table);return t.table&&!a?`Nothing changed: there\u2019s no table ${t.table} on the plan.`:(a&&a!==r.table&&await o.repo.bookings.update(r.id,{table:a}),await o.repo.bookings.setStatus(r.id,'seated'),F(n.rid,a??r.table),`Done: ${r.name} seated${a??r.table?` at table ${a??r.table}`:''}.`)}},E=z('finish_booking','Finish a table (party left)','finished',['seated'],/\b(finished|have left|has left|left|gone|paid and gone|party left|they'?re done)\b/,'Mark finished',(t,n)=>{(0,s.tablesOf)(t.table).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0}))},' The table is then marked as needing clearing.'),R=z('no_show','Mark a no-show','noshow',['confirmed','pending'],/\b(no.?show|didn'?t (turn up|show|come)|not (turned|turning) up)\b/,'Mark as a no-show'),H=z('cancel_booking','Cancel a booking','cancelled',['confirmed','pending'],/^(?!.*\b(shifts?|orders?|rota)\b).*(\bcancel+(ed)?\b.*\b(booking|reservation|table for|party)\b|\bcancel\s+(?!that\b|it\b|this\b|now\b|please\b)[a-z]{3,})/,'Cancel the booking',void 0,' The guest is not messaged from here.'),W={id:'move_booking',apps:$,title:'Move a booking to another table',risk:'change',params:[M[0],{name:'table',type:'string',required:!0,description:'New table'}],keywords:[],description:'Give a booking today a different table (seated parties move too).',match:t=>k(t,/\b(move|put|switch|change)\b/)&&k(t,/\btables?\b/)&&!k(t,/\b(shift|rota)\b/)?7:0,parse:t=>{const n=[...t.matchAll(new RegExp(N.source,'gi'))],r=n[n.length-1];return{booking:t,table:r?String(S(r[1])??r[1]).toUpperCase():void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),o=q(n.rid,t.table);return r?o?`Move ${j(r)} to table ${o}?${O(n.rid,o).stage||O(n.rid,o).blocked?` ${(0,a.tableNumbers)(o)} is not free.`:''}`:`There\u2019s no table ${t.table??''} on the plan.`:P},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),a=q(n.rid,t.table);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";if(!a)return'Nothing changed: I couldn\u2019t find that table on the plan.';const i=r.table;return await o.repo.bookings.update(r.id,{table:a,tableSetHere:!0}),'seated'===r.status&&((0,s.tablesOf)(i).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0})),F(n.rid,a)),`Done: ${r.name} moved to table ${a}.`}},G={id:'change_booking',apps:['owner','staff'],title:'Change a booking\u2019s time or party size',risk:'change',params:[M[0],{name:'time',type:'time',description:'New time HH:mm'},{name:'covers',type:'integer',description:'New party size'}],keywords:[],description:'Change the time or the number of people on a booking today. The guest is not messaged from here.',match:t=>k(t,/\b(change|make it|now|instead|update|actually)\b/)&&k(t,/\b(booking|reservation|party)\b/)&&k(t,/\b(\d|one|two|three|four|five|six|seven|eight|nine|ten)\b/)?6:0,parse:t=>{const n=t.toLowerCase(),r=n.match(/\b(?:to|for|now|of)\s+(\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\s*(?:people|covers|guests|pax)?\b(?!\s*[:.]\d)(?!\s*(?:am|pm|o'?clock))/),a=n.match(/\b(?:to|at)\s+(\d{1,2}(?::\d{2})?\s*(?:am|pm)|\d{1,2}:\d{2}|\d{1,2}\s*o'?clock)/);return{booking:t,covers:r&&/people|covers|guests|pax|party|for/.test(n)&&!a?.[1]?.startsWith(r[1])?S(r[1]):void 0,time:a?x(a[1].replace(/o'?clock/,''))??void 0:void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);return r?t.time||t.covers?`Change ${j(r)} to ${[t.covers?`${t.covers} people`:'',t.time?`${t.time}`:''].filter(Boolean).join(' at ')}? The guest is not messaged from here.`:`What should change on ${r.name}\u2019s booking? Say the new time or number of people.`:P},run:async(t,r)=>{const a=A(r.rid,r.today,t.booking,['confirmed','pending']);if(!a)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const i=S(t.covers);if(!(null==t.covers||i&&(0,n.validParty)(i)))return`Nothing changed: ${n.PARTY_RULE}`;const s=t.time?x(String(t.time)):null;return i||s?(await o.repo.bookings.update(a.id,{...i?{partySize:i}:{},...s?{time:s}:{}}),`Done: ${a.name} is now ${i??a.partySize} at ${s??a.time}.`):'Nothing changed.'}},U={id:'decide_booking',apps:['owner'],title:'Accept or decline a booking request',risk:'change',params:[M[0],{name:'outcome',type:'string',required:!0,description:'confirmed or declined',enum:['confirmed','declined']}],keywords:[],description:'Accept or decline a booking request that is waiting (the same as the Accept / Decline buttons).',match:t=>k(t,/\b(accept|approve|confirm|decline|reject|turn down)\b/)&&k(t,/\b(booking|request|reservation)\b/)?7:0,parse:t=>({booking:t,outcome:/\b(decline|reject|turn down)\b/i.test(t)?'declined':'confirmed'}),preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?`${'declined'===t.outcome?'Decline':'Accept'} the request from ${r.name}, ${r.partySize} on ${f(r.date)} at ${r.time}?`:'I couldn\u2019t find a waiting request with that name.'},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?(await o.repo.bookings.decide(r.id,'declined'===t.outcome?'declined':'confirmed',w(n)),`Done: ${r.name}\u2019s request ${'declined'===t.outcome?'declined':'accepted'}.`):'Nothing changed: I couldn\u2019t find a waiting request with that name.'}},V=[{name:'table',type:'string',required:!0,description:'Table name or number'}],Y={id:'table_cleared',apps:$,title:'Mark a table cleared',risk:'change',params:V,keywords:[],description:'Mark a table cleared and free (after clearing it down).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(cleared|clear(ed)? down|is clean|wiped|reset|is free|is ready|ready again)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} cleared and free?${O(n.rid,r).stage?' People are still marked as seated there.':''}`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!1,stage:void 0}),`Done: table ${r} is free.`):'Nothing changed: I couldn\u2019t find that table.'}},J={id:'table_needs_clearing',apps:$,title:'Mark a table as needing clearing',risk:'change',params:V,keywords:[],description:'Mark a table as needing clearing (dirty).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(needs? (clearing|clearing down|a clean|wiping)|dirty|to be cleared)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} as needing clearing?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!0,stage:void 0}),`Done: table ${r} needs clearing.`):'Nothing changed: I couldn\u2019t find that table.'}},K={id:'block_table',apps:$,title:'Block or unblock a table',risk:'change',params:[...V,{name:'blocked',type:'string',required:!0,description:'yes to block, no to unblock',enum:['yes','no']}],keywords:[],description:'Block a table (not used tonight) or unblock it.',match:t=>k(t,/\b(un.?block|block|out of use|not in use|close)\b/)&&k(t,/\btables?\b/)&&!k(t,/\barea\b/)?8:0,parse:t=>({table:L(t),blocked:/\b(un.?block|back in use|open)\b/i.test(t)?'no':'yes'}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`${'no'===t.blocked?'Unblock':'Block'} table ${r}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{blocked:'no'!==t.blocked}),`Done: table ${r} ${'no'===t.blocked?'unblocked':'blocked'}.`):'Nothing changed: I couldn\u2019t find that table.'}},Q={mains:'mains',main:'mains',dessert:'dessert',desserts:'dessert',pudding:'dessert',bill:'bill',check:'bill',seated:'seated',starters:'seated'},X={id:'table_stage',apps:$,title:'Set a table\u2019s course',risk:'change',params:[...V,{name:'stage',type:'string',required:!0,description:'seated, mains, dessert or bill',enum:['seated','mains','dessert','bill']}],keywords:[],description:'Set where a seated table is: seated (starters), mains, dessert or bill.',match:t=>k(t,/\btables?\b/)&&k(t,/\b(on|at|having|wants?|asked for|ready for|onto)\b.*\b(mains?|desserts?|pudding|bill|check)\b/)?8:0,parse:t=>{const n=t.toLowerCase().match(/\b(mains?|desserts?|pudding|bill|check|starters)\b/);return{table:L(t),stage:n?Q[n[1]]:void 0}},preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Set table ${r} to ${t.stage}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table),a=Q[String(t.stage??'').toLowerCase()];return r&&a?(s.useFloor.getState().setLive(n.rid,r,{stage:a,dirty:!1}),`Done: table ${r} is on ${a}.`):'Nothing changed: say the table and mains, dessert or bill.'}},Z=t=>/\b(how many|how much|what'?s|what is|what are|any|have we got|do we have|are there|is there)\b|\?\s*$/.test(t),ee=t=>/\b(roast|chickens?|beef)\b/.test(t)&&!/\b(sold out|86|off the menu|menu|dish|special|allerg)/.test(t)&&Object.values(d.useShellStore.getState().items).some(t=>t.some(t=>t.active&&(0,l.isRoastItem)(t))),te=t=>(d.useShellStore.getState().items[t]??[]).filter(t=>t.active),ne=(t,n)=>{const r=String(n??'').toLowerCase();return te(t).find(t=>[t.name,t.plural,t.key].some(t=>t&&new RegExp(`\\b${t.toLowerCase().replace(/[^a-z0-9 ]/g,'')}`).test(r)))},re={id:'shellfish_count',apps:C,title:'Shellfish count: sold, delivery or recount',risk:'change',params:[{name:'item',type:'string',required:!0,description:'Item, e.g. lobster'},{name:'qty',type:'string',required:!0,description:'How many (\xbd allowed for half items)'},{name:'mode',type:'string',required:!0,description:'sold, delivery or count',enum:['sold','delivery','count']}],keywords:[],description:'Record shellfish (or other counted stock) sold, a delivery in, or a recount (sets the count).',match:t=>!k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)&&!ee(t)||k(t,/\b(allerg|contain|chat|message|tell|text|post)/)||Z(t)||!k(t,/\b(\d+|\xbd|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|sold|deliver(ed|y)?|came in|arrived|got in|count(ed)?|recount)\b/)?0:7,parse:(n,r)=>{const a=n.toLowerCase(),o=a.match(/\b(\d+(?:\.5)?|\xbd|a half|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|fifteen|twenty)\b/),i=/\b(deliver(ed|y)?|came in|arrived|got in|received)\b/.test(a)?'delivery':/\b(count|we have|we'?ve got|there are|recount|left in)\b/.test(a)?'count':'sold',s=ne(r.rid,a);return s&&(0,t.fishInStone)(r.rid,s)?{item:s.name,qty:(0,t.parseStoneAmount)(n),mode:i}:{item:s?.name??n,qty:o?'\xbd'===o[1]||/half/.test(o[1])?.5:S(o[1]):1,mode:i}},preview:(n,a)=>{const o=ne(a.rid,n.item);if(!o||'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'I couldn\u2019t find that item in the shellfish counts.';if((0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||!Number.isInteger(2*r))return'Use stone in half-stone steps, for example one and a half stone.';const i=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,s=(0,t.fromStone)(r,o.unit),l='count'===n.mode?s:'delivery'===n.mode?i+s:i-s;return`${o.name}: ${n.mode} ${(0,t.stoneSpeech)(r)}, after ${(0,t.stoneSpeech)((0,t.toStone)(Math.max(0,l),o.unit))}?`}const i=S(n.qty)??0,s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c='count'===n.mode?i:'delivery'===n.mode?s+i:s-i;return`${'count'===n.mode?`Set ${o.plural||o.name} to ${(0,l.fmtCount)(i)}`:'delivery'===n.mode?`Add a delivery of ${(0,l.fmtCount)(i)} ${o.plural||o.name}`:`Record ${(0,l.fmtCount)(i)} ${1===i?o.name:o.plural||o.name} sold`} (now ${(0,l.fmtCount)(s)}, after ${(0,l.fmtCount)(Math.max(0,c))})?`},run:(n,a)=>{const o=ne(a.rid,n.item);if(o&&'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'Nothing changed: that item is not in Head Chef stock.';if(o&&(0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||r>500||!Number.isInteger(2*r))return'Nothing changed: use stone in half-stone steps.';const i=(0,t.fromStone)(r,o.unit),s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,l='count'===n.mode?i-s:'delivery'===n.mode?i:-i;return s+l<0?`Nothing changed: only ${(0,t.stoneSpeech)((0,t.toStone)(s,o.unit))} left.`:(l&&d.shellfish.append({rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner',delta:l,reason:'count'===n.mode?'count':'delivery'===n.mode?'delivery':'sold'}),`Done: ${o.name}, ${(0,t.stoneSpeech)((0,t.toStone)(s+l,o.unit))} left.`)}const i=S(n.qty);if(!o||null==i||!(i>=0)||i>500)return'Nothing changed: say the item and how many.';if('half'!==o.unit&&i%1)return`Nothing changed: ${o.plural||o.name} are counted whole.`;const s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c={rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner'};return'count'===n.mode?(i!==s&&d.shellfish.append({...c,delta:i-s,reason:'count'}),`Done: ${o.plural||o.name} counted at ${(0,l.fmtCount)(i)}.`):'delivery'===n.mode?i<=0?'Nothing changed.':(d.shellfish.append({...c,delta:i,reason:'delivery'}),`Done: ${(0,l.fmtCount)(i)} in. ${(0,l.fmtCount)(s+i)} now.`):s(k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)||ee(t))&&Z(t)&&!k(t,/\b(allerg|contain)/)?8:0,parse:(t,n)=>({item:ne(n.rid,t)?.name}),preview:()=>'Shellfish left',run:(n,a)=>{const o=(0,d.venueCounts)(d.useShellStore.getState(),a.rid),i=ne(a.rid,n.item),s=(i?[i]:te(a.rid).filter(t=>!(0,l.isRoastItem)(t)||(0,l.isSundayIn)(new Date))).filter(t=>'chef'!==a.app||(0,r.chefCanSee)(a.rid,t));return s.length?s.map(n=>`${n.plural||n.name}: ${(0,t.fishInStone)(a.rid,n)?(0,t.stoneSpeech)((0,t.toStone)(o[n.key]??0,n.unit)):(0,l.fmtCount)(o[n.key]??0)} left`).join('. ')+'.':'No shellfish counts are set up here.'}},oe={accept:'acknowledged',preparing:'preparing',ready:'ready',collected:'collected'},ie=(t,n)=>{const r=String(n??'').toLowerCase(),a=i.useStore.getState().orders.filter(n=>n.restaurantId===t&&!['closed','cancelled','collected','served'].includes(n.status));return a.find(t=>t.ref&&r.includes(t.ref.toLowerCase()))??a.find(t=>{const n=r.match(/\b(?:number|no\.?|order)\s*(\d{1,4})\b/);return!!n&&t.ref.replace(/\D/g,'').endsWith(n[1])})??(()=>{const t=a.filter(t=>D(t.customerName??'').some(t=>D(r).includes(t)));return 1===t.length?t[0]:void 0})()},se={id:'order_status',apps:C,title:'Move an order on: accept, preparing, ready or collected',risk:'change',params:[{name:'order',type:'string',required:!0,description:'Order reference, number or customer name'},{name:'status',type:'string',required:!0,description:'accept, preparing, ready or collected',enum:['accept','preparing','ready','collected']}],keywords:[],description:'Accept a takeaway or table order, or mark it preparing, ready or collected (the same as the order buttons).',match:t=>k(t,/\b(orders?|takeaways?|collection|ticket)\b/)&&k(t,/\b(accept|ready|collected|picked up|preparing|start(ed)?|on it)\b/)&&!k(t,/\b(read|any|list|what)\b/)?7:0,parse:t=>{const n=t.toLowerCase();return{order:t,status:/\baccept/.test(n)?'accept':/\b(collected|picked up)\b/.test(n)?'collected':/\bready\b/.test(n)?'ready':'preparing'}},preview:(t,n)=>{const r=ie(n.rid,t.order);return r?`Mark order ${r.ref} for ${r.customerName} as ${'accept'===t.status?'accepted':t.status}?`:'I couldn\u2019t find that order. Say the order number or the name.'},run:async(t,n)=>{const r=ie(n.rid,t.order),a=oe[String(t.status)];if(!r||!a)return'Nothing changed: I couldn\u2019t find that order.';if('acknowledged'===a){return await o.repo.orders.accept(r.id,w(n))?`Done: order ${r.ref} accepted.`:`Order ${r.ref} was already accepted.`}return await o.repo.orders.setStatus(r.id,a,w(n)),`Done: order ${r.ref} is ${a}.`}},de={id:'order_list_add',apps:C,title:'Add to an order list',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What we need'},{name:'qty',type:'integer',description:'How many (default 1)'},{name:'list',type:'string',description:'Which list (supplier), if said'}],keywords:[],description:'Add an item to an order list (or add to the quantity if it is already on it). Nothing is ordered from the supplier.',match:t=>k(t,/\b(add|put)\b.*\b(to|on)\b.*\b(order|shopping|cash and carry|list)\b|\bwe need (more )?\w+/)&&!k(t,/\b(chat|message|tell|text|post|shift|rota)\b/)?6:0,parse:t=>{const n=t.toLowerCase().replace(/[.?!]+$/,'').match(/\b(?:add|put|need(?: more)?)\s+(?:(\d+|an?|one|two|three|four|five|six|seven|eight|nine|ten|twelve|twenty)\s+)?(.+?)(?:\s+(?:to|on)\s+(?:the\s+)?(.+?)(?:\s+(?:order|list|order list))*)?$/);return n?{qty:S(n[1])??1,item:n[2].replace(/^(?:some|more)\s+/,'').trim(),list:n[3]?.replace(/\b(order|list|shopping)\b/g,'').trim()||void 0}:{item:t}},preview:(t,n)=>{const r=c.useOrderLists.getState().lists.filter(t=>t.rid===n.rid),a=String(t.list??'').toLowerCase(),o=a&&r.find(t=>t.name.toLowerCase().includes(a))||r[0];return o?`Add ${t.qty??1} ${t.item} to ${o.name}? Nothing is ordered from the supplier.`:'There are no order lists yet. Set one up in Order lists.'},run:(t,n)=>{const r=c.useOrderLists.getState(),a=r.lists.filter(t=>t.rid===n.rid),o=String(t.list??'').toLowerCase(),i=o&&a.find(t=>t.name.toLowerCase().includes(o))||a[0],s=String(t.item??'').trim().slice(0,60),d=Math.max(1,Math.min(99,Math.round(S(t.qty)??1)));if(!i||s.length<2)return'Nothing changed: say what we need.';const l={id:n.whoId??'assistant',name:w(n)},u=r.items.find(t=>t.rid===n.rid&&t.listId===i.id&&'open'===t.status&&t.name.toLowerCase()===s.toLowerCase());return u?(r.bump(u.id,d,l),`Done: added ${d} more ${s} on ${i.name}.`):(r.addItem(n.rid,{listId:i.id,name:s,qty:d,unit:'',addedBy:l.id,addedByName:l.name}),`Done: ${d} ${s} added to ${i.name}.`)}},le={in:'Clock you in',out:'Clock you out',break_start:'Start your break',break_end:'End your break'};function ce(t,n,r){return{id:t,apps:I,title:le[n].replace('you','me').replace('your','my'),risk:'change',params:[],keywords:[],description:`${le[n]} now (only for the person signed in; the same location check as the Clock tab).`,match:t=>k(t,r)?8:0,preview:()=>`${le[n]} now?`,run:async(t,r)=>{if(!r.whoId)return'Sign in to the Staff app first.';const a=y().toISOString(),o=await(0,b.clockAction)(n,{rid:r.rid,staffId:r.whoId,date:r.today,at:a});return o.ok?'Done: '+{in:'clocked in',out:'clocked out',break_start:'break started',break_end:'break ended'}[n]+` at ${new Date(a).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}.`+(o.warn?' '+o.warn:''):'Nothing changed: '+o.message}}}const ue=ce('clock_in','in',/\bclock (me )?in\b|\bclocking in\b|\bstart(ing)? my shift\b/),be=ce('clock_out','out',/\bclock (me )?out\b|\bclocking out\b|\b(finish|end)(ing)? my shift\b/),pe=ce('break_start','break_start',/\b(start|starting|taking|take|going on|begin)( my| a)? break\b|\bon (my )?break now\b/),he=ce('break_end','break_end',/\b(end|ending|finish|finished|back from)( my| a| the)? break\b|\bback from break\b/),me=t=>{const n=u.useOwner.getState().staff,r=String(t??'').toLowerCase();return n.find(n=>n.id===t)?.id??n.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>D(r).includes(t)))?.id},ge=(t,n)=>{if(!(0,p.hasRecipeCards)())return;const r=D(String(n??''));let a;for(const n of(0,p.recipeCards)().list(t)){const t=D(n.dish).filter(t=>r.includes(t)).length;t&&t>(a?.s??0)&&(a={c:n,s:t})}return a?.c},fe=t=>{const n=m.ALLERGENS.filter(n=>t[n.id]).map(n=>('may'===t[n.id]?'may contain ':'')+n.label.toLowerCase());return n.length?n.join(', '):'none of the 14 allergens'},ye=[B,E,R,H,W,G,U,Y,J,K,X,re,ae,se,de,ue,be,pe,he,{id:'decide_leave',apps:['owner'],title:'Approve or decline a holiday request',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff member id or first name'},{name:'outcome',type:'string',required:!0,description:'approved or declined',enum:['approved','declined']}],keywords:[],description:'Approve or decline someone\u2019s waiting holiday (leave) request.',match:t=>k(t,/\b(approve|accept|decline|reject|ok|okay)\b/)&&k(t,/\b(holiday|leave|time off|day off|days off)\b/)?7:0,parse:t=>{const n=t.toLowerCase(),r=u.useOwner.getState().staff.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>new RegExp(`\\b${t}\\b`).test(n)));return{staffId:r?.id,outcome:/\b(decline|reject|refuse)\b/.test(n)?'declined':'approved'}},preview:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status),o=n.staff.find(t=>t.id===r)?.name.replace(' (example)','');return a?`${'declined'===t.outcome?'Decline':'Approve'} ${o}\u2019s holiday, ${f(a.from)}${a.to!==a.from?` to ${f(a.to)}`:''}?`:`There\u2019s no waiting holiday request${o?` from ${o}`:''}.`},run:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status);return a?(n.setLeave(a.id,'declined'===t.outcome?'declined':'approved'),`Done: holiday ${'declined'===t.outcome?'declined':'approved'}.`):'Nothing changed: no waiting request found.'}},{id:'allergen_signoff',apps:['chef'],title:'Sign off a dish\u2019s allergens',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'}],keywords:[],description:'Head chef signs off a recipe card (its allergens). The allergens are read back first.',match:t=>k(t,/\bsign(ed)?.?off\b|\bapprove\b.*\b(card|recipe|allergens?)\b/)?8:0,parse:t=>({dish:t}),preview:(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?`${r.dish} can\u2019t be signed off yet: ${a}`:`Sign off ${r.dish}? Allergens: ${fe(r.allergens)}.`},run:async(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'Nothing changed: I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?'Nothing changed: '+a:(await(0,p.recipeCards)().signOff(r.id,{name:w(n),role:'head-chef'}),`Done: ${r.dish} signed off.`)}}]},1428,[982,1098,804,829,848,800,1014,981,983,1025,865,1071,856,832,830]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.spokenDate=j,Object.defineProperty(_e,"GAP_VOICE_ACTIONS",{enumerable:!0,get:function(){return be}});var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),l=_r(_d[12]),f=_r(_d[13]),u=_r(_d[14]),m=_r(_d[15]),g=_r(_d[16]),y=_r(_d[17]),b=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),S=_r(_d[21]),$=_r(_d[22]);const v=(e,t)=>t.test(e),I=e=>e.who??('display'===e.app?'Main Display':'Assistant'),N=e=>(e??'').replace(' (example)',''),A=e=>String(e).padStart(2,'0'),D=()=>{const e=(0,$.appNow)();return`${A(e.getHours())}:${A(e.getMinutes())}`},C=['owner','staff','display'],T=['owner'],q=['staff','owner'],O=['owner','chef'],_=e=>`\u201c${e}\u201d`,x=(e,t)=>n.useOwner.getState().sys(e,t,(0,$.appNow)().toISOString()),M=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],R=e=>`${A(Math.floor(e))}:${A(Math.round(e%1*60))}`,L=['january','february','march','april','may','june','july','august','september','october','november','december'];function j(e,t){const a=e.toLowerCase(),r=a.match(new RegExp(`\\b(\\d{1,2})(?:st|nd|rd|th)?(?:\\s+of)?\\s+(${L.join('|')})\\b`))??a.match(new RegExp(`\\b(${L.join('|')})\\s+(\\d{1,2})(?:st|nd|rd|th)?\\b`));if(r){const e=Number(/\d/.test(r[1])?r[1]:r[2]),a=L.indexOf(/\d/.test(r[1])?r[2]:r[1]);let n=Number(t.slice(0,4));return`${n}-${A(a+1)}-${A(e)}`e.active)){const r=[N(e.name).split(' ')[0],e.nickname].filter(Boolean).map(e=>e.toLowerCase()),n=Math.min(...r.map(e=>{const a=t.match(new RegExp(`\\b${e.replace(/[^a-z']/g,'')}\\b`));return a?.index??1/0}));n<1/0&&a.push({s:e,at:n})}return a.sort((e,t)=>e.at-t.at).map(e=>e.s)}const F=e=>n.useOwner.getState().staff.find(t=>t.id===e),E=e=>F(e)??W(String(e??''))[0],U=e=>a.useStore.getState().waitlist.filter(t=>t.restaurantId===e&&('waiting'===t.status||'notified'===t.status)).sort((e,t)=>e.number-t.number);function z(e,t){const a=String(t??'').toLowerCase(),r=U(e);if(!r.length)return;const n=a.match(/(?:#|number|no\.?)\s*(\d{1,3})\b/);if(n)return r.find(e=>e.number===Number(n[1]));const i=(0,$.tokensOf)(a).filter(e=>!['waitlist','wait','list','off','remove','told','ready','next'].includes(e)),s=r.filter(e=>(0,$.tokensOf)(e.name).some(e=>i.includes(e)));return s.length?s[0]:/\b(next|first)\b/.test(a)||1===r.length?r[0]:void 0}const Y=e=>`waitlist number ${e.number}, ${e.name}, party of ${e.partySize}`;function B(e,t){const n=a.useStore.getState(),i=n.restaurants.find(t=>t.id===e);if(!i)return;const s=(0,$.appNow)(),o=(0,l.ymdOf)(s),d=r.useFloor.getState(),c=d.plans[e]??(0,r.seedPlan)(e),h=n.bookings.filter(t=>t.restaurantId===e),p=(0,w.closedAreasAt)(w.useBlocks.getState().blocks,e,o,D()),f=(0,b.floorView)(c,h,n.orders.filter(t=>t.restaurantId===e),d.live[e]??{},s,i.settings.turnMins,p);return(0,b.suggestTable)(c,h.filter(e=>e.date===o),f,t,s,(0,b.turnFor)(t,i.settings.turnMins))?.table}const P=/\bwait ?(ing )?list\b|\bwaiting\b/,H=[{name:'who',type:'string',required:!0,description:'Waitlist number or name, as said (or "next")'}],K={id:'waitlist_seat',apps:C,title:'Seat someone from the waitlist',risk:'change',params:[...H,{name:'table',type:'string',required:!1,description:'Table (else the best free table)'}],keywords:[],description:'Seat a waiting party from the waitlist at a table (the suggested table unless one is said), like the Seat button.',match:e=>v(e,P)&&v(e,/\bseat\b|\bsit\b/)?9:0,parse:e=>({who:e,table:(0,$.tableIn)(e)}),preview:(e,t)=>{const a=z(t.rid,e.who);if(!a)return'I couldn\u2019t find that party on the waitlist. Say their number or name.';const r=(0,$.resolveTable)(t.rid,e.table)??B(t.rid,a.partySize);return r?`Seat ${Y(a)}, at table ${r}?`:`There\u2019s no free table for ${a.partySize} right now. Say a table to seat them anyway.`},run:async(e,a)=>{const n=z(a.rid,e.who);if(!n)return'Nothing changed: I couldn\u2019t find that party on the waitlist.';const i=(0,$.resolveTable)(a.rid,e.table)??B(a.rid,n.partySize);return i?(await t.repo.waitlist.setStatus(n.id,'seated'),await t.repo.bookings.seatWalkIn(a.rid,n.partySize,i,`From waitlist #${n.number}`),(0,r.tablesOf)(i).forEach(e=>r.useFloor.getState().setLive(a.rid,e,{stage:'seated',dirty:!1})),`Done: waitlist number ${n.number} seated at table ${i}.`):'Nothing changed: there\u2019s no free table for them. Say a table.'}};function V(e,t){if(!e.whoId)return;const a=n.useOwner.getState().shifts.filter(t=>t.staffId===e.whoId&&!1!==t.published&&t.date>=e.today).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start),r=j(String(t??''),e.today);return r?a.find(e=>e.date===r):a[0]}const G=e=>`${(0,$.niceDay)(e.date)}, ${R(e.start)} to ${R(e.end)}`,Q=/\b(approve|accept|decline|reject|okay|ok)\b/,Z='I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d.';function J(e,t){const a=e.toLowerCase(),r=a.match(/\bfrom\s+(.+?)\s+(?:to|until|till)\s+(.+)$/);if(r){const e=j(r[1],t),a=j(r[2],t)??e;return{from:e,to:a&&e&&a'open'===e.status&&(!r||e.kind===r)),s=W(String(e??'')).map(e=>e.id);return s.length?i.find(e=>s.includes(e.fromId)&&(!e.toId||1===s.length||s.includes(e.toId)))??i.find(e=>s.includes(e.fromId)||e.toId&&s.includes(e.toId)):1===i.length?i[0]:void 0}const ee=(t,a)=>'chef'!==a?.app||(0,e.chefCanSee)(a.rid,t)&&(0,e.chefCanSee)(a.rid,i.useSafety.getState().points.find(e=>e.id===t.pointId)),te=(e,t)=>{const a=i.useSafety.getState().entries.filter(a=>(0,l.ymdOf)(new Date(a.at))===e&&ee(a,t));return{n:a.length,bad:a.filter(e=>!e.ok).length,fixed:a.filter(e=>!e.ok&&e.corrective).length}},ae=/\b(food safety|safety diary|diary|haccp|safe methods|sfbb)\b/;function re(e,t){const a=(0,m.weekStart)(new Date(e+'T12:00:00')),r=new Date(a+'T00:00:00').getTime(),n=r+6048e5,s=i.useSafety.getState().entries.filter(e=>{const a=new Date(e.at).getTime();return a>=r&&a!e.ok).length,actions:s.filter(e=>!e.ok&&e.corrective).length,daysSigned:o.filter(e=>{const t=new Date(e.date+'T00:00:00').getTime();return t>=r&&te.test(t))?.[1]??'Other',location:s?s[1].replace(/^the /,''):'Not said',firstAid:o?o[1]:'',what:e.trim().replace(/^(?:please\s+)?(?:record|log|report|add|write up|put in the accident book)\s+(?:an?\s+)?(?:accident|near miss|injury)?\s*(?:in the accident book)?\s*[:,-]?\s*/i,'').replace(/^\w/,e=>e.toUpperCase())||e.trim()}}function se(e,t){const a=(0,d.ukClock)((0,$.appNow)()),r=new Date(`${a.ymd}T12:00:00Z`).getUTCDay(),n=(0,$.tokensOf)(String(t??'')).filter(e=>!['tick','ticked','task','off','mark','done','did','finished','completed','ive','i\u2019ve','list'].includes(e)),i=e=>(0,$.tokensOf)(e).filter(e=>n.some(t=>t===e||t.length>3&&e.startsWith(t.slice(0,4)))).length,h=e.whoId?(0,o.tasksFor)((0,s.tasksOf)(e.rid,e.whoId),r):[];let p=h.map(e=>({t:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.t;const l='chef'===e.app?['all','kitchen']:'staff'===e.app?['all','foh']:['all','foh','kitchen'],f=p?void 0:c.useReminders.getState().reminders.filter(t=>t.rid===e.rid&&!t.removed&&!t.paused&&t.days.includes(a.dow)&&l.includes(t.audience)).map(e=>({r:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.r;return{ymd:a.ymd,task:p,rem:f}}const oe=e=>a.useStore.getState().menu.filter(t=>t.restaurantId===e);function de(e,t){const a=(0,$.tokensOf)(String(t??''));let r;for(const t of oe(e)){const e=(0,$.tokensOf)(t.name).filter(e=>a.includes(e)).length;e&&e>(r?.s??0)&&(r={m:t,s:e})}return r?.m}const ce=e=>{const t=e.match(/\xa3\s?(\d+(?:\.\d{1,2})?)|\b(\d+(?:\.\d{2}))\b|\b(\d+)\s*(?:pounds|quid)(?:\s*(\d{1,2}))?/i);if(t)return t[1]?Number(t[1]):t[2]?Number(t[2]):Number(t[3])+(t[4]?Number(t[4])/100:0)},he={gram:'g',grams:'g',g:'g',kilo:'kg',kilos:'kg',kg:'kg',ml:'ml',millilitres:'ml',litre:'l',litres:'l',l:'l',tablespoon:'tbsp',tablespoons:'tbsp',tbsp:'tbsp',teaspoon:'tsp',teaspoons:'tsp',tsp:'tsp',pinch:'pinch',slice:'slice',slices:'slices',whole:'whole'};function pe(e){const t=e.match(/\badd\s+(\d+(?:\.\d+)?|a|an|one|two|three|four|five|six|half)\s*(grams?|g|kilos?|kg|ml|millilitres|litres?|l|tablespoons?|tbsp|teaspoons?|tsp|pinch|slices?|whole)?\s+(?:of\s+)?(.+?)\s+(?:to|into|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*$/i);if(t)return{qty:String((0,$.num)(t[1])??t[1]),unit:t[2]?he[t[2].toLowerCase()]??t[2]:'',name:t[3].trim(),dish:t[4]}}const le={in:'Clock {n} in',out:'Clock {n} out',break_start:'Start a break for {n}',break_end:'End {n}\u2019s break'},fe=e=>null==e?'not entered':`\xa3${e.toLocaleString('en-GB',{minimumFractionDigits:2,maximumFractionDigits:2})}`,ue=e=>'owner'===e.app&&'staff'!==e.role,me=['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];function ge(e){if(/\bweekdays?\b/.test(e))return[1,2,3,4,5];if(/\bweekends?\b/.test(e))return[0,6];const t=me.map((t,a)=>new RegExp(`\\b${t}s?\\b`).test(e)?a:-1).filter(e=>e>=0);return t.length?t:[0,1,2,3,4,5,6]}const ye={all:'everyone on shift',foh:'front of house',kitchen:'the kitchen'},be=[K,{id:'waitlist_remove',apps:C,title:'Take someone off the waitlist',risk:'change',params:H,keywords:[],description:'Take a party off the waitlist (they left or no longer need a table), like the Remove button. It stays in the records.',match:e=>v(e,P)&&v(e,/\b(remove|take .*off|cross .*off|strike .*off|gave up|have left|has left|left|gone)\b/)&&!v(e,/\b(seat|told|ready)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Take ${Y(a)}, off the waitlist?`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,a)=>{const r=z(a.rid,e.who);return r?(await t.repo.waitlist.setStatus(r.id,'removed'),`Done: number ${r.number} is off the waitlist.`):'Nothing changed: I couldn\u2019t find that party.'}},{id:'waitlist_told',apps:C,title:'Mark a waiting party as told their table is ready',risk:'change',params:H,keywords:[],description:'Record that a waiting party has been told their table is ready, like the Mark as told button. No text is sent.',match:e=>v(e,P)&&v(e,/\b(told|tell|let .* know|notif|ready|called)\b/)&&!v(e,/\b(seat|remove)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Mark ${Y(a)}, as told their table is ready? No text is sent from here.`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,n)=>{const i=z(n.rid,e.who);if(!i)return'Nothing changed: I couldn\u2019t find that party.';const s=a.useStore.getState().restaurants.find(e=>e.id===n.rid);return r.useFloor.getState().logSms(n.rid,(0,$.appNow)().toISOString(),`#${i.number} ${i.partySize}: Your table at ${s?.name??'the restaurant'} is ready.`),await t.repo.waitlist.setStatus(i.id,'notified'),`Done: number ${i.number} marked as told. No text was sent.`}},{id:'request_cover',apps:q,title:'Ask for cover for my shift',risk:'change',params:[{name:'day',type:'string',required:!1,description:'Day or date of your shift (else your next shift)'}],keywords:[],description:'Ask the team to cover one of your own shifts, like the Ask for cover button. A \u201cCover needed\u201d note goes in the team chat.',match:e=>v(e,/\bcover\b/)&&v(e,/\b(my|me)\b/)&&v(e,/\b(shift|ask|need|someone|anyone|can)\b/)&&!v(e,Q)?9:0,parse:e=>({day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day);return a?`Ask for cover for your shift on ${G(a)}? A \u201cCover needed\u201d note goes in the team chat.`:Z},run:(e,t)=>{const a=V(t,e.day);return a&&t.whoId?n.useOwner.getState().swaps.some(e=>e.shiftId===a.id&&'open'===e.status)?'There\u2019s already an open request for that shift.':(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,kind:'cover',note:'Can anyone cover?'}),x('all',`Cover needed: ${M[a.day]} ${R(a.start)}\u2013${R(a.end)} (${N(F(t.whoId)?.name??t.who)})`),`Done: cover asked for ${G(a)}. A manager approves it once someone takes it.`):"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_swap',apps:q,title:'Ask to swap my shift with someone',risk:'change',params:[{name:'with',type:'string',required:!0,description:'Who you agreed to swap with (first name)'},{name:'day',type:'string',required:!1,description:'Day or date of your shift'}],keywords:[],description:'Ask a manager to approve swapping one of your shifts with a colleague you agreed it with, like the Swap with button.',match:e=>v(e,/\bswap\b/)&&!v(e,Q)?9:0,parse:(e,t)=>({with:W(e).find(e=>e.id!==t?.whoId)?.id,day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day),r=E(e.with);return r&&r.id!==t.whoId?a?`Ask to swap your shift on ${G(a)} with ${N(r.name)}? A manager still approves it.`:Z:'Who are you swapping with? Say their first name.'},run:(e,t)=>{const a=V(t,e.day),r=E(e.with);return a&&t.whoId?r&&r.id!==t.whoId?(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,toId:r.id,kind:'swap',note:'Agreed between us'}),`Done: swap with ${N(r.name)} asked for. A manager approves it.`):'Nothing changed: say who you\u2019re swapping with.':"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_holiday',apps:q,title:'Ask for holiday',risk:'change',params:[{name:'from',type:'string',required:!0,description:'First day off, YYYY-MM-DD'},{name:'to',type:'string',required:!0,description:'Last day off, YYYY-MM-DD'},{name:'reason',type:'string',required:!1,description:'Reason (default Holiday)'}],keywords:[],description:'Send your own holiday (time off) request to a manager, like the Send request button.',match:e=>v(e,/\b(holiday|time off|day off|days off|annual leave|leave)\b/)&&v(e,/\b(request|book|ask|want|need|like|have|put in|take|off)\b/)&&!v(e,Q)&&!v(e,/\b(who|how many|when is)\b/)?8:0,parse:(e,t)=>{const a=J(e,t?.today??(0,l.ymdOf)((0,$.appNow)())),r=e.match(/\b(?:for|because)\s+(?:a |an |my )?([a-z][a-z ]{2,40}?)\s*$/i);return{...a,reason:r&&!/\b(from|to|monday|tuesday|wednesday|thursday|friday|saturday|sunday|tomorrow|\d)/i.test(r[1])?r[1]:void 0}},preview:(e,t)=>t.whoId?`Ask for ${e.reason??'holiday'} from ${(0,$.niceDay)(String(e.from))}${e.to!==e.from?` to ${(0,$.niceDay)(String(e.to))}`:''}? A manager approves it.`:'Sign in first so I know who\u2019s asking.',run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const a=e=>/^\d{4}-\d{2}-\d{2}$/.test(String(e));return!a(e.from)||!a(e.to)||String(e.to)v(e,Q)&&v(e,/\b(swap|cover|swaps)\b/)?9:0,parse:e=>({who:e,outcome:/\b(decline|reject|refuse|no)\b/i.test(e)?'declined':'approved'}),preview:e=>{const t=X(e.who);if(!t)return'I couldn\u2019t find that open swap or cover request. Say the name on it.';const a=n.useOwner.getState().shifts.find(e=>e.id===t.shiftId),r=N(F(t.fromId)?.name),i=N(F(t.toId)?.name),s='swap'===t.kind?`${r}\u2019s swap with ${i}`:t.toId?`${i} covering ${r}`:`${r}\u2019s cover request`;return'declined'===e.outcome||t.toId?`${'declined'===e.outcome?'Decline':'Approve'} ${s}${a?` for ${G(a)}`:''}?${'declined'===e.outcome?'':' The shift moves and a note goes in the team chat.'}`:`Nobody has taken ${r}\u2019s cover yet, so it can\u2019t be approved. You can decline it.`},run:e=>{const t=X(e.who);if(!t)return'Nothing changed: no open request found.';if('declined'!==e.outcome&&!t.toId)return'Nothing changed: nobody has taken that cover yet.';const a=n.useOwner.getState(),r=a.shifts.find(e=>e.id===t.shiftId);if(a.setSwap(t.id,'declined'===e.outcome?'declined':'approved'),'declined'===e.outcome)return'Done: request declined.';const i=e=>N(F(e)?.name);return x('all','swap'===t.kind?`Shift swap: ${i(t.fromId)} \u2194 ${i(t.toId)} approved`:`Cover approved: ${i(t.toId)} covers ${i(t.fromId)}${r?` (${M[r.day]} ${R(r.start)}\u2013${R(r.end)})`:''}`),'Done: approved and posted in the team chat.'}},{id:'sign_safety_day',apps:O,title:'Sign today\u2019s food safety diary',risk:'change',params:[],keywords:[],description:'Sign today\u2019s food safety diary: the opening and closing checks were done and the safe methods were followed, like the diary Sign button. Today only.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,ae)&&!v(e,/\bweek(ly)?\b/)?9:0,preview:(e,t)=>{const a=(i.useSafety.getState().daySigns??[]).find(e=>e.date===t.today);if(a)return`Today\u2019s diary is already signed by ${a.by}.`;const r=te(t.today,t);return`Sign today\u2019s food safety diary as ${I(t)}: the opening and closing checks were done and the safe methods were followed today? Today: ${r.n} checks, ${r.bad} out of range${r.bad?`, ${r.fixed} with an action`:''}.`},run:(e,t)=>'staff'===t.role?'Nothing changed: only a manager or the head chef signs the diary.':(i.useSafety.getState().daySigns??[]).some(e=>e.date===t.today)?'It\u2019s already signed today.':(i.useSafety.getState().signDay({date:t.today,by:N(I(t)),byId:t.whoId??'',at:(0,$.appNow)().toISOString()}),'Done: today\u2019s diary signed.')},{id:'sign_safety_week',apps:O,title:'Sign off this week\u2019s food safety review',risk:'change',params:[],keywords:[],description:'Weekly food safety review: reads the six statements back; Confirm means yes to all six. If any reading is out of range without an action, it must be done on screen with a note.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,/\bweek(ly)?\b/)&&(v(e,ae)||v(e,/\b(review|safety|checks)\b/))?9:0,preview:(e,t)=>{const{week:a,summary:r}=re(t.today,t),n=(i.useSafety.getState().weekly??[]).find(e=>e.week===a);if(n)return`This week is already signed off by ${n.by}.`;const s=`Week of ${(0,$.niceDay)(a)}: ${r.entries} checks, ${r.outOfRange} out of range, ${r.actions} with an action, diary signed ${r.daysSigned} of 7 days.`;return r.actions`${t+1}. ${e}.`).join(' ')} Sign off the week?`},run:(e,t)=>{if('staff'===t.role)return'Nothing changed: only a manager or the head chef signs off the week.';const{week:a,summary:r}=re(t.today,t);return(i.useSafety.getState().weekly??[]).some(e=>e.week===a)?'This week is already signed off.':r.actions!0),note:'Signed by voice: yes to all.',summary:r}),'Done: week signed off.')}},{id:'record_accident',title:'Record an accident or near miss',risk:'change',params:[{name:'what',type:'string',required:!0,description:'What happened, in the speaker\u2019s words'},{name:'person',type:'string',required:!1,description:'Who was hurt'},{name:'location',type:'string',required:!1,description:'Where'},{name:'injury',type:'string',required:!1,description:'The injury'},{name:'firstAid',type:'string',required:!1,description:'First aid given'}],keywords:[],description:'Add an entry to the accident book (accident or near miss) with what was said; every field is read back first.',match:e=>v(e,/\baccident book\b/)?10:v(e,/\b(accident|injur(y|ed)|near miss|hurt|cut (him|her|them|my)self|burn(ed|t)? (him|her|them|my)self|slipped|tripped|fell over|scalded)\b/)&&v(e,/\b(record|log|report|write|add|book|had|there was|has|have|just)\b/)&&!v(e,/\b(how many|show|read)\b/)?8:0,parse:e=>{const t=ie(e);return{what:t.what,person:t.person,location:t.location,firstAid:t.firstAid}},preview:e=>{const t=ie(String(e.what)),a=String(e.person??t.person),r=String(e.location??t.location);return`Add to the accident book: when, today at ${D()}; who, ${a} (${t.personType}); where, ${r}; type, ${t.category}; what happened, ${_(t.what)}; injury, ${e.injury?String(e.injury):'Near miss'===t.category?'none (near miss)':'not recorded'}; first aid, ${e.firstAid||t.firstAid||'none recorded'}; reported by you. Check it before you confirm; you can add more in the Accident book.`},run:(e,t)=>{const a=ie(String(e.what)),r='Near miss'===a.category,n=(0,$.appNow)();return i.useSafety.getState().addAccident({when:`${(0,l.ymdOf)(n)}T${D()}`,location:String(e.location??a.location),person:String(e.person??a.person),personType:a.personType,category:a.category,what:a.what,injury:String(e.injury??'')||(r?'None (near miss)':'Not recorded'),firstAid:String(e.firstAid||a.firstAid||'')||'None recorded',witnesses:'None',reportedBy:N(I(t)),reportedById:t.whoId??'',app:'staff'===t.app?'staff':'chef'===t.app?'chef':'managers'}),'Done: added to the accident book.'+(/(hospital|fracture|broke|unconscious|ambulance)/i.test(a.what)?' This may need reporting under RIDDOR; check the Accident book.':'')}},{id:'tick_task',apps:['staff','chef','owner'],title:'Tick off one of my tasks',risk:'change',params:[{name:'task',type:'string',required:!0,description:'The task or reminder, as said'}],keywords:[],description:'Tick off one of today\u2019s daily tasks (yours), or mark a venue reminder like \u201cchairs up\u201d as done, like the tick and Done buttons.',match:e=>v(e,/\btick(ed)?( off)?\b|\bmark .* (as )?done\b|\b(i'?ve|i have|we'?ve) (done|finished|completed)\b|\b(task|reminder) (is )?done\b|\bdone the\b/)&&!v(e,/\b(shift|break|order|table|booking|clock)\b/)?7:0,parse:e=>({task:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I tick your tasks.';const{ymd:a,task:r,rem:n}=se(t,e.task);return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?`${_(r.text)} is already ticked today.`:`Tick off today\u2019s task ${_(r.text)}?`:n?`Mark the reminder ${_(n.text)} as done for today?`:'I couldn\u2019t find that in today\u2019s tasks. Say a word from the task.'},run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const{ymd:a,task:r,rem:n}=se(t,e.task),i={id:t.whoId,name:N(I(t))};return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?'Already ticked today.':(s.useDailyTasks.getState().toggleTick(t.rid,t.whoId,r.id,a,i),`Done: ${_(r.text)} ticked.`):n?(c.useReminders.getState().markDone({rid:t.rid,reminderId:n.id,forDate:a,at:(0,$.appNow)().toISOString(),staffRef:t.whoId,staffName:i.name}),`Done: ${_(n.text)} marked done.`):'Nothing changed: I couldn\u2019t find that task.'}},{id:'add_dish',apps:T,title:'Add a dish to the menu',risk:'change',params:[{name:'name',type:'string',required:!0,description:'Dish name'},{name:'section',type:'string',required:!1,description:'Menu section'},{name:'price',type:'string',required:!0,description:'Price in pounds'},{name:'description',type:'string',required:!1,description:'Short description'}],keywords:[],description:'Add a new dish to the menu, like Manage \u203a Add dish. It stays off the menu until the head chef signs off its recipe card.',match:e=>v(e,/\b(add|new|put)\b/)&&v(e,/\b(dish|menu item|to the menu|on the menu|onto the menu)\b/)&&!v(e,/\b(special|specials|sold out|order list)\b/)?8:0,parse:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t?.rid),n=e.toLowerCase(),i=e.match(/\b(?:called|named)\s+(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i)??e.match(/\b(?:add|put)\s+(?:a |an |the )?(?:new )?(?:dish\s+)?(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i),s=r?.sections.find(e=>n.includes(e.toLowerCase())||n.includes(e.toLowerCase().replace(/s$/,''))),o=ce(e);return{name:i?.[1]?.replace(/^(?:a |an )?(?:new )?dish\s*/i,'').trim(),section:s,price:null!=o?String(o):void 0}},preview:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=String(e.section??r?.sections[0]??'Mains');return`Add ${_(String(e.name))} to ${n} at \xa3${Number(e.price).toFixed(2)}${e.description?`, described as ${_(String(e.description))}`:''}? It stays off the menu until the head chef signs off its recipe card.`},run:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=Number(e.price),i=String(e.name??'').trim();return i.length<2||!Number.isFinite(n)||n<=0?'Nothing changed: I need a dish name and a price.':de(t.rid,i)?.name.toLowerCase()===i.toLowerCase()?'That dish is already on the menu.':(a.useStore.getState().addMenuItem({restaurantId:t.rid,section:String(e.section??r?.sections[0]??'Mains'),name:i,description:String(e.description??''),price:n,dietary:[],allergens:{},prepMins:10,soldOut:!1,signOff:null}),`Done: ${i} added. The head chef needs to add its recipe card and sign off the allergens before it shows.`)}},{id:'edit_dish',apps:T,title:'Rename a dish or change its description',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name now'},{name:'field',type:'string',required:!0,description:'name or description',enum:['name','description']},{name:'value',type:'string',required:!0,description:'The new name or description'}],keywords:[],description:'Rename a dish or change its menu description, like Manage \u203a Save dish. Renaming changes its recipe card, so the head chef signs it off again.',match:e=>v(e,/\brename\b|\b(change|update|set|edit)\b.*\b(description|name)\b|\bdescri(be|ption)\b.*\bas\b/)&&!v(e,/\b(price|booking|special|my name)\b/)?8:0,parse:e=>{const t=e.match(/\brename\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i);if(t)return{dish:t[1],field:'name',value:t[2].trim()};const a=e.match(/\bname of\s+(?:the\s+)?(.+?)\s+to\s+(.+)$/i);if(a)return{dish:a[1],field:'name',value:a[2].trim()};const r=e.match(/\bdescription (?:of|for)\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i)??e.match(/\b(?:describe|change|update|set)\s+(?:the\s+)?(.+?)(?:'s|\u2019s)?\s+(?:description\s+)?(?:to|as)\s+(.+)$/i);return r?{dish:r[1],field:'description',value:r[2].trim()}:{dish:e}},preview:(e,t)=>{const a=de(t.rid,e.dish);return a?'name'===e.field?`Rename ${_(a.name)} to ${_(String(e.value))}? Its recipe card changes too, so the head chef signs it off again.`:`Change the description of ${a.name} to ${_(String(e.value))}?`:'I couldn\u2019t find that dish on the menu.'},run:(e,t)=>{const r=de(t.rid,e.dish),n=String(e.value??'').trim();return r?n.length<2?'Nothing changed: say the new wording.':(a.useStore.getState().updateMenuItem(r.id,'name'===e.field?{name:n}:{description:n}),'name'===e.field?`Done: renamed to ${n}.`:`Done: description of ${r.name} changed.`):'Nothing changed: I couldn\u2019t find that dish.'}},{id:'add_recipe_ingredient',apps:['chef'],title:'Add an ingredient to a recipe card',risk:'change',params:[{name:'text',type:'string',required:!0,description:'e.g. add 50 grams of butter to the haggis'}],keywords:[],description:'Add an ingredient line to a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\badd\b/)&&v(e,/\b(ingredient|recipe|card)\b|\badd\s+\d+\s*(g|grams?|kg|ml|tbsp|tsp)\b/)&&!v(e,/\b(step|method|order list|special)\b/)?8:0,parse:e=>({text:e}),preview:(e,t)=>{const a=pe(String(e.text));if(!a)return'Say it like \u201cadd 50 grams of butter to the haggis\u201d.';const r=(0,$.findCard)(t.rid,a.dish);return r?`Add ${[a.qty,a.unit].filter(Boolean).join(' ')} ${a.name} to ${r.dish}\u2019s recipe card?${r.signOff?' It\u2019s signed off now, so it will need signing off again.':''} Check its allergens on the card.`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=pe(String(e.text)),r=a&&(0,$.findCard)(t.rid,a.dish);return a&&r?(await(0,y.recipeCards)().update(r.id,{ingredients:[...r.ingredients,{id:(0,k.uuid)(),name:a.name,qty:a.qty,unit:a.unit}]},{name:N(I(t)),role:'head-chef'}),`Done: ${a.name} added to ${r.dish}.${r.signOff?' It needs signing off again.':''}`):'Nothing changed: I couldn\u2019t find that recipe card.'}},{id:'add_recipe_step',apps:['chef'],title:'Add a method step to a recipe card',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'},{name:'step',type:'string',required:!0,description:'The step wording'}],keywords:[],description:'Add a method step to the end of a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\b(add|new)\b/)&&v(e,/\b(step|method)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:to|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*[:,]\s*(.+)$/i)??e.match(/\bstep\s+(?:to|for)\s+(?:the\s+)?(.+?)\s+(?:saying|that says|reading)\s+(.+)$/i);return t?{dish:t[1],step:t[2].trim()}:{dish:e}},preview:(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0;return a?`Add step ${a.steps.length+1} to ${a.dish}: ${_(String(e.step))}?${a.signOff?' It will need signing off again.':''}`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0,r=String(e.step??'').trim();return!a||r.length<3?'Nothing changed: I need the dish and the step.':(await(0,y.recipeCards)().update(a.id,{steps:[...a.steps,r]},{name:N(I(t)),role:'head-chef'}),`Done: step added to ${a.dish}.`)}},{id:'manager_clock',apps:T,title:'Clock someone in or out (manager correction)',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff first name or id'},{name:'action',type:'string',required:!0,description:'in, out, break_start or break_end',enum:['in','out','break_start','break_end']},{name:'reason',type:'string',required:!0,description:'Why (at least 3 letters)'}],keywords:[],description:'A manager clocks a member of staff in or out, or starts or ends their break, now, with a reason, like the Clock tab\u2019s manager buttons. It is marked as a manager correction.',match:e=>v(e,/\bclock\s+\w+\s+(in|out)\b|\bclock (in|out)\s+[a-z]+\b|\b(start|end)\s+(a |the )?break for\b|\b(end|finish)\s+\w+'?s break\b/)&&!v(e,/\b(me|myself|my|who|is|are|has)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=W(e)[0],r=e.match(/\b(?:reason|because|as)\b[:,]?\s*(.+)$/i),n=/\bbreak\b/.test(t)?/\b(end|finish|back)\b/.test(t)?'break_end':'break_start':/\bout\b/.test(t)?'out':'in';return{staffId:a?.id,action:n,reason:r?.[1]?.trim()}},preview:e=>{const t=E(e.staffId);return t?`${le[e.action??'in'].replace('{n}',N(t.name))} now, at ${D()}? Reason: ${_(String(e.reason))}. It\u2019s marked as a manager correction.`:'Who? Say their first name.'},run:(e,t)=>{const a=E(e.staffId);if(!a)return'Nothing changed: I couldn\u2019t tell who.';const r=e.action??'in',n=(0,g.managerClockAction)(r,{rid:t.rid,staffId:a.id,date:t.today,at:(0,$.appNow)().toISOString()},{id:t.whoId??'manager',name:N(I(t))},String(e.reason??''));return n.ok?`Done: ${N(a.name)} ${{in:'clocked in',out:'clocked out',break_start:'on a break',break_end:'back from break'}[r]} at ${D()}.${n.warn?' '+n.warn:''}`:'Nothing changed: '+n.message}},{id:'tips_pot',apps:T,title:'What\u2019s in the tips pot',risk:'look',params:[],keywords:[],description:'Managers only: the confirmed tips held for the team since the last payout (the Tips pot card).',match:e=>v(e,/\btips? (pot|jar|so far|held|this (period|fortnight|month|week))\b|\bin the tips\b|\bhow much (have we got |is there )?in tips\b|\bwhat are the tips\b|\bhow much (are|is) (the )?tips\b/)&&!v(e,/\b(pay|payout|split|share out)\b/)?8:0,preview:()=>'Tips pot',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const r=h.useCashUp.getState(),n=a.useStore.getState().restaurants.find(e=>e.id===t.rid),i=(0,f.payFor)(t.rid,n?.settings.pay,u.useOnboard.getState().answers).pay,s=(0,p.tipsPot)(r.tips.filter(e=>e.rid===t.rid),r.pot.filter(e=>e.rid===t.rid),(0,l.tipsPeriod)(i,t.today).start,t.today);return`The tips pot holds ${fe(s.total)} from ${(0,$.niceDay)(s.from)} to today, from ${s.days.length} confirmed cash-up${1===s.days.length?'':'s'}.${s.lastPayout?` Last paid out through ${(0,$.niceDay)(s.lastPayout.throughDate)}.`:''}`}},{id:'cash_up_summary',apps:T,title:'Read the latest cash-up',risk:'look',params:[{name:'day',type:'string',required:!1,description:'Day (else the latest)'}],keywords:[],description:'Managers only: the latest (or a named day\u2019s) cash-up: gross takings, tips and who confirmed it.',match:e=>v(e,/\bcash.?up\b|\btakings\b|\bhow much did we take\b/)&&!v(e,/\b(add|enter|start|do the|unlock|edit)\b/)?8:0,parse:(e,t)=>({day:j(e.replace(/\btonight\b/i,'today'),t?.today??(0,l.ymdOf)((0,$.appNow)()))??(/\b(last night|yesterday)\b/i.test(e)?'yesterday':void 0)}),preview:()=>'Cash-up read-out',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const a=new Date(t.today+'T12:00:00');a.setDate(a.getDate()-1);const r='yesterday'===e.day?(0,l.ymdOf)(a):e.day,n=h.useCashUp.getState().cashUps.filter(e=>e.rid===t.rid&&(!r||e.date===r)).sort((e,t)=>t.date.localeCompare(e.date)),i=n[0];return i?`Cash-up for ${(0,$.niceDay)(i.date)}: gross takings ${fe((0,p.grossOf)(i.vals))}, tips ${fe((0,p.combinedTips)(i.vals))} (cash and card). ${i.confirmedAt?`Confirmed${i.confirmedBy?` by ${i.confirmedBy}`:''}.`:'Not confirmed yet.'}`:r?`There\u2019s no cash-up for ${(0,$.niceDay)(r)}.`:'There\u2019s no cash-up yet.'}},{id:'table_note',apps:C,title:'Add a note to a table',risk:'change',params:[{name:'table',type:'string',required:!0,description:'Table'},{name:'note',type:'string',required:!0,description:'The note (say \u201cclear\u201d to remove it)'}],keywords:[],description:'Put a short note on a table on the floor plan (e.g. \u201chigh chair\u201d, \u201cbirthday\u201d), like the table sheet\u2019s Note.',match:e=>v(e,/\btables?\s+\w+/)&&v(e,/\bnote\b/)&&!v(e,/\bshift note\b/)?9:0,parse:e=>{const t=e.match(/\bnote\b(?:\s+(?:on|for|to)\s+tables?\s+\w+)?\s*(?:[:,-]|saying|that says|that|says|reading)?\s*(.+)$/i),a=/\b(clear|remove|delete) (the )?note\b/i.test(e);return{table:(0,$.tableIn)(e),note:a?'clear':t?.[1]?.replace(/^(?:on|for|to)?\s*tables?\s+\w+\s*[:,-]?\s*/i,'').trim()}},preview:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);return a?'clear'===e.note?`Clear the note on table ${a}?`:`Note on table ${a}: ${_(String(e.note))}?`:'Which table?'},run:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);if(!a)return'Nothing changed: I couldn\u2019t find that table.';const n='clear'===e.note?'':String(e.note??'').trim().slice(0,80);return(0,r.tablesOf)(a).forEach(e=>r.useFloor.getState().setLive(t.rid,e,{note:n||void 0})),n?`Done: note on table ${a}.`:`Done: note cleared on table ${a}.`}},{id:'log_lost_property',apps:T,title:'Log lost property',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What was found'},{name:'where',type:'string',required:!1,description:'Where it was found'}],keywords:[],description:'Add an item to the lost property log (held), like Extras \u203a Lost property \u203a Add.',match:e=>v(e,/\blost property\b|\b(found|someone left|left behind|handed in)\b\s+(a|an|some|their|his|her)\b|\b(a|an)\s+\w+(\s+\w+)?\s+(was )?(left behind|handed in)\b/)&&!v(e,/\b(how many|what'?s in|list|read|returned)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:found|left(?: behind)?|handed in|log|add)\s+(?:a |an |some |their |his |her )?(.+?)(?=\s+(?:at|on|in|under|by|near|from)\s|[,.]|$)/i)??e.match(/\b(?:a|an)\s+(.+?)\s+(?:was )?(?:left behind|handed in)/i),a=e.match(/\s(?:at|on|in|under|by|near)\s+(?:the\s+)?(table\s+\w+|bar|toilets?|coat ?rack|cloakroom|door|entrance|terrace|garden|car park|dining room|booth\s+\w+|[a-z]+ table)\b/i);return{item:t?.[1]?.replace(/^(?:lost property|to lost property)\s*:?\s*/i,'').trim(),where:a?.[1]}},preview:e=>`Log lost property: ${_(String(e.item))}, found ${e.where?`at ${e.where}`:'(place not noted)'}, today at ${D()}? It\u2019s marked as held.`,run:(e,t)=>{const a=String(e.item??'').trim();if(a.length<2)return'Nothing changed: say what was found.';const r=(0,$.appNow)();return n.useOwner.getState().addLost({item:a,where:String(e.where??'').trim()||'Not noted',foundAt:`${(0,l.ymdOf)(r)} ${D()}`,foundBy:N(I(t))}),`Done: ${a} logged as held.`}},{id:'add_reminder',apps:T,title:'Add a venue reminder for staff',risk:'change',params:[{name:'text',type:'string',required:!0,description:'What it says'},{name:'time',type:'string',required:!0,description:'HH:MM, UK time'},{name:'days',type:'string',required:!1,description:'Days (default every day)'},{name:'audience',type:'string',required:!1,description:'all, foh or kitchen',enum:['all','foh','kitchen']}],keywords:[],description:'Add a venue reminder shown to staff on shift at a time on chosen days, like Settings \u203a Advanced \u203a Reminders \u203a Add.',match:e=>v(e,/\b(remind|reminder)\b/)&&v(e,/\b(add|set|new|create|every|daily|weekdays?|weekends?|at \d)\b/)&&!v(e,/\b(me|my)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=/\b(kitchen|chefs?)\b/.test(t)?'kitchen':/\b(front of house|foh|floor|waiters?|servers?)\b/.test(t)?'foh':'all',r=e.match(/\bremind(?:er)?\s+(?:for\s+)?(?:everyone|all staff|staff|the team|the kitchen|kitchen|front of house|foh|the floor|chefs?)?\s*(?:to|that|:)\s+(.+?)(?=\s+(?:at\s+\d|every\b|on\s+(?:mon|tue|wed|thu|fri|sat|sun)|daily|weekdays?|weekends?)|$)/i)??e.match(/\breminder\s*(?:saying|that says|:)\s*(.+?)(?=\s+(?:at\s+\d|every\b|daily)|$)/i),n=e.match(/\bat\s+(\d{1,2}(?:[:.]\d{2})?\s*(?:am|pm)?)/i);return{text:r?.[1]?.trim(),time:n?(0,$.hm)(n[1])??void 0:void 0,days:ge(t).join(','),audience:a}},preview:e=>{const t=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number),a=String(e.text??''),r=a.charAt(0).toUpperCase()+a.slice(1);return`Add a reminder for ${ye[e.audience??'all']}: ${_(r)}, ${7===t.length?'every day':'every '+t.map(e=>me[e].replace(/^\w/,e=>e.toUpperCase())).join(', ')} at ${e.time} (UK time)?`},run:(e,t)=>{const a=String(e.text??'').trim(),r=String(e.time??'');if(a.length<2||!/^\d{2}:\d{2}$/.test(r))return'Nothing changed: I need the wording and a time like 21:00.';const n=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number).filter(e=>e>=0&&e<=6).sort();return c.useReminders.getState().ensure(t.rid),c.useReminders.getState().add(t.rid,{text:a.charAt(0).toUpperCase()+a.slice(1),days:n,time:r,audience:e.audience??'all'}),'Done: reminder added.'}}]},1429,[804,848,800,1014,865,1019,1029,1030,1002,1001,1024,13,1049,1050,1051,1020,1071,856,1079,1011,839,1430,1428]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.dishesFor=R,_e.findDish=E,_e.allergensSaid=M,_e.timeFrom=Y,_e.coversFrom=G,_e.dateFrom=Z,_e.nameFrom=$,Object.defineProperty(_e,"VOICE_ACTIONS",{enumerable:!0,get:function(){return X}});var e=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),s=_r(_d[7]),d=_r(_d[8]),l=_r(_d[9]),c=_r(_d[10]),p=_r(_d[11]),u=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]),f=_r(_d[15]),g=_r(_d[16]),b=_r(_d[17]),y=_r(_d[18]);const w=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},v=e=>String(e).padStart(2,'0'),k=e=>e.getFullYear()+'-'+v(e.getMonth()+1)+'-'+v(e.getDate()),S=e=>{const[t,r,a]=e.split('-').map(Number);return new Date(t,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},N=(e,t)=>t.test(e),I=(e,t)=>e+' '+t+(1===e?'':'s'),A={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},T=e=>null==e?void 0:A[e.toLowerCase()]??(Number.isFinite(Number(e))?Number(e):void 0),x=e=>e.who??('display'===e.app?'Main Display':'Assistant'),D={owner:'Managers',staff:'Staff',chef:'Head Chef',display:'Main Display'},C=e=>D[e.app??'owner'],O=new Set(['the','and','with','our','for']),L=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').split(/\s+/).filter(e=>e.length>2&&!O.has(e));function R(e){const t=i.useStore.getState(),r=(0,c.resolveMenu)(t.menu.filter(t=>t.restaurantId===e&&!t.hidden)).map(e=>({kind:'menu',id:e.id,name:e.name,allergens:e.allergens,soldOut:e.soldOut,price:e.price,signedOff:!!e.signOff})),a=l.useSpecials.getState().current[e];return[...r,...(a?.items??[]).map(e=>({kind:'special',id:e.id,name:e.name,allergens:e.allergens,price:e.price,signedOff:!!a?.allergenCheck}))]}const _=e=>e.replace(/s$/,'');function E(e,t){const r=new Set(L(e).map(_)),a=e.toLowerCase();let n;for(const e of R(t)){const t=L(e.name);if(!t.length)continue;const o=t.filter(e=>r.has(_(e))).length;if(!o)continue;const i=o/t.length+.25*o+(a.includes(e.name.toLowerCase())?2:0);(o>=Math.min(2,t.length)||t.length<=3)&&(!n||i>n.s)&&(n={d:e,s:i})}return n?.d}const F=[[/\b(gluten|wheat|coeliac|celiac|barley|rye)\b/,['gluten']],[/\bpeanuts?\b/,['peanuts']],[/\b(tree ?nuts?|almonds?|walnuts?|hazelnuts?|cashews?|pecans?|pistachios?)\b/,['treenuts']],[/\bnuts?\b/,['peanuts','treenuts']],[/\b(dairy|milk|lactose|cheese|cream|butter)\b/,['milk']],[/\beggs?\b/,['eggs']],[/\b(shellfish|crustaceans?|prawns?|crab|langoustines?)\b/,['crustaceans']],[/\b(molluscs?|mussels?|oysters?|squid|scallops?|clams?)\b/,['molluscs']],[/\bfish\b/,['fish']],[/\b(soya|soy)\b/,['soya']],[/\bcelery\b/,['celery']],[/\bmustard\b/,['mustard']],[/\bsesame\b/,['sesame']],[/\b(sulphites?|sulfites?|sulphur)\b/,['sulphites']],[/\blupin\b/,['lupin']]];function M(e){const t=new Set;for(const[r,a]of F)r.test(e)&&a.forEach(e=>t.add(e));return[...t]}const q=e=>p.ALLERGENS.find(t=>t.id===e)?.short??e,z='Always check the signed-off recipe card and tell the kitchen about any allergy.';function B(t,r){if('chef'===r?.app&&(0,e.isAnchorage)(r.rid)&&(0,e.isBarFridge)(t))return[];const a=d.useSafety.getState().points.filter(t=>'chef'!==r?.app||(0,e.chefCanSee)(r.rid,t)),n=/\b(done|complete|completed|finished|ok|okay|checked)\b/i.test(t);return(0,f.parseQuick)(t,a).filter(e=>e.point).map(e=>{const t=(0,f.isTempKind)(e.point.kind);return{pointId:e.point.id,value:t?e.value:null,done:t?void 0:n}})}const j=e=>{try{return JSON.parse(String(e.readings??'[]'))}catch{return[]}};function H(e){const t=d.useSafety.getState().points.find(t=>t.id===e.pointId);return t?(0,f.isTempKind)(t.kind)?null==e.value?t.name+': no temperature heard':t.name+': '+e.value+'\xb0C '+((0,f.inRange)(t,e.value)?'(safe)':'OUT OF RANGE (safe: '+(0,f.limitText)(t)+')'):t.name+': '+(e.done?'done':'NOT done'):'?'}function Y(e){const t=e.match(/\b(?:at|around|about)\s+(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})[:.](\d{2})\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})()\s*(am|pm)\b/);if(!t){const t=e.match(new RegExp("\\bhalf (?:past )?(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b"));if(!t)return;let r=T(t[1])??0;return r>=1&&r<=10&&(r+=12),v(r)+':30'}let r=Number(t[1]);const a=Number(t[2]||0),n=t[3];return'pm'===n&&r<12&&(r+=12),'am'===n&&12===r&&(r=0),!n&&r>=1&&r<=10&&(r+=12),r>23||a>59?void 0:v(r)+':'+v(a)}function G(e){const r=e.match(new RegExp("\\b(?:table for|party of|for|of)\\s+(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))"))??e.match(new RegExp("\\b(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\s*(?:covers|people|guests|adults|of us)\\b")),a=T(r?.[1]);return a&&(0,t.validParty)(a)?a:void 0}const P=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function Z(e,t){const r=new Date(t+'T12:00:00');if(/\btomorrow\b/.test(e))return r.setDate(r.getDate()+1),k(r);const a=P.findIndex(t=>e.includes(t));if(a>=0){const t=(r.getDay()+6)%7;return r.setDate(r.getDate()+((a-t+7)%7||(/\bnext\b/.test(e)?7:0))),k(r)}return t}function U(e,t,r,a){const n=i.useStore.getState(),o=n.restaurants.find(t=>t.id===e),d=s.useFloor.getState().plans[e]??(0,s.seedPlan)(e),l=o?.settings.turnMins??90,c=n.bookings.filter(r=>r.restaurantId===e&&r.date===t);return(0,u.freeTablesAt)(d,c,a,new Date(t+'T'+r+':00'),(0,u.turnFor)(a,l),l)}const K=(e,t)=>{const[r,a]=e.split(':').map(Number),n=60*r+a+t;return v(Math.floor(n/60))+':'+v(n%60)},W=e=>e.replace(/^\w/,e=>e.toUpperCase());function $(e){const t=e.match(/\b(?:under|name of|named|called)\s+([A-Za-z][A-Za-z'\u2019-]+(?:\s+[A-Z][A-Za-z'\u2019-]+)?)/i)??e.match(/\bname(?:'s| is)?\s+([A-Za-z][A-Za-z'\u2019-]+)/i);return t?W(t[1]):void 0}const J=e=>!/\b(how do i|how do you|where do i|how to)\b/.test(e),V=e=>!['collected','served','closed','cancelled'].includes(e.status),Q=e=>e.toUpperCase().replace(/[\s-]/g,''),X=[{id:'next_table_free',title:'When is the next table free?',risk:'look',description:'Estimate when the next table frees up, and how long a walk-in for 2 or 4 would wait.',params:[],keywords:['next table','table free'],match:e=>N(e,/\b(next|soonest|first)\b.*\btables?\b.*\b(free|ready|available|clear)\b|\bhow long\b.*\b(wait|walk)|\bwait(ing)? (time|for a table)\b|\bwhen\b.*\btable\b.*\b(free|ready)\b/)?4:0,preview:()=>'Next table free',run:(e,t)=>{const r=i.useStore.getState(),a=w(),n=k(a),o=r.restaurants.find(e=>e.id===t.rid);if(!o)return'I can\u2019t see this venue\u2019s tables yet.';const d=s.useFloor.getState(),l=d.plans[t.rid]??(0,s.seedPlan)(t.rid),c=r.bookings.filter(e=>e.restaurantId===t.rid),p=(0,m.closedAreasAt)(m.useBlocks.getState().blocks,t.rid,n,v(a.getHours())+':'+v(a.getMinutes())),f=(0,u.floorView)(l,c,r.orders.filter(e=>e.restaurantId===t.rid),d.live[t.rid]??{},a,o.settings.turnMins,p);return(0,h.nextFreeSentence)((0,h.nextTablesFree)(o,f,c.filter(e=>e.date===n),a,c),a)+' It\u2019s an estimate.'}},{id:'log_check',title:'Log a temperature or kitchen check',risk:'change',description:'Record fridge, freezer, cooking, cooling, hot-hold or delivery temperatures, or a cleaning or kitchen check, in the food safety log. Out-of-range readings are flagged.',params:[{name:'readings',type:'string',required:!0,description:'JSON list of {pointId, value in \xb0C or null, done for non-temperature checks}'}],keywords:['fridge','freezer','temperature','probe'],match:e=>J(e)&&N(e,/\b(fridges?|freezers?|walk.?in|cold room|temps?|temperatures?|degrees|probe|core temp|hot hold|cooling|cleaning|clean down|deep clean)\b/)&&(!N(e,/\b(seat|seated|party|covers?|people|guests?|table \w+|walk.?ins? (of|for)|just arrived)\b/)||N(e,/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus)\b/))?3:0,parse:(e,t)=>({readings:JSON.stringify(B(e,t))}),preview:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));return n.length?'Log in the food safety log: '+n.map(H).join('; ')+'?':'I didn\u2019t catch which fridge, freezer or check. Try \u201cwalk-in fridge 3 degrees\u201d.'},run:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));if(!n.length)return'Nothing logged: I didn\u2019t catch which unit or check.';if(n.some(e=>{const t=a.find(t=>t.id===e.pointId);return!!t&&(0,f.isTempKind)(t.kind)&&null==e.value}))return'Nothing logged: a temperature was missing. Say the number, for example \u201cfreezer minus 19\u201d.';const o=w().toISOString(),i='chef'===r.app?'chef':'owner'===r.app?'managers':'staff',s=n.filter(e=>a.some(t=>t.id===e.pointId)).map(e=>{const t=a.find(t=>t.id===e.pointId),n=(0,f.isTempKind)(t.kind),s=n?(0,f.inRange)(t,e.value):!!e.done,d=['display'===r.app?'Logged on the Main Display.':'',s?'':'Out of range: add the corrective action.'].filter(Boolean).join(' ');return{pointId:t.id,name:t.name,kind:t.kind,at:o,by:x(r),byId:r.whoId??'voice-'+(r.app??'owner'),app:i,value:n?e.value:void 0,done:n?void 0:!!e.done,ok:s,source:'voice',note:d||void 0}});d.useSafety.getState().addEntries(s);const l=s.filter(e=>!e.ok);return l.length?'Logged. '+l.map(e=>e.name+' is OUT OF RANGE').join(', ')+'. Check it now and add what you did in the food safety log.':'Logged: '+s.map(e=>e.name+' '+(null!=e.value?e.value+'\xb0C':'done')).join(', ')+'. All fine.'}},{id:'allergen_info',title:'Allergen question',risk:'look',description:'Answer allergen questions from the recipe cards and the menu: what a dish contains or may contain, or which dishes are free of an allergen.',params:[{name:'dish',type:'string',description:'Dish name'},{name:'allergens',type:'string',description:'Comma-separated allergen ids'}],keywords:['allergen','allergy','contain'],match:e=>!N(e,/(allergens?|allerg(y|ic|ies)|contains?|coeliac|celiac|safe for|free from|.free\b|intoleran)/)||N(e,/\b(sold out|price|draft)\b/)||N(e,/\btables?\b.*\bfree\b|\bfree\b.*\btables?\b/)?0:3,parse:(e,t)=>{const r=E(e,t.rid);let a=e.toLowerCase();if(r)for(const e of L(r.name))a=a.replace(new RegExp('\\b'+e+'\\b','g'),' ');return{dish:r?.name,allergens:M(a).join(',')}},preview:e=>'Allergens'+(e.dish?' in '+e.dish:''),run:(e,t)=>{const r=R(t.rid),a=e.dish?r.find(t=>t.name===e.dish):void 0,n=String(e.allergens??'').split(',').filter(Boolean);if(a){const e=p.ALLERGENS.filter(e=>'contains'===a.allergens[e.id]).map(e=>e.short),t=p.ALLERGENS.filter(e=>'may'===a.allergens[e.id]).map(e=>e.short);return(n.length?n.map(e=>'contains'===a.allergens[e]?a.name+' CONTAINS '+q(e)+'.':'may'===a.allergens[e]?a.name+' MAY CONTAIN '+q(e)+'.':'No '+q(e)+' is listed for '+a.name+'.').join(' '):a.name+' contains '+(e.length?e.join(', '):'none of the 14 allergens')+(t.length?', and may contain '+t.join(', '):'')+'.')+(a.signedOff?'':' Its allergens are NOT signed off yet.')+' '+z}if(n.length){const e=r.filter(e=>!e.soldOut&&n.every(t=>!e.allergens[t])),t=r.filter(e=>n.some(t=>'contains'===e.allergens[t]));return e.length+(1===e.length?' dish has':' dishes have')+' no '+n.map(q).join(' or ')+' listed'+(e.length?', for example '+e.slice(0,5).map(e=>e.name).join(', '):'')+'. '+t.length+' contain it. '+z}return'Which dish, or which allergen? For example \u201cdoes the fish supper contain gluten?\u201d.'}},{id:'set_sold_out',title:'Mark a dish sold out or back on',risk:'change',description:'Mark a menu dish sold out or back on. A reminder for staff: it shows on the Display and in the Sold out list.',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'soldOut',type:'string',required:!0,description:'yes = sold out, no = back on',enum:['yes','no']}],keywords:['sold out','back on','86'],match:e=>N(e,/\b(sold out|run out|ran out|out of stock|86|eighty.?six|back on|available again|back in stock|un.?86|none left)\b/)?4:0,parse:(e,t)=>{const r=E(e,t.rid),a=/\b(back on|available again|back in stock|un.?86)\b/i.test(e);return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,soldOut:a?'no':'yes'}},preview:e=>e.itemId?'Mark '+e.name+' '+('no'===e.soldOut?'back on':'sold out')+'?':e.name?e.name+' is on the Specials board; change it there.':'I couldn\u2019t find that dish on the menu.',run:async e=>e.itemId?(await o.repo.menu.updateItem(String(e.itemId),{soldOut:'no'!==e.soldOut}),'Done: '+e.name+' is '+('no'===e.soldOut?'back on':'sold out')+'.'):'Nothing changed: I couldn\u2019t find that dish on the menu.'},{id:'change_price',apps:['owner'],title:'Change a menu price',risk:'change',description:'Change the price of a menu dish (managers only).',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'pence',type:'integer',required:!0,description:'New price in pence'}],keywords:['price'],match:e=>N(e,/\b(price|charge|cost)\b/)&&N(e,/(\xa3|\d|pound)/)&&!N(e,/\b(special|offer)\b/)?3:0,parse:(e,t)=>{const r=E(e,t.rid),a=e.match(/\b(?:to|at)\s*\xa3?\s*(\d{1,3})(?:[.:](\d{1,2}))?/i)??e.match(/\xa3\s*(\d{1,3})(?:\.(\d{1,2}))?/)??e.match(/(\d{1,3})\s*pounds?(?:\s*(\d{1,2}))?/i),n=a?100*Number(a[1])+Number((a[2]??'0').padEnd(2,'0')):void 0;return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,pence:n,old:r?.price??void 0}},preview:e=>e.itemId?'Change '+e.name+' from '+(null!=e.old?(0,g.gbp)(Number(e.old)):'its current price')+' to '+(null!=e.pence?(0,g.gbp)(Number(e.pence)):'?')+'?':'I couldn\u2019t find that dish on the menu.',run:async(e,t)=>{if(t.role&&!['owner','manager'].includes(t.role))return'Only managers can change prices.';const r=Number(e.pence);return e.itemId&&r>0&&r<1e5?(await o.repo.menu.updateItem(String(e.itemId),{price:r}),'Done: '+e.name+' is now '+(0,g.gbp)(r)+'.'):'Nothing changed: I need the dish and a price.'}},{id:'draft_special',apps:['owner','chef'],title:'Draft a special',risk:'draft',description:'Save a special as a draft for the owner to approve. It goes on the Specials board only after its allergens are checked.',params:[{name:'text',type:'string',required:!0,description:'The special, e.g. \u201cHake with mussels, \xa318\u201d'}],keywords:['special'],match:e=>N(e,/\bspecials?\b/)&&N(e,/\b(add|new|put|draft|today'?s|tonight'?s|change|set)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\bspecials?\b(?:\s*(?:board|is|are|to|:))?\s*/i,'').trim()||e}),preview:e=>'Save a draft special: \u201c'+e.text+'\u201d. Its allergens get checked before it goes on the board.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'special',title:'New special',lines:[String(e.text),'Add its allergens and post it on the Specials board when approved.'],by:x(t),app:C(t)}),'Saved as a draft special for the owner to approve. It isn\u2019t on the board yet.')},{id:'check_availability',title:'Check table availability',risk:'look',description:'Check whether a table is free for a party at a date and time, and suggest nearby times if not.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'}],keywords:['availability','table for','free table'],match:e=>N(e,/\b(availability|available|space|room for|any room|got room|any tables?|got a table|free table|have we got|is there a table|can we fit|fit in)\b/)&&!N(e,/\b(sold|back on|allerg)/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r)}},preview:e=>'Check a table for '+(e.covers??'?')+' at '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'today'),run:(e,t)=>{const r=Number(e.covers),a=String(e.time),n=String(e.date??t.today),o=U(t.rid,n,a,r);if(o.length)return'Yes, there\u2019s room for '+r+' at '+a+' on '+S(n)+'. Best fit: table '+o[0].table+(o[0].area?' ('+o[0].area+')':'')+'.';const i=[];for(const e of[-30,30,-60,60,-90,90]){const o=K(a,e);if(U(t.rid,n,o,r).length&&i.push(o),i.length>=3)break}return'No table for '+r+' at '+a+' on '+S(n)+'.'+(i.length?' Free nearby: '+i.sort().join(', ')+'.':' Nothing free within 90 minutes either.')}},{id:'draft_booking',title:'Take a booking (draft)',risk:'draft',description:'Take a booking as a DRAFT for the owner to confirm in Bookings. The guest confirmation is only sent from there.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'},{name:'name',type:'string',description:'Guest name'}],keywords:['book','booking','reserve'],match:e=>N(e,/\b(book|booking|reserve|reservation)\b/)&&!N(e,/\b(availability|any tables?|have we got|is there|how many|move|cancel|booker)\b/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r),name:$(e)}},preview:(e,t)=>{const r=e.covers&&e.time?U(t.rid,String(e.date??t.today),String(e.time),Number(e.covers)):[],a=e.covers&&e.time?r.length?' Table '+r[0].table+' is free.':' NO table is free then.':'';return'Draft booking: '+(e.name??'guest')+', '+(e.covers??'?')+' covers, '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'?')+'.'+a+' The owner confirms it in Bookings; nothing is sent to the guest now.'},run:(e,r)=>(0,t.validParty)(Number(e.covers))?(b.useDrafts.getState().add({rid:r.rid,kind:'booking',title:'Booking: '+(e.name??'guest')+', '+e.covers+' covers',lines:[S(String(e.date))+' at '+e.time,'Take their phone number when you confirm it in Bookings.'],data:{covers:e.covers,date:e.date,time:e.time,name:e.name},by:x(r),app:C(r)}),'Saved as a draft booking for the owner to confirm. No confirmation has been sent.'):`Nothing saved. ${t.PARTY_RULE} How many people?`},{id:'add_waitlist',title:'Add to the waitlist',risk:'change',description:'Add a party to the waitlist. Nobody is messaged.',params:[{name:'name',type:'string',description:'Name'},{name:'covers',type:'integer',required:!0,description:'Party size'}],keywords:['waitlist','waiting list'],match:e=>N(e,/\b(wait ?list|waiting list|queue)\b/)?4:0,parse:e=>({name:$(e)??e.match(/\badd\s+([A-Z][a-z'\u2019-]+)\b/)?.[1],covers:G(e.toLowerCase())}),preview:e=>'Add '+(e.name??'a guest')+', '+(e.covers??'?')+' covers, to the waitlist?',run:async(e,r)=>{const a=Number(e.covers);if(!(0,t.validParty)(a))return`Nothing added: how many people? ${t.PARTY_RULE}`;return'Done: '+(await o.repo.waitlist.join(r.rid,String(e.name??'Guest'),a)).name+' is on the waitlist. Nobody has been messaged.'}},{id:'read_orders',title:'Read out orders',risk:'look',description:'Read out the live orders and takeaways.',params:[],keywords:['orders'],match:e=>N(e,/\b(orders?|takeaways?|tickets?|collections?)\b/)&&N(e,/\b(read|what|any|list|how many|open|live|waiting|outstanding|pending|due|next)\b/)&&!N(e,/\b(shopping|booker|bidfood|supplier)\b/)?3:0,preview:()=>'Read out the live orders',run:(e,t)=>{const a=i.useStore.getState().orders.filter(e=>e.restaurantId===t.rid&&V(e)).sort((e,t)=>(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt));if(!a.length)return'No live orders right now.';const n=a.filter(e=>'takeaway'===e.type).length;return I(a.length,'live order')+' ('+n+' takeaway). '+a.slice(0,6).map(e=>{return('takeaway'===e.type?'Takeaway ':(0,r.tableNumbers)(e.tableNo)+' ')+e.ref+' for '+e.customerName+', '+I(e.lines.reduce((e,t)=>e+t.qty,0),'item')+', '+e.status+(e.slotTime?', due '+(t=e.slotTime,new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})):'')+(e.allergies.length?', HAS ALLERGIES':'');var t}).join('. ')+(a.length>6?'. And '+(a.length-6)+' more.':'.')}},{id:'day_numbers',title:'Covers, sales and forecast',risk:'look',description:'How many covers are booked today and tomorrow, sales through CoverCharge so far today, and the forecast for the rest of today.',params:[],keywords:['covers','sales','forecast'],match:e=>N(e,/\b(covers|sales|takings|revenue|forecast|how busy|busy tonight|expected|how many (people|guests|bookings))\b/)&&!N(e,/\b(walk|seat|wait ?list|add|book (a|for|in))\b/)?3:0,preview:()=>'Today\u2019s covers, sales and forecast',run:(e,t)=>{const r=i.useStore.getState(),n=w(),o=k(n),s=r.restaurants.find(e=>e.id===t.rid),d=r.bookings.filter(e=>e.restaurantId===t.rid),l=d.filter(e=>e.date===o&&['confirmed','seated','finished'].includes(e.status)),c=l.reduce((e,t)=>e+t.partySize,0),p=l.filter(e=>e.walkIn).reduce((e,t)=>e+t.partySize,0),u=new Date(n);u.setDate(u.getDate()+1);const h=k(u),m=d.filter(e=>e.date===h&&['confirmed','pending'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),f=r.orders.filter(e=>e.restaurantId===t.rid),b=f.filter(e=>e.createdAt.slice(0,10)===o&&'cancelled'!==e.status),y=b.reduce((e,t)=>e+t.subtotal,0);let v='';if(s){const e=(0,a.forecastToday)(s,d,f,r.events,n);v=e.open?e.enough?' Forecast for the rest of today: about '+e.restOfDay.covers+' covers ('+(0,a.coversRange)(e.restOfDay.low,e.restOfDay.high,!1)+')'+(e.example?', example figures.':'.'):' No forecast yet: not enough history ('+e.restOfDay.booked+' covers booked for the rest of today).':''}return'Today: '+c+' covers booked or seated'+(p?', including '+p+' walk-in':'')+'. '+I(b.length,'order')+' through CoverCharge so far'+('display'===t.app||'staff'===t.app||'staff'===t.role?'.':', '+(0,g.gbp)(y)+' before tips (till sales aren\u2019t included).')+v+' Tomorrow: '+m+' covers booked so far.'}},{id:'supplier_list',title:'Add to a Booker or Bidfood shopping list',risk:'draft',description:'Add items to a DRAFT shopping list for Booker or Bidfood for the owner to check and order on the supplier\u2019s site. Never places an order.',params:[{name:'supplier',type:'string',required:!0,description:'Supplier',enum:['booker','bidfood']},{name:'items',type:'string',required:!0,description:'Items separated by semicolons'}],keywords:['booker','bidfood','shopping list'],match:e=>N(e,/\b(booker|bidfood|bid food)\b/)?4:N(e,/\b(shopping list|order list|we need more|we'?re low on|running low)\b/)?3:0,parse:e=>({supplier:/\bbid ?food\b/i.test(e)?'bidfood':'booker',items:e.replace(/\b(to|on|onto)\s+(the\s+)?(booker|bidfood|bid food)?\s*(shopping\s+|order\s+)?list\b.*$/i,'').replace(/\b(from|at)\s+(booker|bidfood|bid food)\b/i,'').replace(/[,.]?\s*\b(put|add|stick)\s+(it|them|that|those)\b.*$/i,'').replace(/^.*?\b(add|need|order|get|put|low on)\b\s*/i,'').trim().split(/\s*(?:,|\band\b)\s*/i).map(e=>e.trim()).filter(Boolean).join('; ')}),preview:e=>'Add to the draft '+('bidfood'===e.supplier?'Bidfood':'Booker')+' list: '+String(e.items??'').split('; ').join(', ')+'. Nothing is ordered; the owner checks it and orders on the supplier\u2019s site.',run:(e,t)=>{const r=String(e.items??'').split('; ').filter(Boolean);if(!r.length)return'Nothing added: which items?';const a=b.useDrafts.getState().addToList(t.rid,'bidfood'===e.supplier?'bidfood':'booker',r,x(t),C(t));return'Added to the draft '+a.title+' ('+I(a.lines.length,'item')+'). Nothing has been ordered.'}},{id:'draft_offer',title:'Draft an offer',risk:'draft',description:'Save an offer or promotion as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The offer'}],keywords:['offer','promotion'],match:e=>N(e,/\b(offer|promotion|promo|deal|discount|happy hour|two for one|2 for 1)\b/)&&N(e,/\b(draft|create|make|set up|new|add|run|do)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\b(?:offer|promotion|promo|deal)\b\s*(?:for|of|:)?\s*/i,'').trim()||e}),preview:e=>'Save a draft offer for the owner to approve: \u201c'+e.text+'\u201d. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'offer',title:'New offer',lines:[String(e.text)],by:x(t),app:C(t)}),'Saved as a draft offer for the owner to approve. Nothing was published or sent.')},{id:'draft_event',title:'Draft an event',risk:'draft',description:'Save an event (quiz, live music, tasting night) as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The event'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['event'],match:e=>N(e,/\b(event|quiz|live music|tasting|gig|party night|music night|open mic|ceilidh)\b/)&&N(e,/\b(draft|create|make|plan|set up|new|add|put on|run)\b/)?3:0,parse:(e,t)=>({text:e.replace(/^.*?\b(?:draft|create|make|plan|set up|add|put on|run)\b\s*(?:an?|the)?\s*(?:new\s+)?(?:event)?\s*(?:for|:)?\s*/i,'').trim()||e,date:/\b(tomorrow|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i.test(e)?Z(e.toLowerCase(),t.today):void 0}),preview:e=>'Save a draft event for the owner to approve: \u201c'+e.text+'\u201d'+(e.date?' on '+S(String(e.date)):'')+'. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'event',title:'New event',lines:[String(e.text),...e.date?[S(String(e.date))]:[]],data:{date:e.date},by:x(t),app:C(t)}),'Saved as a draft event for the owner to approve. Nothing was published or sent.')},{id:'card_balance',apps:['owner','chef'],title:'Gift card or stamp card balance',risk:'look',description:'Look up a gift card balance by its code, or a summary of stamp cards.',params:[{name:'code',type:'string',description:'Gift card code'},{name:'kind',type:'string',description:'gift or stamp',enum:['gift','stamp']}],keywords:['gift card','voucher','stamp card'],match:e=>N(e,/\b(gift ?cards?|gift vouchers?|vouchers?|stamp ?cards?|stamps|loyalty)\b/)?3:0,parse:e=>{const t=e.toUpperCase().replace(/\b(GIFT|CARDS?|VOUCHERS?|BALANCE|CHECK|WHAT'?S|WHAT|THE|ON|IS|CODE|FOR|OF|HOW|MUCH|LEFT|STAMPS?|A)\b/g,' ').match(/[A-Z0-9][A-Z0-9 -]{3,}[A-Z0-9]/);return{kind:/stamp|loyalty/i.test(e)?'stamp':'gift',code:t?Q(t[0]):void 0}},preview:e=>'stamp'===e.kind?'Stamp cards':'Gift card '+(e.code??''),run:(e,t)=>{const r=i.useStore.getState();if('stamp'===e.kind&&(0,n.staffServer)())return(0,n.loyaltySummary)().then(e=>I(e.members,'guest')+' have stamp cards here; '+I(e.rewardsReady,'reward')+' ready to use. To check one guest, open Stamp card and find or scan them.',()=>'I couldn\u2019t reach the stamp cards just now. Try again in a moment.');if('stamp'===e.kind){const e=r.stampCards.filter(e=>e.restaurantId===t.rid),a=e.reduce((e,t)=>e+t.rewardsAvailable,0);return I(e.length,'guest')+' have stamp cards here; '+I(a,'reward')+' ready to claim. To check one guest, scan their card in Stamp cards.'}if(!e.code)return'Read me the code on the gift card, letter by letter.';const a=String(e.code),o=r.giftCards.filter(e=>e.restaurantId===t.rid).find(e=>Q(e.code)===a||a.length>=4&&Q(e.code).includes(a));return o?'Gift card '+o.code+': '+(0,g.gbp)(o.balance)+' left of '+(0,g.gbp)(o.initial)+'.':'I couldn\u2019t find a gift card with that code. Check it and try again.'}},{id:'feedback_summary',title:'Summarise feedback',risk:'look',description:'Summarise the last 7 days of guest ratings and comments.',params:[],keywords:['feedback','reviews'],match:e=>N(e,/\b(feedback|reviews?|ratings?|complaints?|comments?|what are (guests|people) saying)\b/)?3:0,preview:()=>'Summarise this week\u2019s feedback',run:(e,t)=>{const r=w().getTime()-6048e5,a=i.useStore.getState().ratings.filter(e=>e.restaurantId===t.rid&&new Date(e.createdAt).getTime()>=r);if(!a.length)return'No guest feedback in the last 7 days.';const n=a.reduce((e,t)=>e+t.stars,0)/a.length,o=a.filter(e=>e.stars<=3&&e.comment).slice(0,2),s=a.filter(e=>e.stars>=5&&e.comment).slice(0,1);return I(a.length,'rating')+' in the last 7 days, averaging '+n.toFixed(1)+' stars.'+(s.length?' Best: \u201c'+s[0].comment+'\u201d.':'')+(o.length?' To look at: '+o.map(e=>'\u201c'+e.comment+'\u201d ('+e.stars+' stars)').join('; ')+'.':' No low scores.')}},{id:'shift_note',title:'Leave a shift note',risk:'change',description:'Leave a note for the next shift.',params:[{name:'text',type:'string',required:!0,description:'The note'}],keywords:['shift note','handover'],match:e=>N(e,/\b(shift note|leave a note|note for|handover|tell the next shift|let the next shift know|note that)\b/)&&!N(e,/\b(read|any notes|what notes)\b/)?4:0,parse:e=>({text:e.replace(/^.*?\b(?:shift note|leave a note|note for (?:the )?(?:next shift|tomorrow|tonight|morning|evening)|handover note|handover|tell the next shift|let the next shift know|note that)\b\s*(?:that|:|,|for the next shift)?\s*/i,'').trim()||e}),preview:e=>'Leave a shift note: \u201c'+e.text+'\u201d?',run:(e,t)=>(y.useShiftNotes.getState().add({rid:t.rid,text:String(e.text),by:x(t),app:C(t)}),'Shift note saved. It shows on the Shift notes screen.')},{id:'read_shift_notes',title:'Read shift notes',risk:'look',description:'Read out the latest open shift notes.',params:[],keywords:['notes'],match:e=>N(e,/\b(read|any|what|latest)\b.*\b(shift notes?|notes|handover)\b/)?5:0,preview:()=>'Read the latest shift notes',run:(e,t)=>{const r=y.useShiftNotes.getState().notes.filter(e=>e.rid===t.rid&&!e.done).slice(0,5);return r.length?r.map(e=>e.by+', '+new Date(e.at).toLocaleString('en-GB',{weekday:'short',hour:'2-digit',minute:'2-digit'})+': '+e.text).join('. '):'No open shift notes.'}}]},1430,[804,1098,829,1120,1206,848,800,1014,1019,989,831,830,1079,1080,1011,1020,836,1431,1432]); +__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return f}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},d=r(_d[1]),n=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},f=(0,d.create)()((0,n.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,d,n,o,f)=>{const p=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===d&&'draft'===e.status);if(p){const t={...p,lines:[...p.lines,...n]};return e(e=>({drafts:e.drafts.map(e=>e.id===p.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:d,title:('bidfood'===d?'Bidfood':'Booker')+" shopping list",lines:n,by:o,app:f})},decide:(t,s,d)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:d,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,n.createJSONStorage)(()=>s.default)}))},1431,[808,815,818]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1432,[808,815,818]); +__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,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1433,[798,34,283,364,236,402,102,815,794,840,25]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return a}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],o=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from Bidfood or Booker',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add Bidfood or Booker for this venue, with your account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add Bidfood or Add Booker (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and Booker or Bidfood lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cwalk-in fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, Booker and Bidfood shopping lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cwalk-in fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Take a picture of the taking sheet, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Take a picture of the taking sheet, or upload a spreadsheet',keywords:['cash up','photo','spreadsheet','csv','excel','xlsx','camera','sheet','gross','card','cash','tips','takings'],body:'In Cash up & sales tap Take a picture of the taking sheet: the camera opens and the figures are filled in from the photo. Check every figure beside the photo (gross, card, cash, tips, food and drink), change anything that is wrong, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. If the photo can\u2019t be read, type the figures in.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'The taking sheet buttons are here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display then shows a Buy a gift card button with a large QR code. Guests buy on your website; the Display shows no prices or balances.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per person, the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Upload cash up sheet. Your phone camera opens; take a photo of the paper sheet (you can add several). The review screen shows the photo beside the figures. Automatic reading isn\u2019t switched on yet, so type each figure from the photo; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],a=t=>o.find(o=>o.id===t)},1434,[]); +__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1435,[]); +__d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return x}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]);const i=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},h=e=>String(e).padStart(2,'0'),c=e=>e.getFullYear()+'-'+h(e.getMonth()+1)+'-'+h(e.getDate()),d=e=>{const t=new Date(e);return h(t.getHours())+':'+h(t.getMinutes())},l=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return h(Math.floor(t/60))+':'+h(t%60)},u=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),h=new Date(i());return h.setDate(h.getDate()+1),e===c(h)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},m=(e,t)=>t.test(e),p=e=>(e??'').replace(' (example)',''),f=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),b=['staff'],k=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],w={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function y(e,t){return'all'===e||(0,n.inChannel)(e,t)}function S(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:p(e.name),nickname:e.nickname},o))}const v=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>m(e,/\bkitchen (chat|group|channel)\b/)&&!m(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:b,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>m(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&m(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!m(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=S(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:p(o.name)};const h=k.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(w[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=f(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||y(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(w[s]??'the team chat')+'.'):'You can\u2019t post in '+(w[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:b,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>m(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=f(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||y(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),l=e=>'system'===e.from?'CoverCharge':p(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return l(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(w[t]??t))+' at ')+d(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:b,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>m(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&m(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!m(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=i(),h=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>h)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+u(c.date,s)+', '+l(c.start)+' to '+l(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>u(e.date,s)+' '+l(e.start)+'\u2013'+l(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:b,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>m(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),h=a.today,c=o.getHours()+o.getMinutes()/60,u=s.shifts.find(e=>e.staffId===a.whoId&&e.published&&e.date===h);return n?'You\u2019re clocked in since '+d(n.in)+'.'+(u?' Your shift ends at '+l(u.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':u&&u.end>c?'You\u2019re not clocked in. Your shift today is '+l(u.start)+' to '+l(u.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(u?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:b,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>m(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const h=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+d(e.start)+'. Breaks today: '+h+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return h?'You\u2019ve had '+h+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:b,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>m(e,/\bspecials?\b/)&&!m(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:b,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>m(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],x=new Set(['log_check','allergen_info','next_table_free',...v.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1436,[800,865,989,836,1430,1032]); +__d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1437,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_KEYTERMS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"MAX_APP_KEYTERMS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"VENUE_WORDS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"cleanTerm",{enumerable:!0,get:function(){return u}}),e.venueKeyterms=function(l){const b=[],f=new Set,h=t=>{const a=u(t??''),n=a.toLowerCase();a.length>=2&&!f.has(n)&&b.lengtht.active).forEach(t=>h(String(t.name).split(/\s+/)[0]))}catch{}try{(n.useFloor.getState().plans[l]??(0,n.seedPlan)(l)).areas.forEach(t=>h(t.name))}catch{}try{s.forEach(h)}catch{}try{a.useStore.getState().menu.filter(t=>!t.restaurantId||t.restaurantId===l).forEach(t=>h(t.name))}catch{}return b};var t=r(d[0]),a=r(d[1]),n=r(d[2]);const l=100,c=80,o=['walk-in','covers','table','seat','seated','clear','cleared','needs clearing','block','unblock','waitlist','lobster','crab','langoustines','scallops','sold out','no-show','Sitooterie','Beer Garden','Main Restaurant','party of','people'],s=['table one','table two','table three','table four','table five','table six','table seven','table eight','table nine','table ten','table eleven','table twelve'],u=t=>t.replace(/\([^)]*\)/g,' ').replace(/[^\p{L}\p{N} '&.-]/gu,' ').replace(/\s+/g,' ').trim().slice(0,50).trim()},1438,[865,800,1014]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useVoiceNav",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(()=>({go:null}))},1439,[815]); +__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_TASKS_PER_MONTH",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"VOICE_WARN_AT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"VOICE_FAIR_USAGE",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"monthKey",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"voiceUsage",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"REACHED_TEXT",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"WARN_TEXT",{enumerable:!0,get:function(){return v}}),_e.useVoiceUsage=function(e,t=new Date){const n=h(n=>n.used[e]?.[f(t)]??0);return _(n)};var e,t=r(_d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(_d[1]),s=r(_d[2]);const u=1e3,c=.8,d='Fair usage: 1,000 voice tasks a month per venue',l=new Set(['log_check']),f=(e=new Date)=>e.getFullYear()+'-'+String(e.getMonth()+1).padStart(2,'0'),h=(0,o.create)()((0,s.persist)(e=>({used:{},add:(t,n)=>e(e=>({used:{...e.used,[t]:{[n]:(e.used[t]?.[n]??0)+1}}}))}),{name:'covercharge-voice-usage-v1',version:1,storage:(0,s.createJSONStorage)(()=>n.default)})),_=e=>{const t=e/u;return{used:e,limit:u,pct:t,warn:t>=c,reached:e>=u,line:'Voice assistant: '+e.toLocaleString('en-GB')+' of 1,000 tasks used this month, resets on the 1st'}},b={get:(e,t=new Date)=>_(h.getState().used[e]?.[f(t)]??0),allowed:(e,t,n=new Date)=>null!=t&&l.has(t)||!b.get(e,n).reached,record:(e,t=new Date)=>h.getState().add(e,f(t))},p='This venue has used its fair-usage allowance of 1,000 voice tasks for this month. It starts again on the 1st. Food safety logging still works, and the owner can contact CoverCharge if you need more.',v=e=>e.line+'. That\u2019s '+Math.round(100*e.pct)+'% of this venue\u2019s fair-usage allowance.'},1440,[808,815,818]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useVoiceKeys",{enumerable:!0,get:function(){return e}}),_e.installVoiceKeys=function(){if('undefined'==typeof window||!window.addEventListener)return()=>{};let n=!1;const o=o=>(o.metaKey||o.ctrlKey)&&o.shiftKey&&'g'===o.key.toLowerCase()?(o.preventDefault(),void(o.repeat||e.getState().send('toggle'))):!o.metaKey&&!o.ctrlKey||o.shiftKey||'/'!==o.key?void('Space'!==o.code||o.metaKey||o.ctrlKey||o.altKey||t(o.target)||(o.preventDefault(),o.repeat||n||(n=!0,e.getState().send('start')))):(o.preventDefault(),void e.getState().send('type')),s=t=>{'Space'===t.code&&n&&(t.preventDefault(),n=!1,e.getState().send('stop'))},l=()=>{n&&(n=!1,e.getState().send('stop'))};return window.addEventListener('keydown',o,!0),window.addEventListener('keyup',s,!0),window.addEventListener('blur',l),()=>{window.removeEventListener('keydown',o,!0),window.removeEventListener('keyup',s,!0),window.removeEventListener('blur',l)}};const e=(0,r(d[0]).create)((e,t)=>({last:null,send:n=>e({last:{cmd:n,n:(t().last?.n??0)+1}})})),t=e=>{const t=e?.tagName;return'INPUT'===t||'TEXTAREA'===t||'SELECT'===t||!!e?.isContentEditable}},1441,[815]); +__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=u(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),k=[],A=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);if(i.includes(c))continue;k.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0});const u='st-jack'===t?{auto:'rota'}:{};d=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:f(d,23.5)}:void 0,...u}):d===y&&e<=m&&A.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:f(d,u.auto?e:e-.05),inSite:!0,...u})}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!k.some(e=>e.staffId===t.staffId&&e.date===t.date)),...k],attendance:[...S.attendance,...A]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:f(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:f((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',u=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,f=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1442,[848,800,865,1024,15,997,846]); +__d(function(e,o,s,p,t,a,n){"use strict";t.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},1443,[]); +__d(function(e,o,s,p,c,t,d){"use strict";c.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},1444,[]); +__d(function(o,e,s,p,f,t,d){"use strict";f.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},1445,[]); +__d(function(o,s,e,p,d,t,n){"use strict";d.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},1446,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1447,[30,34,846,25]); +__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 t.Head}});const t=(n=r(d[0]),c=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(c,t)||Object.defineProperty(c,t,{enumerable:!0,get:function(){return n[t]}})}),n);var n,c},1448,[1449]); +__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var c in n)Object.defineProperty(t,c,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,c).get})})(e,{get Head(){return u},get default(){return s}});const n=r(d[1]),c=r(d[2]);function o({children:c}){return(0,t().jsx)(n.Helmet,{children:c})}const u=({children:n})=>(0,c.useIsFocused)()?(0,t().jsx)(o,{children:n}):null;u.Provider=n.HelmetProvider;const s=u},1449,[25,1450,591]); +__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>fe,HelmetData:()=>se,HelmetProvider:()=>oe}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[0])),T=u(r(d[0])),A=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(A||{}),O={rel:["amphtml","canonical","alternate"]},C={type:["application/ld+json"]},w={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x=Object.values(A),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},$=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",k="defaultTitle",S="defer",E="encodeSpecialCharacters",M="onChangeClientState",P="titleTemplate",H="prioritizeSeoTags",D=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},L=t=>{let n=D(t,"title");const s=D(t,P);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=D(t,k);return n||i||void 0},I=t=>D(t,M)||(()=>{}),U=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),N=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;it.push(n));const l=Object.keys(o);for(let t=0;t{if(Array.isArray(t)&&t.length)for(let s=0;sArray.isArray(t)?t.join(""):t,z=(t,n)=>{const s=Object.keys(t);for(let i=0;iArray.isArray(t)?t.reduce((t,s)=>(z(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},F=(t,n)=>({...t,[n]:void 0}),Y=["noscript","script","style"],K=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),G=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${K(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),W=(t,n,s,i)=>{const o=G(s),l=R(n);return o?`<${t} ${j}="true" ${o}>${K(l,i)}`:`<${t} ${j}="true">${K(l,i)}`},J=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${K(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===Y.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}`}`},""),Q=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),V=(t,n,s)=>{const i=Q(s,{key:n,[j]:!0});return[T.default.createElement("title",i,n)]},X=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),T.default.createElement(t,i)}),Z=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>V(0,n.title,n.titleAttributes),toString:()=>W(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Q(n),toString:()=>G(n)};default:return{toComponent:()=>X(t,n),toString:()=>J(t,n,s)}}},ee=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=B(t,w),l=B(n,O),c=B(s,C);return{priorityMethods:{toComponent:()=>[...X("meta",o.priority),...X("link",l.priority),...X("script",c.priority)],toString:()=>`${Z("meta",o.priority,i)} ${Z("link",l.priority,i)} ${Z("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},te=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=ee(t)),{priority:T,base:Z("base",n,i),bodyAttributes:Z("bodyAttributes",s,i),htmlAttributes:Z("htmlAttributes",o,i),link:Z("link",y,i),meta:Z("meta",f,i),noscript:Z("noscript",l,i),script:Z("script",b,i),style:Z("style",c,i),title:Z("title",{title:p,titleAttributes:u},i)}},re=[],ne=!("undefined"==typeof window||!window.document||!window.document.createElement),se=class{instances=[];canUseDOM=ne;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?re:this.instances,add:t=>{(this.canUseDOM?re:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?re:this.instances).indexOf(t);(this.canUseDOM?re:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=te({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ie=b.default.createContext({}),oe=class t extends b.Component{static canUseDOM=ne;constructor(n){super(n),this.helmetData=new se(this.props.context||{},t.canUseDOM)}render(){return b.default.createElement(ie.Provider,{value:this.helmetData.value},this.props.children)}},ae=r(d[0]),le=(t,n)=>{if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;const s=Object.keys(t),i=Object.keys(n);return s.length===i.length&&s.every(s=>Object.prototype.hasOwnProperty.call(n,s)&&t[s]===n[s])},ce=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},pe=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},ue=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=R(t)),pe("title",n)},de=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;pe("body",i),pe("html",o),ue(f,b);const T={baseTag:ce("base",s),linkTags:ce("link",l),metaTags:ce("meta",c),noscriptTags:ce("noscript",p),scriptTags:ce("script",h),styleTags:ce("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},he=null,me=t=>{he&&cancelAnimationFrame(he),t.defer?he=requestAnimationFrame(()=>{de(t,()=>{he=null})}):(de(t),he=null)},ye=class extends ae.Component{rendered=!1;shouldComponentUpdate(t){return!le(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:N(["href"],o),bodyAttributes:U("bodyAttributes",o),defer:D(o,S),encode:D(o,E),htmlAttributes:U("htmlAttributes",o),linkTags:q("link",["rel","href"],o),metaTags:q("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:q("noscript",["innerHTML"],o),onChangeClientState:I(o),scriptTags:q("script",["src","innerHTML"],o),styleTags:q("style",["cssText"],o),title:L(o),titleAttributes:U("titleAttributes",o),prioritizeSeoTags:_(o,H)});var o;oe.canUseDOM?me(i):te&&(s=te(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},fe=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(F(this.props,"helmetData"),F(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){if(!x.some(n=>t.type===n))throw new Error("function"==typeof t.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`);if(n&&"string"!=typeof n&&(!Array.isArray(n)||n.some(t=>"string"!=typeof t)))throw new Error(`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`} ) Refer to our API for more information.`);return!0}mapChildrenToProps(t,n){let s={};return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[$[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof se)){i=new se(i.context,!0),delete s.helmetData}return i?y.default.createElement(ye,{...s,context:i.value}):y.default.createElement(ie.Consumer,null,t=>y.default.createElement(ye,{...s,context:t}))}}},1450,[34,172]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1451,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";function t(){const e=r(d[0]);return t=function(){return e},e}function e(){const t=r(d[1]);return e=function(){return t},t}function n(){const t=f(r(d[2]));return n=function(){return t},t}function o(){const t=r(d[3]);return o=function(){return t},t}Object.defineProperty(_e,"__esModule",{value:!0}),Object.defineProperty(_e,"renderRootComponent",{enumerable:!0,get:function(){return y}});const u=f(r(d[4]));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}function f(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=c(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var s=u?Object.getOwnPropertyDescriptor(t,f):null;s&&(s.get||s.set)?Object.defineProperty(o,f,s):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o}function s(t){if('[object Object]'!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function p(t){return t&&'object'==typeof t&&'string'==typeof t.name&&'string'==typeof t.message}function l(t){return p(t)?t:s(t)?new Error(JSON.stringify(t)):new Error(String(t))}function y(c){try{setTimeout(()=>{u._internal_preventAutoHideAsync?.()}),n().startTransition(()=>{(0,e().registerRootComponent)(c)})}catch(n){u.hideAsync();const c=l(n);(0,e().registerRootComponent)(()=>(0,t().jsx)(o().View,{})),console.error(c),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw c})}}},1452,[25,499,34,270,651]); __r(501); __r(21); __r(0); \ No newline at end of file diff --git a/chef-app/admin.html b/chef-app/admin.html index e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 0d05403fb235142432f376f20612ca9e03cefcda..552fc170169d5889502a7dcb57f222e8c7366545 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 d01c217c5a47dea49431a0658b8f7ec9c80055ed..56f167d1bc118bee9ba1b8cf16e1efd4f3cf5e94 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-133c625c49"; +const V = "cc-chef-577566e870"; 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=133c625c496fcf452b17ee6ba7ce385e9b72530bcbc04ef42e2094d9fb4b48f2"]; +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=577566e870eb3d63373aa30f2b8709266df56fc7916d59d5f57bbd2c089ebcfe"]; // 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 e6e4cc599d3c43d162a30a1d96831e31cc129811..098070c0f9e9469ed0625df0d601179ab1662117 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 011b897f68debdb11bb5300a33f21f7cb705bb6b..d08f1ad4f17b6a49d422f58d863a3e15df935e53 100644 --- a/customer-app/_expo/static/js/web/bundle.js +++ b/customer-app/_expo/static/js/web/bundle.js @@ -23,11 +23,11 @@ __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,"PITCH_VENUE",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"PITCH_TEAM",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PITCH_TEXT",{enumerable:!0,get:function(){return o}}),e.pitchText=function(a){let n=a;for(const[a,t]of o)a.test(n)?(a.lastIndex=0,n=n.replace(a,t)):a.lastIndex=0;return n};const a={name:'The Harbour Kitchen',tagline:'Harbourside seafood & seasonal plates',location:'12 Quay Street, Portmorran',phone:'01632 960 123',website:'harbourkitchen.example'},n={'st-tracy':{name:'Morgan',job:'Owner',hourlyPence:null,salaried:!0},'st-gordon':{name:'Alex',job:'General Manager',dept:'Management',hourlyPence:null,salaried:!0},'st-bisto':{name:'Ravi',job:'Head Chef',hourlyPence:null,salaried:!0},'st-agate':{name:'Priya',job:'Front of house supervisor',hourlyPence:1450},'st-lenny':{name:'Tom',job:'Commis Chef',hourlyPence:1325},'st-finn':{name:'Lewis',job:'Bar staff',hourlyPence:1290},'st-eilidh':{name:'Chloe',job:'Front of house',hourlyPence:1271},'st-emily':{name:'Ellie',job:'Front of house',hourlyPence:1271},'st-lillie':{name:'Jordan',job:'Kitchen porter (KP)',hourlyPence:1271},'st-jack':{name:'Sam',job:'Kitchen porter (KP)',hourlyPence:1271}},o=[['Harbour View, Dunure, South Ayrshire',a.location],['Harbour View, Dunure',a.location],['Harbour View mug','Harbour Kitchen mug'],['Harbour View','Quay Street'],['anchoragedunure.com',a.website],['01292 502826',a.phone],['Mini Anchors','Little Crew'],['The Anchorage',a.name],['Anchorage','Harbour Kitchen'],['ANCHORAGE','HARBOUR KITCHEN'],['South Ayrshire','the Firth coast'],['Ayrshire','the Firth coast'],['Dunure','Portmorran'],['Kittyfisher boat (Big Sean)','Coastal Fish Co'],['Kittyfisher','Coastal Fish Co'],['Big Sean','Coastal Fish Co'],['Example Fish Co.','Coastal Fish Co'],['Sample Dairy Ltd','Hillside Dairy'],['Sample Fruit & Veg','Fieldfare Veg'],['Mills milk','Hillside Dairy milk'],['Mills','Hillside Dairy'],['J. Pieroni & Sons','Fieldfare Veg'],["Pieroni's",'Fieldfare Veg'],['Pieroni','Fieldfare Veg'],['Alsons (drinks)','Drinks wholesaler'],['Alsons','the drinks wholesaler'],['Spes Bona','the deli wholesaler'],['Tarelgin','the butcher'],['Reids','the bakery'],['Reeds','the bakery'],['Example Butchers Ltd','Quayside Butchers'],['Example Dry Goods Wholesale','Dry goods wholesaler'],['Sample Brewing Co.','Harbourside Brewing'],['Example Cleaning Supplies','Cleaning supplies'],['Sample Packaging Ltd','Packaging supplier'],['Example Kitchen Repairs','Kitchen repairs'],['Preston','Ravi'],['Bisto','Ravi'],['Tracy','Morgan'],['James','Morgan'],['Gordon','Alex'],['Agate','Priya'],['Lenny','Tom'],['Finn','Lewis'],['Eilidh','Chloe'],['Emily','Ellie'],['Gabrielle','Ellie'],['Cameron Mc','Sam'],['Cameron','Sam'],['Lillie','Jordan'],['Lily','Jordan'],['Mia','Jordan'],['Jack','Sam'],['Harvey','Jordan'],['Anna','the supplier'],['(preview)',''],[' (example)','']].map(([a,n])=>[new RegExp(`${/^[A-Za-z]/.test(a)?'(?g[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`](_),globalThis.__webpack_require__=o=>{const t=ErrorUtils.reportFatalError;_&&(ErrorUtils.reportFatalError=_=>{throw _});try{return g[`${__METRO_GLOBAL_PREFIX__}__r`](o)}finally{_&&(ErrorUtils.reportFatalError=t)}}},23,[]); -__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}function t(){const n=r(d[1]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"App",{enumerable:!0,get:function(){return c}}),r(d[2]);const o=r(d[3]),u=r(d[4]);function c(){return(0,n().jsx)(u.Head.Provider,{children:(0,n().jsx)(o.ExpoRoot,{context:t().ctx})})}r(d[5])},24,[25,27,34,709,1424,1427]); +__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}function t(){const n=r(d[1]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"App",{enumerable:!0,get:function(){return c}}),r(d[2]);const o=r(d[3]),u=r(d[4]);function c(){return(0,n().jsx)(u.Head.Provider,{children:(0,n().jsx)(o.ExpoRoot,{context:t().ctx})})}r(d[5])},24,[25,27,34,709,1425,1428]); __d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},25,[26]); __d(function(g,r,i,a,m,e,d){ /** @@ -41,7 +41,7 @@ __d(function(g,r,i,a,m,e,d){ */ "use strict";var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(t,o,f){var l=null;if(void 0!==f&&(l=""+f),void 0!==o.key&&(l=""+o.key),"key"in o)for(var y in f={},o)"key"!==y&&(f[y]=o[y]);else f=o;return o=f.ref,{$$typeof:n,type:t,key:l,ref:void 0!==o?o:null,props:f}}e.Fragment=t,e.jsx=o,e.jsxs=o},26,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ctx",{enumerable:!0,get:function(){return t}});const t=r(d[0])},27,[28]); -__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./(chef)/kitchen/[section].tsx":{enumerable:!0,get:()=>r(d[1])(d[0],d.paths)},"./(chef)/kitchen/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[2],d.paths)},"./(customer)/customer/[rid]/book.tsx":{enumerable:!0,get:()=>r(d[1])(d[3],d.paths)},"./(customer)/customer/[rid]/dish/[did].tsx":{enumerable:!0,get:()=>r(d[1])(d[4],d.paths)},"./(customer)/customer/[rid]/feedback.tsx":{enumerable:!0,get:()=>r(d[1])(d[5],d.paths)},"./(customer)/customer/[rid]/gift.tsx":{enumerable:!0,get:()=>r(d[1])(d[6],d.paths)},"./(customer)/customer/[rid]/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[7],d.paths)},"./(customer)/customer/[rid]/lost.tsx":{enumerable:!0,get:()=>r(d[1])(d[8],d.paths)},"./(customer)/customer/[rid]/loyalty.tsx":{enumerable:!0,get:()=>r(d[1])(d[9],d.paths)},"./(customer)/customer/[rid]/merch.tsx":{enumerable:!0,get:()=>r(d[1])(d[10],d.paths)},"./(customer)/customer/[rid]/offers.tsx":{enumerable:!0,get:()=>r(d[1])(d[11],d.paths)},"./(customer)/customer/[rid]/refer.tsx":{enumerable:!0,get:()=>r(d[1])(d[12],d.paths)},"./(customer)/customer/[rid]/waitlist.tsx":{enumerable:!0,get:()=>r(d[1])(d[13],d.paths)},"./(customer)/customer/[rid]/whatson.tsx":{enumerable:!0,get:()=>r(d[1])(d[14],d.paths)},"./(customer)/customer/basket.tsx":{enumerable:!0,get:()=>r(d[1])(d[15],d.paths)},"./(customer)/customer/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[16],d.paths)},"./(customer)/customer/order/[oid].tsx":{enumerable:!0,get:()=>r(d[1])(d[17],d.paths)},"./(customer)/customer/profile.tsx":{enumerable:!0,get:()=>r(d[1])(d[18],d.paths)},"./(customer)/demo.tsx":{enumerable:!0,get:()=>r(d[1])(d[19],d.paths)},"./(customer)/table/[n].tsx":{enumerable:!0,get:()=>r(d[1])(d[20],d.paths)},"./(customer)/table/live/[token].tsx":{enumerable:!0,get:()=>r(d[1])(d[21],d.paths)},"./(display)/display/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[22],d.paths)},"./(display)/staff/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[23],d.paths)},"./(owner)/admin/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[24],d.paths)},"./(owner)/owner/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[25],d.paths)},"./(staff)/team/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[26],d.paths)},"./+not-found.tsx":{enumerable:!0,get:()=>r(d[1])(d[27],d.paths)},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])(d[28],d.paths)},"./index.tsx":{enumerable:!0,get:()=>r(d[1])(d[29],d.paths)}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},28,[29,1038,1184,1185,1187,1191,1193,1200,1256,1257,1258,1259,1260,1261,1263,1264,1265,1266,1267,1268,1269,1270,1273,1331,1332,1333,1335,1378,1379,1423]); +__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./(chef)/kitchen/[section].tsx":{enumerable:!0,get:()=>r(d[1])(d[0],d.paths)},"./(chef)/kitchen/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[2],d.paths)},"./(customer)/customer/[rid]/book.tsx":{enumerable:!0,get:()=>r(d[1])(d[3],d.paths)},"./(customer)/customer/[rid]/dish/[did].tsx":{enumerable:!0,get:()=>r(d[1])(d[4],d.paths)},"./(customer)/customer/[rid]/feedback.tsx":{enumerable:!0,get:()=>r(d[1])(d[5],d.paths)},"./(customer)/customer/[rid]/gift.tsx":{enumerable:!0,get:()=>r(d[1])(d[6],d.paths)},"./(customer)/customer/[rid]/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[7],d.paths)},"./(customer)/customer/[rid]/lost.tsx":{enumerable:!0,get:()=>r(d[1])(d[8],d.paths)},"./(customer)/customer/[rid]/loyalty.tsx":{enumerable:!0,get:()=>r(d[1])(d[9],d.paths)},"./(customer)/customer/[rid]/merch.tsx":{enumerable:!0,get:()=>r(d[1])(d[10],d.paths)},"./(customer)/customer/[rid]/offers.tsx":{enumerable:!0,get:()=>r(d[1])(d[11],d.paths)},"./(customer)/customer/[rid]/refer.tsx":{enumerable:!0,get:()=>r(d[1])(d[12],d.paths)},"./(customer)/customer/[rid]/waitlist.tsx":{enumerable:!0,get:()=>r(d[1])(d[13],d.paths)},"./(customer)/customer/[rid]/whatson.tsx":{enumerable:!0,get:()=>r(d[1])(d[14],d.paths)},"./(customer)/customer/basket.tsx":{enumerable:!0,get:()=>r(d[1])(d[15],d.paths)},"./(customer)/customer/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[16],d.paths)},"./(customer)/customer/order/[oid].tsx":{enumerable:!0,get:()=>r(d[1])(d[17],d.paths)},"./(customer)/customer/profile.tsx":{enumerable:!0,get:()=>r(d[1])(d[18],d.paths)},"./(customer)/demo.tsx":{enumerable:!0,get:()=>r(d[1])(d[19],d.paths)},"./(customer)/table/[n].tsx":{enumerable:!0,get:()=>r(d[1])(d[20],d.paths)},"./(customer)/table/live/[token].tsx":{enumerable:!0,get:()=>r(d[1])(d[21],d.paths)},"./(display)/display/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[22],d.paths)},"./(display)/staff/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[23],d.paths)},"./(owner)/admin/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[24],d.paths)},"./(owner)/owner/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[25],d.paths)},"./(staff)/team/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[26],d.paths)},"./+not-found.tsx":{enumerable:!0,get:()=>r(d[1])(d[27],d.paths)},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])(d[28],d.paths)},"./index.tsx":{enumerable:!0,get:()=>r(d[1])(d[29],d.paths)}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},28,[29,1038,1184,1185,1187,1191,1193,1200,1256,1257,1258,1259,1260,1261,1263,1264,1265,1266,1267,1268,1269,1270,1273,1331,1332,1333,1335,1378,1379,1424]); __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 s}});var t=r(d[0]);r(d[1]);var n=r(d[2]),c=r(d[3]),o=r(d[4]),f=r(d[5]);function s(){const{section:s}=(0,t.useLocalSearchParams)();return(0,c.canShow)('chef')?s&&(0,o.chefSectionAllowed)(String(s))?(0,f.jsx)(n.ChefApp,{section:String(s)},String(s)):(0,f.jsx)(t.Redirect,{href:"/kitchen"}):(0,f.jsx)(t.Redirect,{href:c.ENTRY[c.APP_VARIANT]})}},29,[30,34,792,846,988,25]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){return Object.keys(t).forEach(function(c){"default"===c||Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{enumerable:!0,get:function(){return t[c]}})}),t}Object.defineProperty(e,"__esModule",{value:!0}),r(d[0]),t(r(d[1]),e),t(r(d[2]),e),t(r(d[3]),e),t(r(d[4]),e)},30,[31,32,782,783,785]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},31,[]); @@ -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.122'},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.123'},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]); @@ -1195,7 +1195,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}),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: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";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)(!0);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]); @@ -1354,7 +1354,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}),_e.TableOrderLive=function({token:e}){const[s,m]=(0,l.useState)(null),[x,y]=(0,l.useState)(null),[j,f]=(0,l.useState)([]),[k,w]=(0,l.useState)(null),T=(0,h.useCustomer)(),[C,S]=(0,l.useState)(()=>(T?.allergies??[]).map(e=>e.allergen)),[v,O]=(0,l.useState)(''),[P,R]=(0,l.useState)(''),[I,M]=(0,l.useState)(''),[L,N]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),[B,D]=(0,l.useState)([]),q=(0,l.useCallback)(async()=>{try{m(await(0,c.tablePublic)(e)),y(null)}catch(e){y((0,d.tableOrderError)(e,'menu'))}},[e]),_=(0,l.useCallback)(async()=>{try{D(await(0,c.myTableOrders)(e))}catch{}},[e]);(0,l.useEffect)(()=>{q(),_();const e=setInterval(()=>{_(),q()},8e3);return()=>clearInterval(e)},[q,_]);const W=s?.menu??[];(0,l.useEffect)(()=>{f(e=>e.filter(e=>W.some(t=>t.id===e.id&&!t.soldOut)))},[s]);const E=(0,l.useMemo)(()=>{const e=new Map;for(const t of W)e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()]},[s]),Y=(0,d.cartTotal)(j,W),z='yes'===k?C.map(e=>({allergen:e,severity:T?.allergies?.find(t=>t.allergen===e)?.severity??'allergy'})):[],G=(0,d.allergyClashes)(j,W,z.map(e=>e.allergen)),V=e=>j.find(t=>t.id===e)?.qty??0,F=(e,t)=>f(n=>t<=0?n.filter(t=>t.id!==e):n.some(t=>t.id===e)?n.map(n=>n.id===e?{...n,qty:t}:n):[...n,{id:e,qty:t,note:''}]),H=(e,t)=>f(n=>n.map(n=>n.id===e?{...n,note:t}:n)),J=async()=>{N(!0),A(null);try{const t=await(0,c.sendTableOrder)(e,j,{note:I,name:v,phone:P,allergies:z});f([]),M(''),A({kind:'success',text:t.held?`Order ${t.ref} sent. A member of staff will check it, then it goes to the kitchen.`:`Order ${t.ref} sent to the kitchen.`}),_()}catch(e){A({kind:'warn',text:(0,d.tableOrderError)(e,'send')}),q()}finally{N(!1)}};if(x)return(0,p.jsxs)(o.Screen,{title:"Order at the table",children:[(0,p.jsx)(o.Banner,{kind:"warn",title:"Couldn't open the menu",children:x}),(0,p.jsx)(o.Button,{label:"Try again",onPress:()=>{q()}})]});if(!s)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Muted,{children:"Opening the menu\u2026"})});if(!s.ok)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Banner,{kind:"warn",title:"This code isn't working",children:s.reason??'Please ask a member of staff.'})});const K=s.open&&j.length>0&&null!==k&&('none'===k||C.length>0)&&(0,d.nameOk)(v)&&(0,d.phoneOk)(P)&&!L,Q=s.askServer??[],U=[...new Set(Q.map(e=>e.section))],X=L?'Sending\u2026':j.length?null===k?'Answer the allergy question':(0,d.nameOk)(v)?(0,d.phoneOk)(P)?`Send order to the kitchen (${(0,i.gbp)(Y)})`:'Check the phone number':'Add your name to send':'Add a dish to order';return(0,p.jsxs)(o.Screen,{title:`Table ${(0,n.tableNumbers)(s.table)}`,subtitle:s.venueName,footer:s.open?(0,p.jsx)(o.Button,{label:X,disabled:!K,onPress:()=>{J()},testID:"send-table-order-live"}):void 0,children:[(0,p.jsxs)(o.Muted,{center:!0,children:["Tip: add dishes, answer the allergy question, add your name, then send. Staff bring it to table ",(0,n.tableNumbers)(s.table),". ",d.PAY_WORDS]}),s.tip?(0,p.jsx)(o.Banner,{kind:"demo",children:s.tip}):null,s.open?null:(0,p.jsx)(o.Banner,{kind:"warn",title:"Not taking table orders right now",children:s.reason}),s.open&&s.staffAccept&&!B.some(e=>e.accepted)?(0,p.jsx)(o.Muted,{children:"The first order from your phone is checked by a member of staff before it goes to the kitchen."}):null,$?(0,p.jsx)(o.Banner,{kind:$.kind,children:$.text}):null,B.length?(0,p.jsx)(r.default,{testID:"my-table-orders",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Your orders at this table"}),B.map(e=>(0,p.jsxs)(r.default,{style:{gap:2,paddingVertical:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e.ref}),(0,p.jsx)(o.T,{size:13,colour:'cancelled'===e.status?u.colours.amber:u.colours.gold,children:(0,d.guestStatusWords)(e)})]}),(0,p.jsxs)(o.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,i.gbp)(e.totalPence)," to pay at the bar or with the server"]})]},e.id))]})}):null,s.open?E.map(([e,t])=>(0,p.jsxs)(r.default,{style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:e}),t.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,p.jsxs)(r.default,{style:{flex:1,gap:2},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),e.description?(0,p.jsx)(o.Muted,{children:e.description}):null,(0,p.jsxs)(o.T,{size:13,colour:u.colours.muted,children:[e.allergens.length?`Contains: ${e.allergens.map(a.allergenLabel).join(', ')}`:'No allergens listed: ask staff if unsure',e.mayContain.length?` \xb7 May contain: ${e.mayContain.map(a.allergenLabel).join(', ')}`:'']})]}),(0,p.jsx)(o.T,{weight:"semibold",colour:u.colours.gold,children:(0,i.gbp)(e.pricePence)})]}),e.soldOut?(0,p.jsx)(o.Badge,{kind:"amber",label:"Sold out today"}):V(e.id)?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:V(e.id),min:0,max:20,onChange:t=>F(e.id,t),label:e.name}),(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>F(e.id,0)})]}):(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"Add",accessibilityLabel:`Add ${e.name}`,onPress:()=>F(e.id,1)})]},e.id))]},e)):null,s.open&&!W.length?(0,p.jsx)(o.Banner,{kind:"demo",title:"No dishes to order from your phone yet",children:"The kitchen is still checking the allergens on the menu. Please order with your server or at the bar."}):null,s.open&&Q.length?(0,p.jsxs)(r.default,{testID:"table-ask-server",style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:W.length?'Also on the menu':'On the menu'}),(0,p.jsx)(o.Muted,{center:!0,children:"Ask your server for these. They can't be ordered from your phone yet, while the kitchen checks their allergens."}),U.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:e}),Q.filter(t=>t.section===e).map((e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{style:{flex:1},children:e.name}),(0,p.jsx)(o.T,{colour:u.colours.muted,children:(0,i.gbp)(e.pricePence)})]},`${e.name}-${t}`))]},e))]}):null,s.open&&j.length?(0,p.jsx)(r.default,{testID:"table-cart",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:"Review your order"}),j.map(e=>{const n=W.find(t=>t.id===e.id);return(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{children:[e.qty,"\xd7 ",n?.name]}),(0,p.jsx)(o.T,{children:(0,i.gbp)(e.qty*(n?.pricePence??0))})]}),(0,p.jsx)(t.TextInput,{style:b,value:e.note,onChangeText:t=>H(e.id,t),placeholder:"Note for the kitchen (optional), e.g. no onions",placeholderTextColor:u.colours.muted,maxLength:140,accessibilityLabel:`Note for ${n?.name}`,testID:`table-note-${e.id}`})]},e.id)}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Total"}),(0,p.jsx)(o.T,{weight:"semibold",children:(0,i.gbp)(Y)})]})]})}):null,s.open?(0,p.jsx)(r.default,{testID:"table-allergy",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Does anyone at the table have a food allergy?"}),(0,p.jsx)(o.Muted,{center:!0,children:"We ask everyone, so the kitchen can keep you safe."}),(0,p.jsxs)(o.Row,{gap:8,style:{justifyContent:'center'},children:[(0,p.jsx)(o.Chip,{label:"No allergies",selected:'none'===k,onPress:()=>w('none')}),(0,p.jsx)(o.Chip,{label:"Yes, allergies",selected:'yes'===k,onPress:()=>w('yes')})]}),'yes'===k?(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:a.ALLERGENS.map(e=>(0,p.jsx)(o.Chip,{label:e.short,selected:C.includes(e.id),onPress:()=>S(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},e.id))}):null,G.length?(0,p.jsxs)(o.Banner,{kind:"warn",title:"Check with staff",children:[G.map(e=>e.name).join(', ')," ",G.length>1?'contain':'contains'," or may contain an allergy you picked. The kitchen will see your allergies on the ticket."]}):null]})}):null,s.open?(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Who's the order for?"}),(0,p.jsx)(t.TextInput,{style:b,value:v,onChangeText:O,placeholder:"Your name (needed)",placeholderTextColor:u.colours.muted,maxLength:40,accessibilityLabel:"Your name, needed",testID:"table-name",autoComplete:"name"}),(0,p.jsx)(t.TextInput,{style:b,value:P,onChangeText:R,placeholder:"Phone number (optional)",placeholderTextColor:u.colours.muted,maxLength:20,keyboardType:"phone-pad",accessibilityLabel:"Phone number, optional",testID:"table-phone",autoComplete:"tel"}),P&&!(0,d.phoneOk)(P)?(0,p.jsx)(o.Muted,{center:!0,children:"Please check the phone number, or leave it blank."}):null,(0,p.jsx)(o.Muted,{center:!0,children:"We only use these for this order."}),(0,p.jsx)(t.TextInput,{style:b,value:I,onChangeText:M,placeholder:"Note for the staff (optional)",placeholderTextColor:u.colours.muted,maxLength:300,accessibilityLabel:"Note for the staff (optional)"})]}):null,(0,p.jsx)(r.default,{testID:"pay-placeholder",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Paying"}),(0,p.jsx)(o.T,{center:!0,children:d.PAY_WORDS}),(0,p.jsx)(o.Muted,{center:!0,children:"No card details are asked for or kept in this app."})]})})]})};var e,t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),r=(e=s)&&e.__esModule?e:{default:e},o=_r(_d[4]),a=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]);const b={borderWidth:1,borderColor:u.colours.border,borderRadius:10,padding:10,color:u.colours.text,backgroundColor:u.colours.surface2}},1271,[796,829,34,102,794,830,836,1131,1272,848,840,25]); __d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tablePublic",{enumerable:!0,get:function(){return s}}),e.sendTableOrder=async function(t,r,a){if(!await(0,n.guestSession)())throw new Error('No connection. Try again when you are back online.');const o=await(0,n.rpc)('guest_table_order_v2',{p_phone:(a.phone??'').trim().slice(0,20)||null,p_token:t,p_lines:r.map(t=>({id:t.id,qty:t.qty,note:t.note.trim().slice(0,140)})),p_note:a.note.trim().slice(0,300)||null,p_allergies:a.allergies.map(t=>({allergen:t.allergen,severity:t.severity})),p_name:a.name.trim().slice(0,40)||null});if(!o||!1===o.ok||!o.id)throw new Error(o?.reason||'This table code isn\u2019t working any more. Please ask a member of staff.');return{id:o.id,ref:o.ref,held:!!o.held,totalPence:o.totalPence}},e.myTableOrders=async function(t){return await(0,n.guestSession)()?await(0,n.rpc)('guest_table_my_orders',{p_token:t})??[]:[]},e.loadTableSettings=async function(){const{data:t,error:n}=await a().from('table_order_settings').select('*').eq('venue_id',o()).maybeSingle();if(n)throw n;return(0,r.fromRow)(t)},e.saveTableSettings=async function(t,n){const{error:s}=await a().from('table_order_settings').upsert({venue_id:o(),...(0,r.toRow)(t),updated_at:(new Date).toISOString(),updated_by:n.slice(0,80)});if(s)throw s},e.listTableCodes=async function(){const{data:t,error:n}=await a().from('table_qr_codes').select('table_no, token, created_at').eq('venue_id',o()).eq('is_on',!0);if(n)throw n;return(t??[]).map(t=>({table:String(t.table_no),token:String(t.token),createdAt:String(t.created_at)})).sort((t,n)=>Number(t.table)-Number(n.table))},Object.defineProperty(e,"tableReadiness",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"makeTableCodes",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"renewTableCode",{enumerable:!0,get:function(){return u}}),e.watchTableSettings=function(t){const r=n.useSync.getState().venueId;if(!r)return()=>{};const o=a().channel(`tos-${r}-${Math.random().toString(36).slice(2,8)}`).on('postgres_changes',{event:'*',schema:'public',table:'table_order_settings',filter:`venue_id=eq.${r}`},()=>t()).subscribe();return()=>{a().removeChannel(o)}};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const a=()=>(0,t.getSupabase)(),o=()=>{const t=n.useSync.getState().venueId;if(!t)throw new Error('Not connected to the venue yet.');return t},s=t=>(0,n.rpc)('table_public',{p_token:t});const l=()=>(0,n.rpc)('table_order_readiness',{p_venue:o()}),c=t=>(0,n.rpc)('table_qr_make',{p_venue:o(),p_tables:t}),u=t=>(0,n.rpc)('table_qr_renew',{p_venue:o(),p_table:t})},1272,[931,985,1131]); __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 l}});var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]);function l(){return(0,t.canShow)('display')?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.DisplayBoard,{}),(0,c.jsx)(u.DisplayPairing,{})]}):(0,c.jsx)(n.Redirect,{href:t.ENTRY[t.APP_VARIANT]})}},1273,[30,34,846,1274,1329,25]); -__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Pe}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:G,subHeader:Le,noVoice:We=!1}={}){const Oe=(0,P.default)(),Ve=g??Oe.width,Ue=Oe.height,Ke=Ve<700,qe=Ve>=Ue,Ye=!Ke&&qe&&Ve>=600,Qe=Ye,Je=Math.round(Math.min(520,Math.max(Ve>=1e3?448:280,.3*Ve))),Xe=S.default.useRef(null),Ze=S.default.useRef(0),[et,tt]=(0,v.useState)({w:0,h:0}),lt=(0,q.useOwner)(e=>e.site),st=(0,V.useRestaurant)(lt);(0,me.useAlertWatcher)(lt,{enabled:!e});const it=(0,V.useOrders)(lt),ot=(0,V.useBookings)(lt),nt=(0,V.useEvents)(lt),at=(0,V.useStore)(e=>e.skipMinutes),rt=(0,V.useStore)(e=>e.clock.mode),dt=(0,V.useNow)(5e3),ct=(0,q.useOwner)(e=>e.staff),ut=(0,q.useOwner)(e=>e.attendance),ht=(0,q.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,Q.ensureAttendance)((0,F.ymd)(dt),dt)},[(0,F.ymd)(dt)]);const gt=ut.filter(e=>e.in&&!e.out&&dt.getTime()-new Date(e.in).getTime()<72e6&&dt.getTime()>=new Date(e.in).getTime()),bt=Ee(ct.find(e=>e.id===gt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,bt,!e);const yt=(0,F.ymd)(dt),pt=(0,T.useTravelDay)('display',yt),xt=(0,Y.useFrontDoor)(yt,qe),ft=(0,J.useDisplaySettings)(lt),mt=ft.privacy,jt=(0,ne.useSaverSync)(),wt=(0,J.usePlan)(lt),kt=(0,J.useFloor)(e=>e.live[lt]),It=(0,je.useBlocks)(e=>e.blocks),[Dt,vt]=(0,v.useState)('plan'),[St,Ct]=(0,v.useState)('all'),[Tt,$t]=(0,v.useState)(null),[Bt,Rt]=(0,v.useState)(null),[Lt,Wt]=(0,v.useState)(null),[zt,Mt]=(0,v.useState)(!1),[Ht,Pt]=(0,v.useState)(!1),[Et,At]=(0,v.useState)(null),[Ot,Nt]=(0,v.useState)(!1),[_t,Gt]=(0,v.useState)(!1),[Ft,Vt]=(0,v.useState)(null),[Ut,Kt]=(0,v.useState)(null),[qt,Yt]=(0,v.useState)(null),Qt=S.default.useRef(0),Jt=e=>{Qt.current=Date.now(),Yt(e)};S.default.useEffect(()=>{if(!qt)return;const e=setInterval(()=>{Date.now()-Qt.current>=De.DAY_IDLE_MS&&Yt(null)},5e3);return()=>clearInterval(e)},[qt]);const Xt=(0,V.useWaitlist)(lt),Zt=(0,V.useStore)(e=>e.walkIns[lt]??0),[el,tl]=(0,v.useState)(!1),[ll,sl]=(0,v.useState)(!1),[il,ol]=(0,v.useState)(!1);(0,N.useReviewAlerts)(lt);const[nl,al]=(0,v.useState)({view:0,content:0}),[rl,dl]=(0,v.useState)(null);S.default.useEffect(()=>{rl&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:rl,timeoutMs:4500,big:!0,testID:'floor-toast'}),dl(null))},[rl]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[cl,ul]=(0,v.useState)(null),hl=S.default.useRef(0),[gl,bl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!cl)return;hl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-hl.current;if(e>=Pe)return ul(null),void dl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');bl(e>=105e3?Math.ceil((Pe-e)/1e3):null)},1e3);return()=>clearInterval(e)},[cl]);const yl=e=>e.date!==yt?Wt({title:`Guest details \xb7 ${(0,De.dayWord)(e.date,yt)} ${e.time}`,body:(0,He.jsx)(He.Fragment,{children:(0,ye.bookingDetails)(e)})}):Wt({title:`Guest details \xb7 ${e.time}`,body:(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Fe,{rid:lt,id:e.id,turnBase:st.settings.turnMins}),e.walkIn?null:(0,He.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Wt(null),At(e.id)},style:{minHeight:56}}),e.walkIn?(0,He.jsx)(ue.CancelWalkInButton,{rid:lt,b:e,big:!0,onDone:e=>{Wt(null),dl(e)}}):null,e.walkIn?(0,He.jsx)(ue.ReinstateWalkInButton,{rid:lt,b:e,today:yt,onDone:e=>{Wt(null),dl(e)}}):null,(0,ye.bookingDetails)(e)]})}),pl=ot.filter(e=>e.date===yt).sort((e,t)=>e.time.localeCompare(t.time)),xl=pl.filter(e=>!['cancelled','noshow'].includes(e.status)),fl=it.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),ml=(0,v.useMemo)(()=>(0,d.forecastToday)(st,ot,it,nt,dt),[st,ot,it,nt,dt.getTime()/6e4|0]),jl=(0,je.closedAreasAt)(It,lt,yt,(0,F.hm)(dt)),wl=[...jl].join(','),kl=(0,v.useMemo)(()=>(0,X.floorView)(wt,ot,it,kt??{},dt,st.settings.turnMins,jl),[wt,ot,it,kt,dt.getTime(),wl]),Il=(0,be.hoursFor)(st,dt),Dl=Il?.open??new Date(`${yt}T12:00:00`),vl=Il?.close??new Date(`${yt}T21:00:00`),Sl=(0,F.addMins)(Dl,-Dl.getMinutes()),Cl=(0,F.addMins)(vl,90),Tl=e=>new Date(`${yt}T${e}:00`),$l=(0,je.blocksOn)(It,lt,yt).map(e=>({from:Tl(e.from),to:Tl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(st,dt,yt)),Bl=Object.keys(kl).filter(e=>'blocked'===kl[e]?.status),Rl=qt&&qt!==yt?qt:yt,Ll=Rl!==yt,Wl=(0,De.dayWord)(Rl,yt),zl=/^(Today|Yesterday|Tomorrow)$/.test(Wl),Ml=Ll?(0,De.bookingsForDay)(ot,Rl,yt).sort((e,t)=>e.time.localeCompare(t.time)):pl,Hl=(0,F.parseYmd)(Rl);Hl.setHours(12);const Pl=Ll?(0,be.hoursFor)(st,Hl):Il,El=Pl?.open??new Date(`${Rl}T12:00:00`),Al=Pl?.close??new Date(`${Rl}T21:00:00`),Ol=e=>new Date(`${Rl}T${e}:00`),Nl=[...Ll?(0,je.blocksOn)(It,lt,Rl).map(e=>({from:Ol(e.from),to:Ol(e.to),label:e.reason??'Paused'})):$l,...Ll?(0,i.queuedServicePauses)(st,Hl,Rl):[]],_l=(0,i.queuedServiceSessions)(st,Hl),Gl=l.IS_QUEUED_VENUE&&(void 0===_l||!_l.length),Fl=(0,He.jsxs)(H.default,{testID:"queued-hours-gate",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:void 0===_l?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,He.jsx)(A.Muted,{children:s.queuedVenues[lt]?.hours.note})]}),Vl=Ll?Pl||Ml.length?RlLl?(0,X.dayFloorView)(wt,Ml,Rl):kl,[Ll,wt,Ml,Rl,kl]),[Kl,ql]=(0,v.useState)(null),Yl=Ll?Ml.filter(e=>!['cancelled','noshow'].includes(e.status)):xl,Ql=Yl.reduce((e,t)=>e+t.partySize,0),Jl=(0,c.coversSplit)(Yl,Rl),Xl=(0,ve.cancelledDayTally)(ot,Rl),Zl=(0,Se.cancellationsFor)(ot,Rl,e=>e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)','')),es=(0,ve.cancelledTallyWords)(Xl,zl?Wl.toLowerCase():Ll?`on ${Wl}`:'today'),ts=It.filter(e=>e.rid===lt&&e.date===Rl&&!e.removedAt),ls=(0,Ie.chartBands)(ts,60*El.getHours()+El.getMinutes(),60*Al.getHours()+Al.getMinutes()),ss=new Set((0,Ie.blockedHours)(ls)),is=dt.getHours()+(dt.getMinutes()>=30?1:0),os=ml.hours.filter(e=>e.hour>=is&&!ss.has(e.hour)),ns=os.reduce((e,t)=>e+t.coversHigh,0),as=os.reduce((e,t)=>e+t.coversLow,0),rs=Math.round((as+ns)/2),ds=!ml.example&&ml.open&&ml.enough&&ns>0?`Usually ${(0,d.coversRange)(rs,rs)} more`:void 0,cs=async(e,t)=>{const l=kl[e]?.booking;if(!l||e===t)return;const s=kl[t]?.status;if(s&&!['free','soon'].includes(s))return void dl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${X.STATUS[s].label.toLowerCase()}. Pick a free table.`);await V.repo.bookings.update(l.id,{table:t});const i=kt?.[e]?.stage;J.useFloor.getState().setLive(lt,t,{stage:i??'seated',dirty:!1}),J.useFloor.getState().setLive(lt,e,{stage:void 0,dirty:!0}),dl(`${(0,ae.privName)(l,mt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},us=Ut?ot.find(e=>e.id===Ut.id):void 0,hs=Ut&&us?(()=>{const e=us.walkIn?(0,ae.privName)(us,mt):Ee(us.name),t=(0,ge.seatsOf)(wt,Ut.tables).total,l=(0,ge.seatLine)(t,us.partySize),s=(0,ge.pickClashes)(us,Ut.tables,ot.filter(e=>e.date===us.date),st.settings.turnMins),i=(0,ge.tableKey)(Ut.tables)!==(0,ge.tableKey)((0,J.tablesOf)(us.table));return(0,He.jsxs)(H.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:U.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,padding:10},children:[(0,He.jsxs)(H.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,De.dayWord)(us.date,yt)} ${us.time}. Tap tables on the plan to add or take them off. ${(0,ge.tablesWords)(Ut.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,De.dayWord)(us.date,yt)," ",us.time]}),(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[(0,ge.tablesWords)(Ut.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,He.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,He.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,ge.tablesWords)(Ut.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(us){try{await(0,he.saveBookingTables)(lt,us,Ut.tables),dl((0,ge.savedWords)(e,us.partySize,Ut.tables,t))}catch(t){dl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Kt(null)}else Kt(null)}}),(0,He.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Kt(null)})]})]})})():null,gs=wt.areas.filter(e=>wt.tables.some(t=>t.areaId===e.id)),bs=e=>{const t=wt.tables.filter(t=>t.areaId===e);return Ll?`${t.filter(e=>!Ul[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(kl[e.name]?.status??'free')).length}/${t.length} free`},ys='all'===St||gs.some(e=>e.id===St)?St:'all',ps=e=>(0,He.jsx)(Z.FloorCanvas,{plan:wt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Ye,big:!0,view:Ul,privacy:mt,turnBase:st.settings.turnMins,highlight:Ut?Ut.tables:Bt?[Bt]:void 0,onTap:e=>{return t=e.name,void(Ut?Kt(e=>e?{...e,tables:(0,ge.toggleTable)(e.tables,t)}:e):Ll?ql(t):Bt?(t!==Bt&&cs(Bt,t),Rt(null)):$t(t));var t},onDrop:(e,t)=>Ut||Ll?void 0:cs(e.name,t.name)}),xs=Ke?1:qe||gs.length>2?2:1,fs=e=>{const t=wt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ms=[];for(let e=0;e{const t=(0,Z.areaBounds)(wt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,Z.minReadableScale)(wt,e.id)}}),et.w,et.h):null,ws=e=>(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',height:ee.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:bs(e.id)})]}),ks=(0,He.jsx)(H.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-et.w)>1||Math.abs(l-et.h)>1)&&tt({w:t,h:l})},children:js?(0,He.jsx)(M.default,{style:{flex:1},scrollEnabled:js.scroll,showsVerticalScrollIndicator:js.scroll,contentContainerStyle:{gap:ee.GRID_GAP},children:js.rows.map((e,t)=>(0,He.jsx)(H.default,{style:{height:js.rowHeights[t],flexDirection:'row',gap:ee.GRID_GAP},children:e.map(e=>{const t=gs.find(t=>t.id===e);return(0,He.jsxs)(H.default,{testID:`area-cell-${e}`,style:{width:js.cellW,gap:2},children:[ws(t),(0,He.jsx)(H.default,{style:{flex:1},children:ps(e)})]},e)})},t))}):null}),Is=(0,He.jsxs)(H.default,{testID:"venue-plan",style:{flex:Ke?void 0:1,gap:10,minWidth:0},children:[(0,He.jsx)(a.TableNumberWarning,{plan:wt}),wt.tables.length?null:(0,He.jsxs)(H.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,He.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,He.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,He.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,He.jsx)(_e,{chipId:"all",compact:!Ke,label:"Whole venue",selected:'all'===ys,onPress:()=>Ct('all')},"__all"),...gs.map(e=>(0,He.jsx)(_e,{chipId:e.id,compact:!Ke,label:`${e.name}${(0,te.areaMarks)(e)}`,colour:(0,U.brandColour)(e.colour),sub:Ke?jl.has(e.id)?'closed':ys===e.id?bs(e.id):void 0:void 0,selected:ys===e.id,onPress:()=>Ct(e.id)},e.id))];return Ke?(0,He.jsx)(H.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,He.jsx)(M.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;al(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>al(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:nl.view>0&&nl.content>0&&nl.content<=nl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:nl.view>0&&nl.content<=nl.view+1?'100%':void 0},children:e})})(),(0,He.jsx)(h.FloorLegend,{}),hs,Bt?(0,He.jsxs)(A.Row,{gap:8,style:{backgroundColor:U.colours.goldTint,borderRadius:10,padding:8},children:[(0,He.jsxs)(A.T,{weight:"semibold",colour:U.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Bt),": tap the new table."]}),(0,He.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Rt(null)})]}):null,'all'===ys&&Ye?ks:'all'===ys?(0,He.jsx)(H.default,{style:{flex:Ke?void 0:1,gap:12,minHeight:Qe?void 0:360},children:ms.map((e,t)=>(0,He.jsxs)(H.default,{style:{flex:Ke?void 0:Math.max(.3,...e.map(e=>fs(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,He.jsxs)(H.default,{style:{flex:1,gap:2},children:[Ke?(0,He.jsxs)(H.default,{style:{alignItems:'center',gap:4},children:[(0,He.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{center:!0,children:bs(e.id)})]}):(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{children:bs(e.id)})]}),(0,He.jsx)(H.default,{style:Ke?{height:Math.max(280,Math.round((Ve-40)*fs(e.id)))}:{flex:1},children:ps(e.id)})]},e.id)),e.length{if(Ll)return void Vt(e.id);const t=(0,J.tablesOf)(e.table)[0];t&&kl[t]?$t(t):yl(e)}},Rl)}),vs='timeline'===Dt,Ss=Ll?(0,He.jsxs)(H.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,backgroundColor:U.colours.goldTint},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:zl?`Showing ${Wl} \xb7 ${(0,F.niceDate)((0,F.parseYmd)(Rl))}`:`Showing ${(0,De.dayWord)(Rl,yt)}`}),(0,He.jsx)(H.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${es}. Showing ${(0,De.dayLong)(Rl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,He.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Kt(null),Jt(null)},style:{minHeight:44}})]}):null,Cs=(0,He.jsx)(H.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:Ke?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===vs;return(0,He.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},onPress:()=>vt(e),style:{flex:Ke?1:void 0,minHeight:Ke?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?U.colours.gold:'transparent',...$e.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,He.jsx)(A.T,{size:Ke?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ts=(0,u.useBookingWrite)(),$s=e=>(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Be.BigAction,{premium:!0,label:"Walk-in",onPress:xt.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"New booking",onPress:xt.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"Edit booking",onPress:()=>Pt(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint})]});(0,Me.useDisplayNotices)(lt,!e);const Bs=Ke?180:168,[Rs,Ls]=(0,v.useState)(Bs),Ws=S.default.useRef(Bs),zs=S.default.useRef(null),Ms=S.default.useRef(null),Hs=()=>{const e=zs.current,t=Ms.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ue<820?8:12,o=44+(Ue<820?4:8),n=i>Ws.current?Math.ceil(i-Ws.current):ke.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Bs,Math.floor(t-s-l)-n-o));Math.abs(Ws.current-a)>=2&&(Ws.current=a,Ls(a))})})};S.default.useEffect(()=>{const e=setTimeout(Hs,60);return()=>clearTimeout(e)},[Ve,Ue]);const Ps=(0,He.jsxs)(H.default,{ref:Ms,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),Hs()},style:{flexDirection:'row',flexWrap:Ve>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:Ke?12:6,justifyContent:Ke?'center':void 0,borderTopWidth:1,borderTopColor:U.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,He.jsx)(ze.DisplayClockButton,{}),(0,He.jsx)(se.HoldToEdit,{quiet:!0,onUnlock:()=>{bl(null),ul({at:Date.now()})},onHint:()=>dl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,He.jsx)(we.BlockBookingsButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,display:!0,day:Rl}),wt.areas.some(e=>e.outdoor)?(0,He.jsx)(we.CloseGardenButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,short:!0}):null,(0,He.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>ol(!0),style:({pressed:e})=>({...$e.look.quiet(e),flexGrow:1}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,He.jsx)(p.GiftQrButton,{rid:lt,venue:st.name})]}),Es=fl.length?(0,He.jsxs)(H.default,{testID:"takeaway-panel",style:[$e.look.panel,{overflow:'hidden'}],children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,He.jsxs)(A.T,{size:12,colour:U.colours.muted,children:[fl.length," live"]})]}),(0,He.jsx)(H.default,{style:{padding:10},children:(0,He.jsx)(Ge,{list:fl,me:bt,compact:!0,bookings:ot})})]}):null,As=(Te.DueToday,Ll?Ml:pl.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Os=Ll?zl?`${Wl}\u2019s guests`:`Guests ${Wl}`:'Today\u2019s guests',Ns=(0,He.jsxs)(He.Fragment,{children:[0===As.length?(0,He.jsx)(A.Muted,{children:Ll?Rl{const t=(0,K.isSeatedHighlight)(e.status,{otherDay:Ll}),l=(0,re.guestRowText)(e,{name:e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)',''),seated:t}),s=t?K.SEATED_FG:U.colours.text,i=t?K.SEATED_MUTED:U.colours.muted,o=t?K.SEATED_FG:U.colours.gold,n=l.depositWarn?U.colours.amber:t?K.SEATED_FG:U.colours.goldLight;return(0,He.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:Ll?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Gt(!1),Vt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,K.seatedHighlightStyle)({backgroundColor:e?U.colours.goldLight:U.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:U.colours.hairline,backgroundColor:e?U.colours.tilePressed:'transparent'},children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,He.jsx)(H.default,{style:{paddingTop:2},children:(0,He.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':U.colours.amber,ink:t?U.colours.gold:U.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,He.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,He.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,He.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,He.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,He.jsx)(H.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,He.jsx)(de.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,He.jsx)(Ce.CancellationsSection,{items:Zl,dayWord:Ll?zl?Wl.toLowerCase():`on ${Wl}`:'today'})]}),_s=(0,He.jsx)(M.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Ns}),Gs=W.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Gt(!1)}}),Fs=(0,He.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Os}, ${As.length}`,accessibilityState:{expanded:_t},'aria-expanded':_t,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Gt(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:_t?U.colours.gold:U.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?U.colours.tilePressed:_t?U.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,He.jsx)(A.T,{size:16,weight:"bold",colour:U.colours.gold,children:As.length}),(0,He.jsx)(H.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(H.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,He.jsxs)(A.T,{size:13,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,children:[Os," ",_t?'\u2039':'\u203a']})})})]}),Vs=_t?(0,He.jsxs)(H.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,He.jsxs)(H.default,{testID:"guests-drawer",...Gs.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ve)),backgroundColor:U.colours.surface,borderRightWidth:1,borderColor:U.colours.gold,borderRadius:14,...$e.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Os.toUpperCase()," (",As.length,")"]}),Xl.count?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:es}):null,(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Os}`,onPress:()=>Gt(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:18,colour:U.colours.muted,children:"\u2715"})})]}),_s]}),(0,He.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Os}`,accessibilityRole:"button",onPress:()=>Gt(!1),style:{flex:1}})]}):null,Us=Gl?Fl:l.IS_KIRKTON&&!Object.values(st.kitchenHours??{}).some(Boolean)?(0,He.jsxs)(H.default,{testID:"kirkton-hours-to-confirm",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,He.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,He.jsx)(ke.DayGraph,{busyThreshold:(0,t.venueBusy)(st,ot,dt).busy,todays:Ml,open:El,close:Al,now:dt,turnBase:st.settings.turnMins,blocks:ts,pauses:Nl,compact:Ke,dense:!Ke,height:Ye?Rs:Bs,forecastNote:Ll?void 0:ds,emptyText:Vl,past:Rl{Ll?Gt(!0):vt('timeline')},Qs=(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',padding:Ue<820?8:12,paddingTop:Ue<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[pt?null:Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[pt?null:Ss,pt?(0,He.jsx)(M.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"})}):vs?Ds:Is,Vs]}),(0,He.jsxs)(H.default,{testID:"display-side",style:{width:Je,gap:Ue<820?4:8,minHeight:0},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:$s(!1)}),(0,He.jsx)(H.default,{style:{flexShrink:0},children:Cs}),pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:Ue<820,snug:Ue<820,tight:Ue<700,aside:`${Yl.length} ${1===Yl.length?'table':'tables'} booked${fl.length?` \xb7 ${fl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{ref:zs,testID:"day-graph-slot",onLayout:Hs,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Ks}),(0,He.jsxs)(M.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,He.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,He.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),Es,(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt})]})]})]});return(0,He.jsxs)(E.SafeAreaView,{style:{flex:1,backgroundColor:U.colours.bg},onTouchStart:()=>{Qt.current=Date.now()},onMouseDown:()=>{Qt.current=Date.now()},children:[Ke?(0,He.jsxs)(H.default,{style:{flex:1},children:[(0,He.jsxs)(M.default,{ref:Xe,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,He.jsx)(H.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,He.jsx)(f.ExitButton,{})}),(0,He.jsx)(_.RestaurantLogo,{rid:lt,size:64}),(0,He.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:st.name}),(0,He.jsx)(_.PoweredBy,{}),(0,He.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,He.jsx)(H.default,{accessible:!0,accessibilityLabel:`Current time ${(0,F.hm)(dt)}`,children:(0,He.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:U.colours.goldLight,children:(0,F.hm)(dt)})}),(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:"m"}),(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:"m"}),G]}),Le,qs,(0,He.jsx)(H.default,{testID:"phone-glance",style:{width:'100%'},children:(0,He.jsx)(Ne,{phone:!0,split:Jl,items:[{label:`Tables \xb7 ${Wl}`,value:Yl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Wl}`,value:Ql,testID:'badge-covers'},{label:'Takeaway',value:fl.length,alert:fl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Mt(!0)}]})}),(0,He.jsx)(H.default,{testID:"primary-actions",style:{gap:8},children:$s(!0)}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),Cs,(0,He.jsx)(H.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:vs?Ds:Is}),(0,He.jsxs)(H.default,{onLayout:e=>{Ze.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[$e.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,He.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:U.colours.goldLight,accessibilityRole:"header",children:[Os," (",As.length,")"]}),(0,He.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{gap:4},children:Ns})]}),Es,Ks,(0,He.jsx)(H.default,{testID:"covers-dock",children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Xe.current?.scrollTo({y:Ze.current,animated:!0})})}),(0,He.jsxs)(H.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,He.jsx)(A.T,{center:!0,size:14,colour:mt?U.colours.muted:U.colours.amber,children:mt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,He.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,He.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ps]}),e?null:(0,He.jsx)(H.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:U.colours.hairline},children:(0,He.jsx)(R.VoiceSlot,{size:56})})]}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ve>=1e3?18:14,paddingVertical:Ue<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...$e.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,He.jsx)(H.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,He.jsx)(_.RestaurantBrand,{rid:st.id,size:Ve<900?32:40,beside:!0})}),(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,He.jsx)(A.T,{size:Ve<900?18:21,weight:"semibold",colour:U.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,F.hm)(dt)}),Ve>=900?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:(0,F.niceDate)(dt)}):null]})]}),pt?(0,He.jsx)(H.default,{style:{width:220}}):(0,He.jsx)(H.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:qs}),(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:Ve<900?'xs':Ve<1100||Ue<700?'s':'m'}),(0,He.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.muted,children:"?"})}),'simulated'===rt?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>at(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:11,colour:U.colours.muted,children:"+15"})}):null,e?null:(0,He.jsx)(f.ExitButton,{}),G,We?null:(0,He.jsx)(R.VoiceSlot,{size:44})]})]}),Le,pt?null:(0,He.jsxs)(H.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,He.jsx)(Ne,{splitOnly:!0,split:Jl,items:[]}),(0,He.jsx)(H.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ve>=1e3?18:14)+(e?0:52)+('simulated'===rt?52:0),zIndex:4},children:(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:Ve<1100||Ue<700?'s':'m'})})]}),Ye?Qs:(Js=(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"front-door-bar",style:{gap:10},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:$s(!1)}),Cs]}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),pt?(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"}):(0,He.jsx)(He.Fragment,{children:(0,He.jsxs)(H.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Ss,vs?Ds:Is,Vs]})]})}),Es,pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Bs+ke.DAY_GRAPH_CHROME},children:Ks})]}),(0,He.jsx)(M.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:Js})),Ps]}),(0,He.jsx)(j.SoldOutStrip,{rid:lt,by:bt,onOpen:()=>ol(!0)}),(0,He.jsx)(w.SoldOutSheet,{visible:il,onClose:()=>ol(!1),rid:lt,by:bt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,He.jsx)(y.TableOrderCue,{rid:lt}),xt.elements,Ht?(0,He.jsx)(b.EditBookingPicker,{rid:lt,today:yt,who:bt,hidePrivate:!0,onClose:()=>Pt(!1)}):null,Et?(0,He.jsx)(b.EditBookingSheet,{rid:lt,id:Et,who:bt,hidePrivate:!0,onClose:()=>At(null)}):null,Tt?(0,He.jsx)(ye.TableSheet,{rid:lt,name:Tt,view:kl,plan:wt,todays:pl,now:dt,privacy:mt,turnBase:st.settings.turnMins,onClose:()=>$t(null),onWalkIn:e=>xt.openWalkInAt(e),onMove:e=>Rt(e),onDetails:yl}):null,Kl?(()=>{const e=Ul[Kl],t=e?.dayBookings??[];return(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>ql(null),title:`${(0,r.tableNumbers)(Kl)} \xb7 ${zl?Wl:(0,De.dayLong)(Rl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${zl?Wl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${zl?Wl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,ae.privName)(e,mt):Ee(e.name);return(0,He.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,ge.tablesWords)((0,J.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{ql(null),Vt(e.id)},style:{minHeight:56}},e.id)}),(0,He.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>ql(null),style:{minHeight:56}})]})})():null,Ft?(()=>{const e=ot.find(e=>e.id===Ft);return e?(0,He.jsx)(ce.GuestActionsSheet,{rid:lt,b:e,name:e.walkIn?(0,ae.privName)(e,mt):Ee(e.name),view:kl,now:dt,otherDay:e.date!==yt,turnBase:st.settings.turnMins,onClose:()=>Vt(null),onDetails:yl,onDone:dl,onPickOnPlan:(e,t)=>{Gt(!1),vt('plan'),Ct('all'),Kt({id:e.id,tables:t})}}):null})():null,Lt?(0,He.jsx)(ye.DetailsPanel,{title:Lt.title,onClose:()=>Wt(null),children:Lt.body}):null,Ot?(0,He.jsx)(ye.ServiceSummary,{r:st,todays:pl,orders:it,waitlistAll:Xt,walkInCount:Zt,onClose:()=>Nt(!1)}):null,el?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>tl(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,He.jsx)(h.FloorLegend,{}),(0,He.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>tl(!1)})]}):null,ll?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>sl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,He.jsx)(O.ReviewsSection,{rid:lt,mode:"read",venueName:st.name}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>sl(!1)})]}):null,zt?(0,He.jsxs)(ye.DetailsPanel,{title:"Takeaway",onClose:()=>Mt(!1),children:[(0,He.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,He.jsx)(Ge,{list:fl,me:bt,bookings:ot})]}):null,cl?(0,He.jsx)(H.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:U.colours.bg},children:(0,He.jsx)(le.PlanDesigner,{initial:wt,venue:st.name,mode:"display",startStep:"arrange",onActivity:()=>{hl.current=Date.now(),null!==gl&&bl(null)},notice:null!==gl?`Locking again in ${gl} s \xb7 touch to keep editing`:null,onSave:e=>{J.useFloor.getState().setPlan(lt,e),ul(null),dl('Table plan saved. Editing is locked again.')},onCancel:()=>{ul(null),dl('No changes kept. Editing is locked again.')}},cl.at)}):null,e?null:(0,He.jsx)(oe.Screensaver,{rid:lt,idleMins:ft.idleMins,pinOn:ft.pinOn,wake:ft,tonightCards:ft.tonightCards,cfg:jt}),e?null:(0,He.jsx)(xe.PrintHost,{rid:lt}),e?null:(0,He.jsx)(pe.AlertHost,{variant:"display",rid:lt,skipTakeaway:!0}),e?null:(0,He.jsx)(B.SeatAllergenReminder,{rid:lt}),e?null:(0,He.jsx)(fe.TakeawayTakeover,{rid:lt,me:bt})]});var Js};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),z=e(_r(_d[31])),M=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=_r(_d[35]),A=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),ze=_r(_d[85]),Me=_r(_d[86]),He=_r(_d[87]);const Pe=12e4,Ee=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Oe=e=>e.slotTime?(0,F.hm)(new Date(e.slotTime)):'ASAP';function Ne({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,He.jsxs)(H.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,He.jsx)(H.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,He.jsxs)(H.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,He.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?U.colours.amber:U.colours.text,children:e.value}),(0,He.jsx)(A.T,{size:l?14:12,colour:U.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,He.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,He.jsx)(H.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,He.jsx)(A.T,{size:14,colour:U.colours.muted,children:"No Covers yet"}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:U.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,He.jsxs)(H.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:U.colours.gold},children:[(0,He.jsx)(H.default,{style:{width:`${s.walkInPct}%`,backgroundColor:U.colours.gold}}),(0,He.jsx)(H.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function _e({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,He.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,He.jsx)(H.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,He.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?U.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,He.jsx)(A.T,{size:12,colour:U.colours.muted,children:l}):null]})}function Ge({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,We.statusBlock)(e,t,(0,We.linkedBooking)(e,s));return e.length?(0,He.jsx)(H.default,{style:{gap:8},children:e.map(e=>(0,He.jsxs)(H.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:U.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?U.colours.ok:e.allergies.length?U.colours.red:U.colours.gold},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Oe(e)," \xb7 ",Ee(e.customerName)]}),(0,He.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,He.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:U.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,G.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,He.jsx)(Le.AllergyChain,{o:e,me:t,compact:!0}):null,(0,He.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,He.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>V.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,He.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,He.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'collected',t)}):null,(0,He.jsx)(xe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,He.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Fe({rid:e,id:t,turnBase:l}){const s=(0,V.useBookings)(e).find(e=>e.id===t);return s?(0,He.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1274,[1121,5,6,1275,798,822,1094,829,1120,1276,1277,1278,1091,1115,1279,1280,1282,1283,1284,1130,977,1099,1285,34,1073,1148,1033,1087,1116,1286,380,402,295,102,426,36,794,1176,1180,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1287,1107,1288,1291,1293,1296,1299,1295,1300,1302,1303,1112,1093,1095,852,1305,1165,1306,1175,1167,1011,1311,1319,1321,1076,1114,1323,1324,1325,1143,1326,1142,1136,838,1327,1328,25]); +__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Ee}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:F,subHeader:We,noVoice:Me=!1}={}){const Ne=(0,E.default)(),Ue=g??Ne.width,Ke=Ne.height,qe=Ue<700,Ye=Ue>=Ke,Qe=!qe&&Ye&&Ue>=600,Je=Qe,Xe=Math.round(Math.min(520,Math.max(Ue>=1e3?448:280,.3*Ue))),Ze=S.default.useRef(null),et=S.default.useRef(0),[tt,lt]=(0,v.useState)({w:0,h:0}),st=(0,Y.useOwner)(e=>e.site),it=(0,U.useRestaurant)(st);(0,je.useAlertWatcher)(st,{enabled:!e});const ot=(0,U.useOrders)(st),nt=(0,U.useBookings)(st),at=(0,U.useEvents)(st),rt=(0,U.useStore)(e=>e.skipMinutes),dt=(0,U.useStore)(e=>e.clock.mode),ct=(0,U.useNow)(5e3),ut=(0,Y.useOwner)(e=>e.staff),ht=(0,Y.useOwner)(e=>e.attendance),gt=(0,Y.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,J.ensureAttendance)((0,V.ymd)(ct),ct)},[(0,V.ymd)(ct)]);const bt=ht.filter(e=>e.in&&!e.out&&ct.getTime()-new Date(e.in).getTime()<72e6&&ct.getTime()>=new Date(e.in).getTime()),yt=Oe(ut.find(e=>e.id===bt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,yt,!e);const pt=(0,V.ymd)(ct),xt=(0,T.useTravelDay)('display',pt),ft=(0,Q.useFrontDoor)(pt,Ye),mt=(0,X.useDisplaySettings)(st),jt=mt.privacy,wt=(0,ae.useSaverSync)(),kt=(0,X.usePlan)(st),It=(0,X.useFloor)(e=>e.live[st]),Dt=(0,we.useBlocks)(e=>e.blocks),[vt,St]=(0,v.useState)('plan'),[Ct,Tt]=(0,v.useState)(!1),[$t,Bt]=(0,v.useState)('all'),[Rt,Lt]=(0,v.useState)(null),[Wt,Mt]=(0,v.useState)(null),[zt,Ht]=(0,v.useState)(null),[Pt,Et]=(0,v.useState)(!1),[Ot,At]=(0,v.useState)(!1),[Nt,_t]=(0,v.useState)(null),[Gt,Ft]=(0,v.useState)(!1),[Vt,Ut]=(0,v.useState)(!1),[Kt,qt]=(0,v.useState)(null),[Yt,Qt]=(0,v.useState)(null),[Jt,Xt]=(0,v.useState)(null),Zt=S.default.useRef(0),el=e=>{Zt.current=Date.now(),Xt(e)};S.default.useEffect(()=>{if(!Jt)return;const e=setInterval(()=>{Date.now()-Zt.current>=ve.DAY_IDLE_MS&&Xt(null)},5e3);return()=>clearInterval(e)},[Jt]);const tl=(0,U.useWaitlist)(st),ll=(0,U.useStore)(e=>e.walkIns[st]??0),[sl,il]=(0,v.useState)(!1),[ol,nl]=(0,v.useState)(!1),[al,rl]=(0,v.useState)(!1);(0,_.useReviewAlerts)(st);const[dl,cl]=(0,v.useState)({view:0,content:0}),[ul,hl]=(0,v.useState)(null);S.default.useEffect(()=>{ul&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:ul,timeoutMs:4500,big:!0,testID:'floor-toast'}),hl(null))},[ul]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[gl,bl]=(0,v.useState)(null),yl=S.default.useRef(0),[pl,xl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!gl)return;yl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-yl.current;if(e>=Ee)return bl(null),void hl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');xl(e>=105e3?Math.ceil((Ee-e)/1e3):null)},1e3);return()=>clearInterval(e)},[gl]);const fl=e=>e.date!==pt?Ht({title:`Guest details \xb7 ${(0,ve.dayWord)(e.date,pt)} ${e.time}`,body:(0,Pe.jsx)(Pe.Fragment,{children:(0,pe.bookingDetails)(e)})}):Ht({title:`Guest details \xb7 ${e.time}`,body:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ve,{rid:st,id:e.id,turnBase:it.settings.turnMins}),e.walkIn?null:(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Ht(null),_t(e.id)},style:{minHeight:56}}),e.walkIn?(0,Pe.jsx)(he.CancelWalkInButton,{rid:st,b:e,big:!0,onDone:e=>{Ht(null),hl(e)}}):null,e.walkIn?(0,Pe.jsx)(he.ReinstateWalkInButton,{rid:st,b:e,today:pt,onDone:e=>{Ht(null),hl(e)}}):null,(0,pe.bookingDetails)(e)]})}),ml=nt.filter(e=>e.date===pt).sort((e,t)=>e.time.localeCompare(t.time)),jl=ml.filter(e=>!['cancelled','noshow'].includes(e.status)),wl=ot.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),kl=(0,v.useMemo)(()=>(0,d.forecastToday)(it,nt,ot,at,ct),[it,nt,ot,at,ct.getTime()/6e4|0]),Il=(0,we.closedAreasAt)(Dt,st,pt,(0,V.hm)(ct)),Dl=[...Il].join(','),vl=(0,v.useMemo)(()=>(0,Z.floorView)(kt,nt,ot,It??{},ct,it.settings.turnMins,Il),[kt,nt,ot,It,ct.getTime(),Dl]),Sl=(0,ye.hoursFor)(it,ct),Cl=Sl?.open??new Date(`${pt}T12:00:00`),Tl=Sl?.close??new Date(`${pt}T21:00:00`),$l=(0,V.addMins)(Cl,-Cl.getMinutes()),Bl=(0,V.addMins)(Tl,90),Rl=e=>new Date(`${pt}T${e}:00`),Ll=(0,we.blocksOn)(Dt,st,pt).map(e=>({from:Rl(e.from),to:Rl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(it,ct,pt)),Wl=Object.keys(vl).filter(e=>'blocked'===vl[e]?.status),Ml=Jt&&Jt!==pt?Jt:pt,zl=Ml!==pt,Hl=(0,ve.dayWord)(Ml,pt),Pl=/^(Today|Yesterday|Tomorrow)$/.test(Hl),El=zl?(0,ve.bookingsForDay)(nt,Ml,pt).sort((e,t)=>e.time.localeCompare(t.time)):ml,Ol=(0,V.parseYmd)(Ml);Ol.setHours(12);const Al=zl?(0,ye.hoursFor)(it,Ol):Sl,Nl=Al?.open??new Date(`${Ml}T12:00:00`),_l=Al?.close??new Date(`${Ml}T21:00:00`),Gl=e=>new Date(`${Ml}T${e}:00`),Fl=[...zl?(0,we.blocksOn)(Dt,st,Ml).map(e=>({from:Gl(e.from),to:Gl(e.to),label:e.reason??'Paused'})):Ll,...zl?(0,i.queuedServicePauses)(it,Ol,Ml):[]],Vl=(0,i.queuedServiceSessions)(it,Ol),Ul=l.IS_QUEUED_VENUE&&(void 0===Vl||!Vl.length),Kl=(0,Pe.jsxs)(P.default,{testID:"queued-hours-gate",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:void 0===Vl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Pe.jsx)(A.Muted,{children:s.queuedVenues[st]?.hours.note})]}),ql=zl?Al||El.length?Mlzl?(0,Z.dayFloorView)(kt,El,Ml):vl,[zl,kt,El,Ml,vl]),[Ql,Jl]=(0,v.useState)(null),Xl=zl?El.filter(e=>!['cancelled','noshow'].includes(e.status)):jl,Zl=Xl.reduce((e,t)=>e+t.partySize,0),es=(0,c.coversSplit)(Xl,Ml),ts=(0,Se.cancelledDayTally)(nt,Ml),ls=(0,Ce.cancellationsFor)(nt,Ml,e=>e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)','')),ss=(0,Se.cancelledTallyWords)(ts,Pl?Hl.toLowerCase():zl?`on ${Hl}`:'today'),is=Dt.filter(e=>e.rid===st&&e.date===Ml&&!e.removedAt),os=(0,De.chartBands)(is,60*Nl.getHours()+Nl.getMinutes(),60*_l.getHours()+_l.getMinutes()),ns=new Set((0,De.blockedHours)(os)),as=ct.getHours()+(ct.getMinutes()>=30?1:0),rs=kl.hours.filter(e=>e.hour>=as&&!ns.has(e.hour)),ds=rs.reduce((e,t)=>e+t.coversHigh,0),cs=rs.reduce((e,t)=>e+t.coversLow,0),us=Math.round((cs+ds)/2),hs=!kl.example&&kl.open&&kl.enough&&ds>0?`Usually ${(0,d.coversRange)(us,us)} more`:void 0,gs=async(e,t)=>{const l=vl[e]?.booking;if(!l||e===t)return;const s=vl[t]?.status;if(s&&!['free','soon'].includes(s))return void hl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${Z.STATUS[s].label.toLowerCase()}. Pick a free table.`);await U.repo.bookings.update(l.id,{table:t});const i=It?.[e]?.stage;X.useFloor.getState().setLive(st,t,{stage:i??'seated',dirty:!1}),X.useFloor.getState().setLive(st,e,{stage:void 0,dirty:!0}),hl(`${(0,re.privName)(l,jt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},bs=Yt?nt.find(e=>e.id===Yt.id):void 0,ys=Yt&&bs?(()=>{const e=bs.walkIn?(0,re.privName)(bs,jt):Oe(bs.name),t=(0,be.seatsOf)(kt,Yt.tables).total,l=(0,be.seatLine)(t,bs.partySize),s=(0,be.pickClashes)(bs,Yt.tables,nt.filter(e=>e.date===bs.date),it.settings.turnMins),i=(0,be.tableKey)(Yt.tables)!==(0,be.tableKey)((0,X.tablesOf)(bs.table));return(0,Pe.jsxs)(P.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:K.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,padding:10},children:[(0,Pe.jsxs)(P.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,ve.dayWord)(bs.date,pt)} ${bs.time}. Tap tables on the plan to add or take them off. ${(0,be.tablesWords)(Yt.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,ve.dayWord)(bs.date,pt)," ",bs.time]}),(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[(0,be.tablesWords)(Yt.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,Pe.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,Pe.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,be.tablesWords)(Yt.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(bs){try{await(0,ge.saveBookingTables)(st,bs,Yt.tables),hl((0,be.savedWords)(e,bs.partySize,Yt.tables,t))}catch(t){hl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Qt(null)}else Qt(null)}}),(0,Pe.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Qt(null)})]})]})})():null,ps=kt.areas.filter(e=>kt.tables.some(t=>t.areaId===e.id)),xs=e=>{const t=kt.tables.filter(t=>t.areaId===e);return zl?`${t.filter(e=>!Yl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(vl[e.name]?.status??'free')).length}/${t.length} free`},fs='all'===$t||ps.some(e=>e.id===$t)?$t:'all',ms=e=>(0,Pe.jsx)(ee.FloorCanvas,{plan:kt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Qe,big:!0,view:Yl,privacy:jt,turnBase:it.settings.turnMins,highlight:Yt?Yt.tables:Wt?[Wt]:void 0,onTap:e=>{return t=e.name,void(Yt?Qt(e=>e?{...e,tables:(0,be.toggleTable)(e.tables,t)}:e):zl?Jl(t):Wt?(t!==Wt&&gs(Wt,t),Mt(null)):Lt(t));var t},onDrop:(e,t)=>Yt||zl?void 0:gs(e.name,t.name)}),js=qe?1:Ye||ps.length>2?2:1,ws=e=>{const t=kt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ks=[];for(let e=0;e{const t=(0,ee.areaBounds)(kt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ee.minReadableScale)(kt,e.id)}}),tt.w,tt.h):null,Ds=e=>(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',height:te.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:xs(e.id)})]}),vs=(0,Pe.jsx)(P.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-tt.w)>1||Math.abs(l-tt.h)>1)&<({w:t,h:l})},children:Is?(0,Pe.jsx)(H.default,{style:{flex:1},scrollEnabled:Is.scroll,showsVerticalScrollIndicator:Is.scroll,contentContainerStyle:{gap:te.GRID_GAP},children:Is.rows.map((e,t)=>(0,Pe.jsx)(P.default,{style:{height:Is.rowHeights[t],flexDirection:'row',gap:te.GRID_GAP},children:e.map(e=>{const t=ps.find(t=>t.id===e);return(0,Pe.jsxs)(P.default,{testID:`area-cell-${e}`,style:{width:Is.cellW,gap:2},children:[Ds(t),(0,Pe.jsx)(P.default,{style:{flex:1},children:ms(e)})]},e)})},t))}):null}),Ss=(0,Pe.jsxs)(P.default,{testID:"venue-plan",style:{flex:qe?void 0:1,gap:10,minWidth:0},children:[(0,Pe.jsx)(a.TableNumberWarning,{plan:kt}),kt.tables.length?null:(0,Pe.jsxs)(P.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Pe.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Pe.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,Pe.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Pe.jsx)(Ge,{chipId:"all",compact:!qe,label:"Whole venue",selected:'all'===fs,onPress:()=>Bt('all')},"__all"),...ps.map(e=>(0,Pe.jsx)(Ge,{chipId:e.id,compact:!qe,label:`${e.name}${(0,le.areaMarks)(e)}`,colour:(0,K.brandColour)(e.colour),sub:qe?Il.has(e.id)?'closed':fs===e.id?xs(e.id):void 0:void 0,selected:fs===e.id,onPress:()=>Bt(e.id)},e.id))];return qe?(0,Pe.jsx)(P.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Pe.jsx)(H.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;cl(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>cl(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:dl.view>0&&dl.content>0&&dl.content<=dl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:dl.view>0&&dl.content<=dl.view+1?'100%':void 0},children:e})})(),(0,Pe.jsx)(h.FloorLegend,{}),ys,Wt?(0,Pe.jsxs)(A.Row,{gap:8,style:{backgroundColor:K.colours.goldTint,borderRadius:10,padding:8},children:[(0,Pe.jsxs)(A.T,{weight:"semibold",colour:K.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Wt),": tap the new table."]}),(0,Pe.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Mt(null)})]}):null,'all'===fs&&Qe?vs:'all'===fs?(0,Pe.jsx)(P.default,{style:{flex:qe?void 0:1,gap:12,minHeight:Je?void 0:360},children:ks.map((e,t)=>(0,Pe.jsxs)(P.default,{style:{flex:qe?void 0:Math.max(.3,...e.map(e=>ws(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Pe.jsxs)(P.default,{style:{flex:1,gap:2},children:[qe?(0,Pe.jsxs)(P.default,{style:{alignItems:'center',gap:4},children:[(0,Pe.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{center:!0,children:xs(e.id)})]}):(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{children:xs(e.id)})]}),(0,Pe.jsx)(P.default,{style:qe?{height:Math.max(280,Math.round((Ue-40)*ws(e.id)))}:{flex:1},children:ms(e.id)})]},e.id)),e.length{if(zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},Ml)}),Ts='timeline'===vt,$s=Ct?(0,Pe.jsx)(W.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Tt(!1),supportedOrientations:['landscape','portrait'],children:(0,Pe.jsxs)(P.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:K.colours.bg,padding:10,gap:8},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Pe.jsx)(z.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Tt(!1),style:{minHeight:64,minWidth:180,paddingHorizontal:22,borderRadius:16,borderWidth:2,borderColor:K.colours.goldLight,backgroundColor:K.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Pe.jsx)(P.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Pe.jsx)(A.T,{size:22,weight:"semibold",colour:K.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${zl?(0,ve.dayLong)(Ml):'Today'}`})}),(0,Pe.jsx)(P.default,{style:{minWidth:180}})]}),Ul?Kl:(0,Pe.jsx)(P.default,{style:{flex:1,minHeight:0},children:(0,Pe.jsx)(oe.Timeline,{hideNow:!0,plan:kt,bookings:zl?El:ml,now:zl?Nl:ct,privacy:jt,turnBase:it.settings.turnMins,t0:zl?(0,V.addMins)(Nl,-Nl.getMinutes()):$l,t1:zl?(0,V.addMins)(_l,90):Bl,pauses:zl?Fl:Ll,blockedTables:zl?[]:Wl,onOpen:e=>{if(Tt(!1),zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},`full-${Ml}`)})]})}):null,Bs=zl?(0,Pe.jsxs)(P.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,backgroundColor:K.colours.goldTint},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:Pl?`Showing ${Hl} \xb7 ${(0,V.niceDate)((0,V.parseYmd)(Ml))}`:`Showing ${(0,ve.dayWord)(Ml,pt)}`}),(0,Pe.jsx)(P.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${ss}. Showing ${(0,ve.dayLong)(Ml)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Pe.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Qt(null),el(null)},style:{minHeight:44}})]}):null,Rs=(0,Pe.jsx)(P.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:qe?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(Ts||Ct);return(0,Pe.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},accessibilityHint:'timeline'===e?'Opens the timeline over the whole screen':void 0,onPress:()=>{'timeline'===e?(St('plan'),Tt(!0)):(Tt(!1),St('plan'))},style:{flex:qe?1:void 0,minHeight:qe?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?K.colours.gold:'transparent',...Be.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,Pe.jsx)(A.T,{size:qe?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ls=(0,u.useBookingWrite)(),Ws=e=>(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Walk-in",onPress:ft.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"New booking",onPress:ft.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Edit booking",onPress:()=>At(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint})]});(0,He.useDisplayNotices)(st,!e);const Ms=qe?180:168,[zs,Hs]=(0,v.useState)(Ms),Ps=S.default.useRef(Ms),Es=S.default.useRef(null),Os=S.default.useRef(null),As=()=>{const e=Es.current,t=Os.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ke<820?8:12,o=44+(Ke<820?4:8),n=i>Ps.current?Math.ceil(i-Ps.current):Ie.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Ms,Math.floor(t-s-l)-n-o));Math.abs(Ps.current-a)>=2&&(Ps.current=a,Hs(a))})})};S.default.useEffect(()=>{const e=setTimeout(As,60);return()=>clearTimeout(e)},[Ue,Ke]);const Ns=(0,Pe.jsxs)(P.default,{ref:Os,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),As()},style:{flexDirection:'row',flexWrap:Ue>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:qe?12:6,justifyContent:qe?'center':void 0,borderTopWidth:1,borderTopColor:K.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Pe.jsx)(ze.DisplayClockButton,{}),(0,Pe.jsx)(ie.HoldToEdit,{quiet:!0,onUnlock:()=>{xl(null),bl({at:Date.now()})},onHint:()=>hl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Pe.jsx)(ke.BlockBookingsButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,display:!0,day:Ml}),kt.areas.some(e=>e.outdoor)?(0,Pe.jsx)(ke.CloseGardenButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,short:!0}):null,(0,Pe.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>rl(!0),style:({pressed:e})=>({...Be.look.quiet(e),flexGrow:1}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,Pe.jsx)(p.GiftQrButton,{rid:st,venue:it.name})]}),_s=wl.length?(0,Pe.jsxs)(P.default,{testID:"takeaway-panel",style:[Be.look.panel,{overflow:'hidden'}],children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Pe.jsxs)(A.T,{size:12,colour:K.colours.muted,children:[wl.length," live"]})]}),(0,Pe.jsx)(P.default,{style:{padding:10},children:(0,Pe.jsx)(Fe,{list:wl,me:yt,compact:!0,bookings:nt})})]}):null,Gs=($e.DueToday,zl?El:ml.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Fs=zl?Pl?`${Hl}\u2019s guests`:`Guests ${Hl}`:'Today\u2019s guests',Vs=(0,Pe.jsxs)(Pe.Fragment,{children:[0===Gs.length?(0,Pe.jsx)(A.Muted,{children:zl?Ml{const t=(0,q.isSeatedHighlight)(e.status,{otherDay:zl}),l=(0,de.guestRowText)(e,{name:e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)',''),seated:t}),s=t?q.SEATED_FG:K.colours.text,i=t?q.SEATED_MUTED:K.colours.muted,o=t?q.SEATED_FG:K.colours.gold,n=l.depositWarn?K.colours.amber:t?q.SEATED_FG:K.colours.goldLight;return(0,Pe.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:zl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Ut(!1),qt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,q.seatedHighlightStyle)({backgroundColor:e?K.colours.goldLight:K.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:K.colours.hairline,backgroundColor:e?K.colours.tilePressed:'transparent'},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Pe.jsx)(P.default,{style:{paddingTop:2},children:(0,Pe.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':K.colours.amber,ink:t?K.colours.gold:K.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Pe.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,Pe.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,Pe.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,Pe.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,Pe.jsx)(P.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Pe.jsx)(ce.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,Pe.jsx)(Te.CancellationsSection,{items:ls,dayWord:zl?Pl?Hl.toLowerCase():`on ${Hl}`:'today'})]}),Us=(0,Pe.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Vs}),Ks=M.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Ut(!1)}}),qs=(0,Pe.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Fs}, ${Gs.length}`,accessibilityState:{expanded:Vt},'aria-expanded':Vt,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Ut(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:Vt?K.colours.gold:K.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?K.colours.tilePressed:Vt?K.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Pe.jsx)(A.T,{size:16,weight:"bold",colour:K.colours.gold,children:Gs.length}),(0,Pe.jsx)(P.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(P.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Pe.jsxs)(A.T,{size:13,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,children:[Fs," ",Vt?'\u2039':'\u203a']})})})]}),Ys=Vt?(0,Pe.jsxs)(P.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Pe.jsxs)(P.default,{testID:"guests-drawer",...Ks.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ue)),backgroundColor:K.colours.surface,borderRightWidth:1,borderColor:K.colours.gold,borderRadius:14,...Be.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Fs.toUpperCase()," (",Gs.length,")"]}),ts.count?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:ss}):null,(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Fs}`,onPress:()=>Ut(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:18,colour:K.colours.muted,children:"\u2715"})})]}),Us]}),(0,Pe.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Fs}`,accessibilityRole:"button",onPress:()=>Ut(!1),style:{flex:1}})]}):null,Qs=Ul?Kl:l.IS_KIRKTON&&!Object.values(it.kitchenHours??{}).some(Boolean)?(0,Pe.jsxs)(P.default,{testID:"kirkton-hours-to-confirm",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Pe.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,Pe.jsx)(Ie.DayGraph,{busyThreshold:(0,t.venueBusy)(it,nt,ct).busy,todays:El,open:Nl,close:_l,now:ct,turnBase:it.settings.turnMins,blocks:is,pauses:Fl,compact:qe,dense:!qe,height:Qe?zs:Ms,forecastNote:zl?void 0:hs,emptyText:ql,past:Ml{zl?Ut(!0):Tt(!0)},ei=(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',padding:Ke<820?8:12,paddingTop:Ke<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[xt?null:qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[xt?null:Bs,xt?(0,Pe.jsx)(H.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"})}):Ts?Cs:Ss,$s,Ys]}),(0,Pe.jsxs)(P.default,{testID:"display-side",style:{width:Xe,gap:Ke<820?4:8,minHeight:0},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Ws(!1)}),(0,Pe.jsx)(P.default,{style:{flexShrink:0},children:Rs}),xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:Ke<820,snug:Ke<820,tight:Ke<700,aside:`${Xl.length} ${1===Xl.length?'table':'tables'} booked${wl.length?` \xb7 ${wl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{ref:Es,testID:"day-graph-slot",onLayout:As,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Js}),(0,Pe.jsxs)(H.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,Pe.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Pe.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),_s,(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt})]})]})]});return(0,Pe.jsxs)(O.SafeAreaView,{style:{flex:1,backgroundColor:K.colours.bg},onTouchStart:()=>{Zt.current=Date.now()},onMouseDown:()=>{Zt.current=Date.now()},children:[qe?(0,Pe.jsxs)(P.default,{style:{flex:1},children:[(0,Pe.jsxs)(H.default,{ref:Ze,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Pe.jsx)(P.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Pe.jsx)(f.ExitButton,{})}),(0,Pe.jsx)(G.RestaurantLogo,{rid:st,size:64}),(0,Pe.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:it.name}),(0,Pe.jsx)(G.PoweredBy,{}),(0,Pe.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Pe.jsx)(P.default,{accessible:!0,accessibilityLabel:`Current time ${(0,V.hm)(ct)}`,children:(0,Pe.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:K.colours.goldLight,children:(0,V.hm)(ct)})}),(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:"m"}),(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:"m"}),F]}),We,Xs,(0,Pe.jsx)(P.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Pe.jsx)(_e,{phone:!0,split:es,items:[{label:`Tables \xb7 ${Hl}`,value:Xl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Hl}`,value:Zl,testID:'badge-covers'},{label:'Takeaway',value:wl.length,alert:wl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Et(!0)}]})}),(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{gap:8},children:Ws(!0)}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),Rs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[Ts?Cs:Ss,$s]}),(0,Pe.jsxs)(P.default,{onLayout:e=>{et.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Be.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Pe.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:K.colours.goldLight,accessibilityRole:"header",children:[Fs," (",Gs.length,")"]}),(0,Pe.jsx)(P.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{gap:4},children:Vs})]}),_s,Js,(0,Pe.jsx)(P.default,{testID:"covers-dock",children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Ze.current?.scrollTo({y:et.current,animated:!0})})}),(0,Pe.jsxs)(P.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Pe.jsx)(A.T,{center:!0,size:14,colour:jt?K.colours.muted:K.colours.amber,children:jt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Pe.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,Pe.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ns]}),e?null:(0,Pe.jsx)(P.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:K.colours.hairline},children:(0,Pe.jsx)(R.VoiceSlot,{size:56})})]}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ue>=1e3?18:14,paddingVertical:Ke<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Be.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,Pe.jsx)(P.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Pe.jsx)(G.RestaurantBrand,{rid:it.id,size:Ue<900?32:40,beside:!0})}),(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Pe.jsx)(A.T,{size:Ue<900?18:21,weight:"semibold",colour:K.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,V.hm)(ct)}),Ue>=900?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:(0,V.niceDate)(ct)}):null]})]}),xt?(0,Pe.jsx)(P.default,{style:{width:220}}):(0,Pe.jsx)(P.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:Xs}),(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:Ue<900?'xs':Ue<1100||Ke<700?'s':'m'}),(0,Pe.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.muted,children:"?"})}),'simulated'===dt?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>rt(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:11,colour:K.colours.muted,children:"+15"})}):null,e?null:(0,Pe.jsx)(f.ExitButton,{}),F,Me?null:(0,Pe.jsx)(R.VoiceSlot,{size:44})]})]}),We,xt?null:(0,Pe.jsxs)(P.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,Pe.jsx)(_e,{splitOnly:!0,split:es,items:[]}),(0,Pe.jsx)(P.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ue>=1e3?18:14)+(e?0:52)+('simulated'===dt?52:0),zIndex:4},children:(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:Ue<1100||Ke<700?'s':'m'})})]}),Qe?ei:(ti=(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Ws(!1)}),Rs]}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),xt?(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"}):(0,Pe.jsx)(Pe.Fragment,{children:(0,Pe.jsxs)(P.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Bs,Ts?Cs:Ss,$s,Ys]})]})}),_s,xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Ms+Ie.DAY_GRAPH_CHROME},children:Js})]}),(0,Pe.jsx)(H.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:ti})),Ns]}),(0,Pe.jsx)(j.SoldOutStrip,{rid:st,by:yt,onOpen:()=>rl(!0)}),(0,Pe.jsx)(w.SoldOutSheet,{visible:al,onClose:()=>rl(!1),rid:st,by:yt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Pe.jsx)(y.TableOrderCue,{rid:st}),ft.elements,Ot?(0,Pe.jsx)(b.EditBookingPicker,{rid:st,today:pt,who:yt,hidePrivate:!0,onClose:()=>At(!1)}):null,Nt?(0,Pe.jsx)(b.EditBookingSheet,{rid:st,id:Nt,who:yt,hidePrivate:!0,onClose:()=>_t(null)}):null,Rt?(0,Pe.jsx)(pe.TableSheet,{rid:st,name:Rt,view:vl,plan:kt,todays:ml,now:ct,privacy:jt,turnBase:it.settings.turnMins,onClose:()=>Lt(null),onWalkIn:e=>ft.openWalkInAt(e),onMove:e=>Mt(e),onDetails:fl}):null,Ql?(()=>{const e=Yl[Ql],t=e?.dayBookings??[];return(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>Jl(null),title:`${(0,r.tableNumbers)(Ql)} \xb7 ${Pl?Hl:(0,ve.dayLong)(Ml)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${Pl?Hl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${Pl?Hl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,re.privName)(e,jt):Oe(e.name);return(0,Pe.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,be.tablesWords)((0,X.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Jl(null),qt(e.id)},style:{minHeight:56}},e.id)}),(0,Pe.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>Jl(null),style:{minHeight:56}})]})})():null,Kt?(()=>{const e=nt.find(e=>e.id===Kt);return e?(0,Pe.jsx)(ue.GuestActionsSheet,{rid:st,b:e,name:e.walkIn?(0,re.privName)(e,jt):Oe(e.name),view:vl,now:ct,otherDay:e.date!==pt,turnBase:it.settings.turnMins,onClose:()=>qt(null),onDetails:fl,onDone:hl,onPickOnPlan:(e,t)=>{Ut(!1),St('plan'),Bt('all'),Qt({id:e.id,tables:t})}}):null})():null,zt?(0,Pe.jsx)(pe.DetailsPanel,{title:zt.title,onClose:()=>Ht(null),children:zt.body}):null,Gt?(0,Pe.jsx)(pe.ServiceSummary,{r:it,todays:ml,orders:ot,waitlistAll:tl,walkInCount:ll,onClose:()=>Ft(!1)}):null,sl?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>il(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Pe.jsx)(h.FloorLegend,{}),(0,Pe.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>il(!1)})]}):null,ol?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>nl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Pe.jsx)(N.ReviewsSection,{rid:st,mode:"read",venueName:it.name}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>nl(!1)})]}):null,Pt?(0,Pe.jsxs)(pe.DetailsPanel,{title:"Takeaway",onClose:()=>Et(!1),children:[(0,Pe.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Pe.jsx)(Fe,{list:wl,me:yt,bookings:nt})]}):null,gl?(0,Pe.jsx)(P.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:K.colours.bg},children:(0,Pe.jsx)(se.PlanDesigner,{initial:kt,venue:it.name,mode:"display",startStep:"arrange",onActivity:()=>{yl.current=Date.now(),null!==pl&&xl(null)},notice:null!==pl?`Locking again in ${pl} s \xb7 touch to keep editing`:null,onSave:e=>{X.useFloor.getState().setPlan(st,e),bl(null),hl('Table plan saved. Editing is locked again.')},onCancel:()=>{bl(null),hl('No changes kept. Editing is locked again.')}},gl.at)}):null,e?null:(0,Pe.jsx)(ne.Screensaver,{rid:st,idleMins:mt.idleMins,pinOn:mt.pinOn,wake:mt,tonightCards:mt.tonightCards,cfg:wt}),e?null:(0,Pe.jsx)(fe.PrintHost,{rid:st}),e?null:(0,Pe.jsx)(xe.AlertHost,{variant:"display",rid:st,skipTakeaway:!0}),e?null:(0,Pe.jsx)(B.SeatAllergenReminder,{rid:st}),e?null:(0,Pe.jsx)(me.TakeawayTakeover,{rid:st,me:yt})]});var ti};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),M=e(_r(_d[31])),z=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=e(_r(_d[35])),O=_r(_d[36]),A=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),Me=_r(_d[85]),ze=_r(_d[86]),He=_r(_d[87]),Pe=_r(_d[88]);const Ee=12e4,Oe=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Ne=e=>e.slotTime?(0,V.hm)(new Date(e.slotTime)):'ASAP';function _e({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,Pe.jsxs)(P.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,Pe.jsx)(P.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,Pe.jsxs)(P.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,Pe.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?K.colours.amber:K.colours.text,children:e.value}),(0,Pe.jsx)(A.T,{size:l?14:12,colour:K.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Pe.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,Pe.jsx)(P.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,Pe.jsx)(A.T,{size:14,colour:K.colours.muted,children:"No Covers yet"}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:K.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,Pe.jsxs)(P.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:K.colours.gold},children:[(0,Pe.jsx)(P.default,{style:{width:`${s.walkInPct}%`,backgroundColor:K.colours.gold}}),(0,Pe.jsx)(P.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function Ge({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,Pe.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,Pe.jsx)(P.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,Pe.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?K.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,Pe.jsx)(A.T,{size:12,colour:K.colours.muted,children:l}):null]})}function Fe({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,Me.statusBlock)(e,t,(0,Me.linkedBooking)(e,s));return e.length?(0,Pe.jsx)(P.default,{style:{gap:8},children:e.map(e=>(0,Pe.jsxs)(P.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:K.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?K.colours.ok:e.allergies.length?K.colours.red:K.colours.gold},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Ne(e)," \xb7 ",Oe(e.customerName)]}),(0,Pe.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,Pe.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:K.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,F.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Pe.jsx)(We.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Pe.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Pe.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>U.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Pe.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Pe.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Pe.jsx)(fe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Pe.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Ve({rid:e,id:t,turnBase:l}){const s=(0,U.useBookings)(e).find(e=>e.id===t);return s?(0,Pe.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1274,[1121,5,6,1275,798,822,1094,829,1120,1276,1277,1278,1091,1115,1279,1280,1282,1283,1284,1130,977,1099,1285,34,1073,1148,1033,1087,1116,1286,395,380,402,295,102,426,36,794,1176,1180,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1287,1107,1288,1291,1293,1296,1299,1295,1300,1302,1303,1112,1093,1095,852,1305,1165,1306,1175,1167,1011,1311,1319,1321,1076,1114,1323,1324,1325,1143,1326,1142,1136,838,1327,1328,25]); __d(function(g,_r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.queuedServiceSessions=u,e.queuedServicePauses=function(n,t,s){const i=u(n,t);return i?i.slice(1).flatMap((n,t)=>{const u=i[t][1],r=n[0];return u!!t.walkIn||'walk-in'===t.source},1276,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useBookingWrite=function(){const t=(0,s.useSignedIn)(),c=(0,n.canChangeBookings)(t);return{ok:c,hint:c?void 0:n.BOOKING_VIEW_ONLY,lock:s=>c?{disabled:!1,accessibilityLabel:s}:{disabled:!0,accessibilityLabel:s,accessibilityHint:n.BOOKING_VIEW_ONLY}}};var n=r(d[0]),s=r(d[1])},1277,[1012,1100]); @@ -1459,7 +1459,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";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LaunchWelcome=function({p:e,onDone:t}){(0,r.useEffect)(()=>{if(!z||document.getElementById('cc-launch-css'))return;const e=document.createElement('style');e.id='cc-launch-css',e.textContent=I,document.head.appendChild(e)},[]),(0,r.useEffect)(()=>{if(z)return document.documentElement.classList.add('cc-welcome'),()=>document.documentElement.classList.remove('cc-welcome')},[]);const[o,k]=(0,r.useState)(P()?0:3),[O,N]=(0,r.useState)('main'),[W,H]=(0,r.useState)(''),[M,_]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(o<=0)return;const e=setTimeout(()=>k(e=>e-1),300);return()=>clearTimeout(e)},[o]);const B=(0,f.useAvatars)(t=>!!t.photos[e.id]),V=(0,b.useStore)(e=>e.restaurants[0]?.name??'Your venue').toUpperCase(),G=(0,x.useOwner)(t=>t.hourly[e.id]),K=(0,x.useOwner)(t=>t.staff.find(t=>t.id===e.id)),$=(0,y.useSync)(e=>e.mode),q='live'===$||'offline'===$,J=K?.salaried||e.salaried?'Salaried':null!=G?`\xa3${(G/100).toFixed(2)} an hour${K?.noTax?' \xb7 no-tax code':''}`:'connecting'===$?'Loading\u2026':'Ask your manager',Q='staff'!==e.app&&'staff'!==p.APP_VARIANT?(0,j.appUrl)('staff'):null,X=`AN-${String(v.ROSTER.findIndex(t=>t.id===e.id)+1).padStart(2,'0')}`,Z=j.APP_NAME['staff'===p.APP_VARIANT?'staff':e.app],ee=L['staff'===p.APP_VARIANT&&'staff'!==e.app?'Staff':e.level]??L.Staff;return(0,C.jsxs)(h.default,{testID:"invite-welcome",style:[u.default.absoluteFill,{backgroundColor:(0,n.soutersSurface)('#000'),zIndex:1e3}],children:[(0,C.jsxs)(h.default,{...R('space'),pointerEvents:"none",children:[(0,C.jsx)(h.default,{...R('stars1')}),(0,C.jsx)(h.default,{...R('stars2')})]}),o>0?(0,C.jsxs)(l.default,{testID:"invite-countdown",accessibilityLabel:"Skip intro",onPress:()=>k(0),style:{flex:1,alignItems:'center',justifyContent:'center',gap:10},children:[(0,C.jsxs)(E,{colour:w.colours.muted,children:[V," \xb7 COVER CHARGE"]}),(0,C.jsx)(h.default,{...R('count'),children:(0,C.jsx)(T.T,{size:120,weight:"bold",colour:A,children:o})},o),(0,C.jsx)(E,{children:"GETTING YOU ON BOARD"})]}):'selfie'===O?(0,C.jsx)(F,{p:e,onClose:e=>{N('main'),e?(H('Avatar saved. Looking good!'),_(e=>e+1)):H('')}}):(0,C.jsxs)(c.default,{contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsxs)(h.default,{...R('rise1'),style:{alignItems:'center',gap:2},children:[(0,C.jsxs)(E,{children:[V," \xb7 ",Z.toUpperCase()]}),(0,C.jsx)(T.T,{size:20,colour:w.colours.muted,center:!0,style:{marginTop:10},children:"Welcome aboard,"}),(0,C.jsx)(T.T,{size:42,weight:"bold",center:!0,style:{lineHeight:50},children:e.name})]}),(0,C.jsxs)(h.default,{...R('reveal'),style:{marginVertical:8},children:[(0,C.jsx)(h.default,{...R('orbit'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:156})})]},M),W?(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:w.colours.ok,center:!0,children:W}):null,(0,C.jsx)(h.default,{...R('rise2'),style:{alignSelf:'stretch'},children:(0,C.jsxs)(h.default,{testID:"invite-crew-card",...R('card'),style:{borderRadius:20,borderWidth:1,borderColor:'rgba(207,164,95,0.55)',overflow:'hidden',padding:18,gap:12},children:[(0,C.jsx)(h.default,{...R('sheen'),pointerEvents:"none"}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},children:[(0,C.jsx)(E,{children:"CREW ID"}),(0,C.jsx)(T.T,{size:15,weight:"semibold",colour:w.colours.muted,style:{letterSpacing:1.5},children:X})]}),(0,C.jsx)(h.default,{style:{height:2,backgroundColor:A,opacity:.7,borderRadius:1}}),(0,C.jsx)(Y,{k:"NAME",v:e.name}),(0,C.jsx)(Y,{k:"ROLE",v:(0,j.levelJob)(e.level,e.job)}),(0,C.jsx)(Y,{k:"APP",v:Z}),'owner'!==e.role?(0,C.jsx)(h.default,{testID:"invite-pay",children:(0,C.jsx)(Y,{k:"PAY",v:J})}):null,(0,C.jsx)(Y,{k:"ACCESS",v:'Owner'===e.level?'Everything':'Manager'===e.level?'Manager':'Supervisor'===e.level?'Supervisor':'Head Chef'===e.level?'Kitchen lead':'Team member'}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,C.jsx)(h.default,{...R('blink'),style:{width:10,height:10,borderRadius:5,backgroundColor:w.colours.ok}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.ok,children:"Signed in on this phone"})]})]})}),(0,C.jsxs)(h.default,{...R('rise3'),style:{alignSelf:'stretch',gap:10},children:[(0,C.jsx)(E,{children:"WHAT YOU CAN DO"}),ee.map(e=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'flex-start'},children:[(0,C.jsx)(T.T,{size:16,colour:A,children:"\u25c6"}),(0,C.jsx)(T.T,{size:16,style:{flex:1},children:e})]},e))]}),z?(0,C.jsxs)(h.default,{testID:"invite-avatar-offer",...R('rise4'),style:{alignSelf:'stretch',gap:12,borderRadius:20,padding:18,borderWidth:1,borderColor:'rgba(255,255,255,0.14)',backgroundColor:'rgba(255,255,255,0.03)'},children:[(0,C.jsx)(E,{children:"YOUR AVATAR \xb7 OPTIONAL"}),(0,C.jsx)(T.T,{size:16,children:B?'You made your own avatar from a photo.':'Keep this one, choose an original icon, or make your own from a photo.'}),(0,C.jsx)(D,{kind:"ghost",label:B?'Choose another avatar':'Choose my avatar',testID:"invite-avatar-make",onPress:()=>{H(''),N('selfie')}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.muted,children:"Your photo stays on this phone. It\u2019s turned into your avatar here; only the finished avatar is shared with your team."})]}):null,(0,C.jsx)(h.default,{style:{alignSelf:'stretch',gap:10,marginTop:4},children:(0,C.jsx)(D,{label:B?'Get started':'Skip, keep this one and get started',testID:"invite-get-started",onPress:t})}),(0,s.inPhoneApp)()?null:(0,C.jsxs)(h.default,{style:{alignSelf:'stretch',gap:6,borderRadius:16,padding:16,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:[(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:A,children:"Tip: add it to your Home screen"}),(0,C.jsxs)(T.T,{size:15,children:[U()," It then opens like a normal app and remembers you."]})]}),Q?(0,C.jsx)(l.default,{accessibilityRole:"link",onPress:()=>{z&&window.location.assign(Q)},children:(0,C.jsx)(T.T,{size:15,colour:A,center:!0,children:"Also open CoverCharge for Staff (your clock-in, rota and pay) \u203a"})}):null,(0,C.jsx)(T.T,{size:14,colour:w.colours.muted,center:!0,children:q?'Connected: bookings, orders and stock are shared live with the rest of the team. Your pay is only visible to you and your managers.':'Connecting\u2026 if there\u2019s no signal, what you enter is kept on this phone and shared once you\u2019re back online.'})]})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]),s=_r(d[3]),o=e(_r(d[4]));_r(d[5]);var l=e(_r(d[6])),c=e(_r(d[7])),u=e(_r(d[8])),h=e(_r(d[9])),p=_r(d[10]),f=_r(d[11]),x=_r(d[12]),b=_r(d[13]),y=_r(d[14]),j=_r(d[15]),v=_r(d[16]),k=_r(d[17]),w=_r(d[18]),S=_r(d[19]),T=_r(d[20]),C=_r(d[21]);const A=w.colours.gold,I="\n[data-cc=\"space\"]{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;background:radial-gradient(ellipse at 50% 115%,#2a1f0c 0%,#0a0805 38%,#000 70%)}\n[data-cc=\"stars1\"],[data-cc=\"stars2\"]{position:absolute;top:-50%;left:-50%;width:200%;height:200%;will-change:transform}\n[data-cc=\"stars1\"]{background-image:radial-gradient(1.2px 1.2px at 23px 41px,#fff,transparent),radial-gradient(1px 1px at 97px 13px,#fff9,transparent),radial-gradient(1.4px 1.4px at 151px 120px,#f5e6c8,transparent),radial-gradient(1px 1px at 61px 163px,#fffa,transparent),radial-gradient(1.2px 1.2px at 183px 77px,#fff8,transparent);background-size:211px 199px;animation:cc-drift 90s linear infinite;opacity:.75}\n[data-cc=\"stars2\"]{background-image:radial-gradient(2px 2px at 40px 60px,#CFA45F,transparent),radial-gradient(1.6px 1.6px at 250px 210px,#fff,transparent),radial-gradient(1.8px 1.8px at 330px 40px,#fffc,transparent);background-size:397px 367px;animation:cc-drift2 60s linear infinite,cc-twinkle 3.2s ease-in-out infinite alternate;opacity:.8}\n@keyframes cc-drift{to{transform:translate3d(-211px,199px,0)}}\n@keyframes cc-drift2{to{transform:translate3d(-397px,367px,0)}}\n@keyframes cc-twinkle{from{opacity:.45}to{opacity:.95}}\n[data-cc=\"count\"]{animation:cc-count .32s cubic-bezier(.2,.8,.2,1) both}\n@keyframes cc-count{from{opacity:0;transform:scale(1.9)}to{opacity:1;transform:scale(1)}}\n[data-cc=\"reveal\"]{animation:cc-reveal .75s cubic-bezier(.2,.9,.25,1.25) both}\n@keyframes cc-reveal{0%{opacity:0;transform:scale(.35) rotate(-12deg)}100%{opacity:1;transform:scale(1) rotate(0)}}\n[data-cc=\"halo\"]{border-radius:999px;box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 38px 6px rgba(207,164,95,.35);animation:cc-glow 2.6s ease-in-out infinite}\n@keyframes cc-glow{0%,100%{box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 30px 4px rgba(207,164,95,.28)}50%{box-shadow:0 0 0 2px rgba(207,164,95,1),0 0 52px 10px rgba(207,164,95,.5)}}\n[data-cc=\"orbit\"]{position:absolute;top:-14px;left:-14px;right:-14px;bottom:-14px;border-radius:999px;border:1px dashed rgba(207,164,95,.45);animation:cc-spin 14s linear infinite}\n@keyframes cc-spin{to{transform:rotate(360deg)}}\n[data-cc=\"rise1\"],[data-cc=\"rise2\"],[data-cc=\"rise3\"],[data-cc=\"rise4\"]{animation:cc-rise .5s cubic-bezier(.2,.8,.2,1) both}\n[data-cc=\"rise2\"]{animation-delay:.12s}[data-cc=\"rise3\"]{animation-delay:.24s}[data-cc=\"rise4\"]{animation-delay:.36s}\n@keyframes cc-rise{from{opacity:0;transform:translate3d(0,18px,0)}to{opacity:1;transform:none}}\n[data-cc=\"btn\"]{transition:transform .12s ease,box-shadow .2s ease,filter .2s ease;cursor:pointer}\n[data-cc=\"btn\"]:hover{filter:brightness(1.08)}\n[data-cc=\"btnp\"]{transition:transform .12s ease,box-shadow .2s ease;cursor:pointer;box-shadow:0 0 0 1px rgba(207,164,95,.9),0 8px 30px rgba(207,164,95,.35)}\n[data-cc=\"btnp\"]:hover{box-shadow:0 0 0 1px #CFA45F,0 8px 44px rgba(207,164,95,.6)}\n[data-cc=\"card\"]{background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.02));backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}\n[data-cc=\"sheen\"]{position:absolute;top:0;bottom:0;width:40%;left:-60%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.10),transparent);animation:cc-sheen 3.8s ease-in-out 1s infinite}\n@keyframes cc-sheen{0%{left:-60%}35%,100%{left:130%}}\n[data-cc=\"scan\"]{position:absolute;left:0;right:0;height:4px;background:linear-gradient(90deg,transparent,#CFA45F,#fff,#CFA45F,transparent);box-shadow:0 0 18px 4px rgba(207,164,95,.75);animation:cc-scan .9s ease-in-out infinite alternate}\n@keyframes cc-scan{from{top:2%}to{top:96%}}\n[data-cc=\"grid\"]{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(rgba(207,164,95,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(207,164,95,.18) 1px,transparent 1px);background-size:22px 22px}\n[data-cc=\"blink\"]{animation:cc-blink 1s steps(2,start) infinite}\n@keyframes cc-blink{to{visibility:hidden}}\nhtml.cc-welcome #cc-install-hint{display:none !important}\n@media (prefers-reduced-motion: reduce){[data-cc]{animation:none !important;transition:none !important}}\n",R=e=>({dataSet:{cc:e}}),z='undefined'!=typeof document,P=()=>z&&'function'==typeof window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches,O=()=>{try{z&&navigator.vibrate?.(12)}catch{}};function D({label:e,onPress:t,kind:n="primary",testID:r,disabled:s}){const o='primary'===n;return(0,C.jsx)(l.default,{testID:r,accessibilityRole:"button",accessibilityLabel:e,disabled:s,onPress:()=>{O(),t()},...R(o&&!s?'btnp':'btn'),style:({pressed:e})=>[{alignSelf:'stretch',minHeight:56,borderRadius:28,alignItems:'center',justifyContent:'center',paddingHorizontal:20,backgroundColor:o?A:'rgba(255,255,255,0.04)',borderWidth:o?0:1.5,borderColor:A,opacity:s?.45:1,transform:[{scale:e?.96:1}]}],children:(0,C.jsx)(T.T,{size:18,weight:"semibold",colour:o?'#0B0B0B':A,center:!0,children:e})})}const E=({children:e,colour:t=A})=>(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:t,style:{letterSpacing:2.2},children:e}),L={Owner:['Takings, sales, labour cost and payroll','Bookings (Tables and Covers), orders, the rota and team chat','Every setting, plus the Assistant for quick answers'],Manager:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],Supervisor:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],'Head Chef':['Stock, costings, prep, ordering and the specials board','Food safety checks, allergens and live tickets','Your own clock-in, rota and pay in the Staff app'],Staff:['Clock in and out, see your rota, swap shifts, ask for time off','Team chat, food safety checks and the accident book','Your own hours, pay and tips (only yours)']};function U(){const e=z?navigator.userAgent:'';return/iPhone|iPad|iPod/.test(e)?'In Safari, tap Share (the square with an arrow), then Add to Home Screen.':/SamsungBrowser/.test(e)?'Tap the menu, then Add page to, then Home screen.':'In Chrome, tap \u22ee then Add to Home screen (or Install app).'}const Y=({k:e,v:t})=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'baseline'},children:[(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:w.colours.muted,numberOfLines:1,style:{width:74,letterSpacing:1.2},children:e}),(0,C.jsx)(T.T,{size:18,weight:"semibold",style:{flex:1},children:t})]});function F({p:e,onClose:s}){const[u,p]=(0,r.useState)('choose'),[x,b]=(0,r.useState)(null),[y,j]=(0,r.useState)(null),[v,I]=(0,r.useState)(!1),[z,L]=(0,r.useState)(''),U=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{U.current&&URL.revokeObjectURL(U.current)},[]);const Y=async e=>{L('');const t=await(0,k.pickPhoto)(e);if(!t)return;U.current&&URL.revokeObjectURL(U.current);const n=URL.createObjectURL(t);U.current=n,b(n),I(!1),p('scan');const r=Date.now();try{const e=await(0,k.styliseOnDevice)(t),n=P()?0:Math.max(0,1300-(Date.now()-r));setTimeout(()=>{j(e),p('reveal'),O()},n)}catch{L("That photo couldn't be opened. Try another one (JPEG or PNG)."),p('choose')}},F=({children:e})=>(0,C.jsx)(h.default,{style:{width:236,height:236,borderRadius:118,overflow:'hidden',borderWidth:2,borderColor:A,alignItems:'center',justifyContent:'center',backgroundColor:(0,n.soutersSurface)('#050505')},children:e});return(0,C.jsxs)(c.default,{testID:"invite-avatar-step",contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsx)(E,{children:"MAKE YOUR AVATAR"}),(0,C.jsx)(T.T,{size:28,weight:"bold",center:!0,children:'choose'===u?'Choose your look':'scan'===u?'Scanning\u2026':`Looking good, ${e.name}`}),'choose'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(F,{children:[(0,C.jsx)(h.default,{style:{opacity:.55},children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:200,ring:!1})}),(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"})]})})}),(0,C.jsx)(T.T,{size:16,center:!0,colour:w.colours.muted,children:"Take a selfie or pick a photo. Your phone turns it into a space-age avatar. The photo never leaves this phone and isn\u2019t kept."}),(0,C.jsx)(D,{label:"Take a selfie",testID:"avatar-selfie",onPress:()=>Y(!0)}),(0,C.jsx)(D,{kind:"ghost",label:"Upload a photo",testID:"avatar-upload",onPress:()=>Y(!1)}),(0,C.jsx)(h.default,{style:{width:'100%',minWidth:0},children:(0,C.jsx)(t.AvatarOptions,{onSelect:t=>{f.useAvatars.getState().setOwn(e.id,e.id,t.dataUrl,e.name)?s(!0):L('Could not save your avatar. Try again.')}})})]}):'scan'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(F,{children:[x?(0,C.jsx)(o.default,{source:{uri:x},style:{width:236,height:236},accessibilityLabel:"Your photo"}):null,(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('scan'),pointerEvents:"none"})]})}),(0,C.jsx)(E,{colour:w.colours.muted,children:"MAKING YOUR AVATAR ON THIS PHONE"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:y?(0,C.jsx)(o.default,{testID:"avatar-result",source:{uri:y},style:{width:220,height:220,borderRadius:110},accessibilityLabel:"Your new avatar"}):null})}),(0,C.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityState:{checked:v},accessibilityLabel:"I agree to use this avatar",testID:"avatar-consent",onPress:()=>{O(),I(!v)},style:{alignSelf:'stretch',flexDirection:'row',gap:12,alignItems:'flex-start',padding:14,borderRadius:16,borderWidth:1.5,borderColor:v?A:'rgba(255,255,255,0.2)'},children:[(0,C.jsx)(h.default,{style:{width:28,height:28,borderRadius:8,borderWidth:2,borderColor:A,backgroundColor:v?A:'transparent',alignItems:'center',justifyContent:'center'},children:v?(0,C.jsx)(T.T,{size:17,weight:"bold",colour:"#111",children:"\u2713"}):null}),(0,C.jsx)(T.T,{size:15,style:{flex:1},children:"I\u2019m happy for this avatar, made from my photo, to be shown to my team in CoverCharge. Only the finished avatar is shared; my photo isn\u2019t uploaded or kept, and a manager can reset my avatar."})]}),(0,C.jsx)(D,{label:"Use this avatar",testID:"avatar-save",disabled:!v,onPress:()=>{if(!y)return;f.useAvatars.getState().setOwn(e.id,e.id,y,e.name)?(U.current&&URL.revokeObjectURL(U.current),U.current=null,s(!0)):L("Couldn't save the avatar. Please try again.")}}),(0,C.jsx)(D,{kind:"ghost",label:"Try another photo",onPress:()=>{j(null),p('choose')}})]}),z?(0,C.jsx)(T.T,{size:15,colour:w.colours.red,center:!0,children:z}):null,'scan'!==u?(0,C.jsx)(l.default,{testID:"invite-avatar-done",accessibilityRole:"button",onPress:()=>{O(),s(!1)},style:({pressed:e})=>({padding:12,transform:[{scale:e?.96:1}]}),children:(0,C.jsx)(T.T,{size:17,weight:"semibold",colour:w.colours.text,children:"Skip, keep this one"})}):null]})}},1376,[927,798,34,1072,336,236,402,295,41,102,846,924,865,800,985,997,15,793,840,899,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}),_e.StaffHome=function({go:e}){const L=(0,m.useInStaffApp)(),{now:N,meId:A,me:O,r:R,today:z}=(0,m.useCtx)(3e4),H=(0,s.useTravelDay)('staff',z),P=(0,h.useOwner)(e=>e.shifts),F=(0,h.useOwner)(e=>e.attendance),_=(0,h.useOwner)(e=>e.staffCanViewSuppliers),E=(0,h.useOwner)(e=>e.quickLinks),W=(0,h.useOwner)(e=>e.chat),q=(0,h.useOwner)(e=>e.swaps),V=(0,h.useOwner)(e=>e.leave),G=P.filter(e=>e.staffId===A&&e.published&&e.date>=z).sort((e,s)=>e.date.localeCompare(s.date)||e.start-s.start),U=G.find(e=>e.date===z),Y=F.filter(e=>e.staffId===A&&e.in&&!e.out&&N.getTime()-new Date(e.in).getTime()<72e6).sort((e,s)=>s.in.localeCompare(e.in))[0],Q=(0,x.usePay)(A,0),K=(0,b.useOrders)(R.id),J=(0,b.useBookings)(R.id),X=K.filter(e=>(0,T.LIVE)(e)&&e.allergies.length&&(0,k.nextStep)(e,(0,k.linkedBooking)(e,J))),Z=J.filter(e=>e.date===z&&['confirmed','seated'].includes(e.status)&&(0,k.bookingNeedsAction)(e,K.filter(T.LIVE))),ee=J.filter(e=>(0,S.undoKind)(e,z)||e.walkIn&&'cancelled'===e.status&&e.date===z).sort((e,s)=>e.time.localeCompare(s.time)).slice(0,12),se=W.filter(e=>'all'===e.ch&&e.pinned&&!e.removed).slice(-1)[0],te=q.filter(e=>e.fromId===A&&'open'===e.status).length+V.filter(e=>e.staffId===A&&'pending'===e.status).length,ie=[['Clock in / out',()=>e('more','clock')],['My rota, swaps & time off',()=>e('more','rota')],['Staff chat',()=>e('chat')],['Recipe cards',()=>e('more','recipecards')],['My hours & pay',()=>e('more','mypay')],['My tips',()=>e('more','mytips')],['Post to social (draft)',()=>e('more','social')],..._?[['Suppliers',()=>e('more','suppliers')]]:[]];return!L&&H?(0,v.jsxs)(o.default,{style:{gap:10},children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(s.DayView,{rid:R.id,day:H,today:z,app:"staff"})]}):(0,v.jsxs)(o.default,{style:{gap:10},children:[L?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(t.CoversToday,{rid:R.id})]}),(0,v.jsxs)(r.Card,{highlight:u.colours.accentBorder,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.Row,{gap:10,style:{flex:1},children:[(0,v.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"My avatar",onPress:()=>e('more','avatar'),children:(0,v.jsx)(C.StaffAvatar,{id:A,size:52})}),(0,v.jsxs)(r.T,{size:18,weight:"bold",children:["Hi ",O.replace(' (example)','').split(' ')[0]]})]}),(0,v.jsx)(r.Badge,{kind:"gold",label:L?R.name:'Staff app preview'})]}),(0,v.jsx)(r.Muted,{children:L?`${N.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})}`:'This is what staff will see in the separate Staff app.'})]}),(0,v.jsx)(M.StaffTipsTile,{rid:R.id,today:z,onPress:()=>e('more','mytips')}),(0,v.jsxs)(r.Card,{highlight:Y?u.colours.ok:void 0,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{weight:"semibold",children:Y?`On shift since ${(0,c.hm)(new Date(Y.in))}`:'Not clocked in'}),Y?(0,v.jsx)(r.Badge,{kind:"ok",label:(0,m.hmDur)(Math.max(0,Math.round((N.getTime()-new Date(Y.in).getTime())/6e4)))}):null]}),U?(0,v.jsxs)(r.Muted,{children:["Today on the rota: ",(0,m.fmtH)(U.start),"\u2013",(0,m.fmtH)(U.end)]}):G[0]?(0,v.jsxs)(r.Muted,{children:["Next on the rota: ",m.DAY3[G[0].day]," ",Number(G[0].date.slice(8))," ",(0,m.fmtH)(G[0].start),"\u2013",(0,m.fmtH)(G[0].end)]}):(0,v.jsx)(r.Muted,{children:"No shifts on the rota this week."}),(0,v.jsx)(r.Button,{small:!0,kind:Y?'secondary':'success',label:Y?'Clock out':'Clock in',onPress:()=>e('more','clock')})]}),A?(0,v.jsx)($.RequestTimeOff,{meId:A,me:O,testID:"staff-home-time-off"}):null,(0,v.jsx)(p.ShellfishTile,{rid:R.id,by:O.replace(' (example)',''),app:"staff"}),ee.length?(0,v.jsx)(r.Card,{children:(0,v.jsxs)(o.default,{testID:"staff-seated-today",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Seated and finished today (",ee.length,")"]}),(0,v.jsx)(r.Muted,{children:"Seated someone by mistake? Tap Unseat: they go back to Booked and their tables are freed. Finished or No-show by mistake? Tap Undo."}),ee.map(e=>{const s=e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;return(0,v.jsxs)(o.default,{testID:(0,f.isSeatedHighlight)(e.status)?`staff-seated-row-${e.id}`:`staff-done-row-${e.id}`,style:(0,f.isSeatedHighlight)(e.status)?{gap:6,padding:10,borderRadius:12,marginTop:4,...(0,f.seatedHighlightStyle)()}:{gap:6,borderTopWidth:1,borderTopColor:u.colours.hairline,paddingTop:8,opacity:'finished'===e.status||'noshow'===e.status?.7:1},children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.T,{size:17,weight:"semibold",colour:(0,f.isSeatedHighlight)(e.status)?f.SEATED_FG:u.colours.text,children:[e.time," \xb7 ",s]}),(0,v.jsx)(r.Badge,{kind:'noshow'===e.status?'red':'seated'===e.status?'ok':'neutral',label:'noshow'===e.status?'No-show':'seated'===e.status?'Seated':'Finished'})]}),(0,v.jsxs)(r.Muted,{children:[e.table?(0,I.tableCardLabel)(e.table):'No table'," \xb7 ",e.ref]}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsxs)(r.Row,{wrap:!0,gap:6,children:['seated'===e.status?(0,v.jsx)(r.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${s}`,onPress:()=>(0,B.finishBookingNow)(R.id,e)}):null,e.walkIn?(0,v.jsx)(a.CancelWalkInButton,{rid:R.id,b:e,small:!0}):null,e.walkIn?(0,v.jsx)(a.ReinstateWalkInButton,{rid:R.id,b:e,today:z,small:!0}):null,(0,v.jsx)(S.BookingUndo,{b:e,rid:R.id,today:z,who:s})]})]},e.id)})]})}):null,X.length+Z.length?(0,v.jsxs)(o.default,{testID:"staff-allergy-signoffs",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Allergy sign-offs (",X.length+Z.length,")"]}),(0,v.jsx)(r.Muted,{children:"Tap Sign off for your step. Your name and the time are recorded."}),X.map(e=>(0,v.jsx)(j.AllergyChain,{o:e,me:O},e.id)),Z.map(e=>(0,v.jsxs)(o.default,{accessible:!0,accessibilityLabel:`Booking ${e.time}, ${e.name}, ${e.partySize}${e.table?`, ${(0,D.tableNumbersA11y)(e.table)}`:''}`,style:{gap:4},children:[(0,v.jsxs)(r.Muted,{children:["Booking ",e.time," \xb7 ",e.name," (",e.partySize,")",e.table?` \xb7 ${(0,I.tablesLabel)(e.table)}`:'']}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsx)(j.BookingAllergyChain,{b:e,me:O}),(0,v.jsx)(o.default,{style:{flexDirection:'row'},children:(0,v.jsx)(w.WhatsAppGuest,{b:e,rid:R.id,kind:"auto"})})]},e.id))]}):null,se?(0,v.jsxs)(r.Card,{onPress:()=>e('chat'),children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{size:12,weight:"semibold",colour:u.colours.gold,children:"\ud83d\udccc PINNED IN ALL STAFF"}),(0,v.jsx)(r.Muted,{children:"Open chat \u203a"})]}),(0,v.jsx)(r.T,{size:14,children:se.text})]}):null,(0,v.jsxs)(r.Card,{children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Hours this pay period"}),(0,v.jsxs)(r.T,{size:18,weight:"semibold",colour:u.colours.goldLight,children:[(0,m.hmDur)(Q.paid)," paid hours"]})]}),te?(0,v.jsx)(r.Card,{onPress:()=>e('more','rota'),children:(0,v.jsxs)(r.T,{size:14,children:["You have ",te," request",te>1?'s':''," waiting for a manager \u203a"]})}):null,(0,y.visibleLinks)(E,'staff').length?(0,v.jsxs)(o.default,{testID:"quick-links",style:{gap:6},children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Quick links"}),(0,v.jsx)(y.QuickLinksRow,{compact:!0})]}):null,L?null:(0,v.jsx)(o.default,{style:{gap:6},children:ie.map(([e,s])=>(0,v.jsx)(r.Button,{kind:"secondary",label:e,onPress:s},e))})]})};var s=_r(d[0]),t=_r(d[1]),a=_r(d[2]),l=_r(d[3]);_r(d[4]);var n=e(_r(d[5])),o=e(_r(d[6])),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),f=_r(d[11]),p=_r(d[12]),m=_r(d[13]),x=_r(d[14]),y=_r(d[15]),j=_r(d[16]),b=_r(d[17]),w=_r(d[18]),k=_r(d[19]),T=_r(d[20]),C=_r(d[21]),S=_r(d[22]),I=_r(d[23]),D=_r(d[24]),B=_r(d[25]),M=_r(d[26]),$=_r(d[27]),v=_r(d[28])},1377,[1148,1073,1112,1089,34,402,102,794,865,827,840,1090,1142,1100,1145,1362,1136,850,1149,838,1147,899,1355,1014,829,1096,1154,1159,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1378,[30,34,846,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,"default",{enumerable:!0,get:function(){return q}});var t=r(_d[0]),s=r(_d[1]);r(_d[2]),r(_d[3]);var n=r(_d[4]),o=r(_d[5]),u=r(_d[6]),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=e(r(_d[10])),p=e(r(_d[11]));r(_d[12]);var y=e(r(_d[13])),h=e(r(_d[14])),S=r(_d[15]),_=r(_d[16]),O=r(_d[17]),P=r(_d[18]),j=r(_d[19]),v=r(_d[20]),b=r(_d[21]),x=r(_d[22]),A=r(_d[23]),w=r(_d[24]),E=r(_d[25]),C=r(_d[26]);r(_d[27]);var I=r(_d[28]),k=r(_d[29]),R=r(_d[30]),H=r(_d[31]),T=r(_d[32]),F=r(_d[33]),B=r(_d[34]),V=r(_d[35]),N=r(_d[36]);const G=r(_d[37]),L=r(_d[38]),M=r(_d[39]),U=r(_d[40]);function q(){const[e]=(0,n.useFonts)({Poppins_400Regular:G,Poppins_500Medium:L,Poppins_600SemiBold:M,Poppins_700Bold:U}),[t,E]=(0,d.useState)(v.useStore.persist.hasHydrated()),[T,F]=(0,d.useState)(x.useOwner.persist.hasHydrated()),B=t&&T;(0,d.useEffect)(()=>{const e=v.useStore.persist.onFinishHydration(()=>E(!0)),t=x.useOwner.persist.onFinishHydration(()=>F(!0));return v.useStore.persist.hasHydrated()&&E(!0),x.useOwner.persist.hasHydrated()&&F(!0),()=>{e(),t()}},[]),(0,d.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===(0,S.venueKey)(v.useStore.persist.getOptions().name??'')&&(0,C.quietly)(()=>v.useStore.persist.rehydrate()),e.key===(0,S.venueKey)(b.useFloor.persist.getOptions().name??'')&&(0,C.quietly)(()=>b.useFloor.persist.rehydrate()),e.key===(0,S.venueKey)(o.useBlocks.persist.getOptions().name??'')&&(0,C.quietly)(()=>o.useBlocks.persist.rehydrate())};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,d.useEffect)(()=>{B&&x.useOwner.getState().syncRoster()},[B]),(0,d.useEffect)(()=>{B&&(0,s.startAppSync)()},[B]);const V=e&&B,q=(0,w.useSignedOutGate)(),D=(0,u.usePathname)(),K=V&&!(0,O.isAllowedPath)(D||'/');return(0,d.useEffect)(()=>{if(!K)return;const e=setTimeout(()=>u.router.replace(O.ENTRY[O.APP_VARIANT]),0);return()=>clearTimeout(e)},[K,D]),(0,d.useEffect)(()=>{V&&l.hideAsync().catch(()=>{})},[V]),V?(0,N.jsxs)(j.SafeAreaProvider,{children:[(0,N.jsx)(c.StatusBar,{style:"light"}),q?(0,N.jsx)(h.default,{style:{flex:1,backgroundColor:A.colours.bg}}):(0,N.jsx)(h.default,{style:{flex:1},children:(0,N.jsx)(u.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:A.colours.bg}}})}),K&&!q?(0,N.jsx)(h.default,{style:[y.default.absoluteFill,{backgroundColor:A.colours.bg}]}):null,K||q||O.IS_CAR?null:(0,N.jsx)(R.VoiceHost,{}),q?null:(0,N.jsx)(I.SyncBadge,{}),K||q||O.IS_CAR?null:(0,N.jsx)(k.PushPrompt,{}),O.IS_CAR?(0,N.jsx)(P.CarGate,{}):(0,N.jsx)(w.InviteGate,{}),K||q?null:(0,N.jsx)(H.SliderHost,{})]}):(0,N.jsxs)(h.default,{style:{flex:1,backgroundColor:A.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[_.HERO_LOGOS[S.VENUE_RID]?(0,N.jsx)(p.default,{source:_.HERO_LOGOS[S.VENUE_RID],accessibilityLabel:"Venue logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,N.jsx)(f.default,{color:A.colours.gold})]})}T.PITCH&&(globalThis.__pitch={useSaverCfg:V.useSaverCfg,useSync:s.useSync,seedInvitePairsForQA:t.seedInvitePairsForQA,appVariant:O.APP_VARIANT,useStore:v.useStore,useOwner:x.useOwner,useFloor:b.useFloor,useBlocks:o.useBlocks,useSession:E.useSession,useCashUp:F.useCashUp,seedPitch:B.seedPitch},setTimeout(()=>{try{(0,B.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),E.START_INVITE,l.preventAutoHideAsync().catch(()=>{})},1379,[1380,985,795,1330,1382,1011,30,1409,496,34,385,336,236,41,102,5,847,846,1411,36,848,1014,865,840,1370,997,1010,1414,1415,1416,1417,1099,2,1024,1418,1299,25,1419,1420,1421,1422]); +__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,"default",{enumerable:!0,get:function(){return q}});var t=r(_d[0]),s=r(_d[1]);r(_d[2]),r(_d[3]);var n=r(_d[4]),o=r(_d[5]),u=r(_d[6]),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=e(r(_d[10])),p=e(r(_d[11]));r(_d[12]);var y=e(r(_d[13])),h=e(r(_d[14])),S=r(_d[15]),_=r(_d[16]),O=r(_d[17]),P=r(_d[18]),j=r(_d[19]),v=r(_d[20]),b=r(_d[21]),x=r(_d[22]),A=r(_d[23]),w=r(_d[24]),E=r(_d[25]),C=r(_d[26]);r(_d[27]);var I=r(_d[28]),k=r(_d[29]),R=r(_d[30]),H=r(_d[31]),T=r(_d[32]),F=r(_d[33]),B=r(_d[34]),V=r(_d[35]),N=r(_d[36]);const G=r(_d[37]),L=r(_d[38]),M=r(_d[39]),U=r(_d[40]);function q(){const[e]=(0,n.useFonts)({Poppins_400Regular:G,Poppins_500Medium:L,Poppins_600SemiBold:M,Poppins_700Bold:U}),[t,E]=(0,d.useState)(v.useStore.persist.hasHydrated()),[T,F]=(0,d.useState)(x.useOwner.persist.hasHydrated()),B=t&&T;(0,d.useEffect)(()=>{const e=v.useStore.persist.onFinishHydration(()=>E(!0)),t=x.useOwner.persist.onFinishHydration(()=>F(!0));return v.useStore.persist.hasHydrated()&&E(!0),x.useOwner.persist.hasHydrated()&&F(!0),()=>{e(),t()}},[]),(0,d.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===(0,S.venueKey)(v.useStore.persist.getOptions().name??'')&&(0,C.quietly)(()=>v.useStore.persist.rehydrate()),e.key===(0,S.venueKey)(b.useFloor.persist.getOptions().name??'')&&(0,C.quietly)(()=>b.useFloor.persist.rehydrate()),e.key===(0,S.venueKey)(o.useBlocks.persist.getOptions().name??'')&&(0,C.quietly)(()=>o.useBlocks.persist.rehydrate())};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,d.useEffect)(()=>{B&&x.useOwner.getState().syncRoster()},[B]),(0,d.useEffect)(()=>{B&&(0,s.startAppSync)()},[B]);const V=e&&B,q=(0,w.useSignedOutGate)(),D=(0,u.usePathname)(),K=V&&!(0,O.isAllowedPath)(D||'/');return(0,d.useEffect)(()=>{if(!K)return;const e=setTimeout(()=>u.router.replace(O.ENTRY[O.APP_VARIANT]),0);return()=>clearTimeout(e)},[K,D]),(0,d.useEffect)(()=>{V&&l.hideAsync().catch(()=>{})},[V]),V?(0,N.jsxs)(j.SafeAreaProvider,{children:[(0,N.jsx)(c.StatusBar,{style:"light"}),q?(0,N.jsx)(h.default,{style:{flex:1,backgroundColor:A.colours.bg}}):(0,N.jsx)(h.default,{style:{flex:1},children:(0,N.jsx)(u.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:A.colours.bg}}})}),K&&!q?(0,N.jsx)(h.default,{style:[y.default.absoluteFill,{backgroundColor:A.colours.bg}]}):null,K||q||O.IS_CAR?null:(0,N.jsx)(R.VoiceHost,{}),q?null:(0,N.jsx)(I.SyncBadge,{}),K||q||O.IS_CAR?null:(0,N.jsx)(k.PushPrompt,{}),O.IS_CAR?(0,N.jsx)(P.CarGate,{}):(0,N.jsx)(w.InviteGate,{}),K||q?null:(0,N.jsx)(H.SliderHost,{})]}):(0,N.jsxs)(h.default,{style:{flex:1,backgroundColor:A.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[_.HERO_LOGOS[S.VENUE_RID]?(0,N.jsx)(p.default,{source:_.HERO_LOGOS[S.VENUE_RID],accessibilityLabel:"Venue logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,N.jsx)(f.default,{color:A.colours.gold})]})}T.PITCH&&(globalThis.__pitch={useSaverCfg:V.useSaverCfg,useSync:s.useSync,seedInvitePairsForQA:t.seedInvitePairsForQA,appVariant:O.APP_VARIANT,useStore:v.useStore,useOwner:x.useOwner,useFloor:b.useFloor,useBlocks:o.useBlocks,useSession:E.useSession,useCashUp:F.useCashUp,seedPitch:B.seedPitch},setTimeout(()=>{try{(0,B.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),E.START_INVITE,l.preventAutoHideAsync().catch(()=>{})},1379,[1380,985,795,1330,1382,1011,30,1409,496,34,385,336,236,41,102,5,847,846,1411,36,848,1014,865,840,1370,997,1010,1415,1416,1417,1418,1099,2,1024,1419,1299,25,1420,1421,1422,1423]); __d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"inviteCache",{enumerable:!0,get:function(){return j}}),_e.refreshLinkPhones=P,_e.linkedSinceText=I,_e.refreshInvites=A,_e.useInviteStatus=function(){const[,e]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const n=()=>e(e=>e+1);return v.add(n),A(),()=>{v.delete(n)}},[]),x},Object.defineProperty(_e,"when",{enumerable:!0,get:function(){return C}}),_e.inviteStateText=function(e,n=Date.now()){return'used'===e?.state?'Previous link used. Current app links are prepared automatically.':e?.devices?`Signed in on ${e.devices} device${1===e.devices?'':'s'}`:'Personal Android and iPhone links'},_e.seedInvitePairsForQA=function(n,t,s){if(!e.PITCH)throw new Error('QA only');w.set(`${n}:${t}`,s),S()},Object.defineProperty(_e,"installSteps",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"installMessage",{enumerable:!0,get:function(){return D}}),_e.InviteLinkControls=function({m:e,actorRole:s}){const o=(0,u.useSync)(e=>e.venueId),b=(0,u.useSync)(e=>'staff'===e.kind&&!!e.venueId),x=(0,u.useSync)(e=>e.perms.includes('*')||e.perms.includes('roles.manage')),j=b&&e.active&&!e.name.includes('(example)')&&('owner'===s||x||'manager'===s&&'owner'!==e.role&&!e.ownerAccess),A=`${o}:${e.id}`,B=(0,f.useSession)(e=>e.meId),T=(0,y.useOwner)(e=>B?e.staff.find(e=>e.id===B):void 0),E=!B||!!T&&(0,k.ownJobManagesLinks)(T),[,z]=(0,t.useState)(0),[O,_]=(0,t.useState)(''),[W,U]=(0,t.useState)(!1),[Z,F]=(0,t.useState)(null),[G,N]=(0,t.useState)(null),[Q,Y]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{if(!j)return;const n=()=>z(e=>e+1);v.add(n),P(),M(A,e.id);const t=setInterval(()=>{M(A,e.id)},3e4),s=()=>{M(A,e.id)};return'undefined'!=typeof window&&window.addEventListener('focus',s),()=>{v.delete(n),clearInterval(t),'undefined'!=typeof window&&window.removeEventListener('focus',s)}},[j,A,e.id]),!j)return null;const J=w.get(A),q=async n=>{try{await(0,u.revokeStaffAppLink)(n),w.delete(A),N(null),_('Link revoked. Existing signed-in sessions are unchanged.'),await M(A,e.id),Z&&F(await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}};return(0,m.jsxs)(l.default,{testID:`invite-${e.id}`,style:{gap:10},children:[(()=>{const n=I(L[e.id]);return n?(0,m.jsxs)(l.default,{testID:`invite-phone-${e.id}`,style:{gap:8,padding:12,borderRadius:10,borderWidth:1,borderColor:h.colours.gold,backgroundColor:h.colours.bg,alignItems:'center'},children:[(0,m.jsx)(d.T,{center:!0,weight:"semibold",colour:h.colours.goldLight,testID:`invite-phone-since-${e.id}`,children:n}),(0,m.jsxs)(d.Muted,{center:!0,size:13,children:["Another phone that opens ",e.name,"\u2019s link is asked to see a manager."]}),E?Q?(0,m.jsxs)(l.default,{style:{gap:8,alignItems:'center',width:'100%'},children:[(0,m.jsxs)(d.T,{center:!0,size:15,children:["Reset ",e.name,"\u2019s phone? Their link will link to the next phone that opens it. Phones already signed in stay signed in."]}),(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Yes, reset phone",testID:`invite-reset-yes-${e.id}`,style:{minHeight:44},accessibilityLabel:`Yes, reset ${e.name}'s phone`,onPress:async()=>{try{await(0,u.resetStaffLinkPhone)(e.id),await P(),_(`Phone reset. ${e.name}\u2019s link will link to the next phone that opens it.`)}catch(e){_(String(e.message))}finally{Y(!1)}}}),(0,m.jsx)(d.Button,{label:"Cancel",kind:"ghost",style:{minHeight:44},testID:`invite-reset-no-${e.id}`,onPress:()=>Y(!1)})]})]}):(0,m.jsx)(d.Button,{label:"Reset phone",kind:"secondary",testID:`invite-reset-${e.id}`,style:{minHeight:44},accessibilityLabel:`Reset phone for ${e.name}. Asks to confirm.`,onPress:()=>Y(!0)}):(0,m.jsx)(d.Muted,{center:!0,size:13,testID:`invite-reset-managers-only-${e.id}`,children:"Only a manager or owner can reset a phone or switch a link off."})]}):null})(),['android','iphone'].map(t=>{const s='android'===t?'Android app':'iPhone web app',o=J?.[t],u=(0,c.currentAppLink)(o)&&o?(0,c.personalAppUrl)(t,o):null;return(0,m.jsxs)(l.default,{testID:`invite-${t}-${e.id}`,style:{gap:6,padding:10,borderRadius:10,borderWidth:1,borderColor:h.colours.gold,backgroundColor:h.colours.bg},children:[(0,m.jsx)(d.T,{center:!0,weight:"semibold",children:s}),u&&o?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n.Text,{selectable:!0,accessibilityLabel:`${e.name}, ${s} personal link`,testID:`invite-link-${t}-${e.id}`,style:{color:h.colours.goldLight,fontSize:14,textAlign:'center',width:'100%'},children:o.shortCode?`Short link: ${o.shortCode}`:"Secure personal link \u2014 Copy or Share"}),(0,m.jsx)(d.Muted,{center:!0,size:13,children:H(t)}),(0,m.jsx)(d.Muted,{center:!0,size:13,children:"Works for good on the first phone that opens it."}),(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Copy",kind:"secondary",style:{minHeight:44,minWidth:44},accessibilityLabel:`Copy ${e.name}'s ${s} link`,testID:`invite-copy-${t}-${e.id}`,onPress:async()=>_(await(0,p.copyText)(D(u,e.name,t))?'Link and install steps copied':'Select and copy the link.')}),(0,m.jsx)(d.Button,{label:"Share",style:{minHeight:44,minWidth:44},accessibilityLabel:`Share ${e.name}'s ${s} link`,testID:`invite-share-${t}-${e.id}`,onPress:async()=>_(await R(u,e.name,t))}),E?(0,m.jsx)(d.Button,{label:"Revoke link",kind:"ghost",style:{minHeight:44},accessibilityLabel:`Revoke ${e.name}'s ${s} link`,onPress:()=>N(o.id)}):null]})]}):(0,m.jsx)(d.Muted,{children:$.has(A)?'Cannot load the current link. Reconnecting automatically.':'Preparing current link\u2026'})]},t)}),G&&E?(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Confirm revoke link",accessibilityLabel:`Confirm revoke link for ${e.name}`,style:{minHeight:44},onPress:()=>{q(G)}}),(0,m.jsx)(d.Button,{label:"Cancel",kind:"ghost",style:{minHeight:44},onPress:()=>N(null)})]}):null,O?(0,m.jsx)(d.T,{center:!0,size:14,children:O}):null,(0,m.jsx)(d.Button,{label:W?"Making new links\u2026":"Make new app links",testID:`invite-new-${e.id}`,accessibilityLabel:`Make new Android and iPhone app links for ${e.name}`,disabled:W,onPress:async()=>{if(!W){U(!0);try{const n=await(0,u.refreshStaffAppLinks)(e.id);w.set(A,n),$.delete(A),S(),_('New links ready. Links already sent keep working. Signed-in phones stay signed in.'),Z&&F(await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}finally{U(!1)}}}}),(0,m.jsxs)(d.Muted,{center:!0,size:13,children:["Share privately with ",e.name,". Links never expire. Each link works on the first phone that opens it; Reset phone lets it link to a new one."]}),(0,m.jsx)(d.Button,{label:Z?'Hide previous links':'Manage previous links',kind:"ghost",style:{minHeight:44},accessibilityLabel:`Manage all previous app links for ${e.name}`,onPress:async()=>{try{F(Z?null:await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}}}),Z?.map(n=>(0,m.jsxs)(l.default,{style:{gap:4},children:[(0,m.jsxs)(d.Muted,{center:!0,size:13,children:['legacy'===n.platform?'Previous app link':'android'===n.platform?'Android app':'iPhone'," \xb7 ",C(n.createdAt)," \xb7 ",n.revokedAt?'Revoked':n.usedAt?'Used for sign-in':'Unused']}),!n.revokedAt&&E?(0,m.jsx)(d.Button,{label:"Revoke this link",kind:"ghost",style:{minHeight:44},accessibilityLabel:`Revoke ${e.name}'s ${n.platform} link from ${C(n.createdAt)}`,onPress:()=>N(n.id)}):null]},n.id))]})};var e=r(_d[0]),n=r(_d[1]),t=r(_d[2]);r(_d[3]),r(_d[4]);var s,o=r(_d[5]),l=(s=o)&&s.__esModule?s:{default:s},d=r(_d[6]),c=r(_d[7]),u=r(_d[8]),h=r(_d[9]),p=r(_d[10]),f=r(_d[11]),y=r(_d[12]),k=r(_d[13]),m=r(_d[14]);const w=new Map,b=new Map,v=new Set,$=new Map,S=()=>v.forEach(e=>e());let x=null;const j=()=>x;let L={};async function P(){return L=await(0,u.staffLinkPhones)(),S(),L}function I(e){if(!e||!e.phones)return null;const n=new Date(e.since).toLocaleDateString('en-GB',{timeZone:'Europe/London',day:'numeric',month:'short',year:'numeric'});return e.phones>1?`Linked to ${e.phones} phones, the first since ${n}`:`Linked to a phone since ${n}`}async function A(){return x=await(0,u.readInviteStatus)(),S(),x}const C=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZoneName:'short'}):'';async function M(n,t){if(e.PITCH&&w.has(n))return;if(b.has(n))return b.get(n);const s=(async()=>{try{w.set(n,await(0,u.ensureStaffAppLinks)(t)),$.delete(n)}catch(e){w.delete(n),$.set(n,String(e.message||e))}finally{b.delete(n),S()}})();return b.set(n,s),s}const H=e=>'android'===e?'Tap the link, download the app, allow installation, then open it. It signs you in.':'Open in Safari and tap Open app. In the app, tap Share, Add to Home Screen, then open it from your Home Screen.',D=(e,n,t)=>`${n} \u2014 ${'android'===t?'Android app':'iPhone web app'}\n${e}\n${H(t)}`;async function R(e,n,t){const s=D(e,n,t);try{if('undefined'!=typeof navigator&&navigator.share)return await navigator.share({title:`CoverCharge for ${n}`,text:s,url:e}),'Share opened'}catch(e){if('AbortError'===e.name)return'Share cancelled'}return await(0,p.copyText)(s)?'Link and install steps copied. Paste them into a private message.':'Select and copy the link.'}},1380,[2,796,34,236,383,102,794,1381,985,840,1151,997,865,988,25]); __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IOS_WEB",{enumerable:!0,get:function(){return t}}),e.getPageSlug=n,e.personalGetUrl=o,e.siteRootFromLocation=s,e.mintPersonalUrl=function(t,c,h){const p=s();if(p)return o({origin:p.origin,basePath:p.basePath,staffId:t,name:c,token:h});return`get/${n(c)||n(t)}.html?v=2#i=${encodeURIComponent(h)}`},e.currentAppLink=function(t,n=Date.now()){return!!t&&/^[A-Za-z0-9_-]{16,64}$/.test(t.token)&&Date.parse(t.expiresAt)>n},e.personalAppUrl=function(t,n){if(n.shortCode&&/^[A-Za-z0-9_-]{10}$/.test(n.shortCode)){const t=s()??{origin:'https://covercharge-apps.static.hf.space',basePath:'/'};return`${t.origin}${t.basePath}s.html#${n.shortCode}`}if(n.url)try{const t=new URL(n.url);if('https:'===t.protocol&&'covercharge-apps.static.hf.space'===t.hostname&&/^\/(?:(?:kirkmichael|wildings)\/)?get\/[a-z0-9-]+\.html$/.test(t.pathname))return t.href}catch{}const o=s()??{origin:'https://covercharge-apps.static.hf.space',basePath:'/'},c=['owner','chef'].includes(n.app)?n.app:'staff',h=`i=${encodeURIComponent(n.token)}${'iphone'===t?`&d=${encodeURIComponent(n.device||'')}`:''}`;return`${o.origin}${o.basePath}get/${t}.html?a=${c}${'android'===t?'&v=2':'&v=61'}#${h}`};const t=new Set(['st-jack','st-agate','st-lenny','st-james','st-lillie','st-bisto','st-gordon','st-cameron','st-mia','st-emily','st-gabrielle','st-harvey','st-tracy','st-eilidh','st-finn']);function n(t){return(t.startsWith('st-')||t.startsWith('ow-')||t.startsWith('ch-')?t.replace(/^(st|ow|ch)-/,''):t.replace(/\s*\(.*?\)\s*/g,' ').trim().split(/\s+/)[0]||t).toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'staff'}function o(t){const o=t.origin.replace(/\/$/,'');let s=(t.basePath||'/').replace(/\/?$/,'/');s.startsWith('/')||(s='/'+s);return`${o}${s}get/${n(t.name)||n(t.staffId)}.html?v=2#i=${encodeURIComponent(t.token)}`}function s(t){try{if(!(t||'undefined'!=typeof window&&window.location))return null;const n=new URL(t||window.location.href),o=n.pathname.match(/^(.*?\/)(?:owner|staff|chef|display|customer)-app(?:\/|$)/);return{origin:n.origin,basePath:o?o[1]:'/'}}catch{return null}}},1381,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return o.useFonts}});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var o=r(d[2])},1382,[1383,1406,1408]); @@ -1491,24 +1491,25 @@ __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,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},1408,[34,1383]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},1409,[1410]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preventAutoHideAsync=async function(){return!1},e.setOptions=function(n){},e.hide=function(){},e.hideAsync=async function(){}},1410,[]); -__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.CarGate=function(){const e=(0,c.useSession)(e=>e.meId),[s,o]=(0,t.useState)(c.useSession.persist.hasHydrated());return(0,t.useEffect)(()=>{const e=c.useSession.persist.onFinishHydration(()=>o(!0));return c.useSession.persist.hasHydrated()&&o(!0),e},[]),s?e||h.PITCH?null:(0,j.jsx)(I,{}):(0,j.jsx)(n.default,{style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=e(_r(d[1])),n=e(_r(d[2])),s=e(_r(d[3])),o=_r(d[4]),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),f=_r(d[10]),p=_r(d[11]),y=_r(d[12]),j=_r(d[13]);let b=null,w=null;async function M(e){return!e&&w&&Date.now()-w.at<6e4&&new Date(w.r.expiresAt).getTime()-Date.now()>12e4?w.r:b||(b=(0,u.carPairStart)().then(e=>(e.ok&&(w={r:e,at:Date.now()}),e)).finally(()=>{b=null}),b)}function I(){const{width:e,height:c}=(0,s.default)(),[h,b]=(0,t.useState)(null),[w,I]=(0,t.useState)('starting'),[T,D]=(0,t.useState)(''),[k,C]=(0,t.useState)(0),z=(0,t.useRef)(!1),S=(0,t.useCallback)(async(e=!0)=>{if(z.current)return;z.current=!0,I('starting'),D('');const t=await M(e);if(z.current=!1,!t.ok)return I('error'),void D(t.error);b({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),I('waiting')},[]);(0,t.useEffect)(()=>{S(!1)},[]),(0,t.useEffect)(()=>{if(!h||'waiting'!==w)return;const e=setInterval(async()=>{C(Math.max(0,Math.round((h.until-Date.now())/1e3)));('expired'===await(0,u.carPairPoll)(h.id)||Date.now()>h.until)&&I('expired')},3e3);return()=>clearInterval(e)},[h,w]);const P=Math.min(120,Math.max(64,Math.round(Math.min(e/9,c/7)))),H=h?.code??'',v=H?`${H.slice(0,3)} ${H.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,j.jsx)(n.default,{testID:"car-pairing",style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:(0,j.jsxs)(n.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:c<820?10:16},children:[(0,j.jsx)(l.RestaurantLogo,{rid:x.VENUE_RID,size:c<820?64:88}),(0,j.jsx)(o.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,j.jsx)(y.ParkedOnly,{}),'waiting'===w||'starting'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,j.jsx)(n.default,{testID:"car-code",accessible:!0,accessibilityLabel:H?`Car code ${(0,p.spokenCode)(H)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,j.jsx)(o.T,{center:!0,size:P,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:P/8,lineHeight:1.2*P},children:v})}),H?(0,j.jsx)(o.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,j.jsxs)(n.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,j.jsx)(o.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,j.jsx)(n.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,j.jsx)(o.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{S()},style:{minHeight:64,minWidth:200}})})]}):'expired'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{S()},style:{minHeight:64,minWidth:280}})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,j.jsx)(o.Muted,{center:!0,children:T}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{S()},style:{minHeight:64,minWidth:240}})]}),T&&'error'!==w?(0,j.jsx)(o.T,{center:!0,colour:f.colours.amber,children:T}):null,(0,j.jsx)(o.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})})}},1411,[34,41,102,426,794,847,997,985,2,5,840,1412,1413,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=32;const l=s=>s.split('').join(' ')},1412,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1413,[34,102,794,840,25]); -__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1414,[986,857,856,985]); -__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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1415,[798,796,34,1338,1015,402,102,846,985,1007,1014,5,840,794,1282,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1416,[796,34,236,402,102,840,985,1045,2,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.VoiceHost=function(){return null}},1417,[]); -__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=u(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),k=[],A=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);if(i.includes(c))continue;k.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0});const u='st-jack'===t?{auto:'rota'}:{};d=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:f(d,23.5)}:void 0,...u}):d===y&&e<=m&&A.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:f(d,u.auto?e:e-.05),inSite:!0,...u})}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!k.some(e=>e.staffId===t.staffId&&e.date===t.date)),...k],attendance:[...S.attendance,...A]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:f(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:f((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',u=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,f=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1418,[848,800,865,1024,15,997,846]); -__d(function(e,o,s,p,t,a,n){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},1419,[]); -__d(function(o,s,e,p,t,c,d){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},1420,[]); -__d(function(o,s,e,p,t,d,f){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},1421,[]); -__d(function(o,s,e,p,t,d,n){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},1422,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1423,[30,34,846,25]); -__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 t.Head}});const t=(n=r(d[0]),c=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(c,t)||Object.defineProperty(c,t,{enumerable:!0,get:function(){return n[t]}})}),n);var n,c},1424,[1425]); -__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var c in n)Object.defineProperty(t,c,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,c).get})})(e,{get Head(){return u},get default(){return s}});const n=r(d[1]),c=r(d[2]);function o({children:c}){return(0,t().jsx)(n.Helmet,{children:c})}const u=({children:n})=>(0,c.useIsFocused)()?(0,t().jsx)(o,{children:n}):null;u.Provider=n.HelmetProvider;const s=u},1425,[25,1426,591]); -__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>fe,HelmetData:()=>se,HelmetProvider:()=>oe}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[0])),T=u(r(d[0])),A=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(A||{}),O={rel:["amphtml","canonical","alternate"]},C={type:["application/ld+json"]},w={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x=Object.values(A),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},$=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",k="defaultTitle",S="defer",E="encodeSpecialCharacters",M="onChangeClientState",P="titleTemplate",H="prioritizeSeoTags",D=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},L=t=>{let n=D(t,"title");const s=D(t,P);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=D(t,k);return n||i||void 0},I=t=>D(t,M)||(()=>{}),U=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),N=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;it.push(n));const l=Object.keys(o);for(let t=0;t{if(Array.isArray(t)&&t.length)for(let s=0;sArray.isArray(t)?t.join(""):t,z=(t,n)=>{const s=Object.keys(t);for(let i=0;iArray.isArray(t)?t.reduce((t,s)=>(z(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},F=(t,n)=>({...t,[n]:void 0}),Y=["noscript","script","style"],K=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),G=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${K(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),W=(t,n,s,i)=>{const o=G(s),l=R(n);return o?`<${t} ${j}="true" ${o}>${K(l,i)}`:`<${t} ${j}="true">${K(l,i)}`},J=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${K(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===Y.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}`}`},""),Q=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),V=(t,n,s)=>{const i=Q(s,{key:n,[j]:!0});return[T.default.createElement("title",i,n)]},X=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),T.default.createElement(t,i)}),Z=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>V(0,n.title,n.titleAttributes),toString:()=>W(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Q(n),toString:()=>G(n)};default:return{toComponent:()=>X(t,n),toString:()=>J(t,n,s)}}},ee=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=B(t,w),l=B(n,O),c=B(s,C);return{priorityMethods:{toComponent:()=>[...X("meta",o.priority),...X("link",l.priority),...X("script",c.priority)],toString:()=>`${Z("meta",o.priority,i)} ${Z("link",l.priority,i)} ${Z("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},te=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=ee(t)),{priority:T,base:Z("base",n,i),bodyAttributes:Z("bodyAttributes",s,i),htmlAttributes:Z("htmlAttributes",o,i),link:Z("link",y,i),meta:Z("meta",f,i),noscript:Z("noscript",l,i),script:Z("script",b,i),style:Z("style",c,i),title:Z("title",{title:p,titleAttributes:u},i)}},re=[],ne=!("undefined"==typeof window||!window.document||!window.document.createElement),se=class{instances=[];canUseDOM=ne;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?re:this.instances,add:t=>{(this.canUseDOM?re:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?re:this.instances).indexOf(t);(this.canUseDOM?re:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=te({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ie=b.default.createContext({}),oe=class t extends b.Component{static canUseDOM=ne;constructor(n){super(n),this.helmetData=new se(this.props.context||{},t.canUseDOM)}render(){return b.default.createElement(ie.Provider,{value:this.helmetData.value},this.props.children)}},ae=r(d[0]),le=(t,n)=>{if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;const s=Object.keys(t),i=Object.keys(n);return s.length===i.length&&s.every(s=>Object.prototype.hasOwnProperty.call(n,s)&&t[s]===n[s])},ce=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},pe=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},ue=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=R(t)),pe("title",n)},de=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;pe("body",i),pe("html",o),ue(f,b);const T={baseTag:ce("base",s),linkTags:ce("link",l),metaTags:ce("meta",c),noscriptTags:ce("noscript",p),scriptTags:ce("script",h),styleTags:ce("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},he=null,me=t=>{he&&cancelAnimationFrame(he),t.defer?he=requestAnimationFrame(()=>{de(t,()=>{he=null})}):(de(t),he=null)},ye=class extends ae.Component{rendered=!1;shouldComponentUpdate(t){return!le(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:N(["href"],o),bodyAttributes:U("bodyAttributes",o),defer:D(o,S),encode:D(o,E),htmlAttributes:U("htmlAttributes",o),linkTags:q("link",["rel","href"],o),metaTags:q("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:q("noscript",["innerHTML"],o),onChangeClientState:I(o),scriptTags:q("script",["src","innerHTML"],o),styleTags:q("style",["cssText"],o),title:L(o),titleAttributes:U("titleAttributes",o),prioritizeSeoTags:_(o,H)});var o;oe.canUseDOM?me(i):te&&(s=te(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},fe=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(F(this.props,"helmetData"),F(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){if(!x.some(n=>t.type===n))throw new Error("function"==typeof t.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`);if(n&&"string"!=typeof n&&(!Array.isArray(n)||n.some(t=>"string"!=typeof t)))throw new Error(`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`} ) Refer to our API for more information.`);return!0}mapChildrenToProps(t,n){let s={};return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[$[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof se)){i=new se(i.context,!0),delete s.helmetData}return i?y.default.createElement(ye,{...s,context:i.value}):y.default.createElement(ie.Consumer,null,t=>y.default.createElement(ye,{...s,context:t}))}}},1426,[34,172]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1427,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";function t(){const e=r(d[0]);return t=function(){return e},e}function e(){const t=r(d[1]);return e=function(){return t},t}function n(){const t=f(r(d[2]));return n=function(){return t},t}function o(){const t=r(d[3]);return o=function(){return t},t}Object.defineProperty(_e,"__esModule",{value:!0}),Object.defineProperty(_e,"renderRootComponent",{enumerable:!0,get:function(){return y}});const u=f(r(d[4]));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}function f(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=c(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var s=u?Object.getOwnPropertyDescriptor(t,f):null;s&&(s.get||s.set)?Object.defineProperty(o,f,s):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o}function s(t){if('[object Object]'!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function p(t){return t&&'object'==typeof t&&'string'==typeof t.name&&'string'==typeof t.message}function l(t){return p(t)?t:s(t)?new Error(JSON.stringify(t)):new Error(String(t))}function y(c){try{setTimeout(()=>{u._internal_preventAutoHideAsync?.()}),n().startTransition(()=>{(0,e().registerRootComponent)(c)})}catch(n){u.hideAsync();const c=l(n);(0,e().registerRootComponent)(()=>(0,t().jsx)(o().View,{})),console.error(c),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw c})}}},1428,[25,499,34,270,651]); +__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.CarGate=function(){const e=(0,u.useSession)(e=>e.meId),[t,o]=(0,r.useState)(u.useSession.persist.hasHydrated());return(0,r.useEffect)(()=>{const e=u.useSession.persist.onFinishHydration(()=>o(!0));return u.useSession.persist.hasHydrated()&&o(!0),e},[]),t?e||x.PITCH?null:(0,b.jsx)(T,{}):(0,b.jsx)(s.default,{style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=_r(d[1]),n=e(_r(d[2])),s=e(_r(d[3])),o=e(_r(d[4])),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),f=_r(d[11]),y=_r(d[12]),j=_r(d[13]),b=_r(d[14]);let w=null,M=null;async function I(e){return!e&&M&&Date.now()-M.at<6e4&&new Date(M.r.expiresAt).getTime()-Date.now()>12e4?M.r:w||(w=(0,h.carPairStart)().then(e=>(e.ok&&(M={r:e,at:Date.now()}),e)).finally(()=>{w=null}),w)}function T(){const{width:e,height:u}=(0,o.default)(),[x,w]=(0,r.useState)(null),[M,T]=(0,r.useState)('starting'),[C,D]=(0,r.useState)(''),[k,z]=(0,r.useState)(0),S=(0,r.useRef)(!1),P=(0,r.useCallback)(async(e=!0)=>{if(S.current)return;S.current=!0,T('starting'),D('');const t=await I(e);if(S.current=!1,!t.ok)return T('error'),void D(t.error);w({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),T('waiting')},[]);(0,r.useEffect)(()=>{P(!1)},[]),(0,r.useEffect)(()=>{if(!x||'waiting'!==M)return;const e=setInterval(async()=>{z(Math.max(0,Math.round((x.until-Date.now())/1e3)));('expired'===await(0,h.carPairPoll)(x.id)||Date.now()>x.until)&&T('expired')},3e3);return()=>clearInterval(e)},[x,M]);const H=Math.min(120,Math.max(64,Math.round(Math.min(e/9,u/7)))),v=x?.code??'',F=v?`${v.slice(0,3)} ${v.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,b.jsxs)(s.default,{testID:"car-pairing",style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:[(0,b.jsx)(t.CarFullscreenButton,{place:"corner"}),(0,b.jsxs)(s.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:u<820?10:16},children:[(0,b.jsx)(c.RestaurantLogo,{rid:p.VENUE_RID,size:u<820?64:88}),(0,b.jsx)(l.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,b.jsx)(j.ParkedOnly,{}),'waiting'===M||'starting'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,b.jsx)(s.default,{testID:"car-code",accessible:!0,accessibilityLabel:v?`Car code ${(0,y.spokenCode)(v)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,b.jsx)(l.T,{center:!0,size:H,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:H/8,lineHeight:1.2*H},children:F})}),v?(0,b.jsx)(l.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,b.jsxs)(s.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,b.jsx)(l.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,b.jsx)(s.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,b.jsx)(l.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{P()},style:{minHeight:64,minWidth:200}})})]}):'expired'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{P()},style:{minHeight:64,minWidth:280}})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,b.jsx)(l.Muted,{center:!0,children:C}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{P()},style:{minHeight:64,minWidth:240}})]}),C&&'error'!==M?(0,b.jsx)(l.T,{center:!0,colour:f.colours.amber,children:C}):null,(0,b.jsx)(l.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})]})}},1411,[1412,34,41,102,426,794,847,997,985,2,5,840,1413,1414,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,"FS_KEY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"FS_BUTTON_H",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"NOT_ALLOWED",{enumerable:!0,get:function(){return b}}),_e.useCarViewport=function(){(0,t.useEffect)(()=>{if(!u)return;const e=document.documentElement,t=document.body,n=[e.style.cssText,t.style.cssText];for(const n of[e.style,t.style])n.height='100%',n.margin='0',n.overflow='hidden',n.overscrollBehavior='none',n.touchAction='manipulation';return()=>{e.style.cssText=n[0],t.style.cssText=n[1]}},[])},_e.CarFullscreenButton=function({place:e="rail",width:E}){const[x,p]=(0,t.useState)(y),[L,T]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!u)return;const e=()=>{const e=y();p(e),e||v.set(f,null)};document.addEventListener('fullscreenchange',e),document.addEventListener('webkitfullscreenchange',e);let t='1'===v.get(f)&&!y();const n=()=>{t&&(t=!1,w())};return t&&(document.addEventListener('click',n,!0),document.addEventListener('touchend',n,!0)),()=>{document.removeEventListener('fullscreenchange',e),document.removeEventListener('webkitfullscreenchange',e),document.removeEventListener('click',n,!0),document.removeEventListener('touchend',n,!0)}},[]),(0,t.useEffect)(()=>{if(!L)return;const e=setTimeout(()=>T(null),9e3);return()=>clearTimeout(e)},[L]);const F=(0,t.useCallback)(async()=>{if(T(null),y()){v.set(f,null);try{await((document.exitFullscreen??document.webkitExitFullscreen)?.call(document))}catch{}return}const e=window.innerHeight;await w()?(v.set(f,'1'),setTimeout(()=>{(!y()||window.innerHeight<=e+8)&&T(b)},900)):T(b)},[]);if(!u)return null;const k=x?'Exit full screen':'Full screen',j='corner'===e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{testID:"car-fullscreen",accessibilityRole:"button",accessibilityLabel:k,accessibilityHint:x?'Shows the browser bar again':'Hides the browser bar, if the car allows it',onPress:()=>{F()},style:[{minHeight:h,minWidth:j?220:void 0,width:j?void 0:E,alignSelf:j?void 0:'center',justifyContent:'center',alignItems:'center',paddingHorizontal:12,borderRadius:14,borderWidth:2,borderColor:o.colours.goldLight,backgroundColor:x?'#1d1708':o.colours.gold},j?{position:'fixed',top:12,right:12,zIndex:1200}:null],children:(0,s.jsx)(l.T,{size:j?20:17,weight:"bold",colour:x?o.colours.goldLight:'#1a1407',center:!0,numberOfLines:1,children:k})}),L?(0,s.jsx)(c.default,{testID:"car-fullscreen-msg",accessible:!0,accessibilityLiveRegion:"assertive",accessibilityLabel:L,style:{position:'fixed',top:j?76:12,right:j?12:220,maxWidth:420,zIndex:1300,padding:14,borderRadius:14,borderWidth:1.5,borderColor:o.colours.amber,backgroundColor:'#1d1708'},children:(0,s.jsx)(l.T,{size:17,center:!0,colour:"#FFE2A8",children:L})}):null]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),c=e(r(d[3])),l=r(d[4]),o=r(d[5]),s=r(d[6]);const u='undefined'!=typeof document,f='cc-car-fullscreen',h=56,b='The car\u2019s browser kept its address bar, so full screen isn\u2019t available here. The car screen already uses all the space it is given.',v={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}},y=()=>u&&!(!document.fullscreenElement&&!document.webkitFullscreenElement);async function w(){const e=document.documentElement,t=e.requestFullscreen??e.webkitRequestFullscreen;if(!t)return!1;try{return await t.call(e,{navigationUI:'hide'}),!0}catch{return!1}}},1412,[34,236,402,102,794,840,25]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=64;const l=s=>s.split('').join(' ')},1413,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1414,[34,102,794,840,25]); +__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1415,[986,857,856,985]); +__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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1416,[798,796,34,1338,1015,402,102,846,985,1007,1014,5,840,794,1282,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1417,[796,34,236,402,102,840,985,1045,2,25]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.VoiceHost=function(){return null}},1418,[]); +__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=u(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),k=[],A=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);if(i.includes(c))continue;k.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0});const u='st-jack'===t?{auto:'rota'}:{};d=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:f(d,23.5)}:void 0,...u}):d===y&&e<=m&&A.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:f(d,u.auto?e:e-.05),inSite:!0,...u})}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!k.some(e=>e.staffId===t.staffId&&e.date===t.date)),...k],attendance:[...S.attendance,...A]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:f(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:f((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',u=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,f=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1419,[848,800,865,1024,15,997,846]); +__d(function(e,o,s,p,t,a,n){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},1420,[]); +__d(function(o,s,e,p,t,c,d){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},1421,[]); +__d(function(o,s,e,p,t,d,f){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},1422,[]); +__d(function(o,s,e,p,t,d,n){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},1423,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1424,[30,34,846,25]); +__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 t.Head}});const t=(n=r(d[0]),c=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(c,t)||Object.defineProperty(c,t,{enumerable:!0,get:function(){return n[t]}})}),n);var n,c},1425,[1426]); +__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var c in n)Object.defineProperty(t,c,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,c).get})})(e,{get Head(){return u},get default(){return s}});const n=r(d[1]),c=r(d[2]);function o({children:c}){return(0,t().jsx)(n.Helmet,{children:c})}const u=({children:n})=>(0,c.useIsFocused)()?(0,t().jsx)(o,{children:n}):null;u.Provider=n.HelmetProvider;const s=u},1426,[25,1427,591]); +__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>fe,HelmetData:()=>se,HelmetProvider:()=>oe}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[0])),T=u(r(d[0])),A=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(A||{}),O={rel:["amphtml","canonical","alternate"]},C={type:["application/ld+json"]},w={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x=Object.values(A),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},$=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",k="defaultTitle",S="defer",E="encodeSpecialCharacters",M="onChangeClientState",P="titleTemplate",H="prioritizeSeoTags",D=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},L=t=>{let n=D(t,"title");const s=D(t,P);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=D(t,k);return n||i||void 0},I=t=>D(t,M)||(()=>{}),U=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),N=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;it.push(n));const l=Object.keys(o);for(let t=0;t{if(Array.isArray(t)&&t.length)for(let s=0;sArray.isArray(t)?t.join(""):t,z=(t,n)=>{const s=Object.keys(t);for(let i=0;iArray.isArray(t)?t.reduce((t,s)=>(z(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},F=(t,n)=>({...t,[n]:void 0}),Y=["noscript","script","style"],K=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),G=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${K(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),W=(t,n,s,i)=>{const o=G(s),l=R(n);return o?`<${t} ${j}="true" ${o}>${K(l,i)}`:`<${t} ${j}="true">${K(l,i)}`},J=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${K(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===Y.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}`}`},""),Q=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),V=(t,n,s)=>{const i=Q(s,{key:n,[j]:!0});return[T.default.createElement("title",i,n)]},X=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),T.default.createElement(t,i)}),Z=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>V(0,n.title,n.titleAttributes),toString:()=>W(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Q(n),toString:()=>G(n)};default:return{toComponent:()=>X(t,n),toString:()=>J(t,n,s)}}},ee=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=B(t,w),l=B(n,O),c=B(s,C);return{priorityMethods:{toComponent:()=>[...X("meta",o.priority),...X("link",l.priority),...X("script",c.priority)],toString:()=>`${Z("meta",o.priority,i)} ${Z("link",l.priority,i)} ${Z("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},te=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=ee(t)),{priority:T,base:Z("base",n,i),bodyAttributes:Z("bodyAttributes",s,i),htmlAttributes:Z("htmlAttributes",o,i),link:Z("link",y,i),meta:Z("meta",f,i),noscript:Z("noscript",l,i),script:Z("script",b,i),style:Z("style",c,i),title:Z("title",{title:p,titleAttributes:u},i)}},re=[],ne=!("undefined"==typeof window||!window.document||!window.document.createElement),se=class{instances=[];canUseDOM=ne;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?re:this.instances,add:t=>{(this.canUseDOM?re:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?re:this.instances).indexOf(t);(this.canUseDOM?re:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=te({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ie=b.default.createContext({}),oe=class t extends b.Component{static canUseDOM=ne;constructor(n){super(n),this.helmetData=new se(this.props.context||{},t.canUseDOM)}render(){return b.default.createElement(ie.Provider,{value:this.helmetData.value},this.props.children)}},ae=r(d[0]),le=(t,n)=>{if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;const s=Object.keys(t),i=Object.keys(n);return s.length===i.length&&s.every(s=>Object.prototype.hasOwnProperty.call(n,s)&&t[s]===n[s])},ce=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},pe=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},ue=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=R(t)),pe("title",n)},de=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;pe("body",i),pe("html",o),ue(f,b);const T={baseTag:ce("base",s),linkTags:ce("link",l),metaTags:ce("meta",c),noscriptTags:ce("noscript",p),scriptTags:ce("script",h),styleTags:ce("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},he=null,me=t=>{he&&cancelAnimationFrame(he),t.defer?he=requestAnimationFrame(()=>{de(t,()=>{he=null})}):(de(t),he=null)},ye=class extends ae.Component{rendered=!1;shouldComponentUpdate(t){return!le(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:N(["href"],o),bodyAttributes:U("bodyAttributes",o),defer:D(o,S),encode:D(o,E),htmlAttributes:U("htmlAttributes",o),linkTags:q("link",["rel","href"],o),metaTags:q("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:q("noscript",["innerHTML"],o),onChangeClientState:I(o),scriptTags:q("script",["src","innerHTML"],o),styleTags:q("style",["cssText"],o),title:L(o),titleAttributes:U("titleAttributes",o),prioritizeSeoTags:_(o,H)});var o;oe.canUseDOM?me(i):te&&(s=te(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},fe=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(F(this.props,"helmetData"),F(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){if(!x.some(n=>t.type===n))throw new Error("function"==typeof t.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`);if(n&&"string"!=typeof n&&(!Array.isArray(n)||n.some(t=>"string"!=typeof t)))throw new Error(`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`} ) Refer to our API for more information.`);return!0}mapChildrenToProps(t,n){let s={};return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[$[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof se)){i=new se(i.context,!0),delete s.helmetData}return i?y.default.createElement(ye,{...s,context:i.value}):y.default.createElement(ie.Consumer,null,t=>y.default.createElement(ye,{...s,context:t}))}}},1427,[34,172]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1428,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";function t(){const e=r(d[0]);return t=function(){return e},e}function e(){const t=r(d[1]);return e=function(){return t},t}function n(){const t=f(r(d[2]));return n=function(){return t},t}function o(){const t=r(d[3]);return o=function(){return t},t}Object.defineProperty(_e,"__esModule",{value:!0}),Object.defineProperty(_e,"renderRootComponent",{enumerable:!0,get:function(){return y}});const u=f(r(d[4]));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}function f(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=c(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var s=u?Object.getOwnPropertyDescriptor(t,f):null;s&&(s.get||s.set)?Object.defineProperty(o,f,s):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o}function s(t){if('[object Object]'!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function p(t){return t&&'object'==typeof t&&'string'==typeof t.name&&'string'==typeof t.message}function l(t){return p(t)?t:s(t)?new Error(JSON.stringify(t)):new Error(String(t))}function y(c){try{setTimeout(()=>{u._internal_preventAutoHideAsync?.()}),n().startTransition(()=>{(0,e().registerRootComponent)(c)})}catch(n){u.hideAsync();const c=l(n);(0,e().registerRootComponent)(()=>(0,t().jsx)(o().View,{})),console.error(c),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw c})}}},1429,[25,499,34,270,651]); __r(501); __r(21); __r(0); \ No newline at end of file diff --git a/customer-app/admin.html b/customer-app/admin.html index 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 48fe47b50abf091b927137bbb0d88fb48ee8e054..16025a4918829feb56838b3ec2582b9aea82cdfc 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 be50c5ad9f76c620d2046482baddb2fcda31a7f7..6762176f5394e86f082f323a5621cb0dec4515ae 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-8a64fb69ab"; +const V = "cc-customer-973e32656e"; 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=8a64fb69abc5b81b9900107cc965b44e83aa2b4bd7c2a9474eff5fc3cd57c4e3"]; +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=973e32656eace0d589cd779910d91046a6fc8ab8155d234534f9b2d0aaca434b"]; // 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 3c03f8cfd77f56db182ea6c2099e61e4a8bed37f..5e5899bd2b412399290273a85287d27c1ae3d696 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 42e933ad2ccf62a716516227c31115fea145b639..ec0e305af99caeef832fc4a0bed8167e4766aaab 100644 --- a/display-app/_expo/static/js/web/bundle.js +++ b/display-app/_expo/static/js/web/bundle.js @@ -23,11 +23,11 @@ __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,"PITCH_VENUE",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"PITCH_TEAM",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PITCH_TEXT",{enumerable:!0,get:function(){return o}}),e.pitchText=function(a){let n=a;for(const[a,t]of o)a.test(n)?(a.lastIndex=0,n=n.replace(a,t)):a.lastIndex=0;return n};const a={name:'The Harbour Kitchen',tagline:'Harbourside seafood & seasonal plates',location:'12 Quay Street, Portmorran',phone:'01632 960 123',website:'harbourkitchen.example'},n={'st-tracy':{name:'Morgan',job:'Owner',hourlyPence:null,salaried:!0},'st-gordon':{name:'Alex',job:'General Manager',dept:'Management',hourlyPence:null,salaried:!0},'st-bisto':{name:'Ravi',job:'Head Chef',hourlyPence:null,salaried:!0},'st-agate':{name:'Priya',job:'Front of house supervisor',hourlyPence:1450},'st-lenny':{name:'Tom',job:'Commis Chef',hourlyPence:1325},'st-finn':{name:'Lewis',job:'Bar staff',hourlyPence:1290},'st-eilidh':{name:'Chloe',job:'Front of house',hourlyPence:1271},'st-emily':{name:'Ellie',job:'Front of house',hourlyPence:1271},'st-lillie':{name:'Jordan',job:'Kitchen porter (KP)',hourlyPence:1271},'st-jack':{name:'Sam',job:'Kitchen porter (KP)',hourlyPence:1271}},o=[['Harbour View, Dunure, South Ayrshire',a.location],['Harbour View, Dunure',a.location],['Harbour View mug','Harbour Kitchen mug'],['Harbour View','Quay Street'],['anchoragedunure.com',a.website],['01292 502826',a.phone],['Mini Anchors','Little Crew'],['The Anchorage',a.name],['Anchorage','Harbour Kitchen'],['ANCHORAGE','HARBOUR KITCHEN'],['South Ayrshire','the Firth coast'],['Ayrshire','the Firth coast'],['Dunure','Portmorran'],['Kittyfisher boat (Big Sean)','Coastal Fish Co'],['Kittyfisher','Coastal Fish Co'],['Big Sean','Coastal Fish Co'],['Example Fish Co.','Coastal Fish Co'],['Sample Dairy Ltd','Hillside Dairy'],['Sample Fruit & Veg','Fieldfare Veg'],['Mills milk','Hillside Dairy milk'],['Mills','Hillside Dairy'],['J. Pieroni & Sons','Fieldfare Veg'],["Pieroni's",'Fieldfare Veg'],['Pieroni','Fieldfare Veg'],['Alsons (drinks)','Drinks wholesaler'],['Alsons','the drinks wholesaler'],['Spes Bona','the deli wholesaler'],['Tarelgin','the butcher'],['Reids','the bakery'],['Reeds','the bakery'],['Example Butchers Ltd','Quayside Butchers'],['Example Dry Goods Wholesale','Dry goods wholesaler'],['Sample Brewing Co.','Harbourside Brewing'],['Example Cleaning Supplies','Cleaning supplies'],['Sample Packaging Ltd','Packaging supplier'],['Example Kitchen Repairs','Kitchen repairs'],['Preston','Ravi'],['Bisto','Ravi'],['Tracy','Morgan'],['James','Morgan'],['Gordon','Alex'],['Agate','Priya'],['Lenny','Tom'],['Finn','Lewis'],['Eilidh','Chloe'],['Emily','Ellie'],['Gabrielle','Ellie'],['Cameron Mc','Sam'],['Cameron','Sam'],['Lillie','Jordan'],['Lily','Jordan'],['Mia','Jordan'],['Jack','Sam'],['Harvey','Jordan'],['Anna','the supplier'],['(preview)',''],[' (example)','']].map(([a,n])=>[new RegExp(`${/^[A-Za-z]/.test(a)?'(?g[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`](_),globalThis.__webpack_require__=o=>{const t=ErrorUtils.reportFatalError;_&&(ErrorUtils.reportFatalError=_=>{throw _});try{return g[`${__METRO_GLOBAL_PREFIX__}__r`](o)}finally{_&&(ErrorUtils.reportFatalError=t)}}},23,[]); -__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}function t(){const n=r(d[1]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"App",{enumerable:!0,get:function(){return c}}),r(d[2]);const o=r(d[3]),u=r(d[4]);function c(){return(0,n().jsx)(u.Head.Provider,{children:(0,n().jsx)(o.ExpoRoot,{context:t().ctx})})}r(d[5])},24,[25,27,34,709,1443,1446]); +__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}function t(){const n=r(d[1]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"App",{enumerable:!0,get:function(){return c}}),r(d[2]);const o=r(d[3]),u=r(d[4]);function c(){return(0,n().jsx)(u.Head.Provider,{children:(0,n().jsx)(o.ExpoRoot,{context:t().ctx})})}r(d[5])},24,[25,27,34,709,1444,1447]); __d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},25,[26]); __d(function(g,r,i,a,m,e,d){ /** @@ -41,7 +41,7 @@ __d(function(g,r,i,a,m,e,d){ */ "use strict";var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(t,o,f){var l=null;if(void 0!==f&&(l=""+f),void 0!==o.key&&(l=""+o.key),"key"in o)for(var y in f={},o)"key"!==y&&(f[y]=o[y]);else f=o;return o=f.ref,{$$typeof:n,type:t,key:l,ref:void 0!==o?o:null,props:f}}e.Fragment=t,e.jsx=o,e.jsxs=o},26,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ctx",{enumerable:!0,get:function(){return t}});const t=r(d[0])},27,[28]); -__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./(chef)/kitchen/[section].tsx":{enumerable:!0,get:()=>r(d[1])(d[0],d.paths)},"./(chef)/kitchen/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[2],d.paths)},"./(customer)/customer/[rid]/book.tsx":{enumerable:!0,get:()=>r(d[1])(d[3],d.paths)},"./(customer)/customer/[rid]/dish/[did].tsx":{enumerable:!0,get:()=>r(d[1])(d[4],d.paths)},"./(customer)/customer/[rid]/feedback.tsx":{enumerable:!0,get:()=>r(d[1])(d[5],d.paths)},"./(customer)/customer/[rid]/gift.tsx":{enumerable:!0,get:()=>r(d[1])(d[6],d.paths)},"./(customer)/customer/[rid]/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[7],d.paths)},"./(customer)/customer/[rid]/lost.tsx":{enumerable:!0,get:()=>r(d[1])(d[8],d.paths)},"./(customer)/customer/[rid]/loyalty.tsx":{enumerable:!0,get:()=>r(d[1])(d[9],d.paths)},"./(customer)/customer/[rid]/merch.tsx":{enumerable:!0,get:()=>r(d[1])(d[10],d.paths)},"./(customer)/customer/[rid]/offers.tsx":{enumerable:!0,get:()=>r(d[1])(d[11],d.paths)},"./(customer)/customer/[rid]/refer.tsx":{enumerable:!0,get:()=>r(d[1])(d[12],d.paths)},"./(customer)/customer/[rid]/waitlist.tsx":{enumerable:!0,get:()=>r(d[1])(d[13],d.paths)},"./(customer)/customer/[rid]/whatson.tsx":{enumerable:!0,get:()=>r(d[1])(d[14],d.paths)},"./(customer)/customer/basket.tsx":{enumerable:!0,get:()=>r(d[1])(d[15],d.paths)},"./(customer)/customer/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[16],d.paths)},"./(customer)/customer/order/[oid].tsx":{enumerable:!0,get:()=>r(d[1])(d[17],d.paths)},"./(customer)/customer/profile.tsx":{enumerable:!0,get:()=>r(d[1])(d[18],d.paths)},"./(customer)/demo.tsx":{enumerable:!0,get:()=>r(d[1])(d[19],d.paths)},"./(customer)/table/[n].tsx":{enumerable:!0,get:()=>r(d[1])(d[20],d.paths)},"./(customer)/table/live/[token].tsx":{enumerable:!0,get:()=>r(d[1])(d[21],d.paths)},"./(display)/display/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[22],d.paths)},"./(display)/staff/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[23],d.paths)},"./(owner)/admin/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[24],d.paths)},"./(owner)/owner/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[25],d.paths)},"./(staff)/team/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[26],d.paths)},"./+not-found.tsx":{enumerable:!0,get:()=>r(d[1])(d[27],d.paths)},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])(d[28],d.paths)},"./index.tsx":{enumerable:!0,get:()=>r(d[1])(d[29],d.paths)}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},28,[29,1038,1184,1185,1187,1191,1193,1200,1256,1257,1258,1259,1260,1261,1263,1264,1265,1266,1267,1268,1269,1270,1273,1331,1332,1333,1335,1378,1379,1442]); +__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./(chef)/kitchen/[section].tsx":{enumerable:!0,get:()=>r(d[1])(d[0],d.paths)},"./(chef)/kitchen/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[2],d.paths)},"./(customer)/customer/[rid]/book.tsx":{enumerable:!0,get:()=>r(d[1])(d[3],d.paths)},"./(customer)/customer/[rid]/dish/[did].tsx":{enumerable:!0,get:()=>r(d[1])(d[4],d.paths)},"./(customer)/customer/[rid]/feedback.tsx":{enumerable:!0,get:()=>r(d[1])(d[5],d.paths)},"./(customer)/customer/[rid]/gift.tsx":{enumerable:!0,get:()=>r(d[1])(d[6],d.paths)},"./(customer)/customer/[rid]/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[7],d.paths)},"./(customer)/customer/[rid]/lost.tsx":{enumerable:!0,get:()=>r(d[1])(d[8],d.paths)},"./(customer)/customer/[rid]/loyalty.tsx":{enumerable:!0,get:()=>r(d[1])(d[9],d.paths)},"./(customer)/customer/[rid]/merch.tsx":{enumerable:!0,get:()=>r(d[1])(d[10],d.paths)},"./(customer)/customer/[rid]/offers.tsx":{enumerable:!0,get:()=>r(d[1])(d[11],d.paths)},"./(customer)/customer/[rid]/refer.tsx":{enumerable:!0,get:()=>r(d[1])(d[12],d.paths)},"./(customer)/customer/[rid]/waitlist.tsx":{enumerable:!0,get:()=>r(d[1])(d[13],d.paths)},"./(customer)/customer/[rid]/whatson.tsx":{enumerable:!0,get:()=>r(d[1])(d[14],d.paths)},"./(customer)/customer/basket.tsx":{enumerable:!0,get:()=>r(d[1])(d[15],d.paths)},"./(customer)/customer/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[16],d.paths)},"./(customer)/customer/order/[oid].tsx":{enumerable:!0,get:()=>r(d[1])(d[17],d.paths)},"./(customer)/customer/profile.tsx":{enumerable:!0,get:()=>r(d[1])(d[18],d.paths)},"./(customer)/demo.tsx":{enumerable:!0,get:()=>r(d[1])(d[19],d.paths)},"./(customer)/table/[n].tsx":{enumerable:!0,get:()=>r(d[1])(d[20],d.paths)},"./(customer)/table/live/[token].tsx":{enumerable:!0,get:()=>r(d[1])(d[21],d.paths)},"./(display)/display/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[22],d.paths)},"./(display)/staff/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[23],d.paths)},"./(owner)/admin/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[24],d.paths)},"./(owner)/owner/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[25],d.paths)},"./(staff)/team/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[26],d.paths)},"./+not-found.tsx":{enumerable:!0,get:()=>r(d[1])(d[27],d.paths)},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])(d[28],d.paths)},"./index.tsx":{enumerable:!0,get:()=>r(d[1])(d[29],d.paths)}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},28,[29,1038,1184,1185,1187,1191,1193,1200,1256,1257,1258,1259,1260,1261,1263,1264,1265,1266,1267,1268,1269,1270,1273,1331,1332,1333,1335,1378,1379,1443]); __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 s}});var t=r(d[0]);r(d[1]);var n=r(d[2]),c=r(d[3]),o=r(d[4]),f=r(d[5]);function s(){const{section:s}=(0,t.useLocalSearchParams)();return(0,c.canShow)('chef')?s&&(0,o.chefSectionAllowed)(String(s))?(0,f.jsx)(n.ChefApp,{section:String(s)},String(s)):(0,f.jsx)(t.Redirect,{href:"/kitchen"}):(0,f.jsx)(t.Redirect,{href:c.ENTRY[c.APP_VARIANT]})}},29,[30,34,792,846,988,25]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){return Object.keys(t).forEach(function(c){"default"===c||Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{enumerable:!0,get:function(){return t[c]}})}),t}Object.defineProperty(e,"__esModule",{value:!0}),r(d[0]),t(r(d[1]),e),t(r(d[2]),e),t(r(d[3]),e),t(r(d[4]),e)},30,[31,32,782,783,785]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},31,[]); @@ -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.122'},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.123'},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]); @@ -1195,7 +1195,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}),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: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";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)(!0);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]); @@ -1354,7 +1354,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}),_e.TableOrderLive=function({token:e}){const[s,m]=(0,l.useState)(null),[x,y]=(0,l.useState)(null),[j,f]=(0,l.useState)([]),[k,w]=(0,l.useState)(null),T=(0,h.useCustomer)(),[C,S]=(0,l.useState)(()=>(T?.allergies??[]).map(e=>e.allergen)),[v,O]=(0,l.useState)(''),[P,R]=(0,l.useState)(''),[I,M]=(0,l.useState)(''),[L,N]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),[B,D]=(0,l.useState)([]),q=(0,l.useCallback)(async()=>{try{m(await(0,c.tablePublic)(e)),y(null)}catch(e){y((0,d.tableOrderError)(e,'menu'))}},[e]),_=(0,l.useCallback)(async()=>{try{D(await(0,c.myTableOrders)(e))}catch{}},[e]);(0,l.useEffect)(()=>{q(),_();const e=setInterval(()=>{_(),q()},8e3);return()=>clearInterval(e)},[q,_]);const W=s?.menu??[];(0,l.useEffect)(()=>{f(e=>e.filter(e=>W.some(t=>t.id===e.id&&!t.soldOut)))},[s]);const E=(0,l.useMemo)(()=>{const e=new Map;for(const t of W)e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()]},[s]),Y=(0,d.cartTotal)(j,W),z='yes'===k?C.map(e=>({allergen:e,severity:T?.allergies?.find(t=>t.allergen===e)?.severity??'allergy'})):[],G=(0,d.allergyClashes)(j,W,z.map(e=>e.allergen)),V=e=>j.find(t=>t.id===e)?.qty??0,F=(e,t)=>f(n=>t<=0?n.filter(t=>t.id!==e):n.some(t=>t.id===e)?n.map(n=>n.id===e?{...n,qty:t}:n):[...n,{id:e,qty:t,note:''}]),H=(e,t)=>f(n=>n.map(n=>n.id===e?{...n,note:t}:n)),J=async()=>{N(!0),A(null);try{const t=await(0,c.sendTableOrder)(e,j,{note:I,name:v,phone:P,allergies:z});f([]),M(''),A({kind:'success',text:t.held?`Order ${t.ref} sent. A member of staff will check it, then it goes to the kitchen.`:`Order ${t.ref} sent to the kitchen.`}),_()}catch(e){A({kind:'warn',text:(0,d.tableOrderError)(e,'send')}),q()}finally{N(!1)}};if(x)return(0,p.jsxs)(o.Screen,{title:"Order at the table",children:[(0,p.jsx)(o.Banner,{kind:"warn",title:"Couldn't open the menu",children:x}),(0,p.jsx)(o.Button,{label:"Try again",onPress:()=>{q()}})]});if(!s)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Muted,{children:"Opening the menu\u2026"})});if(!s.ok)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Banner,{kind:"warn",title:"This code isn't working",children:s.reason??'Please ask a member of staff.'})});const K=s.open&&j.length>0&&null!==k&&('none'===k||C.length>0)&&(0,d.nameOk)(v)&&(0,d.phoneOk)(P)&&!L,Q=s.askServer??[],U=[...new Set(Q.map(e=>e.section))],X=L?'Sending\u2026':j.length?null===k?'Answer the allergy question':(0,d.nameOk)(v)?(0,d.phoneOk)(P)?`Send order to the kitchen (${(0,i.gbp)(Y)})`:'Check the phone number':'Add your name to send':'Add a dish to order';return(0,p.jsxs)(o.Screen,{title:`Table ${(0,n.tableNumbers)(s.table)}`,subtitle:s.venueName,footer:s.open?(0,p.jsx)(o.Button,{label:X,disabled:!K,onPress:()=>{J()},testID:"send-table-order-live"}):void 0,children:[(0,p.jsxs)(o.Muted,{center:!0,children:["Tip: add dishes, answer the allergy question, add your name, then send. Staff bring it to table ",(0,n.tableNumbers)(s.table),". ",d.PAY_WORDS]}),s.tip?(0,p.jsx)(o.Banner,{kind:"demo",children:s.tip}):null,s.open?null:(0,p.jsx)(o.Banner,{kind:"warn",title:"Not taking table orders right now",children:s.reason}),s.open&&s.staffAccept&&!B.some(e=>e.accepted)?(0,p.jsx)(o.Muted,{children:"The first order from your phone is checked by a member of staff before it goes to the kitchen."}):null,$?(0,p.jsx)(o.Banner,{kind:$.kind,children:$.text}):null,B.length?(0,p.jsx)(r.default,{testID:"my-table-orders",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Your orders at this table"}),B.map(e=>(0,p.jsxs)(r.default,{style:{gap:2,paddingVertical:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e.ref}),(0,p.jsx)(o.T,{size:13,colour:'cancelled'===e.status?u.colours.amber:u.colours.gold,children:(0,d.guestStatusWords)(e)})]}),(0,p.jsxs)(o.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,i.gbp)(e.totalPence)," to pay at the bar or with the server"]})]},e.id))]})}):null,s.open?E.map(([e,t])=>(0,p.jsxs)(r.default,{style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:e}),t.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,p.jsxs)(r.default,{style:{flex:1,gap:2},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),e.description?(0,p.jsx)(o.Muted,{children:e.description}):null,(0,p.jsxs)(o.T,{size:13,colour:u.colours.muted,children:[e.allergens.length?`Contains: ${e.allergens.map(a.allergenLabel).join(', ')}`:'No allergens listed: ask staff if unsure',e.mayContain.length?` \xb7 May contain: ${e.mayContain.map(a.allergenLabel).join(', ')}`:'']})]}),(0,p.jsx)(o.T,{weight:"semibold",colour:u.colours.gold,children:(0,i.gbp)(e.pricePence)})]}),e.soldOut?(0,p.jsx)(o.Badge,{kind:"amber",label:"Sold out today"}):V(e.id)?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:V(e.id),min:0,max:20,onChange:t=>F(e.id,t),label:e.name}),(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>F(e.id,0)})]}):(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"Add",accessibilityLabel:`Add ${e.name}`,onPress:()=>F(e.id,1)})]},e.id))]},e)):null,s.open&&!W.length?(0,p.jsx)(o.Banner,{kind:"demo",title:"No dishes to order from your phone yet",children:"The kitchen is still checking the allergens on the menu. Please order with your server or at the bar."}):null,s.open&&Q.length?(0,p.jsxs)(r.default,{testID:"table-ask-server",style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:W.length?'Also on the menu':'On the menu'}),(0,p.jsx)(o.Muted,{center:!0,children:"Ask your server for these. They can't be ordered from your phone yet, while the kitchen checks their allergens."}),U.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:e}),Q.filter(t=>t.section===e).map((e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{style:{flex:1},children:e.name}),(0,p.jsx)(o.T,{colour:u.colours.muted,children:(0,i.gbp)(e.pricePence)})]},`${e.name}-${t}`))]},e))]}):null,s.open&&j.length?(0,p.jsx)(r.default,{testID:"table-cart",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:"Review your order"}),j.map(e=>{const n=W.find(t=>t.id===e.id);return(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{children:[e.qty,"\xd7 ",n?.name]}),(0,p.jsx)(o.T,{children:(0,i.gbp)(e.qty*(n?.pricePence??0))})]}),(0,p.jsx)(t.TextInput,{style:b,value:e.note,onChangeText:t=>H(e.id,t),placeholder:"Note for the kitchen (optional), e.g. no onions",placeholderTextColor:u.colours.muted,maxLength:140,accessibilityLabel:`Note for ${n?.name}`,testID:`table-note-${e.id}`})]},e.id)}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Total"}),(0,p.jsx)(o.T,{weight:"semibold",children:(0,i.gbp)(Y)})]})]})}):null,s.open?(0,p.jsx)(r.default,{testID:"table-allergy",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Does anyone at the table have a food allergy?"}),(0,p.jsx)(o.Muted,{center:!0,children:"We ask everyone, so the kitchen can keep you safe."}),(0,p.jsxs)(o.Row,{gap:8,style:{justifyContent:'center'},children:[(0,p.jsx)(o.Chip,{label:"No allergies",selected:'none'===k,onPress:()=>w('none')}),(0,p.jsx)(o.Chip,{label:"Yes, allergies",selected:'yes'===k,onPress:()=>w('yes')})]}),'yes'===k?(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:a.ALLERGENS.map(e=>(0,p.jsx)(o.Chip,{label:e.short,selected:C.includes(e.id),onPress:()=>S(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},e.id))}):null,G.length?(0,p.jsxs)(o.Banner,{kind:"warn",title:"Check with staff",children:[G.map(e=>e.name).join(', ')," ",G.length>1?'contain':'contains'," or may contain an allergy you picked. The kitchen will see your allergies on the ticket."]}):null]})}):null,s.open?(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Who's the order for?"}),(0,p.jsx)(t.TextInput,{style:b,value:v,onChangeText:O,placeholder:"Your name (needed)",placeholderTextColor:u.colours.muted,maxLength:40,accessibilityLabel:"Your name, needed",testID:"table-name",autoComplete:"name"}),(0,p.jsx)(t.TextInput,{style:b,value:P,onChangeText:R,placeholder:"Phone number (optional)",placeholderTextColor:u.colours.muted,maxLength:20,keyboardType:"phone-pad",accessibilityLabel:"Phone number, optional",testID:"table-phone",autoComplete:"tel"}),P&&!(0,d.phoneOk)(P)?(0,p.jsx)(o.Muted,{center:!0,children:"Please check the phone number, or leave it blank."}):null,(0,p.jsx)(o.Muted,{center:!0,children:"We only use these for this order."}),(0,p.jsx)(t.TextInput,{style:b,value:I,onChangeText:M,placeholder:"Note for the staff (optional)",placeholderTextColor:u.colours.muted,maxLength:300,accessibilityLabel:"Note for the staff (optional)"})]}):null,(0,p.jsx)(r.default,{testID:"pay-placeholder",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Paying"}),(0,p.jsx)(o.T,{center:!0,children:d.PAY_WORDS}),(0,p.jsx)(o.Muted,{center:!0,children:"No card details are asked for or kept in this app."})]})})]})};var e,t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),r=(e=s)&&e.__esModule?e:{default:e},o=_r(_d[4]),a=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]);const b={borderWidth:1,borderColor:u.colours.border,borderRadius:10,padding:10,color:u.colours.text,backgroundColor:u.colours.surface2}},1271,[796,829,34,102,794,830,836,1131,1272,848,840,25]); __d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tablePublic",{enumerable:!0,get:function(){return s}}),e.sendTableOrder=async function(t,r,a){if(!await(0,n.guestSession)())throw new Error('No connection. Try again when you are back online.');const o=await(0,n.rpc)('guest_table_order_v2',{p_phone:(a.phone??'').trim().slice(0,20)||null,p_token:t,p_lines:r.map(t=>({id:t.id,qty:t.qty,note:t.note.trim().slice(0,140)})),p_note:a.note.trim().slice(0,300)||null,p_allergies:a.allergies.map(t=>({allergen:t.allergen,severity:t.severity})),p_name:a.name.trim().slice(0,40)||null});if(!o||!1===o.ok||!o.id)throw new Error(o?.reason||'This table code isn\u2019t working any more. Please ask a member of staff.');return{id:o.id,ref:o.ref,held:!!o.held,totalPence:o.totalPence}},e.myTableOrders=async function(t){return await(0,n.guestSession)()?await(0,n.rpc)('guest_table_my_orders',{p_token:t})??[]:[]},e.loadTableSettings=async function(){const{data:t,error:n}=await a().from('table_order_settings').select('*').eq('venue_id',o()).maybeSingle();if(n)throw n;return(0,r.fromRow)(t)},e.saveTableSettings=async function(t,n){const{error:s}=await a().from('table_order_settings').upsert({venue_id:o(),...(0,r.toRow)(t),updated_at:(new Date).toISOString(),updated_by:n.slice(0,80)});if(s)throw s},e.listTableCodes=async function(){const{data:t,error:n}=await a().from('table_qr_codes').select('table_no, token, created_at').eq('venue_id',o()).eq('is_on',!0);if(n)throw n;return(t??[]).map(t=>({table:String(t.table_no),token:String(t.token),createdAt:String(t.created_at)})).sort((t,n)=>Number(t.table)-Number(n.table))},Object.defineProperty(e,"tableReadiness",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"makeTableCodes",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"renewTableCode",{enumerable:!0,get:function(){return u}}),e.watchTableSettings=function(t){const r=n.useSync.getState().venueId;if(!r)return()=>{};const o=a().channel(`tos-${r}-${Math.random().toString(36).slice(2,8)}`).on('postgres_changes',{event:'*',schema:'public',table:'table_order_settings',filter:`venue_id=eq.${r}`},()=>t()).subscribe();return()=>{a().removeChannel(o)}};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const a=()=>(0,t.getSupabase)(),o=()=>{const t=n.useSync.getState().venueId;if(!t)throw new Error('Not connected to the venue yet.');return t},s=t=>(0,n.rpc)('table_public',{p_token:t});const l=()=>(0,n.rpc)('table_order_readiness',{p_venue:o()}),c=t=>(0,n.rpc)('table_qr_make',{p_venue:o(),p_tables:t}),u=t=>(0,n.rpc)('table_qr_renew',{p_venue:o(),p_table:t})},1272,[931,985,1131]); __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 l}});var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]);function l(){return(0,t.canShow)('display')?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.DisplayBoard,{}),(0,c.jsx)(u.DisplayPairing,{})]}):(0,c.jsx)(n.Redirect,{href:t.ENTRY[t.APP_VARIANT]})}},1273,[30,34,846,1274,1329,25]); -__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Pe}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:G,subHeader:Le,noVoice:We=!1}={}){const Oe=(0,P.default)(),Ve=g??Oe.width,Ue=Oe.height,Ke=Ve<700,qe=Ve>=Ue,Ye=!Ke&&qe&&Ve>=600,Qe=Ye,Je=Math.round(Math.min(520,Math.max(Ve>=1e3?448:280,.3*Ve))),Xe=S.default.useRef(null),Ze=S.default.useRef(0),[et,tt]=(0,v.useState)({w:0,h:0}),lt=(0,q.useOwner)(e=>e.site),st=(0,V.useRestaurant)(lt);(0,me.useAlertWatcher)(lt,{enabled:!e});const it=(0,V.useOrders)(lt),ot=(0,V.useBookings)(lt),nt=(0,V.useEvents)(lt),at=(0,V.useStore)(e=>e.skipMinutes),rt=(0,V.useStore)(e=>e.clock.mode),dt=(0,V.useNow)(5e3),ct=(0,q.useOwner)(e=>e.staff),ut=(0,q.useOwner)(e=>e.attendance),ht=(0,q.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,Q.ensureAttendance)((0,F.ymd)(dt),dt)},[(0,F.ymd)(dt)]);const gt=ut.filter(e=>e.in&&!e.out&&dt.getTime()-new Date(e.in).getTime()<72e6&&dt.getTime()>=new Date(e.in).getTime()),bt=Ee(ct.find(e=>e.id===gt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,bt,!e);const yt=(0,F.ymd)(dt),pt=(0,T.useTravelDay)('display',yt),xt=(0,Y.useFrontDoor)(yt,qe),ft=(0,J.useDisplaySettings)(lt),mt=ft.privacy,jt=(0,ne.useSaverSync)(),wt=(0,J.usePlan)(lt),kt=(0,J.useFloor)(e=>e.live[lt]),It=(0,je.useBlocks)(e=>e.blocks),[Dt,vt]=(0,v.useState)('plan'),[St,Ct]=(0,v.useState)('all'),[Tt,$t]=(0,v.useState)(null),[Bt,Rt]=(0,v.useState)(null),[Lt,Wt]=(0,v.useState)(null),[zt,Mt]=(0,v.useState)(!1),[Ht,Pt]=(0,v.useState)(!1),[Et,At]=(0,v.useState)(null),[Ot,Nt]=(0,v.useState)(!1),[_t,Gt]=(0,v.useState)(!1),[Ft,Vt]=(0,v.useState)(null),[Ut,Kt]=(0,v.useState)(null),[qt,Yt]=(0,v.useState)(null),Qt=S.default.useRef(0),Jt=e=>{Qt.current=Date.now(),Yt(e)};S.default.useEffect(()=>{if(!qt)return;const e=setInterval(()=>{Date.now()-Qt.current>=De.DAY_IDLE_MS&&Yt(null)},5e3);return()=>clearInterval(e)},[qt]);const Xt=(0,V.useWaitlist)(lt),Zt=(0,V.useStore)(e=>e.walkIns[lt]??0),[el,tl]=(0,v.useState)(!1),[ll,sl]=(0,v.useState)(!1),[il,ol]=(0,v.useState)(!1);(0,N.useReviewAlerts)(lt);const[nl,al]=(0,v.useState)({view:0,content:0}),[rl,dl]=(0,v.useState)(null);S.default.useEffect(()=>{rl&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:rl,timeoutMs:4500,big:!0,testID:'floor-toast'}),dl(null))},[rl]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[cl,ul]=(0,v.useState)(null),hl=S.default.useRef(0),[gl,bl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!cl)return;hl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-hl.current;if(e>=Pe)return ul(null),void dl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');bl(e>=105e3?Math.ceil((Pe-e)/1e3):null)},1e3);return()=>clearInterval(e)},[cl]);const yl=e=>e.date!==yt?Wt({title:`Guest details \xb7 ${(0,De.dayWord)(e.date,yt)} ${e.time}`,body:(0,He.jsx)(He.Fragment,{children:(0,ye.bookingDetails)(e)})}):Wt({title:`Guest details \xb7 ${e.time}`,body:(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Fe,{rid:lt,id:e.id,turnBase:st.settings.turnMins}),e.walkIn?null:(0,He.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Wt(null),At(e.id)},style:{minHeight:56}}),e.walkIn?(0,He.jsx)(ue.CancelWalkInButton,{rid:lt,b:e,big:!0,onDone:e=>{Wt(null),dl(e)}}):null,e.walkIn?(0,He.jsx)(ue.ReinstateWalkInButton,{rid:lt,b:e,today:yt,onDone:e=>{Wt(null),dl(e)}}):null,(0,ye.bookingDetails)(e)]})}),pl=ot.filter(e=>e.date===yt).sort((e,t)=>e.time.localeCompare(t.time)),xl=pl.filter(e=>!['cancelled','noshow'].includes(e.status)),fl=it.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),ml=(0,v.useMemo)(()=>(0,d.forecastToday)(st,ot,it,nt,dt),[st,ot,it,nt,dt.getTime()/6e4|0]),jl=(0,je.closedAreasAt)(It,lt,yt,(0,F.hm)(dt)),wl=[...jl].join(','),kl=(0,v.useMemo)(()=>(0,X.floorView)(wt,ot,it,kt??{},dt,st.settings.turnMins,jl),[wt,ot,it,kt,dt.getTime(),wl]),Il=(0,be.hoursFor)(st,dt),Dl=Il?.open??new Date(`${yt}T12:00:00`),vl=Il?.close??new Date(`${yt}T21:00:00`),Sl=(0,F.addMins)(Dl,-Dl.getMinutes()),Cl=(0,F.addMins)(vl,90),Tl=e=>new Date(`${yt}T${e}:00`),$l=(0,je.blocksOn)(It,lt,yt).map(e=>({from:Tl(e.from),to:Tl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(st,dt,yt)),Bl=Object.keys(kl).filter(e=>'blocked'===kl[e]?.status),Rl=qt&&qt!==yt?qt:yt,Ll=Rl!==yt,Wl=(0,De.dayWord)(Rl,yt),zl=/^(Today|Yesterday|Tomorrow)$/.test(Wl),Ml=Ll?(0,De.bookingsForDay)(ot,Rl,yt).sort((e,t)=>e.time.localeCompare(t.time)):pl,Hl=(0,F.parseYmd)(Rl);Hl.setHours(12);const Pl=Ll?(0,be.hoursFor)(st,Hl):Il,El=Pl?.open??new Date(`${Rl}T12:00:00`),Al=Pl?.close??new Date(`${Rl}T21:00:00`),Ol=e=>new Date(`${Rl}T${e}:00`),Nl=[...Ll?(0,je.blocksOn)(It,lt,Rl).map(e=>({from:Ol(e.from),to:Ol(e.to),label:e.reason??'Paused'})):$l,...Ll?(0,i.queuedServicePauses)(st,Hl,Rl):[]],_l=(0,i.queuedServiceSessions)(st,Hl),Gl=l.IS_QUEUED_VENUE&&(void 0===_l||!_l.length),Fl=(0,He.jsxs)(H.default,{testID:"queued-hours-gate",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:void 0===_l?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,He.jsx)(A.Muted,{children:s.queuedVenues[lt]?.hours.note})]}),Vl=Ll?Pl||Ml.length?RlLl?(0,X.dayFloorView)(wt,Ml,Rl):kl,[Ll,wt,Ml,Rl,kl]),[Kl,ql]=(0,v.useState)(null),Yl=Ll?Ml.filter(e=>!['cancelled','noshow'].includes(e.status)):xl,Ql=Yl.reduce((e,t)=>e+t.partySize,0),Jl=(0,c.coversSplit)(Yl,Rl),Xl=(0,ve.cancelledDayTally)(ot,Rl),Zl=(0,Se.cancellationsFor)(ot,Rl,e=>e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)','')),es=(0,ve.cancelledTallyWords)(Xl,zl?Wl.toLowerCase():Ll?`on ${Wl}`:'today'),ts=It.filter(e=>e.rid===lt&&e.date===Rl&&!e.removedAt),ls=(0,Ie.chartBands)(ts,60*El.getHours()+El.getMinutes(),60*Al.getHours()+Al.getMinutes()),ss=new Set((0,Ie.blockedHours)(ls)),is=dt.getHours()+(dt.getMinutes()>=30?1:0),os=ml.hours.filter(e=>e.hour>=is&&!ss.has(e.hour)),ns=os.reduce((e,t)=>e+t.coversHigh,0),as=os.reduce((e,t)=>e+t.coversLow,0),rs=Math.round((as+ns)/2),ds=!ml.example&&ml.open&&ml.enough&&ns>0?`Usually ${(0,d.coversRange)(rs,rs)} more`:void 0,cs=async(e,t)=>{const l=kl[e]?.booking;if(!l||e===t)return;const s=kl[t]?.status;if(s&&!['free','soon'].includes(s))return void dl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${X.STATUS[s].label.toLowerCase()}. Pick a free table.`);await V.repo.bookings.update(l.id,{table:t});const i=kt?.[e]?.stage;J.useFloor.getState().setLive(lt,t,{stage:i??'seated',dirty:!1}),J.useFloor.getState().setLive(lt,e,{stage:void 0,dirty:!0}),dl(`${(0,ae.privName)(l,mt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},us=Ut?ot.find(e=>e.id===Ut.id):void 0,hs=Ut&&us?(()=>{const e=us.walkIn?(0,ae.privName)(us,mt):Ee(us.name),t=(0,ge.seatsOf)(wt,Ut.tables).total,l=(0,ge.seatLine)(t,us.partySize),s=(0,ge.pickClashes)(us,Ut.tables,ot.filter(e=>e.date===us.date),st.settings.turnMins),i=(0,ge.tableKey)(Ut.tables)!==(0,ge.tableKey)((0,J.tablesOf)(us.table));return(0,He.jsxs)(H.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:U.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,padding:10},children:[(0,He.jsxs)(H.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,De.dayWord)(us.date,yt)} ${us.time}. Tap tables on the plan to add or take them off. ${(0,ge.tablesWords)(Ut.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,De.dayWord)(us.date,yt)," ",us.time]}),(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[(0,ge.tablesWords)(Ut.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,He.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,He.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,ge.tablesWords)(Ut.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(us){try{await(0,he.saveBookingTables)(lt,us,Ut.tables),dl((0,ge.savedWords)(e,us.partySize,Ut.tables,t))}catch(t){dl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Kt(null)}else Kt(null)}}),(0,He.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Kt(null)})]})]})})():null,gs=wt.areas.filter(e=>wt.tables.some(t=>t.areaId===e.id)),bs=e=>{const t=wt.tables.filter(t=>t.areaId===e);return Ll?`${t.filter(e=>!Ul[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(kl[e.name]?.status??'free')).length}/${t.length} free`},ys='all'===St||gs.some(e=>e.id===St)?St:'all',ps=e=>(0,He.jsx)(Z.FloorCanvas,{plan:wt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Ye,big:!0,view:Ul,privacy:mt,turnBase:st.settings.turnMins,highlight:Ut?Ut.tables:Bt?[Bt]:void 0,onTap:e=>{return t=e.name,void(Ut?Kt(e=>e?{...e,tables:(0,ge.toggleTable)(e.tables,t)}:e):Ll?ql(t):Bt?(t!==Bt&&cs(Bt,t),Rt(null)):$t(t));var t},onDrop:(e,t)=>Ut||Ll?void 0:cs(e.name,t.name)}),xs=Ke?1:qe||gs.length>2?2:1,fs=e=>{const t=wt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ms=[];for(let e=0;e{const t=(0,Z.areaBounds)(wt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,Z.minReadableScale)(wt,e.id)}}),et.w,et.h):null,ws=e=>(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',height:ee.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:bs(e.id)})]}),ks=(0,He.jsx)(H.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-et.w)>1||Math.abs(l-et.h)>1)&&tt({w:t,h:l})},children:js?(0,He.jsx)(M.default,{style:{flex:1},scrollEnabled:js.scroll,showsVerticalScrollIndicator:js.scroll,contentContainerStyle:{gap:ee.GRID_GAP},children:js.rows.map((e,t)=>(0,He.jsx)(H.default,{style:{height:js.rowHeights[t],flexDirection:'row',gap:ee.GRID_GAP},children:e.map(e=>{const t=gs.find(t=>t.id===e);return(0,He.jsxs)(H.default,{testID:`area-cell-${e}`,style:{width:js.cellW,gap:2},children:[ws(t),(0,He.jsx)(H.default,{style:{flex:1},children:ps(e)})]},e)})},t))}):null}),Is=(0,He.jsxs)(H.default,{testID:"venue-plan",style:{flex:Ke?void 0:1,gap:10,minWidth:0},children:[(0,He.jsx)(a.TableNumberWarning,{plan:wt}),wt.tables.length?null:(0,He.jsxs)(H.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,He.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,He.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,He.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,He.jsx)(_e,{chipId:"all",compact:!Ke,label:"Whole venue",selected:'all'===ys,onPress:()=>Ct('all')},"__all"),...gs.map(e=>(0,He.jsx)(_e,{chipId:e.id,compact:!Ke,label:`${e.name}${(0,te.areaMarks)(e)}`,colour:(0,U.brandColour)(e.colour),sub:Ke?jl.has(e.id)?'closed':ys===e.id?bs(e.id):void 0:void 0,selected:ys===e.id,onPress:()=>Ct(e.id)},e.id))];return Ke?(0,He.jsx)(H.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,He.jsx)(M.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;al(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>al(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:nl.view>0&&nl.content>0&&nl.content<=nl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:nl.view>0&&nl.content<=nl.view+1?'100%':void 0},children:e})})(),(0,He.jsx)(h.FloorLegend,{}),hs,Bt?(0,He.jsxs)(A.Row,{gap:8,style:{backgroundColor:U.colours.goldTint,borderRadius:10,padding:8},children:[(0,He.jsxs)(A.T,{weight:"semibold",colour:U.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Bt),": tap the new table."]}),(0,He.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Rt(null)})]}):null,'all'===ys&&Ye?ks:'all'===ys?(0,He.jsx)(H.default,{style:{flex:Ke?void 0:1,gap:12,minHeight:Qe?void 0:360},children:ms.map((e,t)=>(0,He.jsxs)(H.default,{style:{flex:Ke?void 0:Math.max(.3,...e.map(e=>fs(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,He.jsxs)(H.default,{style:{flex:1,gap:2},children:[Ke?(0,He.jsxs)(H.default,{style:{alignItems:'center',gap:4},children:[(0,He.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{center:!0,children:bs(e.id)})]}):(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{children:bs(e.id)})]}),(0,He.jsx)(H.default,{style:Ke?{height:Math.max(280,Math.round((Ve-40)*fs(e.id)))}:{flex:1},children:ps(e.id)})]},e.id)),e.length{if(Ll)return void Vt(e.id);const t=(0,J.tablesOf)(e.table)[0];t&&kl[t]?$t(t):yl(e)}},Rl)}),vs='timeline'===Dt,Ss=Ll?(0,He.jsxs)(H.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,backgroundColor:U.colours.goldTint},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:zl?`Showing ${Wl} \xb7 ${(0,F.niceDate)((0,F.parseYmd)(Rl))}`:`Showing ${(0,De.dayWord)(Rl,yt)}`}),(0,He.jsx)(H.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${es}. Showing ${(0,De.dayLong)(Rl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,He.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Kt(null),Jt(null)},style:{minHeight:44}})]}):null,Cs=(0,He.jsx)(H.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:Ke?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===vs;return(0,He.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},onPress:()=>vt(e),style:{flex:Ke?1:void 0,minHeight:Ke?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?U.colours.gold:'transparent',...$e.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,He.jsx)(A.T,{size:Ke?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ts=(0,u.useBookingWrite)(),$s=e=>(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Be.BigAction,{premium:!0,label:"Walk-in",onPress:xt.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"New booking",onPress:xt.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"Edit booking",onPress:()=>Pt(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint})]});(0,Me.useDisplayNotices)(lt,!e);const Bs=Ke?180:168,[Rs,Ls]=(0,v.useState)(Bs),Ws=S.default.useRef(Bs),zs=S.default.useRef(null),Ms=S.default.useRef(null),Hs=()=>{const e=zs.current,t=Ms.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ue<820?8:12,o=44+(Ue<820?4:8),n=i>Ws.current?Math.ceil(i-Ws.current):ke.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Bs,Math.floor(t-s-l)-n-o));Math.abs(Ws.current-a)>=2&&(Ws.current=a,Ls(a))})})};S.default.useEffect(()=>{const e=setTimeout(Hs,60);return()=>clearTimeout(e)},[Ve,Ue]);const Ps=(0,He.jsxs)(H.default,{ref:Ms,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),Hs()},style:{flexDirection:'row',flexWrap:Ve>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:Ke?12:6,justifyContent:Ke?'center':void 0,borderTopWidth:1,borderTopColor:U.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,He.jsx)(ze.DisplayClockButton,{}),(0,He.jsx)(se.HoldToEdit,{quiet:!0,onUnlock:()=>{bl(null),ul({at:Date.now()})},onHint:()=>dl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,He.jsx)(we.BlockBookingsButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,display:!0,day:Rl}),wt.areas.some(e=>e.outdoor)?(0,He.jsx)(we.CloseGardenButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,short:!0}):null,(0,He.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>ol(!0),style:({pressed:e})=>({...$e.look.quiet(e),flexGrow:1}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,He.jsx)(p.GiftQrButton,{rid:lt,venue:st.name})]}),Es=fl.length?(0,He.jsxs)(H.default,{testID:"takeaway-panel",style:[$e.look.panel,{overflow:'hidden'}],children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,He.jsxs)(A.T,{size:12,colour:U.colours.muted,children:[fl.length," live"]})]}),(0,He.jsx)(H.default,{style:{padding:10},children:(0,He.jsx)(Ge,{list:fl,me:bt,compact:!0,bookings:ot})})]}):null,As=(Te.DueToday,Ll?Ml:pl.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Os=Ll?zl?`${Wl}\u2019s guests`:`Guests ${Wl}`:'Today\u2019s guests',Ns=(0,He.jsxs)(He.Fragment,{children:[0===As.length?(0,He.jsx)(A.Muted,{children:Ll?Rl{const t=(0,K.isSeatedHighlight)(e.status,{otherDay:Ll}),l=(0,re.guestRowText)(e,{name:e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)',''),seated:t}),s=t?K.SEATED_FG:U.colours.text,i=t?K.SEATED_MUTED:U.colours.muted,o=t?K.SEATED_FG:U.colours.gold,n=l.depositWarn?U.colours.amber:t?K.SEATED_FG:U.colours.goldLight;return(0,He.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:Ll?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Gt(!1),Vt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,K.seatedHighlightStyle)({backgroundColor:e?U.colours.goldLight:U.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:U.colours.hairline,backgroundColor:e?U.colours.tilePressed:'transparent'},children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,He.jsx)(H.default,{style:{paddingTop:2},children:(0,He.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':U.colours.amber,ink:t?U.colours.gold:U.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,He.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,He.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,He.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,He.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,He.jsx)(H.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,He.jsx)(de.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,He.jsx)(Ce.CancellationsSection,{items:Zl,dayWord:Ll?zl?Wl.toLowerCase():`on ${Wl}`:'today'})]}),_s=(0,He.jsx)(M.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Ns}),Gs=W.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Gt(!1)}}),Fs=(0,He.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Os}, ${As.length}`,accessibilityState:{expanded:_t},'aria-expanded':_t,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Gt(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:_t?U.colours.gold:U.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?U.colours.tilePressed:_t?U.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,He.jsx)(A.T,{size:16,weight:"bold",colour:U.colours.gold,children:As.length}),(0,He.jsx)(H.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(H.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,He.jsxs)(A.T,{size:13,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,children:[Os," ",_t?'\u2039':'\u203a']})})})]}),Vs=_t?(0,He.jsxs)(H.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,He.jsxs)(H.default,{testID:"guests-drawer",...Gs.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ve)),backgroundColor:U.colours.surface,borderRightWidth:1,borderColor:U.colours.gold,borderRadius:14,...$e.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Os.toUpperCase()," (",As.length,")"]}),Xl.count?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:es}):null,(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Os}`,onPress:()=>Gt(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:18,colour:U.colours.muted,children:"\u2715"})})]}),_s]}),(0,He.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Os}`,accessibilityRole:"button",onPress:()=>Gt(!1),style:{flex:1}})]}):null,Us=Gl?Fl:l.IS_KIRKTON&&!Object.values(st.kitchenHours??{}).some(Boolean)?(0,He.jsxs)(H.default,{testID:"kirkton-hours-to-confirm",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,He.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,He.jsx)(ke.DayGraph,{busyThreshold:(0,t.venueBusy)(st,ot,dt).busy,todays:Ml,open:El,close:Al,now:dt,turnBase:st.settings.turnMins,blocks:ts,pauses:Nl,compact:Ke,dense:!Ke,height:Ye?Rs:Bs,forecastNote:Ll?void 0:ds,emptyText:Vl,past:Rl{Ll?Gt(!0):vt('timeline')},Qs=(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',padding:Ue<820?8:12,paddingTop:Ue<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[pt?null:Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[pt?null:Ss,pt?(0,He.jsx)(M.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"})}):vs?Ds:Is,Vs]}),(0,He.jsxs)(H.default,{testID:"display-side",style:{width:Je,gap:Ue<820?4:8,minHeight:0},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:$s(!1)}),(0,He.jsx)(H.default,{style:{flexShrink:0},children:Cs}),pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:Ue<820,snug:Ue<820,tight:Ue<700,aside:`${Yl.length} ${1===Yl.length?'table':'tables'} booked${fl.length?` \xb7 ${fl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{ref:zs,testID:"day-graph-slot",onLayout:Hs,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Ks}),(0,He.jsxs)(M.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,He.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,He.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),Es,(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt})]})]})]});return(0,He.jsxs)(E.SafeAreaView,{style:{flex:1,backgroundColor:U.colours.bg},onTouchStart:()=>{Qt.current=Date.now()},onMouseDown:()=>{Qt.current=Date.now()},children:[Ke?(0,He.jsxs)(H.default,{style:{flex:1},children:[(0,He.jsxs)(M.default,{ref:Xe,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,He.jsx)(H.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,He.jsx)(f.ExitButton,{})}),(0,He.jsx)(_.RestaurantLogo,{rid:lt,size:64}),(0,He.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:st.name}),(0,He.jsx)(_.PoweredBy,{}),(0,He.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,He.jsx)(H.default,{accessible:!0,accessibilityLabel:`Current time ${(0,F.hm)(dt)}`,children:(0,He.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:U.colours.goldLight,children:(0,F.hm)(dt)})}),(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:"m"}),(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:"m"}),G]}),Le,qs,(0,He.jsx)(H.default,{testID:"phone-glance",style:{width:'100%'},children:(0,He.jsx)(Ne,{phone:!0,split:Jl,items:[{label:`Tables \xb7 ${Wl}`,value:Yl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Wl}`,value:Ql,testID:'badge-covers'},{label:'Takeaway',value:fl.length,alert:fl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Mt(!0)}]})}),(0,He.jsx)(H.default,{testID:"primary-actions",style:{gap:8},children:$s(!0)}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),Cs,(0,He.jsx)(H.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:vs?Ds:Is}),(0,He.jsxs)(H.default,{onLayout:e=>{Ze.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[$e.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,He.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:U.colours.goldLight,accessibilityRole:"header",children:[Os," (",As.length,")"]}),(0,He.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{gap:4},children:Ns})]}),Es,Ks,(0,He.jsx)(H.default,{testID:"covers-dock",children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Xe.current?.scrollTo({y:Ze.current,animated:!0})})}),(0,He.jsxs)(H.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,He.jsx)(A.T,{center:!0,size:14,colour:mt?U.colours.muted:U.colours.amber,children:mt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,He.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,He.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ps]}),e?null:(0,He.jsx)(H.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:U.colours.hairline},children:(0,He.jsx)(R.VoiceSlot,{size:56})})]}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ve>=1e3?18:14,paddingVertical:Ue<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...$e.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,He.jsx)(H.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,He.jsx)(_.RestaurantBrand,{rid:st.id,size:Ve<900?32:40,beside:!0})}),(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,He.jsx)(A.T,{size:Ve<900?18:21,weight:"semibold",colour:U.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,F.hm)(dt)}),Ve>=900?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:(0,F.niceDate)(dt)}):null]})]}),pt?(0,He.jsx)(H.default,{style:{width:220}}):(0,He.jsx)(H.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:qs}),(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:Ve<900?'xs':Ve<1100||Ue<700?'s':'m'}),(0,He.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.muted,children:"?"})}),'simulated'===rt?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>at(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:11,colour:U.colours.muted,children:"+15"})}):null,e?null:(0,He.jsx)(f.ExitButton,{}),G,We?null:(0,He.jsx)(R.VoiceSlot,{size:44})]})]}),Le,pt?null:(0,He.jsxs)(H.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,He.jsx)(Ne,{splitOnly:!0,split:Jl,items:[]}),(0,He.jsx)(H.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ve>=1e3?18:14)+(e?0:52)+('simulated'===rt?52:0),zIndex:4},children:(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:Ve<1100||Ue<700?'s':'m'})})]}),Ye?Qs:(Js=(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"front-door-bar",style:{gap:10},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:$s(!1)}),Cs]}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),pt?(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"}):(0,He.jsx)(He.Fragment,{children:(0,He.jsxs)(H.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Ss,vs?Ds:Is,Vs]})]})}),Es,pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Bs+ke.DAY_GRAPH_CHROME},children:Ks})]}),(0,He.jsx)(M.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:Js})),Ps]}),(0,He.jsx)(j.SoldOutStrip,{rid:lt,by:bt,onOpen:()=>ol(!0)}),(0,He.jsx)(w.SoldOutSheet,{visible:il,onClose:()=>ol(!1),rid:lt,by:bt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,He.jsx)(y.TableOrderCue,{rid:lt}),xt.elements,Ht?(0,He.jsx)(b.EditBookingPicker,{rid:lt,today:yt,who:bt,hidePrivate:!0,onClose:()=>Pt(!1)}):null,Et?(0,He.jsx)(b.EditBookingSheet,{rid:lt,id:Et,who:bt,hidePrivate:!0,onClose:()=>At(null)}):null,Tt?(0,He.jsx)(ye.TableSheet,{rid:lt,name:Tt,view:kl,plan:wt,todays:pl,now:dt,privacy:mt,turnBase:st.settings.turnMins,onClose:()=>$t(null),onWalkIn:e=>xt.openWalkInAt(e),onMove:e=>Rt(e),onDetails:yl}):null,Kl?(()=>{const e=Ul[Kl],t=e?.dayBookings??[];return(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>ql(null),title:`${(0,r.tableNumbers)(Kl)} \xb7 ${zl?Wl:(0,De.dayLong)(Rl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${zl?Wl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${zl?Wl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,ae.privName)(e,mt):Ee(e.name);return(0,He.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,ge.tablesWords)((0,J.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{ql(null),Vt(e.id)},style:{minHeight:56}},e.id)}),(0,He.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>ql(null),style:{minHeight:56}})]})})():null,Ft?(()=>{const e=ot.find(e=>e.id===Ft);return e?(0,He.jsx)(ce.GuestActionsSheet,{rid:lt,b:e,name:e.walkIn?(0,ae.privName)(e,mt):Ee(e.name),view:kl,now:dt,otherDay:e.date!==yt,turnBase:st.settings.turnMins,onClose:()=>Vt(null),onDetails:yl,onDone:dl,onPickOnPlan:(e,t)=>{Gt(!1),vt('plan'),Ct('all'),Kt({id:e.id,tables:t})}}):null})():null,Lt?(0,He.jsx)(ye.DetailsPanel,{title:Lt.title,onClose:()=>Wt(null),children:Lt.body}):null,Ot?(0,He.jsx)(ye.ServiceSummary,{r:st,todays:pl,orders:it,waitlistAll:Xt,walkInCount:Zt,onClose:()=>Nt(!1)}):null,el?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>tl(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,He.jsx)(h.FloorLegend,{}),(0,He.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>tl(!1)})]}):null,ll?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>sl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,He.jsx)(O.ReviewsSection,{rid:lt,mode:"read",venueName:st.name}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>sl(!1)})]}):null,zt?(0,He.jsxs)(ye.DetailsPanel,{title:"Takeaway",onClose:()=>Mt(!1),children:[(0,He.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,He.jsx)(Ge,{list:fl,me:bt,bookings:ot})]}):null,cl?(0,He.jsx)(H.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:U.colours.bg},children:(0,He.jsx)(le.PlanDesigner,{initial:wt,venue:st.name,mode:"display",startStep:"arrange",onActivity:()=>{hl.current=Date.now(),null!==gl&&bl(null)},notice:null!==gl?`Locking again in ${gl} s \xb7 touch to keep editing`:null,onSave:e=>{J.useFloor.getState().setPlan(lt,e),ul(null),dl('Table plan saved. Editing is locked again.')},onCancel:()=>{ul(null),dl('No changes kept. Editing is locked again.')}},cl.at)}):null,e?null:(0,He.jsx)(oe.Screensaver,{rid:lt,idleMins:ft.idleMins,pinOn:ft.pinOn,wake:ft,tonightCards:ft.tonightCards,cfg:jt}),e?null:(0,He.jsx)(xe.PrintHost,{rid:lt}),e?null:(0,He.jsx)(pe.AlertHost,{variant:"display",rid:lt,skipTakeaway:!0}),e?null:(0,He.jsx)(B.SeatAllergenReminder,{rid:lt}),e?null:(0,He.jsx)(fe.TakeawayTakeover,{rid:lt,me:bt})]});var Js};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),z=e(_r(_d[31])),M=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=_r(_d[35]),A=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),ze=_r(_d[85]),Me=_r(_d[86]),He=_r(_d[87]);const Pe=12e4,Ee=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Oe=e=>e.slotTime?(0,F.hm)(new Date(e.slotTime)):'ASAP';function Ne({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,He.jsxs)(H.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,He.jsx)(H.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,He.jsxs)(H.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,He.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?U.colours.amber:U.colours.text,children:e.value}),(0,He.jsx)(A.T,{size:l?14:12,colour:U.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,He.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,He.jsx)(H.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,He.jsx)(A.T,{size:14,colour:U.colours.muted,children:"No Covers yet"}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:U.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,He.jsxs)(H.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:U.colours.gold},children:[(0,He.jsx)(H.default,{style:{width:`${s.walkInPct}%`,backgroundColor:U.colours.gold}}),(0,He.jsx)(H.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function _e({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,He.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,He.jsx)(H.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,He.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?U.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,He.jsx)(A.T,{size:12,colour:U.colours.muted,children:l}):null]})}function Ge({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,We.statusBlock)(e,t,(0,We.linkedBooking)(e,s));return e.length?(0,He.jsx)(H.default,{style:{gap:8},children:e.map(e=>(0,He.jsxs)(H.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:U.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?U.colours.ok:e.allergies.length?U.colours.red:U.colours.gold},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Oe(e)," \xb7 ",Ee(e.customerName)]}),(0,He.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,He.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:U.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,G.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,He.jsx)(Le.AllergyChain,{o:e,me:t,compact:!0}):null,(0,He.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,He.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>V.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,He.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,He.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'collected',t)}):null,(0,He.jsx)(xe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,He.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Fe({rid:e,id:t,turnBase:l}){const s=(0,V.useBookings)(e).find(e=>e.id===t);return s?(0,He.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1274,[1121,5,6,1275,798,822,1094,829,1120,1276,1277,1278,1091,1115,1279,1280,1282,1283,1284,1130,977,1099,1285,34,1073,1148,1033,1087,1116,1286,380,402,295,102,426,36,794,1176,1180,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1287,1107,1288,1291,1293,1296,1299,1295,1300,1302,1303,1112,1093,1095,852,1305,1165,1306,1175,1167,1011,1311,1319,1321,1076,1114,1323,1324,1325,1143,1326,1142,1136,838,1327,1328,25]); +__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Ee}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:F,subHeader:We,noVoice:Me=!1}={}){const Ne=(0,E.default)(),Ue=g??Ne.width,Ke=Ne.height,qe=Ue<700,Ye=Ue>=Ke,Qe=!qe&&Ye&&Ue>=600,Je=Qe,Xe=Math.round(Math.min(520,Math.max(Ue>=1e3?448:280,.3*Ue))),Ze=S.default.useRef(null),et=S.default.useRef(0),[tt,lt]=(0,v.useState)({w:0,h:0}),st=(0,Y.useOwner)(e=>e.site),it=(0,U.useRestaurant)(st);(0,je.useAlertWatcher)(st,{enabled:!e});const ot=(0,U.useOrders)(st),nt=(0,U.useBookings)(st),at=(0,U.useEvents)(st),rt=(0,U.useStore)(e=>e.skipMinutes),dt=(0,U.useStore)(e=>e.clock.mode),ct=(0,U.useNow)(5e3),ut=(0,Y.useOwner)(e=>e.staff),ht=(0,Y.useOwner)(e=>e.attendance),gt=(0,Y.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,J.ensureAttendance)((0,V.ymd)(ct),ct)},[(0,V.ymd)(ct)]);const bt=ht.filter(e=>e.in&&!e.out&&ct.getTime()-new Date(e.in).getTime()<72e6&&ct.getTime()>=new Date(e.in).getTime()),yt=Oe(ut.find(e=>e.id===bt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,yt,!e);const pt=(0,V.ymd)(ct),xt=(0,T.useTravelDay)('display',pt),ft=(0,Q.useFrontDoor)(pt,Ye),mt=(0,X.useDisplaySettings)(st),jt=mt.privacy,wt=(0,ae.useSaverSync)(),kt=(0,X.usePlan)(st),It=(0,X.useFloor)(e=>e.live[st]),Dt=(0,we.useBlocks)(e=>e.blocks),[vt,St]=(0,v.useState)('plan'),[Ct,Tt]=(0,v.useState)(!1),[$t,Bt]=(0,v.useState)('all'),[Rt,Lt]=(0,v.useState)(null),[Wt,Mt]=(0,v.useState)(null),[zt,Ht]=(0,v.useState)(null),[Pt,Et]=(0,v.useState)(!1),[Ot,At]=(0,v.useState)(!1),[Nt,_t]=(0,v.useState)(null),[Gt,Ft]=(0,v.useState)(!1),[Vt,Ut]=(0,v.useState)(!1),[Kt,qt]=(0,v.useState)(null),[Yt,Qt]=(0,v.useState)(null),[Jt,Xt]=(0,v.useState)(null),Zt=S.default.useRef(0),el=e=>{Zt.current=Date.now(),Xt(e)};S.default.useEffect(()=>{if(!Jt)return;const e=setInterval(()=>{Date.now()-Zt.current>=ve.DAY_IDLE_MS&&Xt(null)},5e3);return()=>clearInterval(e)},[Jt]);const tl=(0,U.useWaitlist)(st),ll=(0,U.useStore)(e=>e.walkIns[st]??0),[sl,il]=(0,v.useState)(!1),[ol,nl]=(0,v.useState)(!1),[al,rl]=(0,v.useState)(!1);(0,_.useReviewAlerts)(st);const[dl,cl]=(0,v.useState)({view:0,content:0}),[ul,hl]=(0,v.useState)(null);S.default.useEffect(()=>{ul&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:ul,timeoutMs:4500,big:!0,testID:'floor-toast'}),hl(null))},[ul]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[gl,bl]=(0,v.useState)(null),yl=S.default.useRef(0),[pl,xl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!gl)return;yl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-yl.current;if(e>=Ee)return bl(null),void hl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');xl(e>=105e3?Math.ceil((Ee-e)/1e3):null)},1e3);return()=>clearInterval(e)},[gl]);const fl=e=>e.date!==pt?Ht({title:`Guest details \xb7 ${(0,ve.dayWord)(e.date,pt)} ${e.time}`,body:(0,Pe.jsx)(Pe.Fragment,{children:(0,pe.bookingDetails)(e)})}):Ht({title:`Guest details \xb7 ${e.time}`,body:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ve,{rid:st,id:e.id,turnBase:it.settings.turnMins}),e.walkIn?null:(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Ht(null),_t(e.id)},style:{minHeight:56}}),e.walkIn?(0,Pe.jsx)(he.CancelWalkInButton,{rid:st,b:e,big:!0,onDone:e=>{Ht(null),hl(e)}}):null,e.walkIn?(0,Pe.jsx)(he.ReinstateWalkInButton,{rid:st,b:e,today:pt,onDone:e=>{Ht(null),hl(e)}}):null,(0,pe.bookingDetails)(e)]})}),ml=nt.filter(e=>e.date===pt).sort((e,t)=>e.time.localeCompare(t.time)),jl=ml.filter(e=>!['cancelled','noshow'].includes(e.status)),wl=ot.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),kl=(0,v.useMemo)(()=>(0,d.forecastToday)(it,nt,ot,at,ct),[it,nt,ot,at,ct.getTime()/6e4|0]),Il=(0,we.closedAreasAt)(Dt,st,pt,(0,V.hm)(ct)),Dl=[...Il].join(','),vl=(0,v.useMemo)(()=>(0,Z.floorView)(kt,nt,ot,It??{},ct,it.settings.turnMins,Il),[kt,nt,ot,It,ct.getTime(),Dl]),Sl=(0,ye.hoursFor)(it,ct),Cl=Sl?.open??new Date(`${pt}T12:00:00`),Tl=Sl?.close??new Date(`${pt}T21:00:00`),$l=(0,V.addMins)(Cl,-Cl.getMinutes()),Bl=(0,V.addMins)(Tl,90),Rl=e=>new Date(`${pt}T${e}:00`),Ll=(0,we.blocksOn)(Dt,st,pt).map(e=>({from:Rl(e.from),to:Rl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(it,ct,pt)),Wl=Object.keys(vl).filter(e=>'blocked'===vl[e]?.status),Ml=Jt&&Jt!==pt?Jt:pt,zl=Ml!==pt,Hl=(0,ve.dayWord)(Ml,pt),Pl=/^(Today|Yesterday|Tomorrow)$/.test(Hl),El=zl?(0,ve.bookingsForDay)(nt,Ml,pt).sort((e,t)=>e.time.localeCompare(t.time)):ml,Ol=(0,V.parseYmd)(Ml);Ol.setHours(12);const Al=zl?(0,ye.hoursFor)(it,Ol):Sl,Nl=Al?.open??new Date(`${Ml}T12:00:00`),_l=Al?.close??new Date(`${Ml}T21:00:00`),Gl=e=>new Date(`${Ml}T${e}:00`),Fl=[...zl?(0,we.blocksOn)(Dt,st,Ml).map(e=>({from:Gl(e.from),to:Gl(e.to),label:e.reason??'Paused'})):Ll,...zl?(0,i.queuedServicePauses)(it,Ol,Ml):[]],Vl=(0,i.queuedServiceSessions)(it,Ol),Ul=l.IS_QUEUED_VENUE&&(void 0===Vl||!Vl.length),Kl=(0,Pe.jsxs)(P.default,{testID:"queued-hours-gate",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:void 0===Vl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Pe.jsx)(A.Muted,{children:s.queuedVenues[st]?.hours.note})]}),ql=zl?Al||El.length?Mlzl?(0,Z.dayFloorView)(kt,El,Ml):vl,[zl,kt,El,Ml,vl]),[Ql,Jl]=(0,v.useState)(null),Xl=zl?El.filter(e=>!['cancelled','noshow'].includes(e.status)):jl,Zl=Xl.reduce((e,t)=>e+t.partySize,0),es=(0,c.coversSplit)(Xl,Ml),ts=(0,Se.cancelledDayTally)(nt,Ml),ls=(0,Ce.cancellationsFor)(nt,Ml,e=>e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)','')),ss=(0,Se.cancelledTallyWords)(ts,Pl?Hl.toLowerCase():zl?`on ${Hl}`:'today'),is=Dt.filter(e=>e.rid===st&&e.date===Ml&&!e.removedAt),os=(0,De.chartBands)(is,60*Nl.getHours()+Nl.getMinutes(),60*_l.getHours()+_l.getMinutes()),ns=new Set((0,De.blockedHours)(os)),as=ct.getHours()+(ct.getMinutes()>=30?1:0),rs=kl.hours.filter(e=>e.hour>=as&&!ns.has(e.hour)),ds=rs.reduce((e,t)=>e+t.coversHigh,0),cs=rs.reduce((e,t)=>e+t.coversLow,0),us=Math.round((cs+ds)/2),hs=!kl.example&&kl.open&&kl.enough&&ds>0?`Usually ${(0,d.coversRange)(us,us)} more`:void 0,gs=async(e,t)=>{const l=vl[e]?.booking;if(!l||e===t)return;const s=vl[t]?.status;if(s&&!['free','soon'].includes(s))return void hl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${Z.STATUS[s].label.toLowerCase()}. Pick a free table.`);await U.repo.bookings.update(l.id,{table:t});const i=It?.[e]?.stage;X.useFloor.getState().setLive(st,t,{stage:i??'seated',dirty:!1}),X.useFloor.getState().setLive(st,e,{stage:void 0,dirty:!0}),hl(`${(0,re.privName)(l,jt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},bs=Yt?nt.find(e=>e.id===Yt.id):void 0,ys=Yt&&bs?(()=>{const e=bs.walkIn?(0,re.privName)(bs,jt):Oe(bs.name),t=(0,be.seatsOf)(kt,Yt.tables).total,l=(0,be.seatLine)(t,bs.partySize),s=(0,be.pickClashes)(bs,Yt.tables,nt.filter(e=>e.date===bs.date),it.settings.turnMins),i=(0,be.tableKey)(Yt.tables)!==(0,be.tableKey)((0,X.tablesOf)(bs.table));return(0,Pe.jsxs)(P.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:K.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,padding:10},children:[(0,Pe.jsxs)(P.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,ve.dayWord)(bs.date,pt)} ${bs.time}. Tap tables on the plan to add or take them off. ${(0,be.tablesWords)(Yt.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,ve.dayWord)(bs.date,pt)," ",bs.time]}),(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[(0,be.tablesWords)(Yt.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,Pe.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,Pe.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,be.tablesWords)(Yt.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(bs){try{await(0,ge.saveBookingTables)(st,bs,Yt.tables),hl((0,be.savedWords)(e,bs.partySize,Yt.tables,t))}catch(t){hl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Qt(null)}else Qt(null)}}),(0,Pe.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Qt(null)})]})]})})():null,ps=kt.areas.filter(e=>kt.tables.some(t=>t.areaId===e.id)),xs=e=>{const t=kt.tables.filter(t=>t.areaId===e);return zl?`${t.filter(e=>!Yl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(vl[e.name]?.status??'free')).length}/${t.length} free`},fs='all'===$t||ps.some(e=>e.id===$t)?$t:'all',ms=e=>(0,Pe.jsx)(ee.FloorCanvas,{plan:kt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Qe,big:!0,view:Yl,privacy:jt,turnBase:it.settings.turnMins,highlight:Yt?Yt.tables:Wt?[Wt]:void 0,onTap:e=>{return t=e.name,void(Yt?Qt(e=>e?{...e,tables:(0,be.toggleTable)(e.tables,t)}:e):zl?Jl(t):Wt?(t!==Wt&&gs(Wt,t),Mt(null)):Lt(t));var t},onDrop:(e,t)=>Yt||zl?void 0:gs(e.name,t.name)}),js=qe?1:Ye||ps.length>2?2:1,ws=e=>{const t=kt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ks=[];for(let e=0;e{const t=(0,ee.areaBounds)(kt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ee.minReadableScale)(kt,e.id)}}),tt.w,tt.h):null,Ds=e=>(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',height:te.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:xs(e.id)})]}),vs=(0,Pe.jsx)(P.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-tt.w)>1||Math.abs(l-tt.h)>1)&<({w:t,h:l})},children:Is?(0,Pe.jsx)(H.default,{style:{flex:1},scrollEnabled:Is.scroll,showsVerticalScrollIndicator:Is.scroll,contentContainerStyle:{gap:te.GRID_GAP},children:Is.rows.map((e,t)=>(0,Pe.jsx)(P.default,{style:{height:Is.rowHeights[t],flexDirection:'row',gap:te.GRID_GAP},children:e.map(e=>{const t=ps.find(t=>t.id===e);return(0,Pe.jsxs)(P.default,{testID:`area-cell-${e}`,style:{width:Is.cellW,gap:2},children:[Ds(t),(0,Pe.jsx)(P.default,{style:{flex:1},children:ms(e)})]},e)})},t))}):null}),Ss=(0,Pe.jsxs)(P.default,{testID:"venue-plan",style:{flex:qe?void 0:1,gap:10,minWidth:0},children:[(0,Pe.jsx)(a.TableNumberWarning,{plan:kt}),kt.tables.length?null:(0,Pe.jsxs)(P.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Pe.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Pe.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,Pe.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Pe.jsx)(Ge,{chipId:"all",compact:!qe,label:"Whole venue",selected:'all'===fs,onPress:()=>Bt('all')},"__all"),...ps.map(e=>(0,Pe.jsx)(Ge,{chipId:e.id,compact:!qe,label:`${e.name}${(0,le.areaMarks)(e)}`,colour:(0,K.brandColour)(e.colour),sub:qe?Il.has(e.id)?'closed':fs===e.id?xs(e.id):void 0:void 0,selected:fs===e.id,onPress:()=>Bt(e.id)},e.id))];return qe?(0,Pe.jsx)(P.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Pe.jsx)(H.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;cl(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>cl(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:dl.view>0&&dl.content>0&&dl.content<=dl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:dl.view>0&&dl.content<=dl.view+1?'100%':void 0},children:e})})(),(0,Pe.jsx)(h.FloorLegend,{}),ys,Wt?(0,Pe.jsxs)(A.Row,{gap:8,style:{backgroundColor:K.colours.goldTint,borderRadius:10,padding:8},children:[(0,Pe.jsxs)(A.T,{weight:"semibold",colour:K.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Wt),": tap the new table."]}),(0,Pe.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Mt(null)})]}):null,'all'===fs&&Qe?vs:'all'===fs?(0,Pe.jsx)(P.default,{style:{flex:qe?void 0:1,gap:12,minHeight:Je?void 0:360},children:ks.map((e,t)=>(0,Pe.jsxs)(P.default,{style:{flex:qe?void 0:Math.max(.3,...e.map(e=>ws(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Pe.jsxs)(P.default,{style:{flex:1,gap:2},children:[qe?(0,Pe.jsxs)(P.default,{style:{alignItems:'center',gap:4},children:[(0,Pe.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{center:!0,children:xs(e.id)})]}):(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{children:xs(e.id)})]}),(0,Pe.jsx)(P.default,{style:qe?{height:Math.max(280,Math.round((Ue-40)*ws(e.id)))}:{flex:1},children:ms(e.id)})]},e.id)),e.length{if(zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},Ml)}),Ts='timeline'===vt,$s=Ct?(0,Pe.jsx)(W.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Tt(!1),supportedOrientations:['landscape','portrait'],children:(0,Pe.jsxs)(P.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:K.colours.bg,padding:10,gap:8},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Pe.jsx)(z.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Tt(!1),style:{minHeight:64,minWidth:180,paddingHorizontal:22,borderRadius:16,borderWidth:2,borderColor:K.colours.goldLight,backgroundColor:K.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Pe.jsx)(P.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Pe.jsx)(A.T,{size:22,weight:"semibold",colour:K.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${zl?(0,ve.dayLong)(Ml):'Today'}`})}),(0,Pe.jsx)(P.default,{style:{minWidth:180}})]}),Ul?Kl:(0,Pe.jsx)(P.default,{style:{flex:1,minHeight:0},children:(0,Pe.jsx)(oe.Timeline,{hideNow:!0,plan:kt,bookings:zl?El:ml,now:zl?Nl:ct,privacy:jt,turnBase:it.settings.turnMins,t0:zl?(0,V.addMins)(Nl,-Nl.getMinutes()):$l,t1:zl?(0,V.addMins)(_l,90):Bl,pauses:zl?Fl:Ll,blockedTables:zl?[]:Wl,onOpen:e=>{if(Tt(!1),zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},`full-${Ml}`)})]})}):null,Bs=zl?(0,Pe.jsxs)(P.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,backgroundColor:K.colours.goldTint},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:Pl?`Showing ${Hl} \xb7 ${(0,V.niceDate)((0,V.parseYmd)(Ml))}`:`Showing ${(0,ve.dayWord)(Ml,pt)}`}),(0,Pe.jsx)(P.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${ss}. Showing ${(0,ve.dayLong)(Ml)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Pe.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Qt(null),el(null)},style:{minHeight:44}})]}):null,Rs=(0,Pe.jsx)(P.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:qe?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(Ts||Ct);return(0,Pe.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},accessibilityHint:'timeline'===e?'Opens the timeline over the whole screen':void 0,onPress:()=>{'timeline'===e?(St('plan'),Tt(!0)):(Tt(!1),St('plan'))},style:{flex:qe?1:void 0,minHeight:qe?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?K.colours.gold:'transparent',...Be.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,Pe.jsx)(A.T,{size:qe?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ls=(0,u.useBookingWrite)(),Ws=e=>(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Walk-in",onPress:ft.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"New booking",onPress:ft.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Edit booking",onPress:()=>At(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint})]});(0,He.useDisplayNotices)(st,!e);const Ms=qe?180:168,[zs,Hs]=(0,v.useState)(Ms),Ps=S.default.useRef(Ms),Es=S.default.useRef(null),Os=S.default.useRef(null),As=()=>{const e=Es.current,t=Os.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ke<820?8:12,o=44+(Ke<820?4:8),n=i>Ps.current?Math.ceil(i-Ps.current):Ie.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Ms,Math.floor(t-s-l)-n-o));Math.abs(Ps.current-a)>=2&&(Ps.current=a,Hs(a))})})};S.default.useEffect(()=>{const e=setTimeout(As,60);return()=>clearTimeout(e)},[Ue,Ke]);const Ns=(0,Pe.jsxs)(P.default,{ref:Os,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),As()},style:{flexDirection:'row',flexWrap:Ue>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:qe?12:6,justifyContent:qe?'center':void 0,borderTopWidth:1,borderTopColor:K.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Pe.jsx)(ze.DisplayClockButton,{}),(0,Pe.jsx)(ie.HoldToEdit,{quiet:!0,onUnlock:()=>{xl(null),bl({at:Date.now()})},onHint:()=>hl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Pe.jsx)(ke.BlockBookingsButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,display:!0,day:Ml}),kt.areas.some(e=>e.outdoor)?(0,Pe.jsx)(ke.CloseGardenButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,short:!0}):null,(0,Pe.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>rl(!0),style:({pressed:e})=>({...Be.look.quiet(e),flexGrow:1}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,Pe.jsx)(p.GiftQrButton,{rid:st,venue:it.name})]}),_s=wl.length?(0,Pe.jsxs)(P.default,{testID:"takeaway-panel",style:[Be.look.panel,{overflow:'hidden'}],children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Pe.jsxs)(A.T,{size:12,colour:K.colours.muted,children:[wl.length," live"]})]}),(0,Pe.jsx)(P.default,{style:{padding:10},children:(0,Pe.jsx)(Fe,{list:wl,me:yt,compact:!0,bookings:nt})})]}):null,Gs=($e.DueToday,zl?El:ml.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Fs=zl?Pl?`${Hl}\u2019s guests`:`Guests ${Hl}`:'Today\u2019s guests',Vs=(0,Pe.jsxs)(Pe.Fragment,{children:[0===Gs.length?(0,Pe.jsx)(A.Muted,{children:zl?Ml{const t=(0,q.isSeatedHighlight)(e.status,{otherDay:zl}),l=(0,de.guestRowText)(e,{name:e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)',''),seated:t}),s=t?q.SEATED_FG:K.colours.text,i=t?q.SEATED_MUTED:K.colours.muted,o=t?q.SEATED_FG:K.colours.gold,n=l.depositWarn?K.colours.amber:t?q.SEATED_FG:K.colours.goldLight;return(0,Pe.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:zl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Ut(!1),qt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,q.seatedHighlightStyle)({backgroundColor:e?K.colours.goldLight:K.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:K.colours.hairline,backgroundColor:e?K.colours.tilePressed:'transparent'},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Pe.jsx)(P.default,{style:{paddingTop:2},children:(0,Pe.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':K.colours.amber,ink:t?K.colours.gold:K.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Pe.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,Pe.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,Pe.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,Pe.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,Pe.jsx)(P.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Pe.jsx)(ce.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,Pe.jsx)(Te.CancellationsSection,{items:ls,dayWord:zl?Pl?Hl.toLowerCase():`on ${Hl}`:'today'})]}),Us=(0,Pe.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Vs}),Ks=M.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Ut(!1)}}),qs=(0,Pe.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Fs}, ${Gs.length}`,accessibilityState:{expanded:Vt},'aria-expanded':Vt,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Ut(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:Vt?K.colours.gold:K.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?K.colours.tilePressed:Vt?K.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Pe.jsx)(A.T,{size:16,weight:"bold",colour:K.colours.gold,children:Gs.length}),(0,Pe.jsx)(P.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(P.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Pe.jsxs)(A.T,{size:13,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,children:[Fs," ",Vt?'\u2039':'\u203a']})})})]}),Ys=Vt?(0,Pe.jsxs)(P.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Pe.jsxs)(P.default,{testID:"guests-drawer",...Ks.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ue)),backgroundColor:K.colours.surface,borderRightWidth:1,borderColor:K.colours.gold,borderRadius:14,...Be.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Fs.toUpperCase()," (",Gs.length,")"]}),ts.count?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:ss}):null,(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Fs}`,onPress:()=>Ut(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:18,colour:K.colours.muted,children:"\u2715"})})]}),Us]}),(0,Pe.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Fs}`,accessibilityRole:"button",onPress:()=>Ut(!1),style:{flex:1}})]}):null,Qs=Ul?Kl:l.IS_KIRKTON&&!Object.values(it.kitchenHours??{}).some(Boolean)?(0,Pe.jsxs)(P.default,{testID:"kirkton-hours-to-confirm",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Pe.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,Pe.jsx)(Ie.DayGraph,{busyThreshold:(0,t.venueBusy)(it,nt,ct).busy,todays:El,open:Nl,close:_l,now:ct,turnBase:it.settings.turnMins,blocks:is,pauses:Fl,compact:qe,dense:!qe,height:Qe?zs:Ms,forecastNote:zl?void 0:hs,emptyText:ql,past:Ml{zl?Ut(!0):Tt(!0)},ei=(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',padding:Ke<820?8:12,paddingTop:Ke<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[xt?null:qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[xt?null:Bs,xt?(0,Pe.jsx)(H.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"})}):Ts?Cs:Ss,$s,Ys]}),(0,Pe.jsxs)(P.default,{testID:"display-side",style:{width:Xe,gap:Ke<820?4:8,minHeight:0},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Ws(!1)}),(0,Pe.jsx)(P.default,{style:{flexShrink:0},children:Rs}),xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:Ke<820,snug:Ke<820,tight:Ke<700,aside:`${Xl.length} ${1===Xl.length?'table':'tables'} booked${wl.length?` \xb7 ${wl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{ref:Es,testID:"day-graph-slot",onLayout:As,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Js}),(0,Pe.jsxs)(H.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,Pe.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Pe.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),_s,(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt})]})]})]});return(0,Pe.jsxs)(O.SafeAreaView,{style:{flex:1,backgroundColor:K.colours.bg},onTouchStart:()=>{Zt.current=Date.now()},onMouseDown:()=>{Zt.current=Date.now()},children:[qe?(0,Pe.jsxs)(P.default,{style:{flex:1},children:[(0,Pe.jsxs)(H.default,{ref:Ze,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Pe.jsx)(P.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Pe.jsx)(f.ExitButton,{})}),(0,Pe.jsx)(G.RestaurantLogo,{rid:st,size:64}),(0,Pe.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:it.name}),(0,Pe.jsx)(G.PoweredBy,{}),(0,Pe.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Pe.jsx)(P.default,{accessible:!0,accessibilityLabel:`Current time ${(0,V.hm)(ct)}`,children:(0,Pe.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:K.colours.goldLight,children:(0,V.hm)(ct)})}),(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:"m"}),(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:"m"}),F]}),We,Xs,(0,Pe.jsx)(P.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Pe.jsx)(_e,{phone:!0,split:es,items:[{label:`Tables \xb7 ${Hl}`,value:Xl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Hl}`,value:Zl,testID:'badge-covers'},{label:'Takeaway',value:wl.length,alert:wl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Et(!0)}]})}),(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{gap:8},children:Ws(!0)}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),Rs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[Ts?Cs:Ss,$s]}),(0,Pe.jsxs)(P.default,{onLayout:e=>{et.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Be.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Pe.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:K.colours.goldLight,accessibilityRole:"header",children:[Fs," (",Gs.length,")"]}),(0,Pe.jsx)(P.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{gap:4},children:Vs})]}),_s,Js,(0,Pe.jsx)(P.default,{testID:"covers-dock",children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Ze.current?.scrollTo({y:et.current,animated:!0})})}),(0,Pe.jsxs)(P.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Pe.jsx)(A.T,{center:!0,size:14,colour:jt?K.colours.muted:K.colours.amber,children:jt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Pe.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,Pe.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ns]}),e?null:(0,Pe.jsx)(P.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:K.colours.hairline},children:(0,Pe.jsx)(R.VoiceSlot,{size:56})})]}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ue>=1e3?18:14,paddingVertical:Ke<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Be.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,Pe.jsx)(P.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Pe.jsx)(G.RestaurantBrand,{rid:it.id,size:Ue<900?32:40,beside:!0})}),(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Pe.jsx)(A.T,{size:Ue<900?18:21,weight:"semibold",colour:K.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,V.hm)(ct)}),Ue>=900?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:(0,V.niceDate)(ct)}):null]})]}),xt?(0,Pe.jsx)(P.default,{style:{width:220}}):(0,Pe.jsx)(P.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:Xs}),(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:Ue<900?'xs':Ue<1100||Ke<700?'s':'m'}),(0,Pe.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.muted,children:"?"})}),'simulated'===dt?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>rt(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:11,colour:K.colours.muted,children:"+15"})}):null,e?null:(0,Pe.jsx)(f.ExitButton,{}),F,Me?null:(0,Pe.jsx)(R.VoiceSlot,{size:44})]})]}),We,xt?null:(0,Pe.jsxs)(P.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,Pe.jsx)(_e,{splitOnly:!0,split:es,items:[]}),(0,Pe.jsx)(P.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ue>=1e3?18:14)+(e?0:52)+('simulated'===dt?52:0),zIndex:4},children:(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:Ue<1100||Ke<700?'s':'m'})})]}),Qe?ei:(ti=(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Ws(!1)}),Rs]}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),xt?(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"}):(0,Pe.jsx)(Pe.Fragment,{children:(0,Pe.jsxs)(P.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Bs,Ts?Cs:Ss,$s,Ys]})]})}),_s,xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Ms+Ie.DAY_GRAPH_CHROME},children:Js})]}),(0,Pe.jsx)(H.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:ti})),Ns]}),(0,Pe.jsx)(j.SoldOutStrip,{rid:st,by:yt,onOpen:()=>rl(!0)}),(0,Pe.jsx)(w.SoldOutSheet,{visible:al,onClose:()=>rl(!1),rid:st,by:yt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Pe.jsx)(y.TableOrderCue,{rid:st}),ft.elements,Ot?(0,Pe.jsx)(b.EditBookingPicker,{rid:st,today:pt,who:yt,hidePrivate:!0,onClose:()=>At(!1)}):null,Nt?(0,Pe.jsx)(b.EditBookingSheet,{rid:st,id:Nt,who:yt,hidePrivate:!0,onClose:()=>_t(null)}):null,Rt?(0,Pe.jsx)(pe.TableSheet,{rid:st,name:Rt,view:vl,plan:kt,todays:ml,now:ct,privacy:jt,turnBase:it.settings.turnMins,onClose:()=>Lt(null),onWalkIn:e=>ft.openWalkInAt(e),onMove:e=>Mt(e),onDetails:fl}):null,Ql?(()=>{const e=Yl[Ql],t=e?.dayBookings??[];return(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>Jl(null),title:`${(0,r.tableNumbers)(Ql)} \xb7 ${Pl?Hl:(0,ve.dayLong)(Ml)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${Pl?Hl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${Pl?Hl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,re.privName)(e,jt):Oe(e.name);return(0,Pe.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,be.tablesWords)((0,X.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Jl(null),qt(e.id)},style:{minHeight:56}},e.id)}),(0,Pe.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>Jl(null),style:{minHeight:56}})]})})():null,Kt?(()=>{const e=nt.find(e=>e.id===Kt);return e?(0,Pe.jsx)(ue.GuestActionsSheet,{rid:st,b:e,name:e.walkIn?(0,re.privName)(e,jt):Oe(e.name),view:vl,now:ct,otherDay:e.date!==pt,turnBase:it.settings.turnMins,onClose:()=>qt(null),onDetails:fl,onDone:hl,onPickOnPlan:(e,t)=>{Ut(!1),St('plan'),Bt('all'),Qt({id:e.id,tables:t})}}):null})():null,zt?(0,Pe.jsx)(pe.DetailsPanel,{title:zt.title,onClose:()=>Ht(null),children:zt.body}):null,Gt?(0,Pe.jsx)(pe.ServiceSummary,{r:it,todays:ml,orders:ot,waitlistAll:tl,walkInCount:ll,onClose:()=>Ft(!1)}):null,sl?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>il(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Pe.jsx)(h.FloorLegend,{}),(0,Pe.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>il(!1)})]}):null,ol?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>nl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Pe.jsx)(N.ReviewsSection,{rid:st,mode:"read",venueName:it.name}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>nl(!1)})]}):null,Pt?(0,Pe.jsxs)(pe.DetailsPanel,{title:"Takeaway",onClose:()=>Et(!1),children:[(0,Pe.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Pe.jsx)(Fe,{list:wl,me:yt,bookings:nt})]}):null,gl?(0,Pe.jsx)(P.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:K.colours.bg},children:(0,Pe.jsx)(se.PlanDesigner,{initial:kt,venue:it.name,mode:"display",startStep:"arrange",onActivity:()=>{yl.current=Date.now(),null!==pl&&xl(null)},notice:null!==pl?`Locking again in ${pl} s \xb7 touch to keep editing`:null,onSave:e=>{X.useFloor.getState().setPlan(st,e),bl(null),hl('Table plan saved. Editing is locked again.')},onCancel:()=>{bl(null),hl('No changes kept. Editing is locked again.')}},gl.at)}):null,e?null:(0,Pe.jsx)(ne.Screensaver,{rid:st,idleMins:mt.idleMins,pinOn:mt.pinOn,wake:mt,tonightCards:mt.tonightCards,cfg:wt}),e?null:(0,Pe.jsx)(fe.PrintHost,{rid:st}),e?null:(0,Pe.jsx)(xe.AlertHost,{variant:"display",rid:st,skipTakeaway:!0}),e?null:(0,Pe.jsx)(B.SeatAllergenReminder,{rid:st}),e?null:(0,Pe.jsx)(me.TakeawayTakeover,{rid:st,me:yt})]});var ti};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),M=e(_r(_d[31])),z=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=e(_r(_d[35])),O=_r(_d[36]),A=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),Me=_r(_d[85]),ze=_r(_d[86]),He=_r(_d[87]),Pe=_r(_d[88]);const Ee=12e4,Oe=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Ne=e=>e.slotTime?(0,V.hm)(new Date(e.slotTime)):'ASAP';function _e({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,Pe.jsxs)(P.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,Pe.jsx)(P.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,Pe.jsxs)(P.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,Pe.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?K.colours.amber:K.colours.text,children:e.value}),(0,Pe.jsx)(A.T,{size:l?14:12,colour:K.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Pe.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,Pe.jsx)(P.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,Pe.jsx)(A.T,{size:14,colour:K.colours.muted,children:"No Covers yet"}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:K.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,Pe.jsxs)(P.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:K.colours.gold},children:[(0,Pe.jsx)(P.default,{style:{width:`${s.walkInPct}%`,backgroundColor:K.colours.gold}}),(0,Pe.jsx)(P.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function Ge({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,Pe.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,Pe.jsx)(P.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,Pe.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?K.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,Pe.jsx)(A.T,{size:12,colour:K.colours.muted,children:l}):null]})}function Fe({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,Me.statusBlock)(e,t,(0,Me.linkedBooking)(e,s));return e.length?(0,Pe.jsx)(P.default,{style:{gap:8},children:e.map(e=>(0,Pe.jsxs)(P.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:K.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?K.colours.ok:e.allergies.length?K.colours.red:K.colours.gold},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Ne(e)," \xb7 ",Oe(e.customerName)]}),(0,Pe.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,Pe.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:K.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,F.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Pe.jsx)(We.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Pe.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Pe.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>U.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Pe.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Pe.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Pe.jsx)(fe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Pe.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Ve({rid:e,id:t,turnBase:l}){const s=(0,U.useBookings)(e).find(e=>e.id===t);return s?(0,Pe.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1274,[1121,5,6,1275,798,822,1094,829,1120,1276,1277,1278,1091,1115,1279,1280,1282,1283,1284,1130,977,1099,1285,34,1073,1148,1033,1087,1116,1286,395,380,402,295,102,426,36,794,1176,1180,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1287,1107,1288,1291,1293,1296,1299,1295,1300,1302,1303,1112,1093,1095,852,1305,1165,1306,1175,1167,1011,1311,1319,1321,1076,1114,1323,1324,1325,1143,1326,1142,1136,838,1327,1328,25]); __d(function(g,_r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.queuedServiceSessions=u,e.queuedServicePauses=function(n,t,s){const i=u(n,t);return i?i.slice(1).flatMap((n,t)=>{const u=i[t][1],r=n[0];return u!!t.walkIn||'walk-in'===t.source},1276,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useBookingWrite=function(){const t=(0,s.useSignedIn)(),c=(0,n.canChangeBookings)(t);return{ok:c,hint:c?void 0:n.BOOKING_VIEW_ONLY,lock:s=>c?{disabled:!1,accessibilityLabel:s}:{disabled:!0,accessibilityLabel:s,accessibilityHint:n.BOOKING_VIEW_ONLY}}};var n=r(d[0]),s=r(d[1])},1277,[1012,1100]); @@ -1459,7 +1459,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";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LaunchWelcome=function({p:e,onDone:t}){(0,r.useEffect)(()=>{if(!z||document.getElementById('cc-launch-css'))return;const e=document.createElement('style');e.id='cc-launch-css',e.textContent=I,document.head.appendChild(e)},[]),(0,r.useEffect)(()=>{if(z)return document.documentElement.classList.add('cc-welcome'),()=>document.documentElement.classList.remove('cc-welcome')},[]);const[o,k]=(0,r.useState)(P()?0:3),[O,N]=(0,r.useState)('main'),[W,H]=(0,r.useState)(''),[M,_]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(o<=0)return;const e=setTimeout(()=>k(e=>e-1),300);return()=>clearTimeout(e)},[o]);const B=(0,f.useAvatars)(t=>!!t.photos[e.id]),V=(0,b.useStore)(e=>e.restaurants[0]?.name??'Your venue').toUpperCase(),G=(0,x.useOwner)(t=>t.hourly[e.id]),K=(0,x.useOwner)(t=>t.staff.find(t=>t.id===e.id)),$=(0,y.useSync)(e=>e.mode),q='live'===$||'offline'===$,J=K?.salaried||e.salaried?'Salaried':null!=G?`\xa3${(G/100).toFixed(2)} an hour${K?.noTax?' \xb7 no-tax code':''}`:'connecting'===$?'Loading\u2026':'Ask your manager',Q='staff'!==e.app&&'staff'!==p.APP_VARIANT?(0,j.appUrl)('staff'):null,X=`AN-${String(v.ROSTER.findIndex(t=>t.id===e.id)+1).padStart(2,'0')}`,Z=j.APP_NAME['staff'===p.APP_VARIANT?'staff':e.app],ee=L['staff'===p.APP_VARIANT&&'staff'!==e.app?'Staff':e.level]??L.Staff;return(0,C.jsxs)(h.default,{testID:"invite-welcome",style:[u.default.absoluteFill,{backgroundColor:(0,n.soutersSurface)('#000'),zIndex:1e3}],children:[(0,C.jsxs)(h.default,{...R('space'),pointerEvents:"none",children:[(0,C.jsx)(h.default,{...R('stars1')}),(0,C.jsx)(h.default,{...R('stars2')})]}),o>0?(0,C.jsxs)(l.default,{testID:"invite-countdown",accessibilityLabel:"Skip intro",onPress:()=>k(0),style:{flex:1,alignItems:'center',justifyContent:'center',gap:10},children:[(0,C.jsxs)(E,{colour:w.colours.muted,children:[V," \xb7 COVER CHARGE"]}),(0,C.jsx)(h.default,{...R('count'),children:(0,C.jsx)(T.T,{size:120,weight:"bold",colour:A,children:o})},o),(0,C.jsx)(E,{children:"GETTING YOU ON BOARD"})]}):'selfie'===O?(0,C.jsx)(F,{p:e,onClose:e=>{N('main'),e?(H('Avatar saved. Looking good!'),_(e=>e+1)):H('')}}):(0,C.jsxs)(c.default,{contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsxs)(h.default,{...R('rise1'),style:{alignItems:'center',gap:2},children:[(0,C.jsxs)(E,{children:[V," \xb7 ",Z.toUpperCase()]}),(0,C.jsx)(T.T,{size:20,colour:w.colours.muted,center:!0,style:{marginTop:10},children:"Welcome aboard,"}),(0,C.jsx)(T.T,{size:42,weight:"bold",center:!0,style:{lineHeight:50},children:e.name})]}),(0,C.jsxs)(h.default,{...R('reveal'),style:{marginVertical:8},children:[(0,C.jsx)(h.default,{...R('orbit'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:156})})]},M),W?(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:w.colours.ok,center:!0,children:W}):null,(0,C.jsx)(h.default,{...R('rise2'),style:{alignSelf:'stretch'},children:(0,C.jsxs)(h.default,{testID:"invite-crew-card",...R('card'),style:{borderRadius:20,borderWidth:1,borderColor:'rgba(207,164,95,0.55)',overflow:'hidden',padding:18,gap:12},children:[(0,C.jsx)(h.default,{...R('sheen'),pointerEvents:"none"}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},children:[(0,C.jsx)(E,{children:"CREW ID"}),(0,C.jsx)(T.T,{size:15,weight:"semibold",colour:w.colours.muted,style:{letterSpacing:1.5},children:X})]}),(0,C.jsx)(h.default,{style:{height:2,backgroundColor:A,opacity:.7,borderRadius:1}}),(0,C.jsx)(Y,{k:"NAME",v:e.name}),(0,C.jsx)(Y,{k:"ROLE",v:(0,j.levelJob)(e.level,e.job)}),(0,C.jsx)(Y,{k:"APP",v:Z}),'owner'!==e.role?(0,C.jsx)(h.default,{testID:"invite-pay",children:(0,C.jsx)(Y,{k:"PAY",v:J})}):null,(0,C.jsx)(Y,{k:"ACCESS",v:'Owner'===e.level?'Everything':'Manager'===e.level?'Manager':'Supervisor'===e.level?'Supervisor':'Head Chef'===e.level?'Kitchen lead':'Team member'}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,C.jsx)(h.default,{...R('blink'),style:{width:10,height:10,borderRadius:5,backgroundColor:w.colours.ok}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.ok,children:"Signed in on this phone"})]})]})}),(0,C.jsxs)(h.default,{...R('rise3'),style:{alignSelf:'stretch',gap:10},children:[(0,C.jsx)(E,{children:"WHAT YOU CAN DO"}),ee.map(e=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'flex-start'},children:[(0,C.jsx)(T.T,{size:16,colour:A,children:"\u25c6"}),(0,C.jsx)(T.T,{size:16,style:{flex:1},children:e})]},e))]}),z?(0,C.jsxs)(h.default,{testID:"invite-avatar-offer",...R('rise4'),style:{alignSelf:'stretch',gap:12,borderRadius:20,padding:18,borderWidth:1,borderColor:'rgba(255,255,255,0.14)',backgroundColor:'rgba(255,255,255,0.03)'},children:[(0,C.jsx)(E,{children:"YOUR AVATAR \xb7 OPTIONAL"}),(0,C.jsx)(T.T,{size:16,children:B?'You made your own avatar from a photo.':'Keep this one, choose an original icon, or make your own from a photo.'}),(0,C.jsx)(D,{kind:"ghost",label:B?'Choose another avatar':'Choose my avatar',testID:"invite-avatar-make",onPress:()=>{H(''),N('selfie')}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.muted,children:"Your photo stays on this phone. It\u2019s turned into your avatar here; only the finished avatar is shared with your team."})]}):null,(0,C.jsx)(h.default,{style:{alignSelf:'stretch',gap:10,marginTop:4},children:(0,C.jsx)(D,{label:B?'Get started':'Skip, keep this one and get started',testID:"invite-get-started",onPress:t})}),(0,s.inPhoneApp)()?null:(0,C.jsxs)(h.default,{style:{alignSelf:'stretch',gap:6,borderRadius:16,padding:16,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:[(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:A,children:"Tip: add it to your Home screen"}),(0,C.jsxs)(T.T,{size:15,children:[U()," It then opens like a normal app and remembers you."]})]}),Q?(0,C.jsx)(l.default,{accessibilityRole:"link",onPress:()=>{z&&window.location.assign(Q)},children:(0,C.jsx)(T.T,{size:15,colour:A,center:!0,children:"Also open CoverCharge for Staff (your clock-in, rota and pay) \u203a"})}):null,(0,C.jsx)(T.T,{size:14,colour:w.colours.muted,center:!0,children:q?'Connected: bookings, orders and stock are shared live with the rest of the team. Your pay is only visible to you and your managers.':'Connecting\u2026 if there\u2019s no signal, what you enter is kept on this phone and shared once you\u2019re back online.'})]})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]),s=_r(d[3]),o=e(_r(d[4]));_r(d[5]);var l=e(_r(d[6])),c=e(_r(d[7])),u=e(_r(d[8])),h=e(_r(d[9])),p=_r(d[10]),f=_r(d[11]),x=_r(d[12]),b=_r(d[13]),y=_r(d[14]),j=_r(d[15]),v=_r(d[16]),k=_r(d[17]),w=_r(d[18]),S=_r(d[19]),T=_r(d[20]),C=_r(d[21]);const A=w.colours.gold,I="\n[data-cc=\"space\"]{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;background:radial-gradient(ellipse at 50% 115%,#2a1f0c 0%,#0a0805 38%,#000 70%)}\n[data-cc=\"stars1\"],[data-cc=\"stars2\"]{position:absolute;top:-50%;left:-50%;width:200%;height:200%;will-change:transform}\n[data-cc=\"stars1\"]{background-image:radial-gradient(1.2px 1.2px at 23px 41px,#fff,transparent),radial-gradient(1px 1px at 97px 13px,#fff9,transparent),radial-gradient(1.4px 1.4px at 151px 120px,#f5e6c8,transparent),radial-gradient(1px 1px at 61px 163px,#fffa,transparent),radial-gradient(1.2px 1.2px at 183px 77px,#fff8,transparent);background-size:211px 199px;animation:cc-drift 90s linear infinite;opacity:.75}\n[data-cc=\"stars2\"]{background-image:radial-gradient(2px 2px at 40px 60px,#CFA45F,transparent),radial-gradient(1.6px 1.6px at 250px 210px,#fff,transparent),radial-gradient(1.8px 1.8px at 330px 40px,#fffc,transparent);background-size:397px 367px;animation:cc-drift2 60s linear infinite,cc-twinkle 3.2s ease-in-out infinite alternate;opacity:.8}\n@keyframes cc-drift{to{transform:translate3d(-211px,199px,0)}}\n@keyframes cc-drift2{to{transform:translate3d(-397px,367px,0)}}\n@keyframes cc-twinkle{from{opacity:.45}to{opacity:.95}}\n[data-cc=\"count\"]{animation:cc-count .32s cubic-bezier(.2,.8,.2,1) both}\n@keyframes cc-count{from{opacity:0;transform:scale(1.9)}to{opacity:1;transform:scale(1)}}\n[data-cc=\"reveal\"]{animation:cc-reveal .75s cubic-bezier(.2,.9,.25,1.25) both}\n@keyframes cc-reveal{0%{opacity:0;transform:scale(.35) rotate(-12deg)}100%{opacity:1;transform:scale(1) rotate(0)}}\n[data-cc=\"halo\"]{border-radius:999px;box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 38px 6px rgba(207,164,95,.35);animation:cc-glow 2.6s ease-in-out infinite}\n@keyframes cc-glow{0%,100%{box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 30px 4px rgba(207,164,95,.28)}50%{box-shadow:0 0 0 2px rgba(207,164,95,1),0 0 52px 10px rgba(207,164,95,.5)}}\n[data-cc=\"orbit\"]{position:absolute;top:-14px;left:-14px;right:-14px;bottom:-14px;border-radius:999px;border:1px dashed rgba(207,164,95,.45);animation:cc-spin 14s linear infinite}\n@keyframes cc-spin{to{transform:rotate(360deg)}}\n[data-cc=\"rise1\"],[data-cc=\"rise2\"],[data-cc=\"rise3\"],[data-cc=\"rise4\"]{animation:cc-rise .5s cubic-bezier(.2,.8,.2,1) both}\n[data-cc=\"rise2\"]{animation-delay:.12s}[data-cc=\"rise3\"]{animation-delay:.24s}[data-cc=\"rise4\"]{animation-delay:.36s}\n@keyframes cc-rise{from{opacity:0;transform:translate3d(0,18px,0)}to{opacity:1;transform:none}}\n[data-cc=\"btn\"]{transition:transform .12s ease,box-shadow .2s ease,filter .2s ease;cursor:pointer}\n[data-cc=\"btn\"]:hover{filter:brightness(1.08)}\n[data-cc=\"btnp\"]{transition:transform .12s ease,box-shadow .2s ease;cursor:pointer;box-shadow:0 0 0 1px rgba(207,164,95,.9),0 8px 30px rgba(207,164,95,.35)}\n[data-cc=\"btnp\"]:hover{box-shadow:0 0 0 1px #CFA45F,0 8px 44px rgba(207,164,95,.6)}\n[data-cc=\"card\"]{background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.02));backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}\n[data-cc=\"sheen\"]{position:absolute;top:0;bottom:0;width:40%;left:-60%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.10),transparent);animation:cc-sheen 3.8s ease-in-out 1s infinite}\n@keyframes cc-sheen{0%{left:-60%}35%,100%{left:130%}}\n[data-cc=\"scan\"]{position:absolute;left:0;right:0;height:4px;background:linear-gradient(90deg,transparent,#CFA45F,#fff,#CFA45F,transparent);box-shadow:0 0 18px 4px rgba(207,164,95,.75);animation:cc-scan .9s ease-in-out infinite alternate}\n@keyframes cc-scan{from{top:2%}to{top:96%}}\n[data-cc=\"grid\"]{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(rgba(207,164,95,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(207,164,95,.18) 1px,transparent 1px);background-size:22px 22px}\n[data-cc=\"blink\"]{animation:cc-blink 1s steps(2,start) infinite}\n@keyframes cc-blink{to{visibility:hidden}}\nhtml.cc-welcome #cc-install-hint{display:none !important}\n@media (prefers-reduced-motion: reduce){[data-cc]{animation:none !important;transition:none !important}}\n",R=e=>({dataSet:{cc:e}}),z='undefined'!=typeof document,P=()=>z&&'function'==typeof window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches,O=()=>{try{z&&navigator.vibrate?.(12)}catch{}};function D({label:e,onPress:t,kind:n="primary",testID:r,disabled:s}){const o='primary'===n;return(0,C.jsx)(l.default,{testID:r,accessibilityRole:"button",accessibilityLabel:e,disabled:s,onPress:()=>{O(),t()},...R(o&&!s?'btnp':'btn'),style:({pressed:e})=>[{alignSelf:'stretch',minHeight:56,borderRadius:28,alignItems:'center',justifyContent:'center',paddingHorizontal:20,backgroundColor:o?A:'rgba(255,255,255,0.04)',borderWidth:o?0:1.5,borderColor:A,opacity:s?.45:1,transform:[{scale:e?.96:1}]}],children:(0,C.jsx)(T.T,{size:18,weight:"semibold",colour:o?'#0B0B0B':A,center:!0,children:e})})}const E=({children:e,colour:t=A})=>(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:t,style:{letterSpacing:2.2},children:e}),L={Owner:['Takings, sales, labour cost and payroll','Bookings (Tables and Covers), orders, the rota and team chat','Every setting, plus the Assistant for quick answers'],Manager:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],Supervisor:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],'Head Chef':['Stock, costings, prep, ordering and the specials board','Food safety checks, allergens and live tickets','Your own clock-in, rota and pay in the Staff app'],Staff:['Clock in and out, see your rota, swap shifts, ask for time off','Team chat, food safety checks and the accident book','Your own hours, pay and tips (only yours)']};function U(){const e=z?navigator.userAgent:'';return/iPhone|iPad|iPod/.test(e)?'In Safari, tap Share (the square with an arrow), then Add to Home Screen.':/SamsungBrowser/.test(e)?'Tap the menu, then Add page to, then Home screen.':'In Chrome, tap \u22ee then Add to Home screen (or Install app).'}const Y=({k:e,v:t})=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'baseline'},children:[(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:w.colours.muted,numberOfLines:1,style:{width:74,letterSpacing:1.2},children:e}),(0,C.jsx)(T.T,{size:18,weight:"semibold",style:{flex:1},children:t})]});function F({p:e,onClose:s}){const[u,p]=(0,r.useState)('choose'),[x,b]=(0,r.useState)(null),[y,j]=(0,r.useState)(null),[v,I]=(0,r.useState)(!1),[z,L]=(0,r.useState)(''),U=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{U.current&&URL.revokeObjectURL(U.current)},[]);const Y=async e=>{L('');const t=await(0,k.pickPhoto)(e);if(!t)return;U.current&&URL.revokeObjectURL(U.current);const n=URL.createObjectURL(t);U.current=n,b(n),I(!1),p('scan');const r=Date.now();try{const e=await(0,k.styliseOnDevice)(t),n=P()?0:Math.max(0,1300-(Date.now()-r));setTimeout(()=>{j(e),p('reveal'),O()},n)}catch{L("That photo couldn't be opened. Try another one (JPEG or PNG)."),p('choose')}},F=({children:e})=>(0,C.jsx)(h.default,{style:{width:236,height:236,borderRadius:118,overflow:'hidden',borderWidth:2,borderColor:A,alignItems:'center',justifyContent:'center',backgroundColor:(0,n.soutersSurface)('#050505')},children:e});return(0,C.jsxs)(c.default,{testID:"invite-avatar-step",contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsx)(E,{children:"MAKE YOUR AVATAR"}),(0,C.jsx)(T.T,{size:28,weight:"bold",center:!0,children:'choose'===u?'Choose your look':'scan'===u?'Scanning\u2026':`Looking good, ${e.name}`}),'choose'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(F,{children:[(0,C.jsx)(h.default,{style:{opacity:.55},children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:200,ring:!1})}),(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"})]})})}),(0,C.jsx)(T.T,{size:16,center:!0,colour:w.colours.muted,children:"Take a selfie or pick a photo. Your phone turns it into a space-age avatar. The photo never leaves this phone and isn\u2019t kept."}),(0,C.jsx)(D,{label:"Take a selfie",testID:"avatar-selfie",onPress:()=>Y(!0)}),(0,C.jsx)(D,{kind:"ghost",label:"Upload a photo",testID:"avatar-upload",onPress:()=>Y(!1)}),(0,C.jsx)(h.default,{style:{width:'100%',minWidth:0},children:(0,C.jsx)(t.AvatarOptions,{onSelect:t=>{f.useAvatars.getState().setOwn(e.id,e.id,t.dataUrl,e.name)?s(!0):L('Could not save your avatar. Try again.')}})})]}):'scan'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(F,{children:[x?(0,C.jsx)(o.default,{source:{uri:x},style:{width:236,height:236},accessibilityLabel:"Your photo"}):null,(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('scan'),pointerEvents:"none"})]})}),(0,C.jsx)(E,{colour:w.colours.muted,children:"MAKING YOUR AVATAR ON THIS PHONE"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:y?(0,C.jsx)(o.default,{testID:"avatar-result",source:{uri:y},style:{width:220,height:220,borderRadius:110},accessibilityLabel:"Your new avatar"}):null})}),(0,C.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityState:{checked:v},accessibilityLabel:"I agree to use this avatar",testID:"avatar-consent",onPress:()=>{O(),I(!v)},style:{alignSelf:'stretch',flexDirection:'row',gap:12,alignItems:'flex-start',padding:14,borderRadius:16,borderWidth:1.5,borderColor:v?A:'rgba(255,255,255,0.2)'},children:[(0,C.jsx)(h.default,{style:{width:28,height:28,borderRadius:8,borderWidth:2,borderColor:A,backgroundColor:v?A:'transparent',alignItems:'center',justifyContent:'center'},children:v?(0,C.jsx)(T.T,{size:17,weight:"bold",colour:"#111",children:"\u2713"}):null}),(0,C.jsx)(T.T,{size:15,style:{flex:1},children:"I\u2019m happy for this avatar, made from my photo, to be shown to my team in CoverCharge. Only the finished avatar is shared; my photo isn\u2019t uploaded or kept, and a manager can reset my avatar."})]}),(0,C.jsx)(D,{label:"Use this avatar",testID:"avatar-save",disabled:!v,onPress:()=>{if(!y)return;f.useAvatars.getState().setOwn(e.id,e.id,y,e.name)?(U.current&&URL.revokeObjectURL(U.current),U.current=null,s(!0)):L("Couldn't save the avatar. Please try again.")}}),(0,C.jsx)(D,{kind:"ghost",label:"Try another photo",onPress:()=>{j(null),p('choose')}})]}),z?(0,C.jsx)(T.T,{size:15,colour:w.colours.red,center:!0,children:z}):null,'scan'!==u?(0,C.jsx)(l.default,{testID:"invite-avatar-done",accessibilityRole:"button",onPress:()=>{O(),s(!1)},style:({pressed:e})=>({padding:12,transform:[{scale:e?.96:1}]}),children:(0,C.jsx)(T.T,{size:17,weight:"semibold",colour:w.colours.text,children:"Skip, keep this one"})}):null]})}},1376,[927,798,34,1072,336,236,402,295,41,102,846,924,865,800,985,997,15,793,840,899,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}),_e.StaffHome=function({go:e}){const L=(0,m.useInStaffApp)(),{now:N,meId:A,me:O,r:R,today:z}=(0,m.useCtx)(3e4),H=(0,s.useTravelDay)('staff',z),P=(0,h.useOwner)(e=>e.shifts),F=(0,h.useOwner)(e=>e.attendance),_=(0,h.useOwner)(e=>e.staffCanViewSuppliers),E=(0,h.useOwner)(e=>e.quickLinks),W=(0,h.useOwner)(e=>e.chat),q=(0,h.useOwner)(e=>e.swaps),V=(0,h.useOwner)(e=>e.leave),G=P.filter(e=>e.staffId===A&&e.published&&e.date>=z).sort((e,s)=>e.date.localeCompare(s.date)||e.start-s.start),U=G.find(e=>e.date===z),Y=F.filter(e=>e.staffId===A&&e.in&&!e.out&&N.getTime()-new Date(e.in).getTime()<72e6).sort((e,s)=>s.in.localeCompare(e.in))[0],Q=(0,x.usePay)(A,0),K=(0,b.useOrders)(R.id),J=(0,b.useBookings)(R.id),X=K.filter(e=>(0,T.LIVE)(e)&&e.allergies.length&&(0,k.nextStep)(e,(0,k.linkedBooking)(e,J))),Z=J.filter(e=>e.date===z&&['confirmed','seated'].includes(e.status)&&(0,k.bookingNeedsAction)(e,K.filter(T.LIVE))),ee=J.filter(e=>(0,S.undoKind)(e,z)||e.walkIn&&'cancelled'===e.status&&e.date===z).sort((e,s)=>e.time.localeCompare(s.time)).slice(0,12),se=W.filter(e=>'all'===e.ch&&e.pinned&&!e.removed).slice(-1)[0],te=q.filter(e=>e.fromId===A&&'open'===e.status).length+V.filter(e=>e.staffId===A&&'pending'===e.status).length,ie=[['Clock in / out',()=>e('more','clock')],['My rota, swaps & time off',()=>e('more','rota')],['Staff chat',()=>e('chat')],['Recipe cards',()=>e('more','recipecards')],['My hours & pay',()=>e('more','mypay')],['My tips',()=>e('more','mytips')],['Post to social (draft)',()=>e('more','social')],..._?[['Suppliers',()=>e('more','suppliers')]]:[]];return!L&&H?(0,v.jsxs)(o.default,{style:{gap:10},children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(s.DayView,{rid:R.id,day:H,today:z,app:"staff"})]}):(0,v.jsxs)(o.default,{style:{gap:10},children:[L?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(t.CoversToday,{rid:R.id})]}),(0,v.jsxs)(r.Card,{highlight:u.colours.accentBorder,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.Row,{gap:10,style:{flex:1},children:[(0,v.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"My avatar",onPress:()=>e('more','avatar'),children:(0,v.jsx)(C.StaffAvatar,{id:A,size:52})}),(0,v.jsxs)(r.T,{size:18,weight:"bold",children:["Hi ",O.replace(' (example)','').split(' ')[0]]})]}),(0,v.jsx)(r.Badge,{kind:"gold",label:L?R.name:'Staff app preview'})]}),(0,v.jsx)(r.Muted,{children:L?`${N.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})}`:'This is what staff will see in the separate Staff app.'})]}),(0,v.jsx)(M.StaffTipsTile,{rid:R.id,today:z,onPress:()=>e('more','mytips')}),(0,v.jsxs)(r.Card,{highlight:Y?u.colours.ok:void 0,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{weight:"semibold",children:Y?`On shift since ${(0,c.hm)(new Date(Y.in))}`:'Not clocked in'}),Y?(0,v.jsx)(r.Badge,{kind:"ok",label:(0,m.hmDur)(Math.max(0,Math.round((N.getTime()-new Date(Y.in).getTime())/6e4)))}):null]}),U?(0,v.jsxs)(r.Muted,{children:["Today on the rota: ",(0,m.fmtH)(U.start),"\u2013",(0,m.fmtH)(U.end)]}):G[0]?(0,v.jsxs)(r.Muted,{children:["Next on the rota: ",m.DAY3[G[0].day]," ",Number(G[0].date.slice(8))," ",(0,m.fmtH)(G[0].start),"\u2013",(0,m.fmtH)(G[0].end)]}):(0,v.jsx)(r.Muted,{children:"No shifts on the rota this week."}),(0,v.jsx)(r.Button,{small:!0,kind:Y?'secondary':'success',label:Y?'Clock out':'Clock in',onPress:()=>e('more','clock')})]}),A?(0,v.jsx)($.RequestTimeOff,{meId:A,me:O,testID:"staff-home-time-off"}):null,(0,v.jsx)(p.ShellfishTile,{rid:R.id,by:O.replace(' (example)',''),app:"staff"}),ee.length?(0,v.jsx)(r.Card,{children:(0,v.jsxs)(o.default,{testID:"staff-seated-today",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Seated and finished today (",ee.length,")"]}),(0,v.jsx)(r.Muted,{children:"Seated someone by mistake? Tap Unseat: they go back to Booked and their tables are freed. Finished or No-show by mistake? Tap Undo."}),ee.map(e=>{const s=e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;return(0,v.jsxs)(o.default,{testID:(0,f.isSeatedHighlight)(e.status)?`staff-seated-row-${e.id}`:`staff-done-row-${e.id}`,style:(0,f.isSeatedHighlight)(e.status)?{gap:6,padding:10,borderRadius:12,marginTop:4,...(0,f.seatedHighlightStyle)()}:{gap:6,borderTopWidth:1,borderTopColor:u.colours.hairline,paddingTop:8,opacity:'finished'===e.status||'noshow'===e.status?.7:1},children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.T,{size:17,weight:"semibold",colour:(0,f.isSeatedHighlight)(e.status)?f.SEATED_FG:u.colours.text,children:[e.time," \xb7 ",s]}),(0,v.jsx)(r.Badge,{kind:'noshow'===e.status?'red':'seated'===e.status?'ok':'neutral',label:'noshow'===e.status?'No-show':'seated'===e.status?'Seated':'Finished'})]}),(0,v.jsxs)(r.Muted,{children:[e.table?(0,I.tableCardLabel)(e.table):'No table'," \xb7 ",e.ref]}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsxs)(r.Row,{wrap:!0,gap:6,children:['seated'===e.status?(0,v.jsx)(r.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${s}`,onPress:()=>(0,B.finishBookingNow)(R.id,e)}):null,e.walkIn?(0,v.jsx)(a.CancelWalkInButton,{rid:R.id,b:e,small:!0}):null,e.walkIn?(0,v.jsx)(a.ReinstateWalkInButton,{rid:R.id,b:e,today:z,small:!0}):null,(0,v.jsx)(S.BookingUndo,{b:e,rid:R.id,today:z,who:s})]})]},e.id)})]})}):null,X.length+Z.length?(0,v.jsxs)(o.default,{testID:"staff-allergy-signoffs",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Allergy sign-offs (",X.length+Z.length,")"]}),(0,v.jsx)(r.Muted,{children:"Tap Sign off for your step. Your name and the time are recorded."}),X.map(e=>(0,v.jsx)(j.AllergyChain,{o:e,me:O},e.id)),Z.map(e=>(0,v.jsxs)(o.default,{accessible:!0,accessibilityLabel:`Booking ${e.time}, ${e.name}, ${e.partySize}${e.table?`, ${(0,D.tableNumbersA11y)(e.table)}`:''}`,style:{gap:4},children:[(0,v.jsxs)(r.Muted,{children:["Booking ",e.time," \xb7 ",e.name," (",e.partySize,")",e.table?` \xb7 ${(0,I.tablesLabel)(e.table)}`:'']}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsx)(j.BookingAllergyChain,{b:e,me:O}),(0,v.jsx)(o.default,{style:{flexDirection:'row'},children:(0,v.jsx)(w.WhatsAppGuest,{b:e,rid:R.id,kind:"auto"})})]},e.id))]}):null,se?(0,v.jsxs)(r.Card,{onPress:()=>e('chat'),children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{size:12,weight:"semibold",colour:u.colours.gold,children:"\ud83d\udccc PINNED IN ALL STAFF"}),(0,v.jsx)(r.Muted,{children:"Open chat \u203a"})]}),(0,v.jsx)(r.T,{size:14,children:se.text})]}):null,(0,v.jsxs)(r.Card,{children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Hours this pay period"}),(0,v.jsxs)(r.T,{size:18,weight:"semibold",colour:u.colours.goldLight,children:[(0,m.hmDur)(Q.paid)," paid hours"]})]}),te?(0,v.jsx)(r.Card,{onPress:()=>e('more','rota'),children:(0,v.jsxs)(r.T,{size:14,children:["You have ",te," request",te>1?'s':''," waiting for a manager \u203a"]})}):null,(0,y.visibleLinks)(E,'staff').length?(0,v.jsxs)(o.default,{testID:"quick-links",style:{gap:6},children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Quick links"}),(0,v.jsx)(y.QuickLinksRow,{compact:!0})]}):null,L?null:(0,v.jsx)(o.default,{style:{gap:6},children:ie.map(([e,s])=>(0,v.jsx)(r.Button,{kind:"secondary",label:e,onPress:s},e))})]})};var s=_r(d[0]),t=_r(d[1]),a=_r(d[2]),l=_r(d[3]);_r(d[4]);var n=e(_r(d[5])),o=e(_r(d[6])),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),f=_r(d[11]),p=_r(d[12]),m=_r(d[13]),x=_r(d[14]),y=_r(d[15]),j=_r(d[16]),b=_r(d[17]),w=_r(d[18]),k=_r(d[19]),T=_r(d[20]),C=_r(d[21]),S=_r(d[22]),I=_r(d[23]),D=_r(d[24]),B=_r(d[25]),M=_r(d[26]),$=_r(d[27]),v=_r(d[28])},1377,[1148,1073,1112,1089,34,402,102,794,865,827,840,1090,1142,1100,1145,1362,1136,850,1149,838,1147,899,1355,1014,829,1096,1154,1159,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1378,[30,34,846,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,"default",{enumerable:!0,get:function(){return q}});var t=r(_d[0]),s=r(_d[1]);r(_d[2]),r(_d[3]);var n=r(_d[4]),o=r(_d[5]),u=r(_d[6]),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=e(r(_d[10])),p=e(r(_d[11]));r(_d[12]);var y=e(r(_d[13])),h=e(r(_d[14])),S=r(_d[15]),_=r(_d[16]),O=r(_d[17]),P=r(_d[18]),j=r(_d[19]),v=r(_d[20]),b=r(_d[21]),x=r(_d[22]),A=r(_d[23]),w=r(_d[24]),E=r(_d[25]),C=r(_d[26]);r(_d[27]);var I=r(_d[28]),k=r(_d[29]),R=r(_d[30]),H=r(_d[31]),T=r(_d[32]),F=r(_d[33]),B=r(_d[34]),V=r(_d[35]),N=r(_d[36]);const G=r(_d[37]),L=r(_d[38]),M=r(_d[39]),U=r(_d[40]);function q(){const[e]=(0,n.useFonts)({Poppins_400Regular:G,Poppins_500Medium:L,Poppins_600SemiBold:M,Poppins_700Bold:U}),[t,E]=(0,d.useState)(v.useStore.persist.hasHydrated()),[T,F]=(0,d.useState)(x.useOwner.persist.hasHydrated()),B=t&&T;(0,d.useEffect)(()=>{const e=v.useStore.persist.onFinishHydration(()=>E(!0)),t=x.useOwner.persist.onFinishHydration(()=>F(!0));return v.useStore.persist.hasHydrated()&&E(!0),x.useOwner.persist.hasHydrated()&&F(!0),()=>{e(),t()}},[]),(0,d.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===(0,S.venueKey)(v.useStore.persist.getOptions().name??'')&&(0,C.quietly)(()=>v.useStore.persist.rehydrate()),e.key===(0,S.venueKey)(b.useFloor.persist.getOptions().name??'')&&(0,C.quietly)(()=>b.useFloor.persist.rehydrate()),e.key===(0,S.venueKey)(o.useBlocks.persist.getOptions().name??'')&&(0,C.quietly)(()=>o.useBlocks.persist.rehydrate())};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,d.useEffect)(()=>{B&&x.useOwner.getState().syncRoster()},[B]),(0,d.useEffect)(()=>{B&&(0,s.startAppSync)()},[B]);const V=e&&B,q=(0,w.useSignedOutGate)(),D=(0,u.usePathname)(),K=V&&!(0,O.isAllowedPath)(D||'/');return(0,d.useEffect)(()=>{if(!K)return;const e=setTimeout(()=>u.router.replace(O.ENTRY[O.APP_VARIANT]),0);return()=>clearTimeout(e)},[K,D]),(0,d.useEffect)(()=>{V&&l.hideAsync().catch(()=>{})},[V]),V?(0,N.jsxs)(j.SafeAreaProvider,{children:[(0,N.jsx)(c.StatusBar,{style:"light"}),q?(0,N.jsx)(h.default,{style:{flex:1,backgroundColor:A.colours.bg}}):(0,N.jsx)(h.default,{style:{flex:1},children:(0,N.jsx)(u.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:A.colours.bg}}})}),K&&!q?(0,N.jsx)(h.default,{style:[y.default.absoluteFill,{backgroundColor:A.colours.bg}]}):null,K||q||O.IS_CAR?null:(0,N.jsx)(R.VoiceHost,{}),q?null:(0,N.jsx)(I.SyncBadge,{}),K||q||O.IS_CAR?null:(0,N.jsx)(k.PushPrompt,{}),O.IS_CAR?(0,N.jsx)(P.CarGate,{}):(0,N.jsx)(w.InviteGate,{}),K||q?null:(0,N.jsx)(H.SliderHost,{})]}):(0,N.jsxs)(h.default,{style:{flex:1,backgroundColor:A.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[_.HERO_LOGOS[S.VENUE_RID]?(0,N.jsx)(p.default,{source:_.HERO_LOGOS[S.VENUE_RID],accessibilityLabel:"Venue logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,N.jsx)(f.default,{color:A.colours.gold})]})}T.PITCH&&(globalThis.__pitch={useSaverCfg:V.useSaverCfg,useSync:s.useSync,seedInvitePairsForQA:t.seedInvitePairsForQA,appVariant:O.APP_VARIANT,useStore:v.useStore,useOwner:x.useOwner,useFloor:b.useFloor,useBlocks:o.useBlocks,useSession:E.useSession,useCashUp:F.useCashUp,seedPitch:B.seedPitch},setTimeout(()=>{try{(0,B.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),E.START_INVITE,l.preventAutoHideAsync().catch(()=>{})},1379,[1380,985,795,1330,1382,1011,30,1409,496,34,385,336,236,41,102,5,847,846,1411,36,848,1014,865,840,1370,997,1010,1414,1415,1416,1417,1099,2,1024,1437,1299,25,1438,1439,1440,1441]); +__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,"default",{enumerable:!0,get:function(){return q}});var t=r(_d[0]),s=r(_d[1]);r(_d[2]),r(_d[3]);var n=r(_d[4]),o=r(_d[5]),u=r(_d[6]),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=e(r(_d[10])),p=e(r(_d[11]));r(_d[12]);var y=e(r(_d[13])),h=e(r(_d[14])),S=r(_d[15]),_=r(_d[16]),O=r(_d[17]),P=r(_d[18]),j=r(_d[19]),v=r(_d[20]),b=r(_d[21]),x=r(_d[22]),A=r(_d[23]),w=r(_d[24]),E=r(_d[25]),C=r(_d[26]);r(_d[27]);var I=r(_d[28]),k=r(_d[29]),R=r(_d[30]),H=r(_d[31]),T=r(_d[32]),F=r(_d[33]),B=r(_d[34]),V=r(_d[35]),N=r(_d[36]);const G=r(_d[37]),L=r(_d[38]),M=r(_d[39]),U=r(_d[40]);function q(){const[e]=(0,n.useFonts)({Poppins_400Regular:G,Poppins_500Medium:L,Poppins_600SemiBold:M,Poppins_700Bold:U}),[t,E]=(0,d.useState)(v.useStore.persist.hasHydrated()),[T,F]=(0,d.useState)(x.useOwner.persist.hasHydrated()),B=t&&T;(0,d.useEffect)(()=>{const e=v.useStore.persist.onFinishHydration(()=>E(!0)),t=x.useOwner.persist.onFinishHydration(()=>F(!0));return v.useStore.persist.hasHydrated()&&E(!0),x.useOwner.persist.hasHydrated()&&F(!0),()=>{e(),t()}},[]),(0,d.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===(0,S.venueKey)(v.useStore.persist.getOptions().name??'')&&(0,C.quietly)(()=>v.useStore.persist.rehydrate()),e.key===(0,S.venueKey)(b.useFloor.persist.getOptions().name??'')&&(0,C.quietly)(()=>b.useFloor.persist.rehydrate()),e.key===(0,S.venueKey)(o.useBlocks.persist.getOptions().name??'')&&(0,C.quietly)(()=>o.useBlocks.persist.rehydrate())};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,d.useEffect)(()=>{B&&x.useOwner.getState().syncRoster()},[B]),(0,d.useEffect)(()=>{B&&(0,s.startAppSync)()},[B]);const V=e&&B,q=(0,w.useSignedOutGate)(),D=(0,u.usePathname)(),K=V&&!(0,O.isAllowedPath)(D||'/');return(0,d.useEffect)(()=>{if(!K)return;const e=setTimeout(()=>u.router.replace(O.ENTRY[O.APP_VARIANT]),0);return()=>clearTimeout(e)},[K,D]),(0,d.useEffect)(()=>{V&&l.hideAsync().catch(()=>{})},[V]),V?(0,N.jsxs)(j.SafeAreaProvider,{children:[(0,N.jsx)(c.StatusBar,{style:"light"}),q?(0,N.jsx)(h.default,{style:{flex:1,backgroundColor:A.colours.bg}}):(0,N.jsx)(h.default,{style:{flex:1},children:(0,N.jsx)(u.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:A.colours.bg}}})}),K&&!q?(0,N.jsx)(h.default,{style:[y.default.absoluteFill,{backgroundColor:A.colours.bg}]}):null,K||q||O.IS_CAR?null:(0,N.jsx)(R.VoiceHost,{}),q?null:(0,N.jsx)(I.SyncBadge,{}),K||q||O.IS_CAR?null:(0,N.jsx)(k.PushPrompt,{}),O.IS_CAR?(0,N.jsx)(P.CarGate,{}):(0,N.jsx)(w.InviteGate,{}),K||q?null:(0,N.jsx)(H.SliderHost,{})]}):(0,N.jsxs)(h.default,{style:{flex:1,backgroundColor:A.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[_.HERO_LOGOS[S.VENUE_RID]?(0,N.jsx)(p.default,{source:_.HERO_LOGOS[S.VENUE_RID],accessibilityLabel:"Venue logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,N.jsx)(f.default,{color:A.colours.gold})]})}T.PITCH&&(globalThis.__pitch={useSaverCfg:V.useSaverCfg,useSync:s.useSync,seedInvitePairsForQA:t.seedInvitePairsForQA,appVariant:O.APP_VARIANT,useStore:v.useStore,useOwner:x.useOwner,useFloor:b.useFloor,useBlocks:o.useBlocks,useSession:E.useSession,useCashUp:F.useCashUp,seedPitch:B.seedPitch},setTimeout(()=>{try{(0,B.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),E.START_INVITE,l.preventAutoHideAsync().catch(()=>{})},1379,[1380,985,795,1330,1382,1011,30,1409,496,34,385,336,236,41,102,5,847,846,1411,36,848,1014,865,840,1370,997,1010,1415,1416,1417,1418,1099,2,1024,1438,1299,25,1439,1440,1441,1442]); __d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"inviteCache",{enumerable:!0,get:function(){return j}}),_e.refreshLinkPhones=P,_e.linkedSinceText=I,_e.refreshInvites=A,_e.useInviteStatus=function(){const[,e]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const n=()=>e(e=>e+1);return v.add(n),A(),()=>{v.delete(n)}},[]),x},Object.defineProperty(_e,"when",{enumerable:!0,get:function(){return C}}),_e.inviteStateText=function(e,n=Date.now()){return'used'===e?.state?'Previous link used. Current app links are prepared automatically.':e?.devices?`Signed in on ${e.devices} device${1===e.devices?'':'s'}`:'Personal Android and iPhone links'},_e.seedInvitePairsForQA=function(n,t,s){if(!e.PITCH)throw new Error('QA only');w.set(`${n}:${t}`,s),S()},Object.defineProperty(_e,"installSteps",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"installMessage",{enumerable:!0,get:function(){return D}}),_e.InviteLinkControls=function({m:e,actorRole:s}){const o=(0,u.useSync)(e=>e.venueId),b=(0,u.useSync)(e=>'staff'===e.kind&&!!e.venueId),x=(0,u.useSync)(e=>e.perms.includes('*')||e.perms.includes('roles.manage')),j=b&&e.active&&!e.name.includes('(example)')&&('owner'===s||x||'manager'===s&&'owner'!==e.role&&!e.ownerAccess),A=`${o}:${e.id}`,B=(0,f.useSession)(e=>e.meId),T=(0,y.useOwner)(e=>B?e.staff.find(e=>e.id===B):void 0),E=!B||!!T&&(0,k.ownJobManagesLinks)(T),[,z]=(0,t.useState)(0),[O,_]=(0,t.useState)(''),[W,U]=(0,t.useState)(!1),[Z,F]=(0,t.useState)(null),[G,N]=(0,t.useState)(null),[Q,Y]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{if(!j)return;const n=()=>z(e=>e+1);v.add(n),P(),M(A,e.id);const t=setInterval(()=>{M(A,e.id)},3e4),s=()=>{M(A,e.id)};return'undefined'!=typeof window&&window.addEventListener('focus',s),()=>{v.delete(n),clearInterval(t),'undefined'!=typeof window&&window.removeEventListener('focus',s)}},[j,A,e.id]),!j)return null;const J=w.get(A),q=async n=>{try{await(0,u.revokeStaffAppLink)(n),w.delete(A),N(null),_('Link revoked. Existing signed-in sessions are unchanged.'),await M(A,e.id),Z&&F(await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}};return(0,m.jsxs)(l.default,{testID:`invite-${e.id}`,style:{gap:10},children:[(()=>{const n=I(L[e.id]);return n?(0,m.jsxs)(l.default,{testID:`invite-phone-${e.id}`,style:{gap:8,padding:12,borderRadius:10,borderWidth:1,borderColor:h.colours.gold,backgroundColor:h.colours.bg,alignItems:'center'},children:[(0,m.jsx)(d.T,{center:!0,weight:"semibold",colour:h.colours.goldLight,testID:`invite-phone-since-${e.id}`,children:n}),(0,m.jsxs)(d.Muted,{center:!0,size:13,children:["Another phone that opens ",e.name,"\u2019s link is asked to see a manager."]}),E?Q?(0,m.jsxs)(l.default,{style:{gap:8,alignItems:'center',width:'100%'},children:[(0,m.jsxs)(d.T,{center:!0,size:15,children:["Reset ",e.name,"\u2019s phone? Their link will link to the next phone that opens it. Phones already signed in stay signed in."]}),(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Yes, reset phone",testID:`invite-reset-yes-${e.id}`,style:{minHeight:44},accessibilityLabel:`Yes, reset ${e.name}'s phone`,onPress:async()=>{try{await(0,u.resetStaffLinkPhone)(e.id),await P(),_(`Phone reset. ${e.name}\u2019s link will link to the next phone that opens it.`)}catch(e){_(String(e.message))}finally{Y(!1)}}}),(0,m.jsx)(d.Button,{label:"Cancel",kind:"ghost",style:{minHeight:44},testID:`invite-reset-no-${e.id}`,onPress:()=>Y(!1)})]})]}):(0,m.jsx)(d.Button,{label:"Reset phone",kind:"secondary",testID:`invite-reset-${e.id}`,style:{minHeight:44},accessibilityLabel:`Reset phone for ${e.name}. Asks to confirm.`,onPress:()=>Y(!0)}):(0,m.jsx)(d.Muted,{center:!0,size:13,testID:`invite-reset-managers-only-${e.id}`,children:"Only a manager or owner can reset a phone or switch a link off."})]}):null})(),['android','iphone'].map(t=>{const s='android'===t?'Android app':'iPhone web app',o=J?.[t],u=(0,c.currentAppLink)(o)&&o?(0,c.personalAppUrl)(t,o):null;return(0,m.jsxs)(l.default,{testID:`invite-${t}-${e.id}`,style:{gap:6,padding:10,borderRadius:10,borderWidth:1,borderColor:h.colours.gold,backgroundColor:h.colours.bg},children:[(0,m.jsx)(d.T,{center:!0,weight:"semibold",children:s}),u&&o?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n.Text,{selectable:!0,accessibilityLabel:`${e.name}, ${s} personal link`,testID:`invite-link-${t}-${e.id}`,style:{color:h.colours.goldLight,fontSize:14,textAlign:'center',width:'100%'},children:o.shortCode?`Short link: ${o.shortCode}`:"Secure personal link \u2014 Copy or Share"}),(0,m.jsx)(d.Muted,{center:!0,size:13,children:H(t)}),(0,m.jsx)(d.Muted,{center:!0,size:13,children:"Works for good on the first phone that opens it."}),(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Copy",kind:"secondary",style:{minHeight:44,minWidth:44},accessibilityLabel:`Copy ${e.name}'s ${s} link`,testID:`invite-copy-${t}-${e.id}`,onPress:async()=>_(await(0,p.copyText)(D(u,e.name,t))?'Link and install steps copied':'Select and copy the link.')}),(0,m.jsx)(d.Button,{label:"Share",style:{minHeight:44,minWidth:44},accessibilityLabel:`Share ${e.name}'s ${s} link`,testID:`invite-share-${t}-${e.id}`,onPress:async()=>_(await R(u,e.name,t))}),E?(0,m.jsx)(d.Button,{label:"Revoke link",kind:"ghost",style:{minHeight:44},accessibilityLabel:`Revoke ${e.name}'s ${s} link`,onPress:()=>N(o.id)}):null]})]}):(0,m.jsx)(d.Muted,{children:$.has(A)?'Cannot load the current link. Reconnecting automatically.':'Preparing current link\u2026'})]},t)}),G&&E?(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Confirm revoke link",accessibilityLabel:`Confirm revoke link for ${e.name}`,style:{minHeight:44},onPress:()=>{q(G)}}),(0,m.jsx)(d.Button,{label:"Cancel",kind:"ghost",style:{minHeight:44},onPress:()=>N(null)})]}):null,O?(0,m.jsx)(d.T,{center:!0,size:14,children:O}):null,(0,m.jsx)(d.Button,{label:W?"Making new links\u2026":"Make new app links",testID:`invite-new-${e.id}`,accessibilityLabel:`Make new Android and iPhone app links for ${e.name}`,disabled:W,onPress:async()=>{if(!W){U(!0);try{const n=await(0,u.refreshStaffAppLinks)(e.id);w.set(A,n),$.delete(A),S(),_('New links ready. Links already sent keep working. Signed-in phones stay signed in.'),Z&&F(await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}finally{U(!1)}}}}),(0,m.jsxs)(d.Muted,{center:!0,size:13,children:["Share privately with ",e.name,". Links never expire. Each link works on the first phone that opens it; Reset phone lets it link to a new one."]}),(0,m.jsx)(d.Button,{label:Z?'Hide previous links':'Manage previous links',kind:"ghost",style:{minHeight:44},accessibilityLabel:`Manage all previous app links for ${e.name}`,onPress:async()=>{try{F(Z?null:await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}}}),Z?.map(n=>(0,m.jsxs)(l.default,{style:{gap:4},children:[(0,m.jsxs)(d.Muted,{center:!0,size:13,children:['legacy'===n.platform?'Previous app link':'android'===n.platform?'Android app':'iPhone'," \xb7 ",C(n.createdAt)," \xb7 ",n.revokedAt?'Revoked':n.usedAt?'Used for sign-in':'Unused']}),!n.revokedAt&&E?(0,m.jsx)(d.Button,{label:"Revoke this link",kind:"ghost",style:{minHeight:44},accessibilityLabel:`Revoke ${e.name}'s ${n.platform} link from ${C(n.createdAt)}`,onPress:()=>N(n.id)}):null]},n.id))]})};var e=r(_d[0]),n=r(_d[1]),t=r(_d[2]);r(_d[3]),r(_d[4]);var s,o=r(_d[5]),l=(s=o)&&s.__esModule?s:{default:s},d=r(_d[6]),c=r(_d[7]),u=r(_d[8]),h=r(_d[9]),p=r(_d[10]),f=r(_d[11]),y=r(_d[12]),k=r(_d[13]),m=r(_d[14]);const w=new Map,b=new Map,v=new Set,$=new Map,S=()=>v.forEach(e=>e());let x=null;const j=()=>x;let L={};async function P(){return L=await(0,u.staffLinkPhones)(),S(),L}function I(e){if(!e||!e.phones)return null;const n=new Date(e.since).toLocaleDateString('en-GB',{timeZone:'Europe/London',day:'numeric',month:'short',year:'numeric'});return e.phones>1?`Linked to ${e.phones} phones, the first since ${n}`:`Linked to a phone since ${n}`}async function A(){return x=await(0,u.readInviteStatus)(),S(),x}const C=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZoneName:'short'}):'';async function M(n,t){if(e.PITCH&&w.has(n))return;if(b.has(n))return b.get(n);const s=(async()=>{try{w.set(n,await(0,u.ensureStaffAppLinks)(t)),$.delete(n)}catch(e){w.delete(n),$.set(n,String(e.message||e))}finally{b.delete(n),S()}})();return b.set(n,s),s}const H=e=>'android'===e?'Tap the link, download the app, allow installation, then open it. It signs you in.':'Open in Safari and tap Open app. In the app, tap Share, Add to Home Screen, then open it from your Home Screen.',D=(e,n,t)=>`${n} \u2014 ${'android'===t?'Android app':'iPhone web app'}\n${e}\n${H(t)}`;async function R(e,n,t){const s=D(e,n,t);try{if('undefined'!=typeof navigator&&navigator.share)return await navigator.share({title:`CoverCharge for ${n}`,text:s,url:e}),'Share opened'}catch(e){if('AbortError'===e.name)return'Share cancelled'}return await(0,p.copyText)(s)?'Link and install steps copied. Paste them into a private message.':'Select and copy the link.'}},1380,[2,796,34,236,383,102,794,1381,985,840,1151,997,865,988,25]); __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IOS_WEB",{enumerable:!0,get:function(){return t}}),e.getPageSlug=n,e.personalGetUrl=o,e.siteRootFromLocation=s,e.mintPersonalUrl=function(t,c,h){const p=s();if(p)return o({origin:p.origin,basePath:p.basePath,staffId:t,name:c,token:h});return`get/${n(c)||n(t)}.html?v=2#i=${encodeURIComponent(h)}`},e.currentAppLink=function(t,n=Date.now()){return!!t&&/^[A-Za-z0-9_-]{16,64}$/.test(t.token)&&Date.parse(t.expiresAt)>n},e.personalAppUrl=function(t,n){if(n.shortCode&&/^[A-Za-z0-9_-]{10}$/.test(n.shortCode)){const t=s()??{origin:'https://covercharge-apps.static.hf.space',basePath:'/'};return`${t.origin}${t.basePath}s.html#${n.shortCode}`}if(n.url)try{const t=new URL(n.url);if('https:'===t.protocol&&'covercharge-apps.static.hf.space'===t.hostname&&/^\/(?:(?:kirkmichael|wildings)\/)?get\/[a-z0-9-]+\.html$/.test(t.pathname))return t.href}catch{}const o=s()??{origin:'https://covercharge-apps.static.hf.space',basePath:'/'},c=['owner','chef'].includes(n.app)?n.app:'staff',h=`i=${encodeURIComponent(n.token)}${'iphone'===t?`&d=${encodeURIComponent(n.device||'')}`:''}`;return`${o.origin}${o.basePath}get/${t}.html?a=${c}${'android'===t?'&v=2':'&v=61'}#${h}`};const t=new Set(['st-jack','st-agate','st-lenny','st-james','st-lillie','st-bisto','st-gordon','st-cameron','st-mia','st-emily','st-gabrielle','st-harvey','st-tracy','st-eilidh','st-finn']);function n(t){return(t.startsWith('st-')||t.startsWith('ow-')||t.startsWith('ch-')?t.replace(/^(st|ow|ch)-/,''):t.replace(/\s*\(.*?\)\s*/g,' ').trim().split(/\s+/)[0]||t).toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'staff'}function o(t){const o=t.origin.replace(/\/$/,'');let s=(t.basePath||'/').replace(/\/?$/,'/');s.startsWith('/')||(s='/'+s);return`${o}${s}get/${n(t.name)||n(t.staffId)}.html?v=2#i=${encodeURIComponent(t.token)}`}function s(t){try{if(!(t||'undefined'!=typeof window&&window.location))return null;const n=new URL(t||window.location.href),o=n.pathname.match(/^(.*?\/)(?:owner|staff|chef|display|customer)-app(?:\/|$)/);return{origin:n.origin,basePath:o?o[1]:'/'}}catch{return null}}},1381,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return o.useFonts}});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var o=r(d[2])},1382,[1383,1406,1408]); @@ -1491,43 +1491,44 @@ __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,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},1408,[34,1383]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},1409,[1410]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preventAutoHideAsync=async function(){return!1},e.setOptions=function(n){},e.hide=function(){},e.hideAsync=async function(){}},1410,[]); -__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.CarGate=function(){const e=(0,c.useSession)(e=>e.meId),[s,o]=(0,t.useState)(c.useSession.persist.hasHydrated());return(0,t.useEffect)(()=>{const e=c.useSession.persist.onFinishHydration(()=>o(!0));return c.useSession.persist.hasHydrated()&&o(!0),e},[]),s?e||h.PITCH?null:(0,j.jsx)(I,{}):(0,j.jsx)(n.default,{style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=e(_r(d[1])),n=e(_r(d[2])),s=e(_r(d[3])),o=_r(d[4]),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),f=_r(d[10]),p=_r(d[11]),y=_r(d[12]),j=_r(d[13]);let b=null,w=null;async function M(e){return!e&&w&&Date.now()-w.at<6e4&&new Date(w.r.expiresAt).getTime()-Date.now()>12e4?w.r:b||(b=(0,u.carPairStart)().then(e=>(e.ok&&(w={r:e,at:Date.now()}),e)).finally(()=>{b=null}),b)}function I(){const{width:e,height:c}=(0,s.default)(),[h,b]=(0,t.useState)(null),[w,I]=(0,t.useState)('starting'),[T,D]=(0,t.useState)(''),[k,C]=(0,t.useState)(0),z=(0,t.useRef)(!1),S=(0,t.useCallback)(async(e=!0)=>{if(z.current)return;z.current=!0,I('starting'),D('');const t=await M(e);if(z.current=!1,!t.ok)return I('error'),void D(t.error);b({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),I('waiting')},[]);(0,t.useEffect)(()=>{S(!1)},[]),(0,t.useEffect)(()=>{if(!h||'waiting'!==w)return;const e=setInterval(async()=>{C(Math.max(0,Math.round((h.until-Date.now())/1e3)));('expired'===await(0,u.carPairPoll)(h.id)||Date.now()>h.until)&&I('expired')},3e3);return()=>clearInterval(e)},[h,w]);const P=Math.min(120,Math.max(64,Math.round(Math.min(e/9,c/7)))),H=h?.code??'',v=H?`${H.slice(0,3)} ${H.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,j.jsx)(n.default,{testID:"car-pairing",style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:(0,j.jsxs)(n.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:c<820?10:16},children:[(0,j.jsx)(l.RestaurantLogo,{rid:x.VENUE_RID,size:c<820?64:88}),(0,j.jsx)(o.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,j.jsx)(y.ParkedOnly,{}),'waiting'===w||'starting'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,j.jsx)(n.default,{testID:"car-code",accessible:!0,accessibilityLabel:H?`Car code ${(0,p.spokenCode)(H)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,j.jsx)(o.T,{center:!0,size:P,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:P/8,lineHeight:1.2*P},children:v})}),H?(0,j.jsx)(o.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,j.jsxs)(n.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,j.jsx)(o.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,j.jsx)(n.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,j.jsx)(o.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{S()},style:{minHeight:64,minWidth:200}})})]}):'expired'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{S()},style:{minHeight:64,minWidth:280}})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,j.jsx)(o.Muted,{center:!0,children:T}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{S()},style:{minHeight:64,minWidth:240}})]}),T&&'error'!==w?(0,j.jsx)(o.T,{center:!0,colour:f.colours.amber,children:T}):null,(0,j.jsx)(o.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})})}},1411,[34,41,102,426,794,847,997,985,2,5,840,1412,1413,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=32;const l=s=>s.split('').join(' ')},1412,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1413,[34,102,794,840,25]); -__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1414,[986,857,856,985]); -__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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1415,[798,796,34,1338,1015,402,102,846,985,1007,1014,5,840,794,1282,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1416,[796,34,236,402,102,840,985,1045,2,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.VoiceHost=function(){const e=(0,f.useVoiceTarget)(),t=(0,f.useVoiceSlot)(e=>e.rect);g.PITCH&&(globalThis.__voiceExpect={app:e?.app??null,on:!!e?.on,slot:!!t});if(!e?.on||!t)return null;const n=(0,P.jsx)(X,{app:e.actions,ui:e.app},e.actions);if('undefined'!=typeof document){const{createPortal:e}=_r(d[33]);return e(n,document.body)}return n};var t=_r(d[0]),n=_r(d[1]),o=_r(d[2]),r=e(_r(d[3])),s=e(_r(d[4])),i=e(_r(d[5])),a=e(_r(d[6]));_r(d[7]);var l=e(_r(d[8])),c=e(_r(d[9])),u=e(_r(d[10])),h=e(_r(d[11])),p=_r(d[12]),f=_r(d[13]),g=_r(d[14]),y=_r(d[15]),m=e(y),w=_r(d[16]),x=_r(d[17]),b=_r(d[18]),v=_r(d[19]),k=_r(d[20]),j=_r(d[21]),T=_r(d[22]),R=_r(d[23]),C=_r(d[24]),S=_r(d[25]),I=_r(d[26]),M=_r(d[27]),E=_r(d[28]),H=_r(d[29]),z=_r(d[30]),D=_r(d[31]),P=_r(d[32]);const A='How many people?',$=['covers','partySize'],W=200,_=16e3,B=31e3,O='That took too long, so I stopped waiting. Hold the button and try again, or tap Type instead.',V='Something went wrong there. Hold the button and try again, or tap Type instead.',F='The microphone is blocked. Allow it in the browser\u2019s site settings, or tap the button to type instead.';function L(e,t){return'cap'===e?t?.message||E.REACHED_TEXT:'identity'===e||'app'===e?'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.':'not-allowed'===e?F:'audio-capture'===e?'I couldn\u2019t use the microphone on this device. Check nothing else is using it, then hold the button again, or tap Type instead.':'busy'===e?'Speech to text is busy just now. Hold the button and try again in a moment, or tap Type instead.':'soon'===e?'Speech to text is switching on soon. For now, tap the button to type instead.':'long'===e?'That was longer than 30 seconds. Hold the button and say it more briefly, or tap Type instead.':'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.'}function N({colour:e,size:t=34}){return(0,P.jsxs)(m.default,{width:t,height:t,viewBox:"0 0 24 24",children:[(0,P.jsx)(y.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:e}),(0,P.jsx)(y.Path,{d:"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7",stroke:e,strokeWidth:2,strokeLinecap:"round",fill:"none"})]})}const G={owner:['\u201cWalk-in fridge 3 degrees\u201d','\u201cMark the lobster sold out\u201d','\u201cHow many Covers tonight?\u201d','\u201cAdd blue roll to the Booker list\u201d'],staff:['\u201cMessage the team: running 10 minutes late\u201d','\u201cRead my messages\u201d','\u201cWhen\u2019s my next shift?\u201d','\u201cWhat are today\u2019s specials?\u201d','\u201cDoes the fish supper contain gluten?\u201d'],chef:['\u201cFreezer minus 19\u201d','\u201cMark the soup sold out\u201d','\u201cRead the orders\u201d','\u201cAdd onions to the Bidfood list\u201d'],display:['\u201cWalk-in fridge 3 degrees\u201d','\u201cRead the orders\u201d','\u201cAny room for 6 at 8?\u201d','\u201cRead the shift notes\u201d']};function X({app:e,ui:g}){const y=(0,w.useCtx)(6e4),m=(0,b.useOwner)(e=>e.staff),X=(0,I.useVoiceNav)(e=>e.go),{height:U}=(0,u.default)(),q=(0,f.useVoiceSlot)(e=>e.rect),K=q.size,Y=x.ROSTER.find(e=>'chef'===e.app),J='display'===e?'Main Display':'chef'===e?m.find(e=>e.id===Y?.id)?.name??'Head Chef':y.me,Q='display'===e?'display':'chef'===e?Y?.id??'chef':y.meId,Z={rid:y.rid,today:y.today,go:(e,t)=>X?.(e,t),app:e,who:J.replace(' (example)',''),whoId:Q,role:'owner'===g?y.role:e};(0,o.useEffect)(()=>{try{(0,T.setVenueWords)((0,R.venueKeyterms)(y.rid))}catch{}},[y.rid,m]);const[ee,te]=(0,o.useState)('idle'),[ne,oe]=(0,o.useState)(''),[re,se]=(0,o.useState)(0),[ie,ae]=(0,o.useState)(null),[le,de]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(''),[he,pe]=(0,o.useState)(!1),fe=(0,o.useRef)(null),ge=(0,o.useRef)(0),ye=(0,o.useRef)(null),me=(0,o.useRef)(Z);me.current=Z;const we=(0,o.useRef)(ie);we.current=ie;const xe=(0,o.useRef)(y.now);xe.current=y.now;const be=e=>{ae(e),te('answer')},ve=be,ke=async e=>{const t=++ge.current;let n;te('working');try{n=await(0,j.runAction)(e.id,e.params,me.current,!0)}catch{n={status:'error',message:V}}t===ge.current&&((0,H.buzz)([20,40,20]),ve({text:'needs_confirmation'===n.status?n.preview:n.message,tone:'error'===n.status?'warn':'ok'}))},je=()=>ve({text:'Cancelled. Nothing was changed.',tone:'info'}),Te=async(e,t,n)=>{const o=++ge.current,r={...e.params,[e.field]:t};let s;te('working');try{s=await(0,j.runAction)(e.id,r,me.current,!1)}catch{s={status:'error',message:V}}o===ge.current&&('needs_confirmation'===s.status?ve({heard:n,text:s.preview,pending:{id:e.id,params:r,preview:s.preview}}):ve({heard:n,text:s.message,tone:'error'===s.status?'warn':'ok'}))},Re=async(e,t)=>{const n=ge.current,o=e=>{n===ge.current&&be(e)};try{await Ce(e,o,t)}catch{o({heard:e.trim()||void 0,text:V,tone:'warn'})}},Ce=async(t,n,o)=>{const r=t.trim(),s=me.current;if(!r)return void n({text:'I didn\u2019t catch that. Hold the button while you speak, then let go.',tone:'info'});const i=we.current?.pending;if(i){const e=(0,H.yesNo)(r);if('yes'===e)return void await ke(i);if('no'===e)return void je()}const a=we.current?.ask;if(a){const e=(0,D.coversAnswer)(r);if(e&&e<=30)return void await Te(a,e,r)}te('working');const l=(0,j.matchIntent)(r,s.today,{app:e,rid:s.rid,whoId:s.whoId}),c=xe.current;if(!E.voiceUsage.allowed(s.rid,'action'===l.kind?l.action.id:null,c))return void n({heard:r,text:E.REACHED_TEXT,tone:'info'});E.voiceUsage.record(s.rid,c);const u=E.voiceUsage.get(s.rid,c),h=u.reached?E.REACHED_TEXT:u.warn?(0,E.WARN_TEXT)(u):void 0,p=e=>n({...e,note:h});if('action'===l.kind){const e=l.action,t=e.params.filter(e=>e.required&&(void 0===l.params[e.name]||''===l.params[e.name]||'[]'===l.params[e.name]));if(1===t.length&&$.includes(t[0].name))return void p({heard:r,text:A,ask:{id:e.id,params:l.params,field:t[0].name},tone:'info'});if(t.length)return void p({heard:r,text:e.preview(l.params,s)+(/\?$/.test(e.preview(l.params,s))||/couldn|didn/.test(e.preview(l.params,s))?'':` I still need: ${t.map(e=>e.description.toLowerCase()).join('; ')}.`)+' Hold the button and try again.',tone:'warn'});const n=await(0,j.runAction)(e.id,l.params,s,!1);return void('needs_confirmation'===n.status?p({heard:r,text:n.preview,pending:{id:e.id,params:l.params,preview:n.preview}}):p({heard:r,text:n.message,tone:'error'===n.status?'warn':'ok'}))}const f=` ${r.toLowerCase()} `,g=e=>{const t=(0,j.actionById)(e);if(!t)return 0;try{return t.match?t.match(f):t.keywords.filter(e=>f.includes(e)).length}catch{return 0}},y=()=>(0,j.toolSpecs)().filter(t=>{const n=(0,j.actionById)(t.function.name);return!!n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))}).map((e,t)=>({t:e,i:t,s:g(e.function.name)})).sort((e,t)=>t.s-e.s||e.i-t.i).slice(0,60).map(e=>e.t),m=async t=>{if('call'===t.kind){const n=(0,j.actionById)(t.name);if(n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))){const e=n.params.filter(e=>e.required&&(void 0===t.args[e.name]||''===t.args[e.name]));if(1===e.length&&$.includes(e[0].name))return p({heard:r,text:A,ask:{id:n.id,params:t.args,field:e[0].name},tone:'info'}),!0;const o=await(0,j.runAction)(n.id,t.args,s,!1);return'needs_confirmation'===o.status?p({heard:r,text:o.preview,pending:{id:n.id,params:t.args,preview:o.preview}}):p({heard:r,text:o.message,tone:'error'===o.status?'warn':'ok'}),!0}}return'text'===t.kind&&(p({heard:r,text:(0,j.moneySafe)(e,s.role)?(0,j.noMoney)(t.text):t.text,tone:'info'}),!0)};if('help'===l.kind){const t=l.ids.map(C.helpById).filter(Boolean)[0];if(!(((0,S.searchHelp)(C.HELP,r,1)[0]?.score??0)>=2.5)){const n=await(0,T.askServer)(e,r,y(),o);if(await m(n))return;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(`${t.title}. ${t.body}`)?void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}.`,tone:'info'}):void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}. This guide might help: ${t.title}.`,help:l.ids,tone:'info'})}const n=`${t.title}. ${t.body}`;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(n)?void p({heard:r,text:'That isn\u2019t shown here. Ask a manager in the Managers app.',tone:'info'}):void p({heard:r,text:n,help:l.ids,tone:'info'})}await m(await(0,T.askServer)(e,r,y(),o))||p({heard:r,text:T.SOON_TEXT+' '+G[e].slice(0,2).join(' or ')+'.',tone:'info'})},Se=()=>{fe.current?.abort(),fe.current=null,ye.current?.(),ye.current=null,se(0)};(0,o.useEffect)(()=>()=>{fe.current?.abort(),ye.current?.()},[]);const Ie=async()=>{if(!(0,H.canListen)())return de(!0),void ve({text:(0,H.tabletWithoutMic)()?'This Display tablet app needs an update before it can use the microphone. For now, type below.':'This browser can\u2019t record speech. Type instead below.',tone:'info'});if((0,H.desktopStt)()){if(!(0,M.micExplainedFor)(g))return void pe(!0)}else{const e=await(0,H.micPermission)();if('granted'===e)(0,M.setMicExplainedFor)(g);else{if('denied'===e)return de(!0),void ve({text:F,tone:'warn'});if(!(0,M.micExplainedFor)(g))return void pe(!0)}}if(!He.current.holding&&!Ee.current)return;const t=++ge.current;(0,H.buzz)(35),oe(''),ae(null),de(!1),te('listening');if(fe.current=(0,H.listen)(oe,(e,n,o)=>{if(ye.current?.(),ye.current=null,se(0),fe.current=null,t===ge.current){if('not-allowed'!==n&&'service-not-allowed'!==n)return'stt-failed'===n?(ve({text:'Speech to text didn\u2019t start on this Mac. Type instead below; restarting the app usually fixes it.',tone:'warn'}),void de(!0)):void(n?ve({text:L(n,o),tone:'cap'===n?'info':'warn'}):Re(e,o?.receipt));ve({text:(0,H.desktopStt)()?'The microphone is blocked for CoverCharge. Open System Settings \u203a Privacy & Security \u203a Microphone, switch on CoverCharge for Mac, then try again. Or type instead.':F,tone:'warn'})}},e,se),!fe.current)return te('idle'),void de(!0);if((0,H.desktopStt)()){const e=await(0,H.levelMeter)(se);fe.current?ye.current=e:e()}},Me=()=>{fe.current&&(te('working'),fe.current.stop(),ye.current?.(),ye.current=null,se(0))},Ee=(0,o.useRef)(!1),He=(0,o.useRef)({timer:0,holding:!1}),ze=(0,o.useRef)(Ie);ze.current=Ie;const De=(0,o.useRef)(Me);De.current=Me;const Pe=(0,o.useMemo)(()=>a.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>{const e=He.current;e.holding=!1,(0,M.micExplainedFor)(g)&&(0,H.warmMic)(),e.timer=setTimeout(()=>{e.holding=!0,ze.current()},W)},onPanResponderRelease:()=>{const e=He.current;if(clearTimeout(e.timer),e.holding)return e.holding=!1,void De.current();(0,H.disarmMic)(),de(!0),te(e=>'idle'===e?'answer':e)},onPanResponderTerminate:()=>{const e=He.current;clearTimeout(e.timer),e.holding&&(e.holding=!1,De.current())}}),[e]);(0,o.useRef)(ee).current=ee,(0,o.useEffect)(()=>z.useVoiceKeys.subscribe((e,t)=>{const n=e.last;if(!n||n.n===t.last?.n)return;const o=!!fe.current;'start'!==n.cmd||o?'stop'===n.cmd?(Ee.current=!1,o&&De.current()):'toggle'===n.cmd?o?(Ee.current=!1,De.current()):(Ee.current=!0,ze.current()):'type'===n.cmd&&(de(!0),te(e=>'idle'===e?'answer':e)):(Ee.current=!0,ze.current())}),[]);const Ae=K>=64,$e=(0,o.useRef)(new s.default.Value(0)).current;(0,o.useEffect)(()=>{if('listening'!==ee)return $e.stopAnimation(),void $e.setValue(0);const e=s.default.loop(s.default.timing($e,{toValue:1,duration:1100,easing:i.default.out(i.default.quad),useNativeDriver:!1}));return e.start(),()=>e.stop()},[ee]);const We='listening'===ee,Be='answer'===ee&&(ie||le)||'working'===ee||We,Oe=()=>{ge.current++,Se(),ae(null),de(!1),ue(''),te('idle')};(0,o.useEffect)(()=>{if('working'!==ee&&'listening'!==ee)return;const e=ge.current,t=setTimeout(()=>{e===ge.current&&('listening'!==ee?(ge.current++,Se(),de(!0),be({heard:ne&&!/\u2026$/.test(ne)?ne:void 0,text:O,tone:'warn'})):De.current())},'working'===ee?_:B);return()=>clearTimeout(t)},[ee]);const Ve=()=>{const e=ce.trim();e&&(ue(''),oe(e),ge.current++,Re(e))},Fe='fixed',Le={top:q.y+K+8},Ne=$e.interpolate({inputRange:[0,1],outputRange:[1,1.7]}),Ge=$e.interpolate({inputRange:[0,1],outputRange:[.6,0]}),Xe='warn'===ie?.tone?k.colours.amber:ie?.pending?k.colours.gold:k.colours.border;return(0,P.jsxs)(P.Fragment,{children:[Be?(0,P.jsx)(h.default,{testID:"voice-panel",style:[{position:Fe,left:12,right:12,alignItems:'flex-end',zIndex:60},Le],pointerEvents:"box-none",children:(0,P.jsxs)(h.default,{style:{width:'100%',maxWidth:Ae?720:520,backgroundColor:k.colours.surface,borderRadius:16,borderWidth:2,borderColor:Xe,padding:Ae?20:14,gap:10,maxHeight:U*(Ae?.78:.6)},children:[(0,P.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.gold,accessibilityRole:"header",children:We?Ae?'Listening\u2026 let go (or press \u2318\u21e7G) to send':'Listening\u2026 let go to send':'working'===ee?'Working on it\u2026':ie?.pending?'Please confirm':'Voice assistant'}),(0,P.jsx)(l.default,{testID:"voice-close",accessibilityRole:"button",accessibilityLabel:"Close voice assistant",hitSlop:12,onPress:Oe,style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:20,colour:k.colours.muted,children:"\u2715"})})]}),(0,P.jsx)(v.T,{testID:"voice-reply-mode",size:14,colour:k.colours.muted,children:"Text replies only"}),We?(0,P.jsxs)(h.default,{style:{gap:8},children:[(0,P.jsx)(h.default,{style:{height:10,borderRadius:5,backgroundColor:k.colours.surface2,overflow:'hidden'},children:(0,P.jsx)(h.default,{testID:"voice-level",style:{width:`${Math.round(8+92*re)}%`,height:10,backgroundColor:k.colours.ok}})}),(0,P.jsx)(v.T,{size:16,children:ne||'Say it now\u2026'})]}):null,'working'===ee?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(r.default,{color:k.colours.gold}),(0,P.jsx)(v.T,{size:15,colour:k.colours.muted,children:ne?/\u2026$/.test(ne)?ne:`\u201c${ne}\u201d`:''})]}):null,'working'===ee||We?(0,P.jsx)(v.Button,{testID:"voice-stop",kind:"secondary",label:"Cancel",onPress:()=>{ge.current++,Se(),de(!1),be({text:'Stopped. Nothing was changed.',tone:'info'})},style:{minHeight:48}}):null,'answer'===ee&&ie?(0,P.jsxs)(c.default,{style:{maxHeight:U*(Ae?.55:.36)},contentContainerStyle:{gap:8},children:[ie.heard?(0,P.jsx)(h.default,{testID:"voice-heard",accessible:!0,accessibilityLabel:`I heard: ${ie.heard}`,children:(0,P.jsxs)(v.T,{size:Ae?16:14,colour:k.colours.muted,children:["I heard: \u201c",ie.heard,"\u201d"]})}):null,ie.note?(0,P.jsx)(h.default,{testID:"voice-usage-note",children:(0,P.jsx)(v.T,{size:13,colour:k.colours.amber,children:ie.note})}):null,(0,P.jsx)(h.default,{testID:"voice-answer",children:(0,P.jsx)(v.T,{size:Ae?24:18,weight:ie.pending?'semibold':'regular',children:ie.text})}),ie.help&&'owner'===e&&X?ie.help.slice(0,3).map(e=>{const t=(0,C.helpById)(e);return t?(0,P.jsx)(v.Button,{small:!0,kind:"secondary",label:`Open help: ${t.title}`,onPress:()=>{X('more','help'),Oe()}},e):null}):null]}):null,'answer'===ee&&ie?.ask?(0,P.jsx)(h.default,{testID:"voice-how-many",style:{flexDirection:'row',flexWrap:'wrap',gap:10},children:[1,2,3,4,5,6,7,8].map(e=>(0,P.jsx)(l.default,{testID:`voice-covers-${e}`,accessibilityRole:"button",accessibilityLabel:1===e?'1 person':`${e} people`,onPress:()=>{Te(ie.ask,e)},style:{width:Ae?96:72,height:Ae?96:72,borderRadius:14,backgroundColor:k.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:Ae?40:32,weight:"semibold",colour:k.colours.onGold,children:e})},e))}):null,'answer'===ee&&ie?.pending?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(v.Button,{testID:"voice-confirm",kind:"success",label:"Confirm",onPress:()=>{ke(ie.pending)},style:{flex:1,minHeight:56}}),(0,P.jsx)(v.Button,{testID:"voice-cancel",kind:"secondary",label:"Cancel",onPress:je,style:{flex:1,minHeight:56}})]}):null,'answer'!==ee||ie?.pending?null:(0,P.jsxs)(h.default,{style:{gap:6},children:[le||!(0,H.canListen)()?(0,P.jsxs)(v.Row,{gap:8,children:[(0,P.jsx)(n.TextInput,{testID:"voice-type",value:ce,onChangeText:ue,onSubmitEditing:Ve,placeholder:"Type instead\u2026",placeholderTextColor:k.colours.muted,autoFocus:!0,returnKeyType:"send",style:{flex:1,minWidth:0,width:0,minHeight:48,borderRadius:10,borderWidth:1,borderColor:k.colours.border,backgroundColor:k.colours.surface2,color:k.colours.text,paddingHorizontal:12,fontFamily:k.fonts.regular,fontSize:16}}),(0,P.jsx)(v.Button,{testID:"voice-send",kind:"success",label:"Ask",onPress:Ve,disabled:!ce.trim()})]}):(0,P.jsx)(l.default,{accessibilityRole:"button",onPress:()=>de(!0),children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"Type instead"})}),ie?null:(0,P.jsxs)(v.T,{size:Ae?15:13,colour:k.colours.muted,children:[Ae?'Hold Space (or the gold button) and speak, or press \u2318\u21e7G to start and again to send. ':'Hold the gold button and speak, for example ',Ae?`For example ${G[e].join(', ')}.`:`${G[e].join(', ')}.`]}),'owner'===g&&'owner'===e?(0,P.jsx)(l.default,{testID:"voice-open-assistant",accessibilityRole:"button",onPress:()=>{Oe(),p.useAssistantUi.getState().setOpen(!0)},style:{minHeight:44,justifyContent:'center'},children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"\u2726 Open the Assistant (ideas, history and longer requests) \u203a"})}):null]})]})}):null,(0,P.jsxs)(h.default,{style:{position:Fe,left:`clamp(0px, ${q.x}px, calc(100vw - ${K}px))`,top:q.y,width:K,height:K,zIndex:61},pointerEvents:"box-none",children:[We?(0,P.jsx)(s.default.View,{pointerEvents:"none",style:{position:'absolute',left:0,top:0,width:K,height:K,borderRadius:K/2,borderWidth:4,borderColor:k.colours.ok,opacity:Ge,transform:[{scale:Ne}]}}):null,We?(0,P.jsx)(h.default,{pointerEvents:"none",style:{position:'absolute',left:-6,top:-6,width:K+12,height:K+12,borderRadius:(K+12)/2,borderWidth:3+Math.round(7*re),borderColor:k.colours.ok}}):null,(0,P.jsx)(h.default,{testID:"voice-button",accessible:!0,accessibilityRole:"button",accessibilityLabel:'owner'===g&&'owner'===e?'Voice assistant and Assistant. Hold to talk, let go to send. Tap to type or open the Assistant.':'Voice assistant. Hold to talk, let go to send. Tap to type instead.',...Pe.panHandlers,style:[{width:K,height:K,borderRadius:K/2,alignItems:'center',justifyContent:'center',backgroundColor:We?k.colours.ok:k.colours.gold,borderWidth:2,borderColor:k.colours.bg},{userSelect:'none',WebkitUserSelect:'none',WebkitTouchCallout:'none',touchAction:'none',cursor:'pointer'}],children:['kirkton','abbotsford'].includes(t.VENUE_RID)?(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.onGold,children:'working'===ee?'Wait':'Talk'}):'working'===ee?(0,P.jsx)(r.default,{color:k.colours.onGold,size:"large"}):(0,P.jsx)(N,{colour:k.colours.onGold,size:Math.round(.5*K)})})]}),(0,P.jsx)(v.Sheet,{visible:he,onClose:()=>{(0,M.setMicExplainedFor)(g),pe(!1)},title:"Talk to CoverCharge",testID:"voice-explain",children:(0,P.jsxs)(h.default,{style:{gap:10},children:[(0,P.jsxs)(v.T,{children:["Hold the gold button, say what you need, then let go. For example ",G[e].slice(0,3).join(', '),"."]}),(0,P.jsx)(v.T,{children:(0,H.desktopStt)()?'Your Mac will now ask once to let CoverCharge use the microphone. It only listens while you hold the button.':'Your device will now ask once to use the microphone. It only listens while you hold the button, for up to 30 seconds.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:(0,H.desktopStt)()?'On this Mac, speech is turned into text on the Mac itself, so what you say isn\u2019t sent anywhere. CoverCharge doesn\u2019t keep the audio.':'What you say while holding is sent to Grok (xAI) to be turned into text. CoverCharge doesn\u2019t keep the audio.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:"The helper replies in text only, never aloud. Any change is shown in text first, with Confirm and Cancel buttons; you can also say \u201cyes\u201d. Orders to suppliers, messages and payments are only ever saved as drafts for the owner."}),(0,P.jsx)(v.Button,{testID:"voice-allow",kind:"success",label:"Allow microphone",onPress:async()=>{(0,M.setMicExplainedFor)(g),pe(!1);const e=!!(0,H.desktopStt)()||await(0,H.askMic)();if((0,H.desktopStt)()){(await(0,H.levelMeter)(()=>{}))()}ve(e?{text:'Ready. Now hold the button and speak.',tone:'ok'}:{text:F,tone:'warn'})}}),(0,P.jsx)(v.Button,{kind:"secondary",label:"Type instead",onPress:()=>{(0,M.setMicExplainedFor)(g),pe(!1),de(!0),te('answer')}})]})})]})}},1417,[5,796,34,385,283,364,380,236,402,295,426,102,1418,1116,2,900,1100,15,865,794,840,1419,930,1433,1429,1430,1434,1117,1435,929,1436,1432,25,277]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ASSISTANT_AVAILABLE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"useAssistantUi",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"AssistantFab",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"AssistantSheet",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"AssistantPage",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"AssistantSettings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"AssistantPlanCard",{enumerable:!0,get:function(){return c}});const t=!1,n={getState:()=>({open:!1,setOpen:t=>{}})},u=()=>null,s=()=>null,l=()=>null,o=()=>null,c=()=>null},1418,[]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1419,[1420,1098,829,1423,1424,865,848,1014,1428,1429,1430,1426,1425,1431,1432,1012,1013]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1420,[1421,1422,1038]); -__d(function(g,r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_LABEL",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HISTORY_NOTE",{enumerable:!0,get:function(){return o}}),e.validPastDate=n,Object.defineProperty(e,"ukHistoryDate",{enumerable:!0,get:function(){return s}}),e.parseHistoryInput=function(t){const o=t.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(o))return o;const n=/^(\d{1,2})[\s/.-]+(\d{1,2})[\s/.-]+(\d{4})$/.exec(o);if(!n)return;const s=`${n[3]}-${n[2].padStart(2,'0')}-${n[1].padStart(2,'0')}`,d=new Date(s+'T12:00:00Z');return Number.isNaN(d.getTime())||d.toISOString().slice(0,10)!==s?void 0:s},e.exactHistoryDate=function(t,o){if(1!==(t.match(/\b(?:\d{4}-\d{2}-\d{2}|\d{1,2}\/\d{1,2}\/\d{4}|\d{1,2}(?:st|nd|rd|th)?\s+[a-z]+\s+\d{4})\b/gi)??[]).length)return;const s=t.match(/\b(\d{4}-\d{2}-\d{2})\b/);let d=s?.[1];if(!d){const o=t.match(/\b(\d{1,2})\/(\d{1,2})\/(\d{4})\b/);o&&(d=`${o[3]}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`)}if(!d){const o=t.toLowerCase().match(/\b(\d{1,2})(?:st|nd|rd|th)?\s+(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)\s+(\d{4})\b/),n=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'];o&&(d=`${o[3]}-${String(n.indexOf(o[2].slice(0,3))+1).padStart(2,'0')}-${o[1].padStart(2,'0')}`)}return d&&n(d,o)?d:void 0},Object.defineProperty(e,"historyDateLabel",{enumerable:!0,get:function(){return d}}),e.bookingDayText=function(t){const n=`Booked covers on ${d(t.date)}: ${null===t.booked_covers?'not recorded':t.booked_covers}.`,s=t.bookings.map(t=>`${t.time??'Time not recorded'}: party size ${null===t.covers?'not recorded':`${t.covers} Covers`}; ${t.table?`table ${t.table}`:'table not recorded'}; ${t.status??'status not recorded'}${t.counted?'':', excluded from Booked covers'}.`);return[n,...s,t.historical_records?"Includes previous booking system history (incomplete).":'',o,t.bookings.length?'':'No booking records found; incomplete history does not prove there were no bookings.',t.missing_covers?`${t.missing_covers} booking records have no party size; left blank.`:''].filter(Boolean).join(' ')};const t='Includes previous booking system history (incomplete)',o='Recovered booking records, not confirmed attendance. Cancelled bookings are shown but excluded from Booked covers.';function n(t,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;const n=new Date(t+'T12:00:00Z');return!Number.isNaN(n.getTime())&&n.toISOString().slice(0,10)===t&&t{const[o,n,s]=t.split('-');return`${s} ${n} ${o}`};const d=t=>new Date(t+'T12:00:00Z').toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'Europe/London'})},1421,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.historyAccess=c,_e.lookupBookingDay=l,_e.useHistoricalBookingDay=function(t,o,u,y=0){const k=(0,s.useSync)(e=>[e.kind,e.venueId,e.venueSlug,e.perms.join(',')].join(':')),f=c(t),h=f&&(0,n.validPastDate)(o,u)?`${k}:${o}:${y}`:'',[w,p]=(0,e.useState)({key:'',data:null,error:''});return(0,e.useEffect)(()=>{if(!h)return void p({key:'',data:null,error:''});let e=!0;return l(t,o).then(t=>{e&&p({key:h,data:t,error:''})}).catch(t=>{e&&p({key:h,data:null,error:t.message})}),()=>{e=!1}},[h,t,o]),{allowed:f,data:h&&w.key===h?w.data:null,error:h&&w.key===h?w.error:''}};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]);function c(e){const n=s.useSync.getState();return'owner'===t.APP_VARIANT&&'staff'===n.kind&&n.venueSlug===e&&!!n.venueId&&(n.perms.includes('*')||n.perms.includes('staff.manage'))}async function l(e,t){if(!c(e))throw new Error('Sign in to the Managers app with manager or owner access to Look back.');if(!(0,n.validPastDate)(t,(0,o.venueYmd)(new Date)))throw new Error('Choose an exact past date, with day, month and year.');const l=(0,u.getSupabase)(),{data:y,error:k}=await l.rpc('historical_booking_day',{p_venue:s.useSync.getState().venueId,p_date:t});if(k||!y||!Array.isArray(y.bookings))throw new Error('Booking history could not be loaded. Reconnect and try again.');return y}},1422,[34,846,1421,827,985,931]); -__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"niceDay",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"appNow",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"num",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"tableIn",{enumerable:!0,get:function(){return L}}),e.resolveTable=q,Object.defineProperty(e,"tokensOf",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"hm",{enumerable:!0,get:function(){return x}}),e.findBooking=A,Object.defineProperty(e,"staffOf",{enumerable:!0,get:function(){return me}}),Object.defineProperty(e,"findCard",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(e,"allergenList",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(e,"OPS_VOICE_ACTIONS",{enumerable:!0,get:function(){return ye}});var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),o=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),d=_r(_d[7]),l=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),b=_r(_d[11]),p=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]);const f=t=>{const[n,r,a]=t.split('-').map(Number);return new Date(n,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},y=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},k=(t,n)=>n.test(t),w=t=>t.who??('display'===t.app?'Main Display':'Assistant'),v={a:1,an:1,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,fifteen:15,twenty:20,half:.5},S=t=>null==t||''===t?void 0:'number'==typeof t?t:v[String(t).toLowerCase()]??(Number.isFinite(Number(t))?Number(t):void 0),$=['owner','staff','display'],C=['owner','staff','chef','display'],I=['staff'],N=/\btables?\s+([a-z]?\d{1,3}[a-z]?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/i,L=t=>{const n=t.match(N);return n?String(S(n[1])??n[1]).toUpperCase():void 0};function q(t,n){const r=String(n??'').replace(/^tables?\s+/i,'').trim();if(!r)return;const a=String(S(r)??r).toLowerCase(),o=(0,s.planOf)(t),i=[...new Set([...(o?.tables??[]).map(t=>t.name),...Object.keys(s.useFloor.getState().live[t]??{})])];return i.find(t=>t.toLowerCase()===a)??(o?.tables??[]).find(t=>(t.label??'').toLowerCase()===a)?.name??i.find(t=>t.toLowerCase().replace(/[^0-9a-z]/g,'').replace(/^t(?=\d)/,'')===a.replace(/[^0-9a-z]/g,''))}const O=(t,n)=>s.useFloor.getState().live[t]?.[n]??{},_=new Set(['the','and','for','table','booking','party','seat','seated','cancel','move','mark','finished','show','arrived','here','has','have','they','them','who','with','from','tonight','today','please','change','confirm','decline','request','people','covers','guests','their','into','onto','done','left','gone']),D=t=>t.toLowerCase().replace(/[^a-z0-9: ]/g,' ').split(/\s+/).filter(t=>t.length>2&&!_.has(t)),x=t=>{const n=t.match(/\b(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/i);if(!n)return null;let r=Number(n[1]);return'pm'===n[3]?.toLowerCase()&&r<12&&(r+=12),!n[3]&&r>=1&&r<=11&&(r+=12),`${String(r).padStart(2,'0')}:${n[2]??'00'}`};function A(t,n,r,a,o){const d=String(r??'').toLowerCase(),l=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status)&&!/walk-?in/i.test(r.name??'')),c=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status));if(!d&&!o)return;const u=c.find(t=>t.ref&&d.includes(t.ref.toLowerCase()));if(u)return u;const b=D(d),p=l.filter(t=>D(t.name).some(t=>b.includes(t)));if(1===p.length)return p[0];if(o){const t=c.filter(t=>(0,s.tablesOf)(t.table).some(t=>t.toLowerCase()===o.toLowerCase())),n=p.length?t.filter(t=>p.includes(t)):t;if(n.length)return n.sort((t,n)=>('seated'===t.status?-1:1)-('seated'===n.status?-1:1))[0]}const h=/\d/.test(d.replace(N,''))?x(d.replace(N,'')):null;if(h){const t=(p.length?p:l).filter(t=>t.time===h);if(1===t.length)return t[0]}return p.length?p.sort((t,n)=>t.time.localeCompare(n.time))[0]:void 0}const j=t=>`${t.name}, ${t.partySize} at ${t.time}${t.table?`, table ${t.table}`:''}`,M=[{name:'booking',type:'string',required:!0,description:'Guest name, booking reference or time, as said'},{name:'table',type:'string',description:'Table, if said'}],T=t=>({booking:t,table:L(t)}),P='I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.';function z(t,n,r,a,i,s,d,l=""){return{id:t,apps:$,title:n,risk:'change',params:M,keywords:[],description:`${n}: today\u2019s booking by guest name, reference, table or time.${l}`,match:t=>k(t,i)?7:0,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return r?`${s}: ${j(r)}?${l}`:P},run:async(t,n)=>{const i=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return i?(await o.repo.bookings.setStatus(i.id,r),d&&await d(i,n,t),`Done: ${i.name} ${'noshow'===r?'marked as a no-show':'cancelled'===r?'cancelled':'finished'===r?'finished':r}.`):"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d."}}}const F=(t,n)=>(0,s.tablesOf)(n).forEach(n=>s.useFloor.getState().setLive(t,n,{stage:'seated',dirty:!1})),B={id:'seat_booking',apps:$,title:'Seat a booking',risk:'change',params:M,keywords:[],description:'Seat a guest with a booking today (at their booked table, or the table said). Walk-ins use add_walkin.',match:t=>!k(t,/\b(seat|sit)\b/)||k(t,/\b(walk.?in|walkin|no booking)\b/)||k(t,/\b(\d+|one|two|three|four|five|six|seven|eight|nine|ten) (people|covers|guests)\b/)?k(t,/\b(have|has|are|is) (arrived|here)\b/)?7:0:7,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']),o=q(n.rid,t.table)??r?.table;if(!r)return P;const i=o?O(n.rid,(0,s.tablesOf)(o)[0]):{};return`Seat ${r.name}, ${r.partySize} at ${r.time}${o?`, at table ${o}`:' (no table yet)'}?${i.blocked?` ${(0,a.tableNumbers)(o)} is marked blocked.`:i.dirty?` ${(0,a.tableNumbers)(o)} still needs clearing.`:i.stage?` ${(0,a.tableNumbers)(o)} already has people seated.`:''}`},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const a=q(n.rid,t.table);return t.table&&!a?`Nothing changed: there\u2019s no table ${t.table} on the plan.`:(a&&a!==r.table&&await o.repo.bookings.update(r.id,{table:a}),await o.repo.bookings.setStatus(r.id,'seated'),F(n.rid,a??r.table),`Done: ${r.name} seated${a??r.table?` at table ${a??r.table}`:''}.`)}},E=z('finish_booking','Finish a table (party left)','finished',['seated'],/\b(finished|have left|has left|left|gone|paid and gone|party left|they'?re done)\b/,'Mark finished',(t,n)=>{(0,s.tablesOf)(t.table).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0}))},' The table is then marked as needing clearing.'),R=z('no_show','Mark a no-show','noshow',['confirmed','pending'],/\b(no.?show|didn'?t (turn up|show|come)|not (turned|turning) up)\b/,'Mark as a no-show'),H=z('cancel_booking','Cancel a booking','cancelled',['confirmed','pending'],/^(?!.*\b(shifts?|orders?|rota)\b).*(\bcancel+(ed)?\b.*\b(booking|reservation|table for|party)\b|\bcancel\s+(?!that\b|it\b|this\b|now\b|please\b)[a-z]{3,})/,'Cancel the booking',void 0,' The guest is not messaged from here.'),W={id:'move_booking',apps:$,title:'Move a booking to another table',risk:'change',params:[M[0],{name:'table',type:'string',required:!0,description:'New table'}],keywords:[],description:'Give a booking today a different table (seated parties move too).',match:t=>k(t,/\b(move|put|switch|change)\b/)&&k(t,/\btables?\b/)&&!k(t,/\b(shift|rota)\b/)?7:0,parse:t=>{const n=[...t.matchAll(new RegExp(N.source,'gi'))],r=n[n.length-1];return{booking:t,table:r?String(S(r[1])??r[1]).toUpperCase():void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),o=q(n.rid,t.table);return r?o?`Move ${j(r)} to table ${o}?${O(n.rid,o).stage||O(n.rid,o).blocked?` ${(0,a.tableNumbers)(o)} is not free.`:''}`:`There\u2019s no table ${t.table??''} on the plan.`:P},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),a=q(n.rid,t.table);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";if(!a)return'Nothing changed: I couldn\u2019t find that table on the plan.';const i=r.table;return await o.repo.bookings.update(r.id,{table:a,tableSetHere:!0}),'seated'===r.status&&((0,s.tablesOf)(i).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0})),F(n.rid,a)),`Done: ${r.name} moved to table ${a}.`}},G={id:'change_booking',apps:['owner','staff'],title:'Change a booking\u2019s time or party size',risk:'change',params:[M[0],{name:'time',type:'time',description:'New time HH:mm'},{name:'covers',type:'integer',description:'New party size'}],keywords:[],description:'Change the time or the number of people on a booking today. The guest is not messaged from here.',match:t=>k(t,/\b(change|make it|now|instead|update|actually)\b/)&&k(t,/\b(booking|reservation|party)\b/)&&k(t,/\b(\d|one|two|three|four|five|six|seven|eight|nine|ten)\b/)?6:0,parse:t=>{const n=t.toLowerCase(),r=n.match(/\b(?:to|for|now|of)\s+(\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\s*(?:people|covers|guests|pax)?\b(?!\s*[:.]\d)(?!\s*(?:am|pm|o'?clock))/),a=n.match(/\b(?:to|at)\s+(\d{1,2}(?::\d{2})?\s*(?:am|pm)|\d{1,2}:\d{2}|\d{1,2}\s*o'?clock)/);return{booking:t,covers:r&&/people|covers|guests|pax|party|for/.test(n)&&!a?.[1]?.startsWith(r[1])?S(r[1]):void 0,time:a?x(a[1].replace(/o'?clock/,''))??void 0:void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);return r?t.time||t.covers?`Change ${j(r)} to ${[t.covers?`${t.covers} people`:'',t.time?`${t.time}`:''].filter(Boolean).join(' at ')}? The guest is not messaged from here.`:`What should change on ${r.name}\u2019s booking? Say the new time or number of people.`:P},run:async(t,r)=>{const a=A(r.rid,r.today,t.booking,['confirmed','pending']);if(!a)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const i=S(t.covers);if(!(null==t.covers||i&&(0,n.validParty)(i)))return`Nothing changed: ${n.PARTY_RULE}`;const s=t.time?x(String(t.time)):null;return i||s?(await o.repo.bookings.update(a.id,{...i?{partySize:i}:{},...s?{time:s}:{}}),`Done: ${a.name} is now ${i??a.partySize} at ${s??a.time}.`):'Nothing changed.'}},U={id:'decide_booking',apps:['owner'],title:'Accept or decline a booking request',risk:'change',params:[M[0],{name:'outcome',type:'string',required:!0,description:'confirmed or declined',enum:['confirmed','declined']}],keywords:[],description:'Accept or decline a booking request that is waiting (the same as the Accept / Decline buttons).',match:t=>k(t,/\b(accept|approve|confirm|decline|reject|turn down)\b/)&&k(t,/\b(booking|request|reservation)\b/)?7:0,parse:t=>({booking:t,outcome:/\b(decline|reject|turn down)\b/i.test(t)?'declined':'confirmed'}),preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?`${'declined'===t.outcome?'Decline':'Accept'} the request from ${r.name}, ${r.partySize} on ${f(r.date)} at ${r.time}?`:'I couldn\u2019t find a waiting request with that name.'},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?(await o.repo.bookings.decide(r.id,'declined'===t.outcome?'declined':'confirmed',w(n)),`Done: ${r.name}\u2019s request ${'declined'===t.outcome?'declined':'accepted'}.`):'Nothing changed: I couldn\u2019t find a waiting request with that name.'}},V=[{name:'table',type:'string',required:!0,description:'Table name or number'}],Y={id:'table_cleared',apps:$,title:'Mark a table cleared',risk:'change',params:V,keywords:[],description:'Mark a table cleared and free (after clearing it down).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(cleared|clear(ed)? down|is clean|wiped|reset|is free|is ready|ready again)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} cleared and free?${O(n.rid,r).stage?' People are still marked as seated there.':''}`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!1,stage:void 0}),`Done: table ${r} is free.`):'Nothing changed: I couldn\u2019t find that table.'}},J={id:'table_needs_clearing',apps:$,title:'Mark a table as needing clearing',risk:'change',params:V,keywords:[],description:'Mark a table as needing clearing (dirty).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(needs? (clearing|clearing down|a clean|wiping)|dirty|to be cleared)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} as needing clearing?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!0,stage:void 0}),`Done: table ${r} needs clearing.`):'Nothing changed: I couldn\u2019t find that table.'}},K={id:'block_table',apps:$,title:'Block or unblock a table',risk:'change',params:[...V,{name:'blocked',type:'string',required:!0,description:'yes to block, no to unblock',enum:['yes','no']}],keywords:[],description:'Block a table (not used tonight) or unblock it.',match:t=>k(t,/\b(un.?block|block|out of use|not in use|close)\b/)&&k(t,/\btables?\b/)&&!k(t,/\barea\b/)?8:0,parse:t=>({table:L(t),blocked:/\b(un.?block|back in use|open)\b/i.test(t)?'no':'yes'}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`${'no'===t.blocked?'Unblock':'Block'} table ${r}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{blocked:'no'!==t.blocked}),`Done: table ${r} ${'no'===t.blocked?'unblocked':'blocked'}.`):'Nothing changed: I couldn\u2019t find that table.'}},Q={mains:'mains',main:'mains',dessert:'dessert',desserts:'dessert',pudding:'dessert',bill:'bill',check:'bill',seated:'seated',starters:'seated'},X={id:'table_stage',apps:$,title:'Set a table\u2019s course',risk:'change',params:[...V,{name:'stage',type:'string',required:!0,description:'seated, mains, dessert or bill',enum:['seated','mains','dessert','bill']}],keywords:[],description:'Set where a seated table is: seated (starters), mains, dessert or bill.',match:t=>k(t,/\btables?\b/)&&k(t,/\b(on|at|having|wants?|asked for|ready for|onto)\b.*\b(mains?|desserts?|pudding|bill|check)\b/)?8:0,parse:t=>{const n=t.toLowerCase().match(/\b(mains?|desserts?|pudding|bill|check|starters)\b/);return{table:L(t),stage:n?Q[n[1]]:void 0}},preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Set table ${r} to ${t.stage}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table),a=Q[String(t.stage??'').toLowerCase()];return r&&a?(s.useFloor.getState().setLive(n.rid,r,{stage:a,dirty:!1}),`Done: table ${r} is on ${a}.`):'Nothing changed: say the table and mains, dessert or bill.'}},Z=t=>/\b(how many|how much|what'?s|what is|what are|any|have we got|do we have|are there|is there)\b|\?\s*$/.test(t),ee=t=>/\b(roast|chickens?|beef)\b/.test(t)&&!/\b(sold out|86|off the menu|menu|dish|special|allerg)/.test(t)&&Object.values(d.useShellStore.getState().items).some(t=>t.some(t=>t.active&&(0,l.isRoastItem)(t))),te=t=>(d.useShellStore.getState().items[t]??[]).filter(t=>t.active),ne=(t,n)=>{const r=String(n??'').toLowerCase();return te(t).find(t=>[t.name,t.plural,t.key].some(t=>t&&new RegExp(`\\b${t.toLowerCase().replace(/[^a-z0-9 ]/g,'')}`).test(r)))},re={id:'shellfish_count',apps:C,title:'Shellfish count: sold, delivery or recount',risk:'change',params:[{name:'item',type:'string',required:!0,description:'Item, e.g. lobster'},{name:'qty',type:'string',required:!0,description:'How many (\xbd allowed for half items)'},{name:'mode',type:'string',required:!0,description:'sold, delivery or count',enum:['sold','delivery','count']}],keywords:[],description:'Record shellfish (or other counted stock) sold, a delivery in, or a recount (sets the count).',match:t=>!k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)&&!ee(t)||k(t,/\b(allerg|contain|chat|message|tell|text|post)/)||Z(t)||!k(t,/\b(\d+|\xbd|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|sold|deliver(ed|y)?|came in|arrived|got in|count(ed)?|recount)\b/)?0:7,parse:(n,r)=>{const a=n.toLowerCase(),o=a.match(/\b(\d+(?:\.5)?|\xbd|a half|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|fifteen|twenty)\b/),i=/\b(deliver(ed|y)?|came in|arrived|got in|received)\b/.test(a)?'delivery':/\b(count|we have|we'?ve got|there are|recount|left in)\b/.test(a)?'count':'sold',s=ne(r.rid,a);return s&&(0,t.fishInStone)(r.rid,s)?{item:s.name,qty:(0,t.parseStoneAmount)(n),mode:i}:{item:s?.name??n,qty:o?'\xbd'===o[1]||/half/.test(o[1])?.5:S(o[1]):1,mode:i}},preview:(n,a)=>{const o=ne(a.rid,n.item);if(!o||'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'I couldn\u2019t find that item in the shellfish counts.';if((0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||!Number.isInteger(2*r))return'Use stone in half-stone steps, for example one and a half stone.';const i=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,s=(0,t.fromStone)(r,o.unit),l='count'===n.mode?s:'delivery'===n.mode?i+s:i-s;return`${o.name}: ${n.mode} ${(0,t.stoneSpeech)(r)}, after ${(0,t.stoneSpeech)((0,t.toStone)(Math.max(0,l),o.unit))}?`}const i=S(n.qty)??0,s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c='count'===n.mode?i:'delivery'===n.mode?s+i:s-i;return`${'count'===n.mode?`Set ${o.plural||o.name} to ${(0,l.fmtCount)(i)}`:'delivery'===n.mode?`Add a delivery of ${(0,l.fmtCount)(i)} ${o.plural||o.name}`:`Record ${(0,l.fmtCount)(i)} ${1===i?o.name:o.plural||o.name} sold`} (now ${(0,l.fmtCount)(s)}, after ${(0,l.fmtCount)(Math.max(0,c))})?`},run:(n,a)=>{const o=ne(a.rid,n.item);if(o&&'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'Nothing changed: that item is not in Head Chef stock.';if(o&&(0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||r>500||!Number.isInteger(2*r))return'Nothing changed: use stone in half-stone steps.';const i=(0,t.fromStone)(r,o.unit),s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,l='count'===n.mode?i-s:'delivery'===n.mode?i:-i;return s+l<0?`Nothing changed: only ${(0,t.stoneSpeech)((0,t.toStone)(s,o.unit))} left.`:(l&&d.shellfish.append({rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner',delta:l,reason:'count'===n.mode?'count':'delivery'===n.mode?'delivery':'sold'}),`Done: ${o.name}, ${(0,t.stoneSpeech)((0,t.toStone)(s+l,o.unit))} left.`)}const i=S(n.qty);if(!o||null==i||!(i>=0)||i>500)return'Nothing changed: say the item and how many.';if('half'!==o.unit&&i%1)return`Nothing changed: ${o.plural||o.name} are counted whole.`;const s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c={rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner'};return'count'===n.mode?(i!==s&&d.shellfish.append({...c,delta:i-s,reason:'count'}),`Done: ${o.plural||o.name} counted at ${(0,l.fmtCount)(i)}.`):'delivery'===n.mode?i<=0?'Nothing changed.':(d.shellfish.append({...c,delta:i,reason:'delivery'}),`Done: ${(0,l.fmtCount)(i)} in. ${(0,l.fmtCount)(s+i)} now.`):s(k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)||ee(t))&&Z(t)&&!k(t,/\b(allerg|contain)/)?8:0,parse:(t,n)=>({item:ne(n.rid,t)?.name}),preview:()=>'Shellfish left',run:(n,a)=>{const o=(0,d.venueCounts)(d.useShellStore.getState(),a.rid),i=ne(a.rid,n.item),s=(i?[i]:te(a.rid).filter(t=>!(0,l.isRoastItem)(t)||(0,l.isSundayIn)(new Date))).filter(t=>'chef'!==a.app||(0,r.chefCanSee)(a.rid,t));return s.length?s.map(n=>`${n.plural||n.name}: ${(0,t.fishInStone)(a.rid,n)?(0,t.stoneSpeech)((0,t.toStone)(o[n.key]??0,n.unit)):(0,l.fmtCount)(o[n.key]??0)} left`).join('. ')+'.':'No shellfish counts are set up here.'}},oe={accept:'acknowledged',preparing:'preparing',ready:'ready',collected:'collected'},ie=(t,n)=>{const r=String(n??'').toLowerCase(),a=i.useStore.getState().orders.filter(n=>n.restaurantId===t&&!['closed','cancelled','collected','served'].includes(n.status));return a.find(t=>t.ref&&r.includes(t.ref.toLowerCase()))??a.find(t=>{const n=r.match(/\b(?:number|no\.?|order)\s*(\d{1,4})\b/);return!!n&&t.ref.replace(/\D/g,'').endsWith(n[1])})??(()=>{const t=a.filter(t=>D(t.customerName??'').some(t=>D(r).includes(t)));return 1===t.length?t[0]:void 0})()},se={id:'order_status',apps:C,title:'Move an order on: accept, preparing, ready or collected',risk:'change',params:[{name:'order',type:'string',required:!0,description:'Order reference, number or customer name'},{name:'status',type:'string',required:!0,description:'accept, preparing, ready or collected',enum:['accept','preparing','ready','collected']}],keywords:[],description:'Accept a takeaway or table order, or mark it preparing, ready or collected (the same as the order buttons).',match:t=>k(t,/\b(orders?|takeaways?|collection|ticket)\b/)&&k(t,/\b(accept|ready|collected|picked up|preparing|start(ed)?|on it)\b/)&&!k(t,/\b(read|any|list|what)\b/)?7:0,parse:t=>{const n=t.toLowerCase();return{order:t,status:/\baccept/.test(n)?'accept':/\b(collected|picked up)\b/.test(n)?'collected':/\bready\b/.test(n)?'ready':'preparing'}},preview:(t,n)=>{const r=ie(n.rid,t.order);return r?`Mark order ${r.ref} for ${r.customerName} as ${'accept'===t.status?'accepted':t.status}?`:'I couldn\u2019t find that order. Say the order number or the name.'},run:async(t,n)=>{const r=ie(n.rid,t.order),a=oe[String(t.status)];if(!r||!a)return'Nothing changed: I couldn\u2019t find that order.';if('acknowledged'===a){return await o.repo.orders.accept(r.id,w(n))?`Done: order ${r.ref} accepted.`:`Order ${r.ref} was already accepted.`}return await o.repo.orders.setStatus(r.id,a,w(n)),`Done: order ${r.ref} is ${a}.`}},de={id:'order_list_add',apps:C,title:'Add to an order list',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What we need'},{name:'qty',type:'integer',description:'How many (default 1)'},{name:'list',type:'string',description:'Which list (supplier), if said'}],keywords:[],description:'Add an item to an order list (or add to the quantity if it is already on it). Nothing is ordered from the supplier.',match:t=>k(t,/\b(add|put)\b.*\b(to|on)\b.*\b(order|shopping|cash and carry|list)\b|\bwe need (more )?\w+/)&&!k(t,/\b(chat|message|tell|text|post|shift|rota)\b/)?6:0,parse:t=>{const n=t.toLowerCase().replace(/[.?!]+$/,'').match(/\b(?:add|put|need(?: more)?)\s+(?:(\d+|an?|one|two|three|four|five|six|seven|eight|nine|ten|twelve|twenty)\s+)?(.+?)(?:\s+(?:to|on)\s+(?:the\s+)?(.+?)(?:\s+(?:order|list|order list))*)?$/);return n?{qty:S(n[1])??1,item:n[2].replace(/^(?:some|more)\s+/,'').trim(),list:n[3]?.replace(/\b(order|list|shopping)\b/g,'').trim()||void 0}:{item:t}},preview:(t,n)=>{const r=c.useOrderLists.getState().lists.filter(t=>t.rid===n.rid),a=String(t.list??'').toLowerCase(),o=a&&r.find(t=>t.name.toLowerCase().includes(a))||r[0];return o?`Add ${t.qty??1} ${t.item} to ${o.name}? Nothing is ordered from the supplier.`:'There are no order lists yet. Set one up in Order lists.'},run:(t,n)=>{const r=c.useOrderLists.getState(),a=r.lists.filter(t=>t.rid===n.rid),o=String(t.list??'').toLowerCase(),i=o&&a.find(t=>t.name.toLowerCase().includes(o))||a[0],s=String(t.item??'').trim().slice(0,60),d=Math.max(1,Math.min(99,Math.round(S(t.qty)??1)));if(!i||s.length<2)return'Nothing changed: say what we need.';const l={id:n.whoId??'assistant',name:w(n)},u=r.items.find(t=>t.rid===n.rid&&t.listId===i.id&&'open'===t.status&&t.name.toLowerCase()===s.toLowerCase());return u?(r.bump(u.id,d,l),`Done: added ${d} more ${s} on ${i.name}.`):(r.addItem(n.rid,{listId:i.id,name:s,qty:d,unit:'',addedBy:l.id,addedByName:l.name}),`Done: ${d} ${s} added to ${i.name}.`)}},le={in:'Clock you in',out:'Clock you out',break_start:'Start your break',break_end:'End your break'};function ce(t,n,r){return{id:t,apps:I,title:le[n].replace('you','me').replace('your','my'),risk:'change',params:[],keywords:[],description:`${le[n]} now (only for the person signed in; the same location check as the Clock tab).`,match:t=>k(t,r)?8:0,preview:()=>`${le[n]} now?`,run:async(t,r)=>{if(!r.whoId)return'Sign in to the Staff app first.';const a=y().toISOString(),o=await(0,b.clockAction)(n,{rid:r.rid,staffId:r.whoId,date:r.today,at:a});return o.ok?'Done: '+{in:'clocked in',out:'clocked out',break_start:'break started',break_end:'break ended'}[n]+` at ${new Date(a).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}.`+(o.warn?' '+o.warn:''):'Nothing changed: '+o.message}}}const ue=ce('clock_in','in',/\bclock (me )?in\b|\bclocking in\b|\bstart(ing)? my shift\b/),be=ce('clock_out','out',/\bclock (me )?out\b|\bclocking out\b|\b(finish|end)(ing)? my shift\b/),pe=ce('break_start','break_start',/\b(start|starting|taking|take|going on|begin)( my| a)? break\b|\bon (my )?break now\b/),he=ce('break_end','break_end',/\b(end|ending|finish|finished|back from)( my| a| the)? break\b|\bback from break\b/),me=t=>{const n=u.useOwner.getState().staff,r=String(t??'').toLowerCase();return n.find(n=>n.id===t)?.id??n.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>D(r).includes(t)))?.id},ge=(t,n)=>{if(!(0,p.hasRecipeCards)())return;const r=D(String(n??''));let a;for(const n of(0,p.recipeCards)().list(t)){const t=D(n.dish).filter(t=>r.includes(t)).length;t&&t>(a?.s??0)&&(a={c:n,s:t})}return a?.c},fe=t=>{const n=m.ALLERGENS.filter(n=>t[n.id]).map(n=>('may'===t[n.id]?'may contain ':'')+n.label.toLowerCase());return n.length?n.join(', '):'none of the 14 allergens'},ye=[B,E,R,H,W,G,U,Y,J,K,X,re,ae,se,de,ue,be,pe,he,{id:'decide_leave',apps:['owner'],title:'Approve or decline a holiday request',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff member id or first name'},{name:'outcome',type:'string',required:!0,description:'approved or declined',enum:['approved','declined']}],keywords:[],description:'Approve or decline someone\u2019s waiting holiday (leave) request.',match:t=>k(t,/\b(approve|accept|decline|reject|ok|okay)\b/)&&k(t,/\b(holiday|leave|time off|day off|days off)\b/)?7:0,parse:t=>{const n=t.toLowerCase(),r=u.useOwner.getState().staff.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>new RegExp(`\\b${t}\\b`).test(n)));return{staffId:r?.id,outcome:/\b(decline|reject|refuse)\b/.test(n)?'declined':'approved'}},preview:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status),o=n.staff.find(t=>t.id===r)?.name.replace(' (example)','');return a?`${'declined'===t.outcome?'Decline':'Approve'} ${o}\u2019s holiday, ${f(a.from)}${a.to!==a.from?` to ${f(a.to)}`:''}?`:`There\u2019s no waiting holiday request${o?` from ${o}`:''}.`},run:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status);return a?(n.setLeave(a.id,'declined'===t.outcome?'declined':'approved'),`Done: holiday ${'declined'===t.outcome?'declined':'approved'}.`):'Nothing changed: no waiting request found.'}},{id:'allergen_signoff',apps:['chef'],title:'Sign off a dish\u2019s allergens',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'}],keywords:[],description:'Head chef signs off a recipe card (its allergens). The allergens are read back first.',match:t=>k(t,/\bsign(ed)?.?off\b|\bapprove\b.*\b(card|recipe|allergens?)\b/)?8:0,parse:t=>({dish:t}),preview:(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?`${r.dish} can\u2019t be signed off yet: ${a}`:`Sign off ${r.dish}? Allergens: ${fe(r.allergens)}.`},run:async(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'Nothing changed: I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?'Nothing changed: '+a:(await(0,p.recipeCards)().signOff(r.id,{name:w(n),role:'head-chef'}),`Done: ${r.dish} signed off.`)}}]},1423,[982,1098,804,829,848,800,1014,981,983,1025,865,1071,856,832,830]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.spokenDate=j,Object.defineProperty(_e,"GAP_VOICE_ACTIONS",{enumerable:!0,get:function(){return be}});var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),l=_r(_d[12]),f=_r(_d[13]),u=_r(_d[14]),m=_r(_d[15]),g=_r(_d[16]),y=_r(_d[17]),b=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),S=_r(_d[21]),$=_r(_d[22]);const v=(e,t)=>t.test(e),I=e=>e.who??('display'===e.app?'Main Display':'Assistant'),N=e=>(e??'').replace(' (example)',''),A=e=>String(e).padStart(2,'0'),D=()=>{const e=(0,$.appNow)();return`${A(e.getHours())}:${A(e.getMinutes())}`},C=['owner','staff','display'],T=['owner'],q=['staff','owner'],O=['owner','chef'],_=e=>`\u201c${e}\u201d`,x=(e,t)=>n.useOwner.getState().sys(e,t,(0,$.appNow)().toISOString()),M=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],R=e=>`${A(Math.floor(e))}:${A(Math.round(e%1*60))}`,L=['january','february','march','april','may','june','july','august','september','october','november','december'];function j(e,t){const a=e.toLowerCase(),r=a.match(new RegExp(`\\b(\\d{1,2})(?:st|nd|rd|th)?(?:\\s+of)?\\s+(${L.join('|')})\\b`))??a.match(new RegExp(`\\b(${L.join('|')})\\s+(\\d{1,2})(?:st|nd|rd|th)?\\b`));if(r){const e=Number(/\d/.test(r[1])?r[1]:r[2]),a=L.indexOf(/\d/.test(r[1])?r[2]:r[1]);let n=Number(t.slice(0,4));return`${n}-${A(a+1)}-${A(e)}`e.active)){const r=[N(e.name).split(' ')[0],e.nickname].filter(Boolean).map(e=>e.toLowerCase()),n=Math.min(...r.map(e=>{const a=t.match(new RegExp(`\\b${e.replace(/[^a-z']/g,'')}\\b`));return a?.index??1/0}));n<1/0&&a.push({s:e,at:n})}return a.sort((e,t)=>e.at-t.at).map(e=>e.s)}const F=e=>n.useOwner.getState().staff.find(t=>t.id===e),E=e=>F(e)??W(String(e??''))[0],U=e=>a.useStore.getState().waitlist.filter(t=>t.restaurantId===e&&('waiting'===t.status||'notified'===t.status)).sort((e,t)=>e.number-t.number);function z(e,t){const a=String(t??'').toLowerCase(),r=U(e);if(!r.length)return;const n=a.match(/(?:#|number|no\.?)\s*(\d{1,3})\b/);if(n)return r.find(e=>e.number===Number(n[1]));const i=(0,$.tokensOf)(a).filter(e=>!['waitlist','wait','list','off','remove','told','ready','next'].includes(e)),s=r.filter(e=>(0,$.tokensOf)(e.name).some(e=>i.includes(e)));return s.length?s[0]:/\b(next|first)\b/.test(a)||1===r.length?r[0]:void 0}const Y=e=>`waitlist number ${e.number}, ${e.name}, party of ${e.partySize}`;function B(e,t){const n=a.useStore.getState(),i=n.restaurants.find(t=>t.id===e);if(!i)return;const s=(0,$.appNow)(),o=(0,l.ymdOf)(s),d=r.useFloor.getState(),c=d.plans[e]??(0,r.seedPlan)(e),h=n.bookings.filter(t=>t.restaurantId===e),p=(0,w.closedAreasAt)(w.useBlocks.getState().blocks,e,o,D()),f=(0,b.floorView)(c,h,n.orders.filter(t=>t.restaurantId===e),d.live[e]??{},s,i.settings.turnMins,p);return(0,b.suggestTable)(c,h.filter(e=>e.date===o),f,t,s,(0,b.turnFor)(t,i.settings.turnMins))?.table}const P=/\bwait ?(ing )?list\b|\bwaiting\b/,H=[{name:'who',type:'string',required:!0,description:'Waitlist number or name, as said (or "next")'}],K={id:'waitlist_seat',apps:C,title:'Seat someone from the waitlist',risk:'change',params:[...H,{name:'table',type:'string',required:!1,description:'Table (else the best free table)'}],keywords:[],description:'Seat a waiting party from the waitlist at a table (the suggested table unless one is said), like the Seat button.',match:e=>v(e,P)&&v(e,/\bseat\b|\bsit\b/)?9:0,parse:e=>({who:e,table:(0,$.tableIn)(e)}),preview:(e,t)=>{const a=z(t.rid,e.who);if(!a)return'I couldn\u2019t find that party on the waitlist. Say their number or name.';const r=(0,$.resolveTable)(t.rid,e.table)??B(t.rid,a.partySize);return r?`Seat ${Y(a)}, at table ${r}?`:`There\u2019s no free table for ${a.partySize} right now. Say a table to seat them anyway.`},run:async(e,a)=>{const n=z(a.rid,e.who);if(!n)return'Nothing changed: I couldn\u2019t find that party on the waitlist.';const i=(0,$.resolveTable)(a.rid,e.table)??B(a.rid,n.partySize);return i?(await t.repo.waitlist.setStatus(n.id,'seated'),await t.repo.bookings.seatWalkIn(a.rid,n.partySize,i,`From waitlist #${n.number}`),(0,r.tablesOf)(i).forEach(e=>r.useFloor.getState().setLive(a.rid,e,{stage:'seated',dirty:!1})),`Done: waitlist number ${n.number} seated at table ${i}.`):'Nothing changed: there\u2019s no free table for them. Say a table.'}};function V(e,t){if(!e.whoId)return;const a=n.useOwner.getState().shifts.filter(t=>t.staffId===e.whoId&&!1!==t.published&&t.date>=e.today).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start),r=j(String(t??''),e.today);return r?a.find(e=>e.date===r):a[0]}const G=e=>`${(0,$.niceDay)(e.date)}, ${R(e.start)} to ${R(e.end)}`,Q=/\b(approve|accept|decline|reject|okay|ok)\b/,Z='I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d.';function J(e,t){const a=e.toLowerCase(),r=a.match(/\bfrom\s+(.+?)\s+(?:to|until|till)\s+(.+)$/);if(r){const e=j(r[1],t),a=j(r[2],t)??e;return{from:e,to:a&&e&&a'open'===e.status&&(!r||e.kind===r)),s=W(String(e??'')).map(e=>e.id);return s.length?i.find(e=>s.includes(e.fromId)&&(!e.toId||1===s.length||s.includes(e.toId)))??i.find(e=>s.includes(e.fromId)||e.toId&&s.includes(e.toId)):1===i.length?i[0]:void 0}const ee=(t,a)=>'chef'!==a?.app||(0,e.chefCanSee)(a.rid,t)&&(0,e.chefCanSee)(a.rid,i.useSafety.getState().points.find(e=>e.id===t.pointId)),te=(e,t)=>{const a=i.useSafety.getState().entries.filter(a=>(0,l.ymdOf)(new Date(a.at))===e&&ee(a,t));return{n:a.length,bad:a.filter(e=>!e.ok).length,fixed:a.filter(e=>!e.ok&&e.corrective).length}},ae=/\b(food safety|safety diary|diary|haccp|safe methods|sfbb)\b/;function re(e,t){const a=(0,m.weekStart)(new Date(e+'T12:00:00')),r=new Date(a+'T00:00:00').getTime(),n=r+6048e5,s=i.useSafety.getState().entries.filter(e=>{const a=new Date(e.at).getTime();return a>=r&&a!e.ok).length,actions:s.filter(e=>!e.ok&&e.corrective).length,daysSigned:o.filter(e=>{const t=new Date(e.date+'T00:00:00').getTime();return t>=r&&te.test(t))?.[1]??'Other',location:s?s[1].replace(/^the /,''):'Not said',firstAid:o?o[1]:'',what:e.trim().replace(/^(?:please\s+)?(?:record|log|report|add|write up|put in the accident book)\s+(?:an?\s+)?(?:accident|near miss|injury)?\s*(?:in the accident book)?\s*[:,-]?\s*/i,'').replace(/^\w/,e=>e.toUpperCase())||e.trim()}}function se(e,t){const a=(0,d.ukClock)((0,$.appNow)()),r=new Date(`${a.ymd}T12:00:00Z`).getUTCDay(),n=(0,$.tokensOf)(String(t??'')).filter(e=>!['tick','ticked','task','off','mark','done','did','finished','completed','ive','i\u2019ve','list'].includes(e)),i=e=>(0,$.tokensOf)(e).filter(e=>n.some(t=>t===e||t.length>3&&e.startsWith(t.slice(0,4)))).length,h=e.whoId?(0,o.tasksFor)((0,s.tasksOf)(e.rid,e.whoId),r):[];let p=h.map(e=>({t:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.t;const l='chef'===e.app?['all','kitchen']:'staff'===e.app?['all','foh']:['all','foh','kitchen'],f=p?void 0:c.useReminders.getState().reminders.filter(t=>t.rid===e.rid&&!t.removed&&!t.paused&&t.days.includes(a.dow)&&l.includes(t.audience)).map(e=>({r:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.r;return{ymd:a.ymd,task:p,rem:f}}const oe=e=>a.useStore.getState().menu.filter(t=>t.restaurantId===e);function de(e,t){const a=(0,$.tokensOf)(String(t??''));let r;for(const t of oe(e)){const e=(0,$.tokensOf)(t.name).filter(e=>a.includes(e)).length;e&&e>(r?.s??0)&&(r={m:t,s:e})}return r?.m}const ce=e=>{const t=e.match(/\xa3\s?(\d+(?:\.\d{1,2})?)|\b(\d+(?:\.\d{2}))\b|\b(\d+)\s*(?:pounds|quid)(?:\s*(\d{1,2}))?/i);if(t)return t[1]?Number(t[1]):t[2]?Number(t[2]):Number(t[3])+(t[4]?Number(t[4])/100:0)},he={gram:'g',grams:'g',g:'g',kilo:'kg',kilos:'kg',kg:'kg',ml:'ml',millilitres:'ml',litre:'l',litres:'l',l:'l',tablespoon:'tbsp',tablespoons:'tbsp',tbsp:'tbsp',teaspoon:'tsp',teaspoons:'tsp',tsp:'tsp',pinch:'pinch',slice:'slice',slices:'slices',whole:'whole'};function pe(e){const t=e.match(/\badd\s+(\d+(?:\.\d+)?|a|an|one|two|three|four|five|six|half)\s*(grams?|g|kilos?|kg|ml|millilitres|litres?|l|tablespoons?|tbsp|teaspoons?|tsp|pinch|slices?|whole)?\s+(?:of\s+)?(.+?)\s+(?:to|into|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*$/i);if(t)return{qty:String((0,$.num)(t[1])??t[1]),unit:t[2]?he[t[2].toLowerCase()]??t[2]:'',name:t[3].trim(),dish:t[4]}}const le={in:'Clock {n} in',out:'Clock {n} out',break_start:'Start a break for {n}',break_end:'End {n}\u2019s break'},fe=e=>null==e?'not entered':`\xa3${e.toLocaleString('en-GB',{minimumFractionDigits:2,maximumFractionDigits:2})}`,ue=e=>'owner'===e.app&&'staff'!==e.role,me=['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];function ge(e){if(/\bweekdays?\b/.test(e))return[1,2,3,4,5];if(/\bweekends?\b/.test(e))return[0,6];const t=me.map((t,a)=>new RegExp(`\\b${t}s?\\b`).test(e)?a:-1).filter(e=>e>=0);return t.length?t:[0,1,2,3,4,5,6]}const ye={all:'everyone on shift',foh:'front of house',kitchen:'the kitchen'},be=[K,{id:'waitlist_remove',apps:C,title:'Take someone off the waitlist',risk:'change',params:H,keywords:[],description:'Take a party off the waitlist (they left or no longer need a table), like the Remove button. It stays in the records.',match:e=>v(e,P)&&v(e,/\b(remove|take .*off|cross .*off|strike .*off|gave up|have left|has left|left|gone)\b/)&&!v(e,/\b(seat|told|ready)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Take ${Y(a)}, off the waitlist?`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,a)=>{const r=z(a.rid,e.who);return r?(await t.repo.waitlist.setStatus(r.id,'removed'),`Done: number ${r.number} is off the waitlist.`):'Nothing changed: I couldn\u2019t find that party.'}},{id:'waitlist_told',apps:C,title:'Mark a waiting party as told their table is ready',risk:'change',params:H,keywords:[],description:'Record that a waiting party has been told their table is ready, like the Mark as told button. No text is sent.',match:e=>v(e,P)&&v(e,/\b(told|tell|let .* know|notif|ready|called)\b/)&&!v(e,/\b(seat|remove)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Mark ${Y(a)}, as told their table is ready? No text is sent from here.`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,n)=>{const i=z(n.rid,e.who);if(!i)return'Nothing changed: I couldn\u2019t find that party.';const s=a.useStore.getState().restaurants.find(e=>e.id===n.rid);return r.useFloor.getState().logSms(n.rid,(0,$.appNow)().toISOString(),`#${i.number} ${i.partySize}: Your table at ${s?.name??'the restaurant'} is ready.`),await t.repo.waitlist.setStatus(i.id,'notified'),`Done: number ${i.number} marked as told. No text was sent.`}},{id:'request_cover',apps:q,title:'Ask for cover for my shift',risk:'change',params:[{name:'day',type:'string',required:!1,description:'Day or date of your shift (else your next shift)'}],keywords:[],description:'Ask the team to cover one of your own shifts, like the Ask for cover button. A \u201cCover needed\u201d note goes in the team chat.',match:e=>v(e,/\bcover\b/)&&v(e,/\b(my|me)\b/)&&v(e,/\b(shift|ask|need|someone|anyone|can)\b/)&&!v(e,Q)?9:0,parse:e=>({day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day);return a?`Ask for cover for your shift on ${G(a)}? A \u201cCover needed\u201d note goes in the team chat.`:Z},run:(e,t)=>{const a=V(t,e.day);return a&&t.whoId?n.useOwner.getState().swaps.some(e=>e.shiftId===a.id&&'open'===e.status)?'There\u2019s already an open request for that shift.':(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,kind:'cover',note:'Can anyone cover?'}),x('all',`Cover needed: ${M[a.day]} ${R(a.start)}\u2013${R(a.end)} (${N(F(t.whoId)?.name??t.who)})`),`Done: cover asked for ${G(a)}. A manager approves it once someone takes it.`):"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_swap',apps:q,title:'Ask to swap my shift with someone',risk:'change',params:[{name:'with',type:'string',required:!0,description:'Who you agreed to swap with (first name)'},{name:'day',type:'string',required:!1,description:'Day or date of your shift'}],keywords:[],description:'Ask a manager to approve swapping one of your shifts with a colleague you agreed it with, like the Swap with button.',match:e=>v(e,/\bswap\b/)&&!v(e,Q)?9:0,parse:(e,t)=>({with:W(e).find(e=>e.id!==t?.whoId)?.id,day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day),r=E(e.with);return r&&r.id!==t.whoId?a?`Ask to swap your shift on ${G(a)} with ${N(r.name)}? A manager still approves it.`:Z:'Who are you swapping with? Say their first name.'},run:(e,t)=>{const a=V(t,e.day),r=E(e.with);return a&&t.whoId?r&&r.id!==t.whoId?(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,toId:r.id,kind:'swap',note:'Agreed between us'}),`Done: swap with ${N(r.name)} asked for. A manager approves it.`):'Nothing changed: say who you\u2019re swapping with.':"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_holiday',apps:q,title:'Ask for holiday',risk:'change',params:[{name:'from',type:'string',required:!0,description:'First day off, YYYY-MM-DD'},{name:'to',type:'string',required:!0,description:'Last day off, YYYY-MM-DD'},{name:'reason',type:'string',required:!1,description:'Reason (default Holiday)'}],keywords:[],description:'Send your own holiday (time off) request to a manager, like the Send request button.',match:e=>v(e,/\b(holiday|time off|day off|days off|annual leave|leave)\b/)&&v(e,/\b(request|book|ask|want|need|like|have|put in|take|off)\b/)&&!v(e,Q)&&!v(e,/\b(who|how many|when is)\b/)?8:0,parse:(e,t)=>{const a=J(e,t?.today??(0,l.ymdOf)((0,$.appNow)())),r=e.match(/\b(?:for|because)\s+(?:a |an |my )?([a-z][a-z ]{2,40}?)\s*$/i);return{...a,reason:r&&!/\b(from|to|monday|tuesday|wednesday|thursday|friday|saturday|sunday|tomorrow|\d)/i.test(r[1])?r[1]:void 0}},preview:(e,t)=>t.whoId?`Ask for ${e.reason??'holiday'} from ${(0,$.niceDay)(String(e.from))}${e.to!==e.from?` to ${(0,$.niceDay)(String(e.to))}`:''}? A manager approves it.`:'Sign in first so I know who\u2019s asking.',run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const a=e=>/^\d{4}-\d{2}-\d{2}$/.test(String(e));return!a(e.from)||!a(e.to)||String(e.to)v(e,Q)&&v(e,/\b(swap|cover|swaps)\b/)?9:0,parse:e=>({who:e,outcome:/\b(decline|reject|refuse|no)\b/i.test(e)?'declined':'approved'}),preview:e=>{const t=X(e.who);if(!t)return'I couldn\u2019t find that open swap or cover request. Say the name on it.';const a=n.useOwner.getState().shifts.find(e=>e.id===t.shiftId),r=N(F(t.fromId)?.name),i=N(F(t.toId)?.name),s='swap'===t.kind?`${r}\u2019s swap with ${i}`:t.toId?`${i} covering ${r}`:`${r}\u2019s cover request`;return'declined'===e.outcome||t.toId?`${'declined'===e.outcome?'Decline':'Approve'} ${s}${a?` for ${G(a)}`:''}?${'declined'===e.outcome?'':' The shift moves and a note goes in the team chat.'}`:`Nobody has taken ${r}\u2019s cover yet, so it can\u2019t be approved. You can decline it.`},run:e=>{const t=X(e.who);if(!t)return'Nothing changed: no open request found.';if('declined'!==e.outcome&&!t.toId)return'Nothing changed: nobody has taken that cover yet.';const a=n.useOwner.getState(),r=a.shifts.find(e=>e.id===t.shiftId);if(a.setSwap(t.id,'declined'===e.outcome?'declined':'approved'),'declined'===e.outcome)return'Done: request declined.';const i=e=>N(F(e)?.name);return x('all','swap'===t.kind?`Shift swap: ${i(t.fromId)} \u2194 ${i(t.toId)} approved`:`Cover approved: ${i(t.toId)} covers ${i(t.fromId)}${r?` (${M[r.day]} ${R(r.start)}\u2013${R(r.end)})`:''}`),'Done: approved and posted in the team chat.'}},{id:'sign_safety_day',apps:O,title:'Sign today\u2019s food safety diary',risk:'change',params:[],keywords:[],description:'Sign today\u2019s food safety diary: the opening and closing checks were done and the safe methods were followed, like the diary Sign button. Today only.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,ae)&&!v(e,/\bweek(ly)?\b/)?9:0,preview:(e,t)=>{const a=(i.useSafety.getState().daySigns??[]).find(e=>e.date===t.today);if(a)return`Today\u2019s diary is already signed by ${a.by}.`;const r=te(t.today,t);return`Sign today\u2019s food safety diary as ${I(t)}: the opening and closing checks were done and the safe methods were followed today? Today: ${r.n} checks, ${r.bad} out of range${r.bad?`, ${r.fixed} with an action`:''}.`},run:(e,t)=>'staff'===t.role?'Nothing changed: only a manager or the head chef signs the diary.':(i.useSafety.getState().daySigns??[]).some(e=>e.date===t.today)?'It\u2019s already signed today.':(i.useSafety.getState().signDay({date:t.today,by:N(I(t)),byId:t.whoId??'',at:(0,$.appNow)().toISOString()}),'Done: today\u2019s diary signed.')},{id:'sign_safety_week',apps:O,title:'Sign off this week\u2019s food safety review',risk:'change',params:[],keywords:[],description:'Weekly food safety review: reads the six statements back; Confirm means yes to all six. If any reading is out of range without an action, it must be done on screen with a note.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,/\bweek(ly)?\b/)&&(v(e,ae)||v(e,/\b(review|safety|checks)\b/))?9:0,preview:(e,t)=>{const{week:a,summary:r}=re(t.today,t),n=(i.useSafety.getState().weekly??[]).find(e=>e.week===a);if(n)return`This week is already signed off by ${n.by}.`;const s=`Week of ${(0,$.niceDay)(a)}: ${r.entries} checks, ${r.outOfRange} out of range, ${r.actions} with an action, diary signed ${r.daysSigned} of 7 days.`;return r.actions`${t+1}. ${e}.`).join(' ')} Sign off the week?`},run:(e,t)=>{if('staff'===t.role)return'Nothing changed: only a manager or the head chef signs off the week.';const{week:a,summary:r}=re(t.today,t);return(i.useSafety.getState().weekly??[]).some(e=>e.week===a)?'This week is already signed off.':r.actions!0),note:'Signed by voice: yes to all.',summary:r}),'Done: week signed off.')}},{id:'record_accident',title:'Record an accident or near miss',risk:'change',params:[{name:'what',type:'string',required:!0,description:'What happened, in the speaker\u2019s words'},{name:'person',type:'string',required:!1,description:'Who was hurt'},{name:'location',type:'string',required:!1,description:'Where'},{name:'injury',type:'string',required:!1,description:'The injury'},{name:'firstAid',type:'string',required:!1,description:'First aid given'}],keywords:[],description:'Add an entry to the accident book (accident or near miss) with what was said; every field is read back first.',match:e=>v(e,/\baccident book\b/)?10:v(e,/\b(accident|injur(y|ed)|near miss|hurt|cut (him|her|them|my)self|burn(ed|t)? (him|her|them|my)self|slipped|tripped|fell over|scalded)\b/)&&v(e,/\b(record|log|report|write|add|book|had|there was|has|have|just)\b/)&&!v(e,/\b(how many|show|read)\b/)?8:0,parse:e=>{const t=ie(e);return{what:t.what,person:t.person,location:t.location,firstAid:t.firstAid}},preview:e=>{const t=ie(String(e.what)),a=String(e.person??t.person),r=String(e.location??t.location);return`Add to the accident book: when, today at ${D()}; who, ${a} (${t.personType}); where, ${r}; type, ${t.category}; what happened, ${_(t.what)}; injury, ${e.injury?String(e.injury):'Near miss'===t.category?'none (near miss)':'not recorded'}; first aid, ${e.firstAid||t.firstAid||'none recorded'}; reported by you. Check it before you confirm; you can add more in the Accident book.`},run:(e,t)=>{const a=ie(String(e.what)),r='Near miss'===a.category,n=(0,$.appNow)();return i.useSafety.getState().addAccident({when:`${(0,l.ymdOf)(n)}T${D()}`,location:String(e.location??a.location),person:String(e.person??a.person),personType:a.personType,category:a.category,what:a.what,injury:String(e.injury??'')||(r?'None (near miss)':'Not recorded'),firstAid:String(e.firstAid||a.firstAid||'')||'None recorded',witnesses:'None',reportedBy:N(I(t)),reportedById:t.whoId??'',app:'staff'===t.app?'staff':'chef'===t.app?'chef':'managers'}),'Done: added to the accident book.'+(/(hospital|fracture|broke|unconscious|ambulance)/i.test(a.what)?' This may need reporting under RIDDOR; check the Accident book.':'')}},{id:'tick_task',apps:['staff','chef','owner'],title:'Tick off one of my tasks',risk:'change',params:[{name:'task',type:'string',required:!0,description:'The task or reminder, as said'}],keywords:[],description:'Tick off one of today\u2019s daily tasks (yours), or mark a venue reminder like \u201cchairs up\u201d as done, like the tick and Done buttons.',match:e=>v(e,/\btick(ed)?( off)?\b|\bmark .* (as )?done\b|\b(i'?ve|i have|we'?ve) (done|finished|completed)\b|\b(task|reminder) (is )?done\b|\bdone the\b/)&&!v(e,/\b(shift|break|order|table|booking|clock)\b/)?7:0,parse:e=>({task:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I tick your tasks.';const{ymd:a,task:r,rem:n}=se(t,e.task);return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?`${_(r.text)} is already ticked today.`:`Tick off today\u2019s task ${_(r.text)}?`:n?`Mark the reminder ${_(n.text)} as done for today?`:'I couldn\u2019t find that in today\u2019s tasks. Say a word from the task.'},run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const{ymd:a,task:r,rem:n}=se(t,e.task),i={id:t.whoId,name:N(I(t))};return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?'Already ticked today.':(s.useDailyTasks.getState().toggleTick(t.rid,t.whoId,r.id,a,i),`Done: ${_(r.text)} ticked.`):n?(c.useReminders.getState().markDone({rid:t.rid,reminderId:n.id,forDate:a,at:(0,$.appNow)().toISOString(),staffRef:t.whoId,staffName:i.name}),`Done: ${_(n.text)} marked done.`):'Nothing changed: I couldn\u2019t find that task.'}},{id:'add_dish',apps:T,title:'Add a dish to the menu',risk:'change',params:[{name:'name',type:'string',required:!0,description:'Dish name'},{name:'section',type:'string',required:!1,description:'Menu section'},{name:'price',type:'string',required:!0,description:'Price in pounds'},{name:'description',type:'string',required:!1,description:'Short description'}],keywords:[],description:'Add a new dish to the menu, like Manage \u203a Add dish. It stays off the menu until the head chef signs off its recipe card.',match:e=>v(e,/\b(add|new|put)\b/)&&v(e,/\b(dish|menu item|to the menu|on the menu|onto the menu)\b/)&&!v(e,/\b(special|specials|sold out|order list)\b/)?8:0,parse:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t?.rid),n=e.toLowerCase(),i=e.match(/\b(?:called|named)\s+(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i)??e.match(/\b(?:add|put)\s+(?:a |an |the )?(?:new )?(?:dish\s+)?(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i),s=r?.sections.find(e=>n.includes(e.toLowerCase())||n.includes(e.toLowerCase().replace(/s$/,''))),o=ce(e);return{name:i?.[1]?.replace(/^(?:a |an )?(?:new )?dish\s*/i,'').trim(),section:s,price:null!=o?String(o):void 0}},preview:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=String(e.section??r?.sections[0]??'Mains');return`Add ${_(String(e.name))} to ${n} at \xa3${Number(e.price).toFixed(2)}${e.description?`, described as ${_(String(e.description))}`:''}? It stays off the menu until the head chef signs off its recipe card.`},run:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=Number(e.price),i=String(e.name??'').trim();return i.length<2||!Number.isFinite(n)||n<=0?'Nothing changed: I need a dish name and a price.':de(t.rid,i)?.name.toLowerCase()===i.toLowerCase()?'That dish is already on the menu.':(a.useStore.getState().addMenuItem({restaurantId:t.rid,section:String(e.section??r?.sections[0]??'Mains'),name:i,description:String(e.description??''),price:n,dietary:[],allergens:{},prepMins:10,soldOut:!1,signOff:null}),`Done: ${i} added. The head chef needs to add its recipe card and sign off the allergens before it shows.`)}},{id:'edit_dish',apps:T,title:'Rename a dish or change its description',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name now'},{name:'field',type:'string',required:!0,description:'name or description',enum:['name','description']},{name:'value',type:'string',required:!0,description:'The new name or description'}],keywords:[],description:'Rename a dish or change its menu description, like Manage \u203a Save dish. Renaming changes its recipe card, so the head chef signs it off again.',match:e=>v(e,/\brename\b|\b(change|update|set|edit)\b.*\b(description|name)\b|\bdescri(be|ption)\b.*\bas\b/)&&!v(e,/\b(price|booking|special|my name)\b/)?8:0,parse:e=>{const t=e.match(/\brename\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i);if(t)return{dish:t[1],field:'name',value:t[2].trim()};const a=e.match(/\bname of\s+(?:the\s+)?(.+?)\s+to\s+(.+)$/i);if(a)return{dish:a[1],field:'name',value:a[2].trim()};const r=e.match(/\bdescription (?:of|for)\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i)??e.match(/\b(?:describe|change|update|set)\s+(?:the\s+)?(.+?)(?:'s|\u2019s)?\s+(?:description\s+)?(?:to|as)\s+(.+)$/i);return r?{dish:r[1],field:'description',value:r[2].trim()}:{dish:e}},preview:(e,t)=>{const a=de(t.rid,e.dish);return a?'name'===e.field?`Rename ${_(a.name)} to ${_(String(e.value))}? Its recipe card changes too, so the head chef signs it off again.`:`Change the description of ${a.name} to ${_(String(e.value))}?`:'I couldn\u2019t find that dish on the menu.'},run:(e,t)=>{const r=de(t.rid,e.dish),n=String(e.value??'').trim();return r?n.length<2?'Nothing changed: say the new wording.':(a.useStore.getState().updateMenuItem(r.id,'name'===e.field?{name:n}:{description:n}),'name'===e.field?`Done: renamed to ${n}.`:`Done: description of ${r.name} changed.`):'Nothing changed: I couldn\u2019t find that dish.'}},{id:'add_recipe_ingredient',apps:['chef'],title:'Add an ingredient to a recipe card',risk:'change',params:[{name:'text',type:'string',required:!0,description:'e.g. add 50 grams of butter to the haggis'}],keywords:[],description:'Add an ingredient line to a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\badd\b/)&&v(e,/\b(ingredient|recipe|card)\b|\badd\s+\d+\s*(g|grams?|kg|ml|tbsp|tsp)\b/)&&!v(e,/\b(step|method|order list|special)\b/)?8:0,parse:e=>({text:e}),preview:(e,t)=>{const a=pe(String(e.text));if(!a)return'Say it like \u201cadd 50 grams of butter to the haggis\u201d.';const r=(0,$.findCard)(t.rid,a.dish);return r?`Add ${[a.qty,a.unit].filter(Boolean).join(' ')} ${a.name} to ${r.dish}\u2019s recipe card?${r.signOff?' It\u2019s signed off now, so it will need signing off again.':''} Check its allergens on the card.`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=pe(String(e.text)),r=a&&(0,$.findCard)(t.rid,a.dish);return a&&r?(await(0,y.recipeCards)().update(r.id,{ingredients:[...r.ingredients,{id:(0,k.uuid)(),name:a.name,qty:a.qty,unit:a.unit}]},{name:N(I(t)),role:'head-chef'}),`Done: ${a.name} added to ${r.dish}.${r.signOff?' It needs signing off again.':''}`):'Nothing changed: I couldn\u2019t find that recipe card.'}},{id:'add_recipe_step',apps:['chef'],title:'Add a method step to a recipe card',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'},{name:'step',type:'string',required:!0,description:'The step wording'}],keywords:[],description:'Add a method step to the end of a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\b(add|new)\b/)&&v(e,/\b(step|method)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:to|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*[:,]\s*(.+)$/i)??e.match(/\bstep\s+(?:to|for)\s+(?:the\s+)?(.+?)\s+(?:saying|that says|reading)\s+(.+)$/i);return t?{dish:t[1],step:t[2].trim()}:{dish:e}},preview:(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0;return a?`Add step ${a.steps.length+1} to ${a.dish}: ${_(String(e.step))}?${a.signOff?' It will need signing off again.':''}`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0,r=String(e.step??'').trim();return!a||r.length<3?'Nothing changed: I need the dish and the step.':(await(0,y.recipeCards)().update(a.id,{steps:[...a.steps,r]},{name:N(I(t)),role:'head-chef'}),`Done: step added to ${a.dish}.`)}},{id:'manager_clock',apps:T,title:'Clock someone in or out (manager correction)',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff first name or id'},{name:'action',type:'string',required:!0,description:'in, out, break_start or break_end',enum:['in','out','break_start','break_end']},{name:'reason',type:'string',required:!0,description:'Why (at least 3 letters)'}],keywords:[],description:'A manager clocks a member of staff in or out, or starts or ends their break, now, with a reason, like the Clock tab\u2019s manager buttons. It is marked as a manager correction.',match:e=>v(e,/\bclock\s+\w+\s+(in|out)\b|\bclock (in|out)\s+[a-z]+\b|\b(start|end)\s+(a |the )?break for\b|\b(end|finish)\s+\w+'?s break\b/)&&!v(e,/\b(me|myself|my|who|is|are|has)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=W(e)[0],r=e.match(/\b(?:reason|because|as)\b[:,]?\s*(.+)$/i),n=/\bbreak\b/.test(t)?/\b(end|finish|back)\b/.test(t)?'break_end':'break_start':/\bout\b/.test(t)?'out':'in';return{staffId:a?.id,action:n,reason:r?.[1]?.trim()}},preview:e=>{const t=E(e.staffId);return t?`${le[e.action??'in'].replace('{n}',N(t.name))} now, at ${D()}? Reason: ${_(String(e.reason))}. It\u2019s marked as a manager correction.`:'Who? Say their first name.'},run:(e,t)=>{const a=E(e.staffId);if(!a)return'Nothing changed: I couldn\u2019t tell who.';const r=e.action??'in',n=(0,g.managerClockAction)(r,{rid:t.rid,staffId:a.id,date:t.today,at:(0,$.appNow)().toISOString()},{id:t.whoId??'manager',name:N(I(t))},String(e.reason??''));return n.ok?`Done: ${N(a.name)} ${{in:'clocked in',out:'clocked out',break_start:'on a break',break_end:'back from break'}[r]} at ${D()}.${n.warn?' '+n.warn:''}`:'Nothing changed: '+n.message}},{id:'tips_pot',apps:T,title:'What\u2019s in the tips pot',risk:'look',params:[],keywords:[],description:'Managers only: the confirmed tips held for the team since the last payout (the Tips pot card).',match:e=>v(e,/\btips? (pot|jar|so far|held|this (period|fortnight|month|week))\b|\bin the tips\b|\bhow much (have we got |is there )?in tips\b|\bwhat are the tips\b|\bhow much (are|is) (the )?tips\b/)&&!v(e,/\b(pay|payout|split|share out)\b/)?8:0,preview:()=>'Tips pot',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const r=h.useCashUp.getState(),n=a.useStore.getState().restaurants.find(e=>e.id===t.rid),i=(0,f.payFor)(t.rid,n?.settings.pay,u.useOnboard.getState().answers).pay,s=(0,p.tipsPot)(r.tips.filter(e=>e.rid===t.rid),r.pot.filter(e=>e.rid===t.rid),(0,l.tipsPeriod)(i,t.today).start,t.today);return`The tips pot holds ${fe(s.total)} from ${(0,$.niceDay)(s.from)} to today, from ${s.days.length} confirmed cash-up${1===s.days.length?'':'s'}.${s.lastPayout?` Last paid out through ${(0,$.niceDay)(s.lastPayout.throughDate)}.`:''}`}},{id:'cash_up_summary',apps:T,title:'Read the latest cash-up',risk:'look',params:[{name:'day',type:'string',required:!1,description:'Day (else the latest)'}],keywords:[],description:'Managers only: the latest (or a named day\u2019s) cash-up: gross takings, tips and who confirmed it.',match:e=>v(e,/\bcash.?up\b|\btakings\b|\bhow much did we take\b/)&&!v(e,/\b(add|enter|start|do the|unlock|edit)\b/)?8:0,parse:(e,t)=>({day:j(e.replace(/\btonight\b/i,'today'),t?.today??(0,l.ymdOf)((0,$.appNow)()))??(/\b(last night|yesterday)\b/i.test(e)?'yesterday':void 0)}),preview:()=>'Cash-up read-out',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const a=new Date(t.today+'T12:00:00');a.setDate(a.getDate()-1);const r='yesterday'===e.day?(0,l.ymdOf)(a):e.day,n=h.useCashUp.getState().cashUps.filter(e=>e.rid===t.rid&&(!r||e.date===r)).sort((e,t)=>t.date.localeCompare(e.date)),i=n[0];return i?`Cash-up for ${(0,$.niceDay)(i.date)}: gross takings ${fe((0,p.grossOf)(i.vals))}, tips ${fe((0,p.combinedTips)(i.vals))} (cash and card). ${i.confirmedAt?`Confirmed${i.confirmedBy?` by ${i.confirmedBy}`:''}.`:'Not confirmed yet.'}`:r?`There\u2019s no cash-up for ${(0,$.niceDay)(r)}.`:'There\u2019s no cash-up yet.'}},{id:'table_note',apps:C,title:'Add a note to a table',risk:'change',params:[{name:'table',type:'string',required:!0,description:'Table'},{name:'note',type:'string',required:!0,description:'The note (say \u201cclear\u201d to remove it)'}],keywords:[],description:'Put a short note on a table on the floor plan (e.g. \u201chigh chair\u201d, \u201cbirthday\u201d), like the table sheet\u2019s Note.',match:e=>v(e,/\btables?\s+\w+/)&&v(e,/\bnote\b/)&&!v(e,/\bshift note\b/)?9:0,parse:e=>{const t=e.match(/\bnote\b(?:\s+(?:on|for|to)\s+tables?\s+\w+)?\s*(?:[:,-]|saying|that says|that|says|reading)?\s*(.+)$/i),a=/\b(clear|remove|delete) (the )?note\b/i.test(e);return{table:(0,$.tableIn)(e),note:a?'clear':t?.[1]?.replace(/^(?:on|for|to)?\s*tables?\s+\w+\s*[:,-]?\s*/i,'').trim()}},preview:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);return a?'clear'===e.note?`Clear the note on table ${a}?`:`Note on table ${a}: ${_(String(e.note))}?`:'Which table?'},run:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);if(!a)return'Nothing changed: I couldn\u2019t find that table.';const n='clear'===e.note?'':String(e.note??'').trim().slice(0,80);return(0,r.tablesOf)(a).forEach(e=>r.useFloor.getState().setLive(t.rid,e,{note:n||void 0})),n?`Done: note on table ${a}.`:`Done: note cleared on table ${a}.`}},{id:'log_lost_property',apps:T,title:'Log lost property',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What was found'},{name:'where',type:'string',required:!1,description:'Where it was found'}],keywords:[],description:'Add an item to the lost property log (held), like Extras \u203a Lost property \u203a Add.',match:e=>v(e,/\blost property\b|\b(found|someone left|left behind|handed in)\b\s+(a|an|some|their|his|her)\b|\b(a|an)\s+\w+(\s+\w+)?\s+(was )?(left behind|handed in)\b/)&&!v(e,/\b(how many|what'?s in|list|read|returned)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:found|left(?: behind)?|handed in|log|add)\s+(?:a |an |some |their |his |her )?(.+?)(?=\s+(?:at|on|in|under|by|near|from)\s|[,.]|$)/i)??e.match(/\b(?:a|an)\s+(.+?)\s+(?:was )?(?:left behind|handed in)/i),a=e.match(/\s(?:at|on|in|under|by|near)\s+(?:the\s+)?(table\s+\w+|bar|toilets?|coat ?rack|cloakroom|door|entrance|terrace|garden|car park|dining room|booth\s+\w+|[a-z]+ table)\b/i);return{item:t?.[1]?.replace(/^(?:lost property|to lost property)\s*:?\s*/i,'').trim(),where:a?.[1]}},preview:e=>`Log lost property: ${_(String(e.item))}, found ${e.where?`at ${e.where}`:'(place not noted)'}, today at ${D()}? It\u2019s marked as held.`,run:(e,t)=>{const a=String(e.item??'').trim();if(a.length<2)return'Nothing changed: say what was found.';const r=(0,$.appNow)();return n.useOwner.getState().addLost({item:a,where:String(e.where??'').trim()||'Not noted',foundAt:`${(0,l.ymdOf)(r)} ${D()}`,foundBy:N(I(t))}),`Done: ${a} logged as held.`}},{id:'add_reminder',apps:T,title:'Add a venue reminder for staff',risk:'change',params:[{name:'text',type:'string',required:!0,description:'What it says'},{name:'time',type:'string',required:!0,description:'HH:MM, UK time'},{name:'days',type:'string',required:!1,description:'Days (default every day)'},{name:'audience',type:'string',required:!1,description:'all, foh or kitchen',enum:['all','foh','kitchen']}],keywords:[],description:'Add a venue reminder shown to staff on shift at a time on chosen days, like Settings \u203a Advanced \u203a Reminders \u203a Add.',match:e=>v(e,/\b(remind|reminder)\b/)&&v(e,/\b(add|set|new|create|every|daily|weekdays?|weekends?|at \d)\b/)&&!v(e,/\b(me|my)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=/\b(kitchen|chefs?)\b/.test(t)?'kitchen':/\b(front of house|foh|floor|waiters?|servers?)\b/.test(t)?'foh':'all',r=e.match(/\bremind(?:er)?\s+(?:for\s+)?(?:everyone|all staff|staff|the team|the kitchen|kitchen|front of house|foh|the floor|chefs?)?\s*(?:to|that|:)\s+(.+?)(?=\s+(?:at\s+\d|every\b|on\s+(?:mon|tue|wed|thu|fri|sat|sun)|daily|weekdays?|weekends?)|$)/i)??e.match(/\breminder\s*(?:saying|that says|:)\s*(.+?)(?=\s+(?:at\s+\d|every\b|daily)|$)/i),n=e.match(/\bat\s+(\d{1,2}(?:[:.]\d{2})?\s*(?:am|pm)?)/i);return{text:r?.[1]?.trim(),time:n?(0,$.hm)(n[1])??void 0:void 0,days:ge(t).join(','),audience:a}},preview:e=>{const t=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number),a=String(e.text??''),r=a.charAt(0).toUpperCase()+a.slice(1);return`Add a reminder for ${ye[e.audience??'all']}: ${_(r)}, ${7===t.length?'every day':'every '+t.map(e=>me[e].replace(/^\w/,e=>e.toUpperCase())).join(', ')} at ${e.time} (UK time)?`},run:(e,t)=>{const a=String(e.text??'').trim(),r=String(e.time??'');if(a.length<2||!/^\d{2}:\d{2}$/.test(r))return'Nothing changed: I need the wording and a time like 21:00.';const n=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number).filter(e=>e>=0&&e<=6).sort();return c.useReminders.getState().ensure(t.rid),c.useReminders.getState().add(t.rid,{text:a.charAt(0).toUpperCase()+a.slice(1),days:n,time:r,audience:e.audience??'all'}),'Done: reminder added.'}}]},1424,[804,848,800,1014,865,1019,1029,1030,1002,1001,1024,13,1049,1050,1051,1020,1071,856,1079,1011,839,1425,1423]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.dishesFor=R,_e.findDish=E,_e.allergensSaid=M,_e.timeFrom=Y,_e.coversFrom=G,_e.dateFrom=Z,_e.nameFrom=$,Object.defineProperty(_e,"VOICE_ACTIONS",{enumerable:!0,get:function(){return X}});var e=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),s=_r(_d[7]),d=_r(_d[8]),l=_r(_d[9]),c=_r(_d[10]),p=_r(_d[11]),u=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]),f=_r(_d[15]),g=_r(_d[16]),b=_r(_d[17]),y=_r(_d[18]);const w=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},v=e=>String(e).padStart(2,'0'),k=e=>e.getFullYear()+'-'+v(e.getMonth()+1)+'-'+v(e.getDate()),S=e=>{const[t,r,a]=e.split('-').map(Number);return new Date(t,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},N=(e,t)=>t.test(e),I=(e,t)=>e+' '+t+(1===e?'':'s'),A={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},T=e=>null==e?void 0:A[e.toLowerCase()]??(Number.isFinite(Number(e))?Number(e):void 0),x=e=>e.who??('display'===e.app?'Main Display':'Assistant'),D={owner:'Managers',staff:'Staff',chef:'Head Chef',display:'Main Display'},C=e=>D[e.app??'owner'],O=new Set(['the','and','with','our','for']),L=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').split(/\s+/).filter(e=>e.length>2&&!O.has(e));function R(e){const t=i.useStore.getState(),r=(0,c.resolveMenu)(t.menu.filter(t=>t.restaurantId===e&&!t.hidden)).map(e=>({kind:'menu',id:e.id,name:e.name,allergens:e.allergens,soldOut:e.soldOut,price:e.price,signedOff:!!e.signOff})),a=l.useSpecials.getState().current[e];return[...r,...(a?.items??[]).map(e=>({kind:'special',id:e.id,name:e.name,allergens:e.allergens,price:e.price,signedOff:!!a?.allergenCheck}))]}const _=e=>e.replace(/s$/,'');function E(e,t){const r=new Set(L(e).map(_)),a=e.toLowerCase();let n;for(const e of R(t)){const t=L(e.name);if(!t.length)continue;const o=t.filter(e=>r.has(_(e))).length;if(!o)continue;const i=o/t.length+.25*o+(a.includes(e.name.toLowerCase())?2:0);(o>=Math.min(2,t.length)||t.length<=3)&&(!n||i>n.s)&&(n={d:e,s:i})}return n?.d}const F=[[/\b(gluten|wheat|coeliac|celiac|barley|rye)\b/,['gluten']],[/\bpeanuts?\b/,['peanuts']],[/\b(tree ?nuts?|almonds?|walnuts?|hazelnuts?|cashews?|pecans?|pistachios?)\b/,['treenuts']],[/\bnuts?\b/,['peanuts','treenuts']],[/\b(dairy|milk|lactose|cheese|cream|butter)\b/,['milk']],[/\beggs?\b/,['eggs']],[/\b(shellfish|crustaceans?|prawns?|crab|langoustines?)\b/,['crustaceans']],[/\b(molluscs?|mussels?|oysters?|squid|scallops?|clams?)\b/,['molluscs']],[/\bfish\b/,['fish']],[/\b(soya|soy)\b/,['soya']],[/\bcelery\b/,['celery']],[/\bmustard\b/,['mustard']],[/\bsesame\b/,['sesame']],[/\b(sulphites?|sulfites?|sulphur)\b/,['sulphites']],[/\blupin\b/,['lupin']]];function M(e){const t=new Set;for(const[r,a]of F)r.test(e)&&a.forEach(e=>t.add(e));return[...t]}const q=e=>p.ALLERGENS.find(t=>t.id===e)?.short??e,z='Always check the signed-off recipe card and tell the kitchen about any allergy.';function B(t,r){if('chef'===r?.app&&(0,e.isAnchorage)(r.rid)&&(0,e.isBarFridge)(t))return[];const a=d.useSafety.getState().points.filter(t=>'chef'!==r?.app||(0,e.chefCanSee)(r.rid,t)),n=/\b(done|complete|completed|finished|ok|okay|checked)\b/i.test(t);return(0,f.parseQuick)(t,a).filter(e=>e.point).map(e=>{const t=(0,f.isTempKind)(e.point.kind);return{pointId:e.point.id,value:t?e.value:null,done:t?void 0:n}})}const j=e=>{try{return JSON.parse(String(e.readings??'[]'))}catch{return[]}};function H(e){const t=d.useSafety.getState().points.find(t=>t.id===e.pointId);return t?(0,f.isTempKind)(t.kind)?null==e.value?t.name+': no temperature heard':t.name+': '+e.value+'\xb0C '+((0,f.inRange)(t,e.value)?'(safe)':'OUT OF RANGE (safe: '+(0,f.limitText)(t)+')'):t.name+': '+(e.done?'done':'NOT done'):'?'}function Y(e){const t=e.match(/\b(?:at|around|about)\s+(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})[:.](\d{2})\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})()\s*(am|pm)\b/);if(!t){const t=e.match(new RegExp("\\bhalf (?:past )?(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b"));if(!t)return;let r=T(t[1])??0;return r>=1&&r<=10&&(r+=12),v(r)+':30'}let r=Number(t[1]);const a=Number(t[2]||0),n=t[3];return'pm'===n&&r<12&&(r+=12),'am'===n&&12===r&&(r=0),!n&&r>=1&&r<=10&&(r+=12),r>23||a>59?void 0:v(r)+':'+v(a)}function G(e){const r=e.match(new RegExp("\\b(?:table for|party of|for|of)\\s+(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))"))??e.match(new RegExp("\\b(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\s*(?:covers|people|guests|adults|of us)\\b")),a=T(r?.[1]);return a&&(0,t.validParty)(a)?a:void 0}const P=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function Z(e,t){const r=new Date(t+'T12:00:00');if(/\btomorrow\b/.test(e))return r.setDate(r.getDate()+1),k(r);const a=P.findIndex(t=>e.includes(t));if(a>=0){const t=(r.getDay()+6)%7;return r.setDate(r.getDate()+((a-t+7)%7||(/\bnext\b/.test(e)?7:0))),k(r)}return t}function U(e,t,r,a){const n=i.useStore.getState(),o=n.restaurants.find(t=>t.id===e),d=s.useFloor.getState().plans[e]??(0,s.seedPlan)(e),l=o?.settings.turnMins??90,c=n.bookings.filter(r=>r.restaurantId===e&&r.date===t);return(0,u.freeTablesAt)(d,c,a,new Date(t+'T'+r+':00'),(0,u.turnFor)(a,l),l)}const K=(e,t)=>{const[r,a]=e.split(':').map(Number),n=60*r+a+t;return v(Math.floor(n/60))+':'+v(n%60)},W=e=>e.replace(/^\w/,e=>e.toUpperCase());function $(e){const t=e.match(/\b(?:under|name of|named|called)\s+([A-Za-z][A-Za-z'\u2019-]+(?:\s+[A-Z][A-Za-z'\u2019-]+)?)/i)??e.match(/\bname(?:'s| is)?\s+([A-Za-z][A-Za-z'\u2019-]+)/i);return t?W(t[1]):void 0}const J=e=>!/\b(how do i|how do you|where do i|how to)\b/.test(e),V=e=>!['collected','served','closed','cancelled'].includes(e.status),Q=e=>e.toUpperCase().replace(/[\s-]/g,''),X=[{id:'next_table_free',title:'When is the next table free?',risk:'look',description:'Estimate when the next table frees up, and how long a walk-in for 2 or 4 would wait.',params:[],keywords:['next table','table free'],match:e=>N(e,/\b(next|soonest|first)\b.*\btables?\b.*\b(free|ready|available|clear)\b|\bhow long\b.*\b(wait|walk)|\bwait(ing)? (time|for a table)\b|\bwhen\b.*\btable\b.*\b(free|ready)\b/)?4:0,preview:()=>'Next table free',run:(e,t)=>{const r=i.useStore.getState(),a=w(),n=k(a),o=r.restaurants.find(e=>e.id===t.rid);if(!o)return'I can\u2019t see this venue\u2019s tables yet.';const d=s.useFloor.getState(),l=d.plans[t.rid]??(0,s.seedPlan)(t.rid),c=r.bookings.filter(e=>e.restaurantId===t.rid),p=(0,m.closedAreasAt)(m.useBlocks.getState().blocks,t.rid,n,v(a.getHours())+':'+v(a.getMinutes())),f=(0,u.floorView)(l,c,r.orders.filter(e=>e.restaurantId===t.rid),d.live[t.rid]??{},a,o.settings.turnMins,p);return(0,h.nextFreeSentence)((0,h.nextTablesFree)(o,f,c.filter(e=>e.date===n),a,c),a)+' It\u2019s an estimate.'}},{id:'log_check',title:'Log a temperature or kitchen check',risk:'change',description:'Record fridge, freezer, cooking, cooling, hot-hold or delivery temperatures, or a cleaning or kitchen check, in the food safety log. Out-of-range readings are flagged.',params:[{name:'readings',type:'string',required:!0,description:'JSON list of {pointId, value in \xb0C or null, done for non-temperature checks}'}],keywords:['fridge','freezer','temperature','probe'],match:e=>J(e)&&N(e,/\b(fridges?|freezers?|walk.?in|cold room|temps?|temperatures?|degrees|probe|core temp|hot hold|cooling|cleaning|clean down|deep clean)\b/)&&(!N(e,/\b(seat|seated|party|covers?|people|guests?|table \w+|walk.?ins? (of|for)|just arrived)\b/)||N(e,/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus)\b/))?3:0,parse:(e,t)=>({readings:JSON.stringify(B(e,t))}),preview:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));return n.length?'Log in the food safety log: '+n.map(H).join('; ')+'?':'I didn\u2019t catch which fridge, freezer or check. Try \u201cwalk-in fridge 3 degrees\u201d.'},run:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));if(!n.length)return'Nothing logged: I didn\u2019t catch which unit or check.';if(n.some(e=>{const t=a.find(t=>t.id===e.pointId);return!!t&&(0,f.isTempKind)(t.kind)&&null==e.value}))return'Nothing logged: a temperature was missing. Say the number, for example \u201cfreezer minus 19\u201d.';const o=w().toISOString(),i='chef'===r.app?'chef':'owner'===r.app?'managers':'staff',s=n.filter(e=>a.some(t=>t.id===e.pointId)).map(e=>{const t=a.find(t=>t.id===e.pointId),n=(0,f.isTempKind)(t.kind),s=n?(0,f.inRange)(t,e.value):!!e.done,d=['display'===r.app?'Logged on the Main Display.':'',s?'':'Out of range: add the corrective action.'].filter(Boolean).join(' ');return{pointId:t.id,name:t.name,kind:t.kind,at:o,by:x(r),byId:r.whoId??'voice-'+(r.app??'owner'),app:i,value:n?e.value:void 0,done:n?void 0:!!e.done,ok:s,source:'voice',note:d||void 0}});d.useSafety.getState().addEntries(s);const l=s.filter(e=>!e.ok);return l.length?'Logged. '+l.map(e=>e.name+' is OUT OF RANGE').join(', ')+'. Check it now and add what you did in the food safety log.':'Logged: '+s.map(e=>e.name+' '+(null!=e.value?e.value+'\xb0C':'done')).join(', ')+'. All fine.'}},{id:'allergen_info',title:'Allergen question',risk:'look',description:'Answer allergen questions from the recipe cards and the menu: what a dish contains or may contain, or which dishes are free of an allergen.',params:[{name:'dish',type:'string',description:'Dish name'},{name:'allergens',type:'string',description:'Comma-separated allergen ids'}],keywords:['allergen','allergy','contain'],match:e=>!N(e,/(allergens?|allerg(y|ic|ies)|contains?|coeliac|celiac|safe for|free from|.free\b|intoleran)/)||N(e,/\b(sold out|price|draft)\b/)||N(e,/\btables?\b.*\bfree\b|\bfree\b.*\btables?\b/)?0:3,parse:(e,t)=>{const r=E(e,t.rid);let a=e.toLowerCase();if(r)for(const e of L(r.name))a=a.replace(new RegExp('\\b'+e+'\\b','g'),' ');return{dish:r?.name,allergens:M(a).join(',')}},preview:e=>'Allergens'+(e.dish?' in '+e.dish:''),run:(e,t)=>{const r=R(t.rid),a=e.dish?r.find(t=>t.name===e.dish):void 0,n=String(e.allergens??'').split(',').filter(Boolean);if(a){const e=p.ALLERGENS.filter(e=>'contains'===a.allergens[e.id]).map(e=>e.short),t=p.ALLERGENS.filter(e=>'may'===a.allergens[e.id]).map(e=>e.short);return(n.length?n.map(e=>'contains'===a.allergens[e]?a.name+' CONTAINS '+q(e)+'.':'may'===a.allergens[e]?a.name+' MAY CONTAIN '+q(e)+'.':'No '+q(e)+' is listed for '+a.name+'.').join(' '):a.name+' contains '+(e.length?e.join(', '):'none of the 14 allergens')+(t.length?', and may contain '+t.join(', '):'')+'.')+(a.signedOff?'':' Its allergens are NOT signed off yet.')+' '+z}if(n.length){const e=r.filter(e=>!e.soldOut&&n.every(t=>!e.allergens[t])),t=r.filter(e=>n.some(t=>'contains'===e.allergens[t]));return e.length+(1===e.length?' dish has':' dishes have')+' no '+n.map(q).join(' or ')+' listed'+(e.length?', for example '+e.slice(0,5).map(e=>e.name).join(', '):'')+'. '+t.length+' contain it. '+z}return'Which dish, or which allergen? For example \u201cdoes the fish supper contain gluten?\u201d.'}},{id:'set_sold_out',title:'Mark a dish sold out or back on',risk:'change',description:'Mark a menu dish sold out or back on. A reminder for staff: it shows on the Display and in the Sold out list.',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'soldOut',type:'string',required:!0,description:'yes = sold out, no = back on',enum:['yes','no']}],keywords:['sold out','back on','86'],match:e=>N(e,/\b(sold out|run out|ran out|out of stock|86|eighty.?six|back on|available again|back in stock|un.?86|none left)\b/)?4:0,parse:(e,t)=>{const r=E(e,t.rid),a=/\b(back on|available again|back in stock|un.?86)\b/i.test(e);return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,soldOut:a?'no':'yes'}},preview:e=>e.itemId?'Mark '+e.name+' '+('no'===e.soldOut?'back on':'sold out')+'?':e.name?e.name+' is on the Specials board; change it there.':'I couldn\u2019t find that dish on the menu.',run:async e=>e.itemId?(await o.repo.menu.updateItem(String(e.itemId),{soldOut:'no'!==e.soldOut}),'Done: '+e.name+' is '+('no'===e.soldOut?'back on':'sold out')+'.'):'Nothing changed: I couldn\u2019t find that dish on the menu.'},{id:'change_price',apps:['owner'],title:'Change a menu price',risk:'change',description:'Change the price of a menu dish (managers only).',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'pence',type:'integer',required:!0,description:'New price in pence'}],keywords:['price'],match:e=>N(e,/\b(price|charge|cost)\b/)&&N(e,/(\xa3|\d|pound)/)&&!N(e,/\b(special|offer)\b/)?3:0,parse:(e,t)=>{const r=E(e,t.rid),a=e.match(/\b(?:to|at)\s*\xa3?\s*(\d{1,3})(?:[.:](\d{1,2}))?/i)??e.match(/\xa3\s*(\d{1,3})(?:\.(\d{1,2}))?/)??e.match(/(\d{1,3})\s*pounds?(?:\s*(\d{1,2}))?/i),n=a?100*Number(a[1])+Number((a[2]??'0').padEnd(2,'0')):void 0;return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,pence:n,old:r?.price??void 0}},preview:e=>e.itemId?'Change '+e.name+' from '+(null!=e.old?(0,g.gbp)(Number(e.old)):'its current price')+' to '+(null!=e.pence?(0,g.gbp)(Number(e.pence)):'?')+'?':'I couldn\u2019t find that dish on the menu.',run:async(e,t)=>{if(t.role&&!['owner','manager'].includes(t.role))return'Only managers can change prices.';const r=Number(e.pence);return e.itemId&&r>0&&r<1e5?(await o.repo.menu.updateItem(String(e.itemId),{price:r}),'Done: '+e.name+' is now '+(0,g.gbp)(r)+'.'):'Nothing changed: I need the dish and a price.'}},{id:'draft_special',apps:['owner','chef'],title:'Draft a special',risk:'draft',description:'Save a special as a draft for the owner to approve. It goes on the Specials board only after its allergens are checked.',params:[{name:'text',type:'string',required:!0,description:'The special, e.g. \u201cHake with mussels, \xa318\u201d'}],keywords:['special'],match:e=>N(e,/\bspecials?\b/)&&N(e,/\b(add|new|put|draft|today'?s|tonight'?s|change|set)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\bspecials?\b(?:\s*(?:board|is|are|to|:))?\s*/i,'').trim()||e}),preview:e=>'Save a draft special: \u201c'+e.text+'\u201d. Its allergens get checked before it goes on the board.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'special',title:'New special',lines:[String(e.text),'Add its allergens and post it on the Specials board when approved.'],by:x(t),app:C(t)}),'Saved as a draft special for the owner to approve. It isn\u2019t on the board yet.')},{id:'check_availability',title:'Check table availability',risk:'look',description:'Check whether a table is free for a party at a date and time, and suggest nearby times if not.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'}],keywords:['availability','table for','free table'],match:e=>N(e,/\b(availability|available|space|room for|any room|got room|any tables?|got a table|free table|have we got|is there a table|can we fit|fit in)\b/)&&!N(e,/\b(sold|back on|allerg)/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r)}},preview:e=>'Check a table for '+(e.covers??'?')+' at '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'today'),run:(e,t)=>{const r=Number(e.covers),a=String(e.time),n=String(e.date??t.today),o=U(t.rid,n,a,r);if(o.length)return'Yes, there\u2019s room for '+r+' at '+a+' on '+S(n)+'. Best fit: table '+o[0].table+(o[0].area?' ('+o[0].area+')':'')+'.';const i=[];for(const e of[-30,30,-60,60,-90,90]){const o=K(a,e);if(U(t.rid,n,o,r).length&&i.push(o),i.length>=3)break}return'No table for '+r+' at '+a+' on '+S(n)+'.'+(i.length?' Free nearby: '+i.sort().join(', ')+'.':' Nothing free within 90 minutes either.')}},{id:'draft_booking',title:'Take a booking (draft)',risk:'draft',description:'Take a booking as a DRAFT for the owner to confirm in Bookings. The guest confirmation is only sent from there.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'},{name:'name',type:'string',description:'Guest name'}],keywords:['book','booking','reserve'],match:e=>N(e,/\b(book|booking|reserve|reservation)\b/)&&!N(e,/\b(availability|any tables?|have we got|is there|how many|move|cancel|booker)\b/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r),name:$(e)}},preview:(e,t)=>{const r=e.covers&&e.time?U(t.rid,String(e.date??t.today),String(e.time),Number(e.covers)):[],a=e.covers&&e.time?r.length?' Table '+r[0].table+' is free.':' NO table is free then.':'';return'Draft booking: '+(e.name??'guest')+', '+(e.covers??'?')+' covers, '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'?')+'.'+a+' The owner confirms it in Bookings; nothing is sent to the guest now.'},run:(e,r)=>(0,t.validParty)(Number(e.covers))?(b.useDrafts.getState().add({rid:r.rid,kind:'booking',title:'Booking: '+(e.name??'guest')+', '+e.covers+' covers',lines:[S(String(e.date))+' at '+e.time,'Take their phone number when you confirm it in Bookings.'],data:{covers:e.covers,date:e.date,time:e.time,name:e.name},by:x(r),app:C(r)}),'Saved as a draft booking for the owner to confirm. No confirmation has been sent.'):`Nothing saved. ${t.PARTY_RULE} How many people?`},{id:'add_waitlist',title:'Add to the waitlist',risk:'change',description:'Add a party to the waitlist. Nobody is messaged.',params:[{name:'name',type:'string',description:'Name'},{name:'covers',type:'integer',required:!0,description:'Party size'}],keywords:['waitlist','waiting list'],match:e=>N(e,/\b(wait ?list|waiting list|queue)\b/)?4:0,parse:e=>({name:$(e)??e.match(/\badd\s+([A-Z][a-z'\u2019-]+)\b/)?.[1],covers:G(e.toLowerCase())}),preview:e=>'Add '+(e.name??'a guest')+', '+(e.covers??'?')+' covers, to the waitlist?',run:async(e,r)=>{const a=Number(e.covers);if(!(0,t.validParty)(a))return`Nothing added: how many people? ${t.PARTY_RULE}`;return'Done: '+(await o.repo.waitlist.join(r.rid,String(e.name??'Guest'),a)).name+' is on the waitlist. Nobody has been messaged.'}},{id:'read_orders',title:'Read out orders',risk:'look',description:'Read out the live orders and takeaways.',params:[],keywords:['orders'],match:e=>N(e,/\b(orders?|takeaways?|tickets?|collections?)\b/)&&N(e,/\b(read|what|any|list|how many|open|live|waiting|outstanding|pending|due|next)\b/)&&!N(e,/\b(shopping|booker|bidfood|supplier)\b/)?3:0,preview:()=>'Read out the live orders',run:(e,t)=>{const a=i.useStore.getState().orders.filter(e=>e.restaurantId===t.rid&&V(e)).sort((e,t)=>(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt));if(!a.length)return'No live orders right now.';const n=a.filter(e=>'takeaway'===e.type).length;return I(a.length,'live order')+' ('+n+' takeaway). '+a.slice(0,6).map(e=>{return('takeaway'===e.type?'Takeaway ':(0,r.tableNumbers)(e.tableNo)+' ')+e.ref+' for '+e.customerName+', '+I(e.lines.reduce((e,t)=>e+t.qty,0),'item')+', '+e.status+(e.slotTime?', due '+(t=e.slotTime,new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})):'')+(e.allergies.length?', HAS ALLERGIES':'');var t}).join('. ')+(a.length>6?'. And '+(a.length-6)+' more.':'.')}},{id:'day_numbers',title:'Covers, sales and forecast',risk:'look',description:'How many covers are booked today and tomorrow, sales through CoverCharge so far today, and the forecast for the rest of today.',params:[],keywords:['covers','sales','forecast'],match:e=>N(e,/\b(covers|sales|takings|revenue|forecast|how busy|busy tonight|expected|how many (people|guests|bookings))\b/)&&!N(e,/\b(walk|seat|wait ?list|add|book (a|for|in))\b/)?3:0,preview:()=>'Today\u2019s covers, sales and forecast',run:(e,t)=>{const r=i.useStore.getState(),n=w(),o=k(n),s=r.restaurants.find(e=>e.id===t.rid),d=r.bookings.filter(e=>e.restaurantId===t.rid),l=d.filter(e=>e.date===o&&['confirmed','seated','finished'].includes(e.status)),c=l.reduce((e,t)=>e+t.partySize,0),p=l.filter(e=>e.walkIn).reduce((e,t)=>e+t.partySize,0),u=new Date(n);u.setDate(u.getDate()+1);const h=k(u),m=d.filter(e=>e.date===h&&['confirmed','pending'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),f=r.orders.filter(e=>e.restaurantId===t.rid),b=f.filter(e=>e.createdAt.slice(0,10)===o&&'cancelled'!==e.status),y=b.reduce((e,t)=>e+t.subtotal,0);let v='';if(s){const e=(0,a.forecastToday)(s,d,f,r.events,n);v=e.open?e.enough?' Forecast for the rest of today: about '+e.restOfDay.covers+' covers ('+(0,a.coversRange)(e.restOfDay.low,e.restOfDay.high,!1)+')'+(e.example?', example figures.':'.'):' No forecast yet: not enough history ('+e.restOfDay.booked+' covers booked for the rest of today).':''}return'Today: '+c+' covers booked or seated'+(p?', including '+p+' walk-in':'')+'. '+I(b.length,'order')+' through CoverCharge so far'+('display'===t.app||'staff'===t.app||'staff'===t.role?'.':', '+(0,g.gbp)(y)+' before tips (till sales aren\u2019t included).')+v+' Tomorrow: '+m+' covers booked so far.'}},{id:'supplier_list',title:'Add to a Booker or Bidfood shopping list',risk:'draft',description:'Add items to a DRAFT shopping list for Booker or Bidfood for the owner to check and order on the supplier\u2019s site. Never places an order.',params:[{name:'supplier',type:'string',required:!0,description:'Supplier',enum:['booker','bidfood']},{name:'items',type:'string',required:!0,description:'Items separated by semicolons'}],keywords:['booker','bidfood','shopping list'],match:e=>N(e,/\b(booker|bidfood|bid food)\b/)?4:N(e,/\b(shopping list|order list|we need more|we'?re low on|running low)\b/)?3:0,parse:e=>({supplier:/\bbid ?food\b/i.test(e)?'bidfood':'booker',items:e.replace(/\b(to|on|onto)\s+(the\s+)?(booker|bidfood|bid food)?\s*(shopping\s+|order\s+)?list\b.*$/i,'').replace(/\b(from|at)\s+(booker|bidfood|bid food)\b/i,'').replace(/[,.]?\s*\b(put|add|stick)\s+(it|them|that|those)\b.*$/i,'').replace(/^.*?\b(add|need|order|get|put|low on)\b\s*/i,'').trim().split(/\s*(?:,|\band\b)\s*/i).map(e=>e.trim()).filter(Boolean).join('; ')}),preview:e=>'Add to the draft '+('bidfood'===e.supplier?'Bidfood':'Booker')+' list: '+String(e.items??'').split('; ').join(', ')+'. Nothing is ordered; the owner checks it and orders on the supplier\u2019s site.',run:(e,t)=>{const r=String(e.items??'').split('; ').filter(Boolean);if(!r.length)return'Nothing added: which items?';const a=b.useDrafts.getState().addToList(t.rid,'bidfood'===e.supplier?'bidfood':'booker',r,x(t),C(t));return'Added to the draft '+a.title+' ('+I(a.lines.length,'item')+'). Nothing has been ordered.'}},{id:'draft_offer',title:'Draft an offer',risk:'draft',description:'Save an offer or promotion as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The offer'}],keywords:['offer','promotion'],match:e=>N(e,/\b(offer|promotion|promo|deal|discount|happy hour|two for one|2 for 1)\b/)&&N(e,/\b(draft|create|make|set up|new|add|run|do)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\b(?:offer|promotion|promo|deal)\b\s*(?:for|of|:)?\s*/i,'').trim()||e}),preview:e=>'Save a draft offer for the owner to approve: \u201c'+e.text+'\u201d. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'offer',title:'New offer',lines:[String(e.text)],by:x(t),app:C(t)}),'Saved as a draft offer for the owner to approve. Nothing was published or sent.')},{id:'draft_event',title:'Draft an event',risk:'draft',description:'Save an event (quiz, live music, tasting night) as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The event'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['event'],match:e=>N(e,/\b(event|quiz|live music|tasting|gig|party night|music night|open mic|ceilidh)\b/)&&N(e,/\b(draft|create|make|plan|set up|new|add|put on|run)\b/)?3:0,parse:(e,t)=>({text:e.replace(/^.*?\b(?:draft|create|make|plan|set up|add|put on|run)\b\s*(?:an?|the)?\s*(?:new\s+)?(?:event)?\s*(?:for|:)?\s*/i,'').trim()||e,date:/\b(tomorrow|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i.test(e)?Z(e.toLowerCase(),t.today):void 0}),preview:e=>'Save a draft event for the owner to approve: \u201c'+e.text+'\u201d'+(e.date?' on '+S(String(e.date)):'')+'. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'event',title:'New event',lines:[String(e.text),...e.date?[S(String(e.date))]:[]],data:{date:e.date},by:x(t),app:C(t)}),'Saved as a draft event for the owner to approve. Nothing was published or sent.')},{id:'card_balance',apps:['owner','chef'],title:'Gift card or stamp card balance',risk:'look',description:'Look up a gift card balance by its code, or a summary of stamp cards.',params:[{name:'code',type:'string',description:'Gift card code'},{name:'kind',type:'string',description:'gift or stamp',enum:['gift','stamp']}],keywords:['gift card','voucher','stamp card'],match:e=>N(e,/\b(gift ?cards?|gift vouchers?|vouchers?|stamp ?cards?|stamps|loyalty)\b/)?3:0,parse:e=>{const t=e.toUpperCase().replace(/\b(GIFT|CARDS?|VOUCHERS?|BALANCE|CHECK|WHAT'?S|WHAT|THE|ON|IS|CODE|FOR|OF|HOW|MUCH|LEFT|STAMPS?|A)\b/g,' ').match(/[A-Z0-9][A-Z0-9 -]{3,}[A-Z0-9]/);return{kind:/stamp|loyalty/i.test(e)?'stamp':'gift',code:t?Q(t[0]):void 0}},preview:e=>'stamp'===e.kind?'Stamp cards':'Gift card '+(e.code??''),run:(e,t)=>{const r=i.useStore.getState();if('stamp'===e.kind&&(0,n.staffServer)())return(0,n.loyaltySummary)().then(e=>I(e.members,'guest')+' have stamp cards here; '+I(e.rewardsReady,'reward')+' ready to use. To check one guest, open Stamp card and find or scan them.',()=>'I couldn\u2019t reach the stamp cards just now. Try again in a moment.');if('stamp'===e.kind){const e=r.stampCards.filter(e=>e.restaurantId===t.rid),a=e.reduce((e,t)=>e+t.rewardsAvailable,0);return I(e.length,'guest')+' have stamp cards here; '+I(a,'reward')+' ready to claim. To check one guest, scan their card in Stamp cards.'}if(!e.code)return'Read me the code on the gift card, letter by letter.';const a=String(e.code),o=r.giftCards.filter(e=>e.restaurantId===t.rid).find(e=>Q(e.code)===a||a.length>=4&&Q(e.code).includes(a));return o?'Gift card '+o.code+': '+(0,g.gbp)(o.balance)+' left of '+(0,g.gbp)(o.initial)+'.':'I couldn\u2019t find a gift card with that code. Check it and try again.'}},{id:'feedback_summary',title:'Summarise feedback',risk:'look',description:'Summarise the last 7 days of guest ratings and comments.',params:[],keywords:['feedback','reviews'],match:e=>N(e,/\b(feedback|reviews?|ratings?|complaints?|comments?|what are (guests|people) saying)\b/)?3:0,preview:()=>'Summarise this week\u2019s feedback',run:(e,t)=>{const r=w().getTime()-6048e5,a=i.useStore.getState().ratings.filter(e=>e.restaurantId===t.rid&&new Date(e.createdAt).getTime()>=r);if(!a.length)return'No guest feedback in the last 7 days.';const n=a.reduce((e,t)=>e+t.stars,0)/a.length,o=a.filter(e=>e.stars<=3&&e.comment).slice(0,2),s=a.filter(e=>e.stars>=5&&e.comment).slice(0,1);return I(a.length,'rating')+' in the last 7 days, averaging '+n.toFixed(1)+' stars.'+(s.length?' Best: \u201c'+s[0].comment+'\u201d.':'')+(o.length?' To look at: '+o.map(e=>'\u201c'+e.comment+'\u201d ('+e.stars+' stars)').join('; ')+'.':' No low scores.')}},{id:'shift_note',title:'Leave a shift note',risk:'change',description:'Leave a note for the next shift.',params:[{name:'text',type:'string',required:!0,description:'The note'}],keywords:['shift note','handover'],match:e=>N(e,/\b(shift note|leave a note|note for|handover|tell the next shift|let the next shift know|note that)\b/)&&!N(e,/\b(read|any notes|what notes)\b/)?4:0,parse:e=>({text:e.replace(/^.*?\b(?:shift note|leave a note|note for (?:the )?(?:next shift|tomorrow|tonight|morning|evening)|handover note|handover|tell the next shift|let the next shift know|note that)\b\s*(?:that|:|,|for the next shift)?\s*/i,'').trim()||e}),preview:e=>'Leave a shift note: \u201c'+e.text+'\u201d?',run:(e,t)=>(y.useShiftNotes.getState().add({rid:t.rid,text:String(e.text),by:x(t),app:C(t)}),'Shift note saved. It shows on the Shift notes screen.')},{id:'read_shift_notes',title:'Read shift notes',risk:'look',description:'Read out the latest open shift notes.',params:[],keywords:['notes'],match:e=>N(e,/\b(read|any|what|latest)\b.*\b(shift notes?|notes|handover)\b/)?5:0,preview:()=>'Read the latest shift notes',run:(e,t)=>{const r=y.useShiftNotes.getState().notes.filter(e=>e.rid===t.rid&&!e.done).slice(0,5);return r.length?r.map(e=>e.by+', '+new Date(e.at).toLocaleString('en-GB',{weekday:'short',hour:'2-digit',minute:'2-digit'})+': '+e.text).join('. '):'No open shift notes.'}}]},1425,[804,1098,829,1120,1199,848,800,1014,1019,989,831,830,1079,1080,1011,1020,836,1426,1427]); -__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return f}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},d=r(_d[1]),n=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},f=(0,d.create)()((0,n.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,d,n,o,f)=>{const p=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===d&&'draft'===e.status);if(p){const t={...p,lines:[...p.lines,...n]};return e(e=>({drafts:e.drafts.map(e=>e.id===p.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:d,title:('bidfood'===d?'Bidfood':'Booker')+" shopping list",lines:n,by:o,app:f})},decide:(t,s,d)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:d,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,n.createJSONStorage)(()=>s.default)}))},1426,[808,815,818]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1427,[808,815,818]); -__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,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1428,[798,34,283,364,236,402,102,815,794,840,25]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return a}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],o=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from Bidfood or Booker',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add Bidfood or Booker for this venue, with your account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add Bidfood or Add Booker (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and Booker or Bidfood lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cwalk-in fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, Booker and Bidfood shopping lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cwalk-in fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Take a picture of the taking sheet, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Take a picture of the taking sheet, or upload a spreadsheet',keywords:['cash up','photo','spreadsheet','csv','excel','xlsx','camera','sheet','gross','card','cash','tips','takings'],body:'In Cash up & sales tap Take a picture of the taking sheet: the camera opens and the figures are filled in from the photo. Check every figure beside the photo (gross, card, cash, tips, food and drink), change anything that is wrong, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. If the photo can\u2019t be read, type the figures in.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'The taking sheet buttons are here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display then shows a Buy a gift card button with a large QR code. Guests buy on your website; the Display shows no prices or balances.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per person, the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Upload cash up sheet. Your phone camera opens; take a photo of the paper sheet (you can add several). The review screen shows the photo beside the figures. Automatic reading isn\u2019t switched on yet, so type each figure from the photo; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],a=t=>o.find(o=>o.id===t)},1429,[]); -__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1430,[]); -__d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return x}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]);const i=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},h=e=>String(e).padStart(2,'0'),c=e=>e.getFullYear()+'-'+h(e.getMonth()+1)+'-'+h(e.getDate()),d=e=>{const t=new Date(e);return h(t.getHours())+':'+h(t.getMinutes())},l=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return h(Math.floor(t/60))+':'+h(t%60)},u=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),h=new Date(i());return h.setDate(h.getDate()+1),e===c(h)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},m=(e,t)=>t.test(e),p=e=>(e??'').replace(' (example)',''),f=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),b=['staff'],k=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],w={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function y(e,t){return'all'===e||(0,n.inChannel)(e,t)}function S(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:p(e.name),nickname:e.nickname},o))}const v=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>m(e,/\bkitchen (chat|group|channel)\b/)&&!m(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:b,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>m(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&m(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!m(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=S(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:p(o.name)};const h=k.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(w[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=f(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||y(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(w[s]??'the team chat')+'.'):'You can\u2019t post in '+(w[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:b,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>m(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=f(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||y(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),l=e=>'system'===e.from?'CoverCharge':p(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return l(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(w[t]??t))+' at ')+d(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:b,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>m(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&m(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!m(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=i(),h=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>h)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+u(c.date,s)+', '+l(c.start)+' to '+l(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>u(e.date,s)+' '+l(e.start)+'\u2013'+l(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:b,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>m(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),h=a.today,c=o.getHours()+o.getMinutes()/60,u=s.shifts.find(e=>e.staffId===a.whoId&&e.published&&e.date===h);return n?'You\u2019re clocked in since '+d(n.in)+'.'+(u?' Your shift ends at '+l(u.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':u&&u.end>c?'You\u2019re not clocked in. Your shift today is '+l(u.start)+' to '+l(u.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(u?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:b,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>m(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const h=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+d(e.start)+'. Breaks today: '+h+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return h?'You\u2019ve had '+h+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:b,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>m(e,/\bspecials?\b/)&&!m(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:b,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>m(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],x=new Set(['log_check','allergen_info','next_table_free',...v.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1431,[800,865,989,836,1425,1032]); -__d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1432,[]); -__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_KEYTERMS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"MAX_APP_KEYTERMS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"VENUE_WORDS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"cleanTerm",{enumerable:!0,get:function(){return u}}),e.venueKeyterms=function(l){const b=[],f=new Set,h=t=>{const a=u(t??''),n=a.toLowerCase();a.length>=2&&!f.has(n)&&b.lengtht.active).forEach(t=>h(String(t.name).split(/\s+/)[0]))}catch{}try{(n.useFloor.getState().plans[l]??(0,n.seedPlan)(l)).areas.forEach(t=>h(t.name))}catch{}try{s.forEach(h)}catch{}try{a.useStore.getState().menu.filter(t=>!t.restaurantId||t.restaurantId===l).forEach(t=>h(t.name))}catch{}return b};var t=r(d[0]),a=r(d[1]),n=r(d[2]);const l=100,c=80,o=['walk-in','covers','table','seat','seated','clear','cleared','needs clearing','block','unblock','waitlist','lobster','crab','langoustines','scallops','sold out','no-show','Sitooterie','Beer Garden','Main Restaurant','party of','people'],s=['table one','table two','table three','table four','table five','table six','table seven','table eight','table nine','table ten','table eleven','table twelve'],u=t=>t.replace(/\([^)]*\)/g,' ').replace(/[^\p{L}\p{N} '&.-]/gu,' ').replace(/\s+/g,' ').trim().slice(0,50).trim()},1433,[865,800,1014]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useVoiceNav",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(()=>({go:null}))},1434,[815]); -__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_TASKS_PER_MONTH",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"VOICE_WARN_AT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"VOICE_FAIR_USAGE",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"monthKey",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"voiceUsage",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"REACHED_TEXT",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"WARN_TEXT",{enumerable:!0,get:function(){return v}}),_e.useVoiceUsage=function(e,t=new Date){const n=h(n=>n.used[e]?.[f(t)]??0);return _(n)};var e,t=r(_d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(_d[1]),s=r(_d[2]);const u=1e3,c=.8,d='Fair usage: 1,000 voice tasks a month per venue',l=new Set(['log_check']),f=(e=new Date)=>e.getFullYear()+'-'+String(e.getMonth()+1).padStart(2,'0'),h=(0,o.create)()((0,s.persist)(e=>({used:{},add:(t,n)=>e(e=>({used:{...e.used,[t]:{[n]:(e.used[t]?.[n]??0)+1}}}))}),{name:'covercharge-voice-usage-v1',version:1,storage:(0,s.createJSONStorage)(()=>n.default)})),_=e=>{const t=e/u;return{used:e,limit:u,pct:t,warn:t>=c,reached:e>=u,line:'Voice assistant: '+e.toLocaleString('en-GB')+' of 1,000 tasks used this month, resets on the 1st'}},b={get:(e,t=new Date)=>_(h.getState().used[e]?.[f(t)]??0),allowed:(e,t,n=new Date)=>null!=t&&l.has(t)||!b.get(e,n).reached,record:(e,t=new Date)=>h.getState().add(e,f(t))},p='This venue has used its fair-usage allowance of 1,000 voice tasks for this month. It starts again on the 1st. Food safety logging still works, and the owner can contact CoverCharge if you need more.',v=e=>e.line+'. That\u2019s '+Math.round(100*e.pct)+'% of this venue\u2019s fair-usage allowance.'},1435,[808,815,818]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useVoiceKeys",{enumerable:!0,get:function(){return e}}),_e.installVoiceKeys=function(){if('undefined'==typeof window||!window.addEventListener)return()=>{};let n=!1;const o=o=>(o.metaKey||o.ctrlKey)&&o.shiftKey&&'g'===o.key.toLowerCase()?(o.preventDefault(),void(o.repeat||e.getState().send('toggle'))):!o.metaKey&&!o.ctrlKey||o.shiftKey||'/'!==o.key?void('Space'!==o.code||o.metaKey||o.ctrlKey||o.altKey||t(o.target)||(o.preventDefault(),o.repeat||n||(n=!0,e.getState().send('start')))):(o.preventDefault(),void e.getState().send('type')),s=t=>{'Space'===t.code&&n&&(t.preventDefault(),n=!1,e.getState().send('stop'))},l=()=>{n&&(n=!1,e.getState().send('stop'))};return window.addEventListener('keydown',o,!0),window.addEventListener('keyup',s,!0),window.addEventListener('blur',l),()=>{window.removeEventListener('keydown',o,!0),window.removeEventListener('keyup',s,!0),window.removeEventListener('blur',l)}};const e=(0,r(d[0]).create)((e,t)=>({last:null,send:n=>e({last:{cmd:n,n:(t().last?.n??0)+1}})})),t=e=>{const t=e?.tagName;return'INPUT'===t||'TEXTAREA'===t||'SELECT'===t||!!e?.isContentEditable}},1436,[815]); -__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=u(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),k=[],A=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);if(i.includes(c))continue;k.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0});const u='st-jack'===t?{auto:'rota'}:{};d=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:f(d,23.5)}:void 0,...u}):d===y&&e<=m&&A.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:f(d,u.auto?e:e-.05),inSite:!0,...u})}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!k.some(e=>e.staffId===t.staffId&&e.date===t.date)),...k],attendance:[...S.attendance,...A]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:f(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:f((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',u=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,f=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1437,[848,800,865,1024,15,997,846]); -__d(function(e,s,o,p,t,a,n){"use strict";t.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},1438,[]); -__d(function(s,o,p,e,d,t,c){"use strict";d.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},1439,[]); -__d(function(o,s,p,e,d,t,f){"use strict";d.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},1440,[]); -__d(function(o,s,p,d,e,t,n){"use strict";e.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},1441,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1442,[30,34,846,25]); -__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 t.Head}});const t=(n=r(d[0]),c=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(c,t)||Object.defineProperty(c,t,{enumerable:!0,get:function(){return n[t]}})}),n);var n,c},1443,[1444]); -__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var c in n)Object.defineProperty(t,c,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,c).get})})(e,{get Head(){return u},get default(){return s}});const n=r(d[1]),c=r(d[2]);function o({children:c}){return(0,t().jsx)(n.Helmet,{children:c})}const u=({children:n})=>(0,c.useIsFocused)()?(0,t().jsx)(o,{children:n}):null;u.Provider=n.HelmetProvider;const s=u},1444,[25,1445,591]); -__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>fe,HelmetData:()=>se,HelmetProvider:()=>oe}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[0])),T=u(r(d[0])),A=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(A||{}),O={rel:["amphtml","canonical","alternate"]},C={type:["application/ld+json"]},w={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x=Object.values(A),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},$=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",k="defaultTitle",S="defer",E="encodeSpecialCharacters",M="onChangeClientState",P="titleTemplate",H="prioritizeSeoTags",D=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},L=t=>{let n=D(t,"title");const s=D(t,P);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=D(t,k);return n||i||void 0},I=t=>D(t,M)||(()=>{}),U=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),N=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;it.push(n));const l=Object.keys(o);for(let t=0;t{if(Array.isArray(t)&&t.length)for(let s=0;sArray.isArray(t)?t.join(""):t,z=(t,n)=>{const s=Object.keys(t);for(let i=0;iArray.isArray(t)?t.reduce((t,s)=>(z(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},F=(t,n)=>({...t,[n]:void 0}),Y=["noscript","script","style"],K=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),G=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${K(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),W=(t,n,s,i)=>{const o=G(s),l=R(n);return o?`<${t} ${j}="true" ${o}>${K(l,i)}`:`<${t} ${j}="true">${K(l,i)}`},J=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${K(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===Y.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}`}`},""),Q=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),V=(t,n,s)=>{const i=Q(s,{key:n,[j]:!0});return[T.default.createElement("title",i,n)]},X=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),T.default.createElement(t,i)}),Z=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>V(0,n.title,n.titleAttributes),toString:()=>W(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Q(n),toString:()=>G(n)};default:return{toComponent:()=>X(t,n),toString:()=>J(t,n,s)}}},ee=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=B(t,w),l=B(n,O),c=B(s,C);return{priorityMethods:{toComponent:()=>[...X("meta",o.priority),...X("link",l.priority),...X("script",c.priority)],toString:()=>`${Z("meta",o.priority,i)} ${Z("link",l.priority,i)} ${Z("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},te=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=ee(t)),{priority:T,base:Z("base",n,i),bodyAttributes:Z("bodyAttributes",s,i),htmlAttributes:Z("htmlAttributes",o,i),link:Z("link",y,i),meta:Z("meta",f,i),noscript:Z("noscript",l,i),script:Z("script",b,i),style:Z("style",c,i),title:Z("title",{title:p,titleAttributes:u},i)}},re=[],ne=!("undefined"==typeof window||!window.document||!window.document.createElement),se=class{instances=[];canUseDOM=ne;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?re:this.instances,add:t=>{(this.canUseDOM?re:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?re:this.instances).indexOf(t);(this.canUseDOM?re:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=te({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ie=b.default.createContext({}),oe=class t extends b.Component{static canUseDOM=ne;constructor(n){super(n),this.helmetData=new se(this.props.context||{},t.canUseDOM)}render(){return b.default.createElement(ie.Provider,{value:this.helmetData.value},this.props.children)}},ae=r(d[0]),le=(t,n)=>{if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;const s=Object.keys(t),i=Object.keys(n);return s.length===i.length&&s.every(s=>Object.prototype.hasOwnProperty.call(n,s)&&t[s]===n[s])},ce=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},pe=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},ue=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=R(t)),pe("title",n)},de=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;pe("body",i),pe("html",o),ue(f,b);const T={baseTag:ce("base",s),linkTags:ce("link",l),metaTags:ce("meta",c),noscriptTags:ce("noscript",p),scriptTags:ce("script",h),styleTags:ce("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},he=null,me=t=>{he&&cancelAnimationFrame(he),t.defer?he=requestAnimationFrame(()=>{de(t,()=>{he=null})}):(de(t),he=null)},ye=class extends ae.Component{rendered=!1;shouldComponentUpdate(t){return!le(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:N(["href"],o),bodyAttributes:U("bodyAttributes",o),defer:D(o,S),encode:D(o,E),htmlAttributes:U("htmlAttributes",o),linkTags:q("link",["rel","href"],o),metaTags:q("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:q("noscript",["innerHTML"],o),onChangeClientState:I(o),scriptTags:q("script",["src","innerHTML"],o),styleTags:q("style",["cssText"],o),title:L(o),titleAttributes:U("titleAttributes",o),prioritizeSeoTags:_(o,H)});var o;oe.canUseDOM?me(i):te&&(s=te(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},fe=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(F(this.props,"helmetData"),F(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){if(!x.some(n=>t.type===n))throw new Error("function"==typeof t.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`);if(n&&"string"!=typeof n&&(!Array.isArray(n)||n.some(t=>"string"!=typeof t)))throw new Error(`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`} ) Refer to our API for more information.`);return!0}mapChildrenToProps(t,n){let s={};return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[$[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof se)){i=new se(i.context,!0),delete s.helmetData}return i?y.default.createElement(ye,{...s,context:i.value}):y.default.createElement(ie.Consumer,null,t=>y.default.createElement(ye,{...s,context:t}))}}},1445,[34,172]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1446,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";function t(){const e=r(d[0]);return t=function(){return e},e}function e(){const t=r(d[1]);return e=function(){return t},t}function n(){const t=f(r(d[2]));return n=function(){return t},t}function o(){const t=r(d[3]);return o=function(){return t},t}Object.defineProperty(_e,"__esModule",{value:!0}),Object.defineProperty(_e,"renderRootComponent",{enumerable:!0,get:function(){return y}});const u=f(r(d[4]));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}function f(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=c(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var s=u?Object.getOwnPropertyDescriptor(t,f):null;s&&(s.get||s.set)?Object.defineProperty(o,f,s):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o}function s(t){if('[object Object]'!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function p(t){return t&&'object'==typeof t&&'string'==typeof t.name&&'string'==typeof t.message}function l(t){return p(t)?t:s(t)?new Error(JSON.stringify(t)):new Error(String(t))}function y(c){try{setTimeout(()=>{u._internal_preventAutoHideAsync?.()}),n().startTransition(()=>{(0,e().registerRootComponent)(c)})}catch(n){u.hideAsync();const c=l(n);(0,e().registerRootComponent)(()=>(0,t().jsx)(o().View,{})),console.error(c),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw c})}}},1447,[25,499,34,270,651]); +__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.CarGate=function(){const e=(0,u.useSession)(e=>e.meId),[t,o]=(0,r.useState)(u.useSession.persist.hasHydrated());return(0,r.useEffect)(()=>{const e=u.useSession.persist.onFinishHydration(()=>o(!0));return u.useSession.persist.hasHydrated()&&o(!0),e},[]),t?e||x.PITCH?null:(0,b.jsx)(T,{}):(0,b.jsx)(s.default,{style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=_r(d[1]),n=e(_r(d[2])),s=e(_r(d[3])),o=e(_r(d[4])),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),f=_r(d[11]),y=_r(d[12]),j=_r(d[13]),b=_r(d[14]);let w=null,M=null;async function I(e){return!e&&M&&Date.now()-M.at<6e4&&new Date(M.r.expiresAt).getTime()-Date.now()>12e4?M.r:w||(w=(0,h.carPairStart)().then(e=>(e.ok&&(M={r:e,at:Date.now()}),e)).finally(()=>{w=null}),w)}function T(){const{width:e,height:u}=(0,o.default)(),[x,w]=(0,r.useState)(null),[M,T]=(0,r.useState)('starting'),[C,D]=(0,r.useState)(''),[k,z]=(0,r.useState)(0),S=(0,r.useRef)(!1),P=(0,r.useCallback)(async(e=!0)=>{if(S.current)return;S.current=!0,T('starting'),D('');const t=await I(e);if(S.current=!1,!t.ok)return T('error'),void D(t.error);w({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),T('waiting')},[]);(0,r.useEffect)(()=>{P(!1)},[]),(0,r.useEffect)(()=>{if(!x||'waiting'!==M)return;const e=setInterval(async()=>{z(Math.max(0,Math.round((x.until-Date.now())/1e3)));('expired'===await(0,h.carPairPoll)(x.id)||Date.now()>x.until)&&T('expired')},3e3);return()=>clearInterval(e)},[x,M]);const H=Math.min(120,Math.max(64,Math.round(Math.min(e/9,u/7)))),v=x?.code??'',F=v?`${v.slice(0,3)} ${v.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,b.jsxs)(s.default,{testID:"car-pairing",style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:[(0,b.jsx)(t.CarFullscreenButton,{place:"corner"}),(0,b.jsxs)(s.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:u<820?10:16},children:[(0,b.jsx)(c.RestaurantLogo,{rid:p.VENUE_RID,size:u<820?64:88}),(0,b.jsx)(l.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,b.jsx)(j.ParkedOnly,{}),'waiting'===M||'starting'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,b.jsx)(s.default,{testID:"car-code",accessible:!0,accessibilityLabel:v?`Car code ${(0,y.spokenCode)(v)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,b.jsx)(l.T,{center:!0,size:H,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:H/8,lineHeight:1.2*H},children:F})}),v?(0,b.jsx)(l.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,b.jsxs)(s.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,b.jsx)(l.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,b.jsx)(s.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,b.jsx)(l.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{P()},style:{minHeight:64,minWidth:200}})})]}):'expired'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{P()},style:{minHeight:64,minWidth:280}})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,b.jsx)(l.Muted,{center:!0,children:C}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{P()},style:{minHeight:64,minWidth:240}})]}),C&&'error'!==M?(0,b.jsx)(l.T,{center:!0,colour:f.colours.amber,children:C}):null,(0,b.jsx)(l.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})]})}},1411,[1412,34,41,102,426,794,847,997,985,2,5,840,1413,1414,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,"FS_KEY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"FS_BUTTON_H",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"NOT_ALLOWED",{enumerable:!0,get:function(){return b}}),_e.useCarViewport=function(){(0,t.useEffect)(()=>{if(!u)return;const e=document.documentElement,t=document.body,n=[e.style.cssText,t.style.cssText];for(const n of[e.style,t.style])n.height='100%',n.margin='0',n.overflow='hidden',n.overscrollBehavior='none',n.touchAction='manipulation';return()=>{e.style.cssText=n[0],t.style.cssText=n[1]}},[])},_e.CarFullscreenButton=function({place:e="rail",width:E}){const[x,p]=(0,t.useState)(y),[L,T]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!u)return;const e=()=>{const e=y();p(e),e||v.set(f,null)};document.addEventListener('fullscreenchange',e),document.addEventListener('webkitfullscreenchange',e);let t='1'===v.get(f)&&!y();const n=()=>{t&&(t=!1,w())};return t&&(document.addEventListener('click',n,!0),document.addEventListener('touchend',n,!0)),()=>{document.removeEventListener('fullscreenchange',e),document.removeEventListener('webkitfullscreenchange',e),document.removeEventListener('click',n,!0),document.removeEventListener('touchend',n,!0)}},[]),(0,t.useEffect)(()=>{if(!L)return;const e=setTimeout(()=>T(null),9e3);return()=>clearTimeout(e)},[L]);const F=(0,t.useCallback)(async()=>{if(T(null),y()){v.set(f,null);try{await((document.exitFullscreen??document.webkitExitFullscreen)?.call(document))}catch{}return}const e=window.innerHeight;await w()?(v.set(f,'1'),setTimeout(()=>{(!y()||window.innerHeight<=e+8)&&T(b)},900)):T(b)},[]);if(!u)return null;const k=x?'Exit full screen':'Full screen',j='corner'===e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{testID:"car-fullscreen",accessibilityRole:"button",accessibilityLabel:k,accessibilityHint:x?'Shows the browser bar again':'Hides the browser bar, if the car allows it',onPress:()=>{F()},style:[{minHeight:h,minWidth:j?220:void 0,width:j?void 0:E,alignSelf:j?void 0:'center',justifyContent:'center',alignItems:'center',paddingHorizontal:12,borderRadius:14,borderWidth:2,borderColor:o.colours.goldLight,backgroundColor:x?'#1d1708':o.colours.gold},j?{position:'fixed',top:12,right:12,zIndex:1200}:null],children:(0,s.jsx)(l.T,{size:j?20:17,weight:"bold",colour:x?o.colours.goldLight:'#1a1407',center:!0,numberOfLines:1,children:k})}),L?(0,s.jsx)(c.default,{testID:"car-fullscreen-msg",accessible:!0,accessibilityLiveRegion:"assertive",accessibilityLabel:L,style:{position:'fixed',top:j?76:12,right:j?12:220,maxWidth:420,zIndex:1300,padding:14,borderRadius:14,borderWidth:1.5,borderColor:o.colours.amber,backgroundColor:'#1d1708'},children:(0,s.jsx)(l.T,{size:17,center:!0,colour:"#FFE2A8",children:L})}):null]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),c=e(r(d[3])),l=r(d[4]),o=r(d[5]),s=r(d[6]);const u='undefined'!=typeof document,f='cc-car-fullscreen',h=56,b='The car\u2019s browser kept its address bar, so full screen isn\u2019t available here. The car screen already uses all the space it is given.',v={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}},y=()=>u&&!(!document.fullscreenElement&&!document.webkitFullscreenElement);async function w(){const e=document.documentElement,t=e.requestFullscreen??e.webkitRequestFullscreen;if(!t)return!1;try{return await t.call(e,{navigationUI:'hide'}),!0}catch{return!1}}},1412,[34,236,402,102,794,840,25]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=64;const l=s=>s.split('').join(' ')},1413,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1414,[34,102,794,840,25]); +__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1415,[986,857,856,985]); +__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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1416,[798,796,34,1338,1015,402,102,846,985,1007,1014,5,840,794,1282,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1417,[796,34,236,402,102,840,985,1045,2,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.VoiceHost=function(){const e=(0,f.useVoiceTarget)(),t=(0,f.useVoiceSlot)(e=>e.rect);g.PITCH&&(globalThis.__voiceExpect={app:e?.app??null,on:!!e?.on,slot:!!t});if(!e?.on||!t)return null;const n=(0,P.jsx)(X,{app:e.actions,ui:e.app},e.actions);if('undefined'!=typeof document){const{createPortal:e}=_r(d[33]);return e(n,document.body)}return n};var t=_r(d[0]),n=_r(d[1]),o=_r(d[2]),r=e(_r(d[3])),s=e(_r(d[4])),i=e(_r(d[5])),a=e(_r(d[6]));_r(d[7]);var l=e(_r(d[8])),c=e(_r(d[9])),u=e(_r(d[10])),h=e(_r(d[11])),p=_r(d[12]),f=_r(d[13]),g=_r(d[14]),y=_r(d[15]),m=e(y),w=_r(d[16]),x=_r(d[17]),b=_r(d[18]),v=_r(d[19]),k=_r(d[20]),j=_r(d[21]),T=_r(d[22]),R=_r(d[23]),C=_r(d[24]),S=_r(d[25]),I=_r(d[26]),M=_r(d[27]),E=_r(d[28]),H=_r(d[29]),z=_r(d[30]),D=_r(d[31]),P=_r(d[32]);const A='How many people?',$=['covers','partySize'],W=200,_=16e3,B=31e3,O='That took too long, so I stopped waiting. Hold the button and try again, or tap Type instead.',V='Something went wrong there. Hold the button and try again, or tap Type instead.',F='The microphone is blocked. Allow it in the browser\u2019s site settings, or tap the button to type instead.';function L(e,t){return'cap'===e?t?.message||E.REACHED_TEXT:'identity'===e||'app'===e?'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.':'not-allowed'===e?F:'audio-capture'===e?'I couldn\u2019t use the microphone on this device. Check nothing else is using it, then hold the button again, or tap Type instead.':'busy'===e?'Speech to text is busy just now. Hold the button and try again in a moment, or tap Type instead.':'soon'===e?'Speech to text is switching on soon. For now, tap the button to type instead.':'long'===e?'That was longer than 30 seconds. Hold the button and say it more briefly, or tap Type instead.':'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.'}function N({colour:e,size:t=34}){return(0,P.jsxs)(m.default,{width:t,height:t,viewBox:"0 0 24 24",children:[(0,P.jsx)(y.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:e}),(0,P.jsx)(y.Path,{d:"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7",stroke:e,strokeWidth:2,strokeLinecap:"round",fill:"none"})]})}const G={owner:['\u201cWalk-in fridge 3 degrees\u201d','\u201cMark the lobster sold out\u201d','\u201cHow many Covers tonight?\u201d','\u201cAdd blue roll to the Booker list\u201d'],staff:['\u201cMessage the team: running 10 minutes late\u201d','\u201cRead my messages\u201d','\u201cWhen\u2019s my next shift?\u201d','\u201cWhat are today\u2019s specials?\u201d','\u201cDoes the fish supper contain gluten?\u201d'],chef:['\u201cFreezer minus 19\u201d','\u201cMark the soup sold out\u201d','\u201cRead the orders\u201d','\u201cAdd onions to the Bidfood list\u201d'],display:['\u201cWalk-in fridge 3 degrees\u201d','\u201cRead the orders\u201d','\u201cAny room for 6 at 8?\u201d','\u201cRead the shift notes\u201d']};function X({app:e,ui:g}){const y=(0,w.useCtx)(6e4),m=(0,b.useOwner)(e=>e.staff),X=(0,I.useVoiceNav)(e=>e.go),{height:U}=(0,u.default)(),q=(0,f.useVoiceSlot)(e=>e.rect),K=q.size,Y=x.ROSTER.find(e=>'chef'===e.app),J='display'===e?'Main Display':'chef'===e?m.find(e=>e.id===Y?.id)?.name??'Head Chef':y.me,Q='display'===e?'display':'chef'===e?Y?.id??'chef':y.meId,Z={rid:y.rid,today:y.today,go:(e,t)=>X?.(e,t),app:e,who:J.replace(' (example)',''),whoId:Q,role:'owner'===g?y.role:e};(0,o.useEffect)(()=>{try{(0,T.setVenueWords)((0,R.venueKeyterms)(y.rid))}catch{}},[y.rid,m]);const[ee,te]=(0,o.useState)('idle'),[ne,oe]=(0,o.useState)(''),[re,se]=(0,o.useState)(0),[ie,ae]=(0,o.useState)(null),[le,de]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(''),[he,pe]=(0,o.useState)(!1),fe=(0,o.useRef)(null),ge=(0,o.useRef)(0),ye=(0,o.useRef)(null),me=(0,o.useRef)(Z);me.current=Z;const we=(0,o.useRef)(ie);we.current=ie;const xe=(0,o.useRef)(y.now);xe.current=y.now;const be=e=>{ae(e),te('answer')},ve=be,ke=async e=>{const t=++ge.current;let n;te('working');try{n=await(0,j.runAction)(e.id,e.params,me.current,!0)}catch{n={status:'error',message:V}}t===ge.current&&((0,H.buzz)([20,40,20]),ve({text:'needs_confirmation'===n.status?n.preview:n.message,tone:'error'===n.status?'warn':'ok'}))},je=()=>ve({text:'Cancelled. Nothing was changed.',tone:'info'}),Te=async(e,t,n)=>{const o=++ge.current,r={...e.params,[e.field]:t};let s;te('working');try{s=await(0,j.runAction)(e.id,r,me.current,!1)}catch{s={status:'error',message:V}}o===ge.current&&('needs_confirmation'===s.status?ve({heard:n,text:s.preview,pending:{id:e.id,params:r,preview:s.preview}}):ve({heard:n,text:s.message,tone:'error'===s.status?'warn':'ok'}))},Re=async(e,t)=>{const n=ge.current,o=e=>{n===ge.current&&be(e)};try{await Ce(e,o,t)}catch{o({heard:e.trim()||void 0,text:V,tone:'warn'})}},Ce=async(t,n,o)=>{const r=t.trim(),s=me.current;if(!r)return void n({text:'I didn\u2019t catch that. Hold the button while you speak, then let go.',tone:'info'});const i=we.current?.pending;if(i){const e=(0,H.yesNo)(r);if('yes'===e)return void await ke(i);if('no'===e)return void je()}const a=we.current?.ask;if(a){const e=(0,D.coversAnswer)(r);if(e&&e<=30)return void await Te(a,e,r)}te('working');const l=(0,j.matchIntent)(r,s.today,{app:e,rid:s.rid,whoId:s.whoId}),c=xe.current;if(!E.voiceUsage.allowed(s.rid,'action'===l.kind?l.action.id:null,c))return void n({heard:r,text:E.REACHED_TEXT,tone:'info'});E.voiceUsage.record(s.rid,c);const u=E.voiceUsage.get(s.rid,c),h=u.reached?E.REACHED_TEXT:u.warn?(0,E.WARN_TEXT)(u):void 0,p=e=>n({...e,note:h});if('action'===l.kind){const e=l.action,t=e.params.filter(e=>e.required&&(void 0===l.params[e.name]||''===l.params[e.name]||'[]'===l.params[e.name]));if(1===t.length&&$.includes(t[0].name))return void p({heard:r,text:A,ask:{id:e.id,params:l.params,field:t[0].name},tone:'info'});if(t.length)return void p({heard:r,text:e.preview(l.params,s)+(/\?$/.test(e.preview(l.params,s))||/couldn|didn/.test(e.preview(l.params,s))?'':` I still need: ${t.map(e=>e.description.toLowerCase()).join('; ')}.`)+' Hold the button and try again.',tone:'warn'});const n=await(0,j.runAction)(e.id,l.params,s,!1);return void('needs_confirmation'===n.status?p({heard:r,text:n.preview,pending:{id:e.id,params:l.params,preview:n.preview}}):p({heard:r,text:n.message,tone:'error'===n.status?'warn':'ok'}))}const f=` ${r.toLowerCase()} `,g=e=>{const t=(0,j.actionById)(e);if(!t)return 0;try{return t.match?t.match(f):t.keywords.filter(e=>f.includes(e)).length}catch{return 0}},y=()=>(0,j.toolSpecs)().filter(t=>{const n=(0,j.actionById)(t.function.name);return!!n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))}).map((e,t)=>({t:e,i:t,s:g(e.function.name)})).sort((e,t)=>t.s-e.s||e.i-t.i).slice(0,60).map(e=>e.t),m=async t=>{if('call'===t.kind){const n=(0,j.actionById)(t.name);if(n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))){const e=n.params.filter(e=>e.required&&(void 0===t.args[e.name]||''===t.args[e.name]));if(1===e.length&&$.includes(e[0].name))return p({heard:r,text:A,ask:{id:n.id,params:t.args,field:e[0].name},tone:'info'}),!0;const o=await(0,j.runAction)(n.id,t.args,s,!1);return'needs_confirmation'===o.status?p({heard:r,text:o.preview,pending:{id:n.id,params:t.args,preview:o.preview}}):p({heard:r,text:o.message,tone:'error'===o.status?'warn':'ok'}),!0}}return'text'===t.kind&&(p({heard:r,text:(0,j.moneySafe)(e,s.role)?(0,j.noMoney)(t.text):t.text,tone:'info'}),!0)};if('help'===l.kind){const t=l.ids.map(C.helpById).filter(Boolean)[0];if(!(((0,S.searchHelp)(C.HELP,r,1)[0]?.score??0)>=2.5)){const n=await(0,T.askServer)(e,r,y(),o);if(await m(n))return;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(`${t.title}. ${t.body}`)?void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}.`,tone:'info'}):void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}. This guide might help: ${t.title}.`,help:l.ids,tone:'info'})}const n=`${t.title}. ${t.body}`;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(n)?void p({heard:r,text:'That isn\u2019t shown here. Ask a manager in the Managers app.',tone:'info'}):void p({heard:r,text:n,help:l.ids,tone:'info'})}await m(await(0,T.askServer)(e,r,y(),o))||p({heard:r,text:T.SOON_TEXT+' '+G[e].slice(0,2).join(' or ')+'.',tone:'info'})},Se=()=>{fe.current?.abort(),fe.current=null,ye.current?.(),ye.current=null,se(0)};(0,o.useEffect)(()=>()=>{fe.current?.abort(),ye.current?.()},[]);const Ie=async()=>{if(!(0,H.canListen)())return de(!0),void ve({text:(0,H.tabletWithoutMic)()?'This Display tablet app needs an update before it can use the microphone. For now, type below.':'This browser can\u2019t record speech. Type instead below.',tone:'info'});if((0,H.desktopStt)()){if(!(0,M.micExplainedFor)(g))return void pe(!0)}else{const e=await(0,H.micPermission)();if('granted'===e)(0,M.setMicExplainedFor)(g);else{if('denied'===e)return de(!0),void ve({text:F,tone:'warn'});if(!(0,M.micExplainedFor)(g))return void pe(!0)}}if(!He.current.holding&&!Ee.current)return;const t=++ge.current;(0,H.buzz)(35),oe(''),ae(null),de(!1),te('listening');if(fe.current=(0,H.listen)(oe,(e,n,o)=>{if(ye.current?.(),ye.current=null,se(0),fe.current=null,t===ge.current){if('not-allowed'!==n&&'service-not-allowed'!==n)return'stt-failed'===n?(ve({text:'Speech to text didn\u2019t start on this Mac. Type instead below; restarting the app usually fixes it.',tone:'warn'}),void de(!0)):void(n?ve({text:L(n,o),tone:'cap'===n?'info':'warn'}):Re(e,o?.receipt));ve({text:(0,H.desktopStt)()?'The microphone is blocked for CoverCharge. Open System Settings \u203a Privacy & Security \u203a Microphone, switch on CoverCharge for Mac, then try again. Or type instead.':F,tone:'warn'})}},e,se),!fe.current)return te('idle'),void de(!0);if((0,H.desktopStt)()){const e=await(0,H.levelMeter)(se);fe.current?ye.current=e:e()}},Me=()=>{fe.current&&(te('working'),fe.current.stop(),ye.current?.(),ye.current=null,se(0))},Ee=(0,o.useRef)(!1),He=(0,o.useRef)({timer:0,holding:!1}),ze=(0,o.useRef)(Ie);ze.current=Ie;const De=(0,o.useRef)(Me);De.current=Me;const Pe=(0,o.useMemo)(()=>a.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>{const e=He.current;e.holding=!1,(0,M.micExplainedFor)(g)&&(0,H.warmMic)(),e.timer=setTimeout(()=>{e.holding=!0,ze.current()},W)},onPanResponderRelease:()=>{const e=He.current;if(clearTimeout(e.timer),e.holding)return e.holding=!1,void De.current();(0,H.disarmMic)(),de(!0),te(e=>'idle'===e?'answer':e)},onPanResponderTerminate:()=>{const e=He.current;clearTimeout(e.timer),e.holding&&(e.holding=!1,De.current())}}),[e]);(0,o.useRef)(ee).current=ee,(0,o.useEffect)(()=>z.useVoiceKeys.subscribe((e,t)=>{const n=e.last;if(!n||n.n===t.last?.n)return;const o=!!fe.current;'start'!==n.cmd||o?'stop'===n.cmd?(Ee.current=!1,o&&De.current()):'toggle'===n.cmd?o?(Ee.current=!1,De.current()):(Ee.current=!0,ze.current()):'type'===n.cmd&&(de(!0),te(e=>'idle'===e?'answer':e)):(Ee.current=!0,ze.current())}),[]);const Ae=K>=64,$e=(0,o.useRef)(new s.default.Value(0)).current;(0,o.useEffect)(()=>{if('listening'!==ee)return $e.stopAnimation(),void $e.setValue(0);const e=s.default.loop(s.default.timing($e,{toValue:1,duration:1100,easing:i.default.out(i.default.quad),useNativeDriver:!1}));return e.start(),()=>e.stop()},[ee]);const We='listening'===ee,Be='answer'===ee&&(ie||le)||'working'===ee||We,Oe=()=>{ge.current++,Se(),ae(null),de(!1),ue(''),te('idle')};(0,o.useEffect)(()=>{if('working'!==ee&&'listening'!==ee)return;const e=ge.current,t=setTimeout(()=>{e===ge.current&&('listening'!==ee?(ge.current++,Se(),de(!0),be({heard:ne&&!/\u2026$/.test(ne)?ne:void 0,text:O,tone:'warn'})):De.current())},'working'===ee?_:B);return()=>clearTimeout(t)},[ee]);const Ve=()=>{const e=ce.trim();e&&(ue(''),oe(e),ge.current++,Re(e))},Fe='fixed',Le={top:q.y+K+8},Ne=$e.interpolate({inputRange:[0,1],outputRange:[1,1.7]}),Ge=$e.interpolate({inputRange:[0,1],outputRange:[.6,0]}),Xe='warn'===ie?.tone?k.colours.amber:ie?.pending?k.colours.gold:k.colours.border;return(0,P.jsxs)(P.Fragment,{children:[Be?(0,P.jsx)(h.default,{testID:"voice-panel",style:[{position:Fe,left:12,right:12,alignItems:'flex-end',zIndex:60},Le],pointerEvents:"box-none",children:(0,P.jsxs)(h.default,{style:{width:'100%',maxWidth:Ae?720:520,backgroundColor:k.colours.surface,borderRadius:16,borderWidth:2,borderColor:Xe,padding:Ae?20:14,gap:10,maxHeight:U*(Ae?.78:.6)},children:[(0,P.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.gold,accessibilityRole:"header",children:We?Ae?'Listening\u2026 let go (or press \u2318\u21e7G) to send':'Listening\u2026 let go to send':'working'===ee?'Working on it\u2026':ie?.pending?'Please confirm':'Voice assistant'}),(0,P.jsx)(l.default,{testID:"voice-close",accessibilityRole:"button",accessibilityLabel:"Close voice assistant",hitSlop:12,onPress:Oe,style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:20,colour:k.colours.muted,children:"\u2715"})})]}),(0,P.jsx)(v.T,{testID:"voice-reply-mode",size:14,colour:k.colours.muted,children:"Text replies only"}),We?(0,P.jsxs)(h.default,{style:{gap:8},children:[(0,P.jsx)(h.default,{style:{height:10,borderRadius:5,backgroundColor:k.colours.surface2,overflow:'hidden'},children:(0,P.jsx)(h.default,{testID:"voice-level",style:{width:`${Math.round(8+92*re)}%`,height:10,backgroundColor:k.colours.ok}})}),(0,P.jsx)(v.T,{size:16,children:ne||'Say it now\u2026'})]}):null,'working'===ee?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(r.default,{color:k.colours.gold}),(0,P.jsx)(v.T,{size:15,colour:k.colours.muted,children:ne?/\u2026$/.test(ne)?ne:`\u201c${ne}\u201d`:''})]}):null,'working'===ee||We?(0,P.jsx)(v.Button,{testID:"voice-stop",kind:"secondary",label:"Cancel",onPress:()=>{ge.current++,Se(),de(!1),be({text:'Stopped. Nothing was changed.',tone:'info'})},style:{minHeight:48}}):null,'answer'===ee&&ie?(0,P.jsxs)(c.default,{style:{maxHeight:U*(Ae?.55:.36)},contentContainerStyle:{gap:8},children:[ie.heard?(0,P.jsx)(h.default,{testID:"voice-heard",accessible:!0,accessibilityLabel:`I heard: ${ie.heard}`,children:(0,P.jsxs)(v.T,{size:Ae?16:14,colour:k.colours.muted,children:["I heard: \u201c",ie.heard,"\u201d"]})}):null,ie.note?(0,P.jsx)(h.default,{testID:"voice-usage-note",children:(0,P.jsx)(v.T,{size:13,colour:k.colours.amber,children:ie.note})}):null,(0,P.jsx)(h.default,{testID:"voice-answer",children:(0,P.jsx)(v.T,{size:Ae?24:18,weight:ie.pending?'semibold':'regular',children:ie.text})}),ie.help&&'owner'===e&&X?ie.help.slice(0,3).map(e=>{const t=(0,C.helpById)(e);return t?(0,P.jsx)(v.Button,{small:!0,kind:"secondary",label:`Open help: ${t.title}`,onPress:()=>{X('more','help'),Oe()}},e):null}):null]}):null,'answer'===ee&&ie?.ask?(0,P.jsx)(h.default,{testID:"voice-how-many",style:{flexDirection:'row',flexWrap:'wrap',gap:10},children:[1,2,3,4,5,6,7,8].map(e=>(0,P.jsx)(l.default,{testID:`voice-covers-${e}`,accessibilityRole:"button",accessibilityLabel:1===e?'1 person':`${e} people`,onPress:()=>{Te(ie.ask,e)},style:{width:Ae?96:72,height:Ae?96:72,borderRadius:14,backgroundColor:k.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:Ae?40:32,weight:"semibold",colour:k.colours.onGold,children:e})},e))}):null,'answer'===ee&&ie?.pending?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(v.Button,{testID:"voice-confirm",kind:"success",label:"Confirm",onPress:()=>{ke(ie.pending)},style:{flex:1,minHeight:56}}),(0,P.jsx)(v.Button,{testID:"voice-cancel",kind:"secondary",label:"Cancel",onPress:je,style:{flex:1,minHeight:56}})]}):null,'answer'!==ee||ie?.pending?null:(0,P.jsxs)(h.default,{style:{gap:6},children:[le||!(0,H.canListen)()?(0,P.jsxs)(v.Row,{gap:8,children:[(0,P.jsx)(n.TextInput,{testID:"voice-type",value:ce,onChangeText:ue,onSubmitEditing:Ve,placeholder:"Type instead\u2026",placeholderTextColor:k.colours.muted,autoFocus:!0,returnKeyType:"send",style:{flex:1,minWidth:0,width:0,minHeight:48,borderRadius:10,borderWidth:1,borderColor:k.colours.border,backgroundColor:k.colours.surface2,color:k.colours.text,paddingHorizontal:12,fontFamily:k.fonts.regular,fontSize:16}}),(0,P.jsx)(v.Button,{testID:"voice-send",kind:"success",label:"Ask",onPress:Ve,disabled:!ce.trim()})]}):(0,P.jsx)(l.default,{accessibilityRole:"button",onPress:()=>de(!0),children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"Type instead"})}),ie?null:(0,P.jsxs)(v.T,{size:Ae?15:13,colour:k.colours.muted,children:[Ae?'Hold Space (or the gold button) and speak, or press \u2318\u21e7G to start and again to send. ':'Hold the gold button and speak, for example ',Ae?`For example ${G[e].join(', ')}.`:`${G[e].join(', ')}.`]}),'owner'===g&&'owner'===e?(0,P.jsx)(l.default,{testID:"voice-open-assistant",accessibilityRole:"button",onPress:()=>{Oe(),p.useAssistantUi.getState().setOpen(!0)},style:{minHeight:44,justifyContent:'center'},children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"\u2726 Open the Assistant (ideas, history and longer requests) \u203a"})}):null]})]})}):null,(0,P.jsxs)(h.default,{style:{position:Fe,left:`clamp(0px, ${q.x}px, calc(100vw - ${K}px))`,top:q.y,width:K,height:K,zIndex:61},pointerEvents:"box-none",children:[We?(0,P.jsx)(s.default.View,{pointerEvents:"none",style:{position:'absolute',left:0,top:0,width:K,height:K,borderRadius:K/2,borderWidth:4,borderColor:k.colours.ok,opacity:Ge,transform:[{scale:Ne}]}}):null,We?(0,P.jsx)(h.default,{pointerEvents:"none",style:{position:'absolute',left:-6,top:-6,width:K+12,height:K+12,borderRadius:(K+12)/2,borderWidth:3+Math.round(7*re),borderColor:k.colours.ok}}):null,(0,P.jsx)(h.default,{testID:"voice-button",accessible:!0,accessibilityRole:"button",accessibilityLabel:'owner'===g&&'owner'===e?'Voice assistant and Assistant. Hold to talk, let go to send. Tap to type or open the Assistant.':'Voice assistant. Hold to talk, let go to send. Tap to type instead.',...Pe.panHandlers,style:[{width:K,height:K,borderRadius:K/2,alignItems:'center',justifyContent:'center',backgroundColor:We?k.colours.ok:k.colours.gold,borderWidth:2,borderColor:k.colours.bg},{userSelect:'none',WebkitUserSelect:'none',WebkitTouchCallout:'none',touchAction:'none',cursor:'pointer'}],children:['kirkton','abbotsford'].includes(t.VENUE_RID)?(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.onGold,children:'working'===ee?'Wait':'Talk'}):'working'===ee?(0,P.jsx)(r.default,{color:k.colours.onGold,size:"large"}):(0,P.jsx)(N,{colour:k.colours.onGold,size:Math.round(.5*K)})})]}),(0,P.jsx)(v.Sheet,{visible:he,onClose:()=>{(0,M.setMicExplainedFor)(g),pe(!1)},title:"Talk to CoverCharge",testID:"voice-explain",children:(0,P.jsxs)(h.default,{style:{gap:10},children:[(0,P.jsxs)(v.T,{children:["Hold the gold button, say what you need, then let go. For example ",G[e].slice(0,3).join(', '),"."]}),(0,P.jsx)(v.T,{children:(0,H.desktopStt)()?'Your Mac will now ask once to let CoverCharge use the microphone. It only listens while you hold the button.':'Your device will now ask once to use the microphone. It only listens while you hold the button, for up to 30 seconds.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:(0,H.desktopStt)()?'On this Mac, speech is turned into text on the Mac itself, so what you say isn\u2019t sent anywhere. CoverCharge doesn\u2019t keep the audio.':'What you say while holding is sent to Grok (xAI) to be turned into text. CoverCharge doesn\u2019t keep the audio.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:"The helper replies in text only, never aloud. Any change is shown in text first, with Confirm and Cancel buttons; you can also say \u201cyes\u201d. Orders to suppliers, messages and payments are only ever saved as drafts for the owner."}),(0,P.jsx)(v.Button,{testID:"voice-allow",kind:"success",label:"Allow microphone",onPress:async()=>{(0,M.setMicExplainedFor)(g),pe(!1);const e=!!(0,H.desktopStt)()||await(0,H.askMic)();if((0,H.desktopStt)()){(await(0,H.levelMeter)(()=>{}))()}ve(e?{text:'Ready. Now hold the button and speak.',tone:'ok'}:{text:F,tone:'warn'})}}),(0,P.jsx)(v.Button,{kind:"secondary",label:"Type instead",onPress:()=>{(0,M.setMicExplainedFor)(g),pe(!1),de(!0),te('answer')}})]})})]})}},1418,[5,796,34,385,283,364,380,236,402,295,426,102,1419,1116,2,900,1100,15,865,794,840,1420,930,1434,1430,1431,1435,1117,1436,929,1437,1433,25,277]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ASSISTANT_AVAILABLE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"useAssistantUi",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"AssistantFab",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"AssistantSheet",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"AssistantPage",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"AssistantSettings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"AssistantPlanCard",{enumerable:!0,get:function(){return c}});const t=!1,n={getState:()=>({open:!1,setOpen:t=>{}})},u=()=>null,s=()=>null,l=()=>null,o=()=>null,c=()=>null},1419,[]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1420,[1421,1098,829,1424,1425,865,848,1014,1429,1430,1431,1427,1426,1432,1433,1012,1013]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1421,[1422,1423,1038]); +__d(function(g,r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_LABEL",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HISTORY_NOTE",{enumerable:!0,get:function(){return o}}),e.validPastDate=n,Object.defineProperty(e,"ukHistoryDate",{enumerable:!0,get:function(){return s}}),e.parseHistoryInput=function(t){const o=t.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(o))return o;const n=/^(\d{1,2})[\s/.-]+(\d{1,2})[\s/.-]+(\d{4})$/.exec(o);if(!n)return;const s=`${n[3]}-${n[2].padStart(2,'0')}-${n[1].padStart(2,'0')}`,d=new Date(s+'T12:00:00Z');return Number.isNaN(d.getTime())||d.toISOString().slice(0,10)!==s?void 0:s},e.exactHistoryDate=function(t,o){if(1!==(t.match(/\b(?:\d{4}-\d{2}-\d{2}|\d{1,2}\/\d{1,2}\/\d{4}|\d{1,2}(?:st|nd|rd|th)?\s+[a-z]+\s+\d{4})\b/gi)??[]).length)return;const s=t.match(/\b(\d{4}-\d{2}-\d{2})\b/);let d=s?.[1];if(!d){const o=t.match(/\b(\d{1,2})\/(\d{1,2})\/(\d{4})\b/);o&&(d=`${o[3]}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`)}if(!d){const o=t.toLowerCase().match(/\b(\d{1,2})(?:st|nd|rd|th)?\s+(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)\s+(\d{4})\b/),n=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'];o&&(d=`${o[3]}-${String(n.indexOf(o[2].slice(0,3))+1).padStart(2,'0')}-${o[1].padStart(2,'0')}`)}return d&&n(d,o)?d:void 0},Object.defineProperty(e,"historyDateLabel",{enumerable:!0,get:function(){return d}}),e.bookingDayText=function(t){const n=`Booked covers on ${d(t.date)}: ${null===t.booked_covers?'not recorded':t.booked_covers}.`,s=t.bookings.map(t=>`${t.time??'Time not recorded'}: party size ${null===t.covers?'not recorded':`${t.covers} Covers`}; ${t.table?`table ${t.table}`:'table not recorded'}; ${t.status??'status not recorded'}${t.counted?'':', excluded from Booked covers'}.`);return[n,...s,t.historical_records?"Includes previous booking system history (incomplete).":'',o,t.bookings.length?'':'No booking records found; incomplete history does not prove there were no bookings.',t.missing_covers?`${t.missing_covers} booking records have no party size; left blank.`:''].filter(Boolean).join(' ')};const t='Includes previous booking system history (incomplete)',o='Recovered booking records, not confirmed attendance. Cancelled bookings are shown but excluded from Booked covers.';function n(t,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;const n=new Date(t+'T12:00:00Z');return!Number.isNaN(n.getTime())&&n.toISOString().slice(0,10)===t&&t{const[o,n,s]=t.split('-');return`${s} ${n} ${o}`};const d=t=>new Date(t+'T12:00:00Z').toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'Europe/London'})},1422,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.historyAccess=c,_e.lookupBookingDay=l,_e.useHistoricalBookingDay=function(t,o,u,y=0){const k=(0,s.useSync)(e=>[e.kind,e.venueId,e.venueSlug,e.perms.join(',')].join(':')),f=c(t),h=f&&(0,n.validPastDate)(o,u)?`${k}:${o}:${y}`:'',[w,p]=(0,e.useState)({key:'',data:null,error:''});return(0,e.useEffect)(()=>{if(!h)return void p({key:'',data:null,error:''});let e=!0;return l(t,o).then(t=>{e&&p({key:h,data:t,error:''})}).catch(t=>{e&&p({key:h,data:null,error:t.message})}),()=>{e=!1}},[h,t,o]),{allowed:f,data:h&&w.key===h?w.data:null,error:h&&w.key===h?w.error:''}};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]);function c(e){const n=s.useSync.getState();return'owner'===t.APP_VARIANT&&'staff'===n.kind&&n.venueSlug===e&&!!n.venueId&&(n.perms.includes('*')||n.perms.includes('staff.manage'))}async function l(e,t){if(!c(e))throw new Error('Sign in to the Managers app with manager or owner access to Look back.');if(!(0,n.validPastDate)(t,(0,o.venueYmd)(new Date)))throw new Error('Choose an exact past date, with day, month and year.');const l=(0,u.getSupabase)(),{data:y,error:k}=await l.rpc('historical_booking_day',{p_venue:s.useSync.getState().venueId,p_date:t});if(k||!y||!Array.isArray(y.bookings))throw new Error('Booking history could not be loaded. Reconnect and try again.');return y}},1423,[34,846,1422,827,985,931]); +__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"niceDay",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"appNow",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"num",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"tableIn",{enumerable:!0,get:function(){return L}}),e.resolveTable=q,Object.defineProperty(e,"tokensOf",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"hm",{enumerable:!0,get:function(){return x}}),e.findBooking=A,Object.defineProperty(e,"staffOf",{enumerable:!0,get:function(){return me}}),Object.defineProperty(e,"findCard",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(e,"allergenList",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(e,"OPS_VOICE_ACTIONS",{enumerable:!0,get:function(){return ye}});var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),o=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),d=_r(_d[7]),l=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),b=_r(_d[11]),p=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]);const f=t=>{const[n,r,a]=t.split('-').map(Number);return new Date(n,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},y=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},k=(t,n)=>n.test(t),w=t=>t.who??('display'===t.app?'Main Display':'Assistant'),v={a:1,an:1,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,fifteen:15,twenty:20,half:.5},S=t=>null==t||''===t?void 0:'number'==typeof t?t:v[String(t).toLowerCase()]??(Number.isFinite(Number(t))?Number(t):void 0),$=['owner','staff','display'],C=['owner','staff','chef','display'],I=['staff'],N=/\btables?\s+([a-z]?\d{1,3}[a-z]?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/i,L=t=>{const n=t.match(N);return n?String(S(n[1])??n[1]).toUpperCase():void 0};function q(t,n){const r=String(n??'').replace(/^tables?\s+/i,'').trim();if(!r)return;const a=String(S(r)??r).toLowerCase(),o=(0,s.planOf)(t),i=[...new Set([...(o?.tables??[]).map(t=>t.name),...Object.keys(s.useFloor.getState().live[t]??{})])];return i.find(t=>t.toLowerCase()===a)??(o?.tables??[]).find(t=>(t.label??'').toLowerCase()===a)?.name??i.find(t=>t.toLowerCase().replace(/[^0-9a-z]/g,'').replace(/^t(?=\d)/,'')===a.replace(/[^0-9a-z]/g,''))}const O=(t,n)=>s.useFloor.getState().live[t]?.[n]??{},_=new Set(['the','and','for','table','booking','party','seat','seated','cancel','move','mark','finished','show','arrived','here','has','have','they','them','who','with','from','tonight','today','please','change','confirm','decline','request','people','covers','guests','their','into','onto','done','left','gone']),D=t=>t.toLowerCase().replace(/[^a-z0-9: ]/g,' ').split(/\s+/).filter(t=>t.length>2&&!_.has(t)),x=t=>{const n=t.match(/\b(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/i);if(!n)return null;let r=Number(n[1]);return'pm'===n[3]?.toLowerCase()&&r<12&&(r+=12),!n[3]&&r>=1&&r<=11&&(r+=12),`${String(r).padStart(2,'0')}:${n[2]??'00'}`};function A(t,n,r,a,o){const d=String(r??'').toLowerCase(),l=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status)&&!/walk-?in/i.test(r.name??'')),c=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status));if(!d&&!o)return;const u=c.find(t=>t.ref&&d.includes(t.ref.toLowerCase()));if(u)return u;const b=D(d),p=l.filter(t=>D(t.name).some(t=>b.includes(t)));if(1===p.length)return p[0];if(o){const t=c.filter(t=>(0,s.tablesOf)(t.table).some(t=>t.toLowerCase()===o.toLowerCase())),n=p.length?t.filter(t=>p.includes(t)):t;if(n.length)return n.sort((t,n)=>('seated'===t.status?-1:1)-('seated'===n.status?-1:1))[0]}const h=/\d/.test(d.replace(N,''))?x(d.replace(N,'')):null;if(h){const t=(p.length?p:l).filter(t=>t.time===h);if(1===t.length)return t[0]}return p.length?p.sort((t,n)=>t.time.localeCompare(n.time))[0]:void 0}const j=t=>`${t.name}, ${t.partySize} at ${t.time}${t.table?`, table ${t.table}`:''}`,M=[{name:'booking',type:'string',required:!0,description:'Guest name, booking reference or time, as said'},{name:'table',type:'string',description:'Table, if said'}],T=t=>({booking:t,table:L(t)}),P='I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.';function z(t,n,r,a,i,s,d,l=""){return{id:t,apps:$,title:n,risk:'change',params:M,keywords:[],description:`${n}: today\u2019s booking by guest name, reference, table or time.${l}`,match:t=>k(t,i)?7:0,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return r?`${s}: ${j(r)}?${l}`:P},run:async(t,n)=>{const i=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return i?(await o.repo.bookings.setStatus(i.id,r),d&&await d(i,n,t),`Done: ${i.name} ${'noshow'===r?'marked as a no-show':'cancelled'===r?'cancelled':'finished'===r?'finished':r}.`):"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d."}}}const F=(t,n)=>(0,s.tablesOf)(n).forEach(n=>s.useFloor.getState().setLive(t,n,{stage:'seated',dirty:!1})),B={id:'seat_booking',apps:$,title:'Seat a booking',risk:'change',params:M,keywords:[],description:'Seat a guest with a booking today (at their booked table, or the table said). Walk-ins use add_walkin.',match:t=>!k(t,/\b(seat|sit)\b/)||k(t,/\b(walk.?in|walkin|no booking)\b/)||k(t,/\b(\d+|one|two|three|four|five|six|seven|eight|nine|ten) (people|covers|guests)\b/)?k(t,/\b(have|has|are|is) (arrived|here)\b/)?7:0:7,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']),o=q(n.rid,t.table)??r?.table;if(!r)return P;const i=o?O(n.rid,(0,s.tablesOf)(o)[0]):{};return`Seat ${r.name}, ${r.partySize} at ${r.time}${o?`, at table ${o}`:' (no table yet)'}?${i.blocked?` ${(0,a.tableNumbers)(o)} is marked blocked.`:i.dirty?` ${(0,a.tableNumbers)(o)} still needs clearing.`:i.stage?` ${(0,a.tableNumbers)(o)} already has people seated.`:''}`},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const a=q(n.rid,t.table);return t.table&&!a?`Nothing changed: there\u2019s no table ${t.table} on the plan.`:(a&&a!==r.table&&await o.repo.bookings.update(r.id,{table:a}),await o.repo.bookings.setStatus(r.id,'seated'),F(n.rid,a??r.table),`Done: ${r.name} seated${a??r.table?` at table ${a??r.table}`:''}.`)}},E=z('finish_booking','Finish a table (party left)','finished',['seated'],/\b(finished|have left|has left|left|gone|paid and gone|party left|they'?re done)\b/,'Mark finished',(t,n)=>{(0,s.tablesOf)(t.table).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0}))},' The table is then marked as needing clearing.'),R=z('no_show','Mark a no-show','noshow',['confirmed','pending'],/\b(no.?show|didn'?t (turn up|show|come)|not (turned|turning) up)\b/,'Mark as a no-show'),H=z('cancel_booking','Cancel a booking','cancelled',['confirmed','pending'],/^(?!.*\b(shifts?|orders?|rota)\b).*(\bcancel+(ed)?\b.*\b(booking|reservation|table for|party)\b|\bcancel\s+(?!that\b|it\b|this\b|now\b|please\b)[a-z]{3,})/,'Cancel the booking',void 0,' The guest is not messaged from here.'),W={id:'move_booking',apps:$,title:'Move a booking to another table',risk:'change',params:[M[0],{name:'table',type:'string',required:!0,description:'New table'}],keywords:[],description:'Give a booking today a different table (seated parties move too).',match:t=>k(t,/\b(move|put|switch|change)\b/)&&k(t,/\btables?\b/)&&!k(t,/\b(shift|rota)\b/)?7:0,parse:t=>{const n=[...t.matchAll(new RegExp(N.source,'gi'))],r=n[n.length-1];return{booking:t,table:r?String(S(r[1])??r[1]).toUpperCase():void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),o=q(n.rid,t.table);return r?o?`Move ${j(r)} to table ${o}?${O(n.rid,o).stage||O(n.rid,o).blocked?` ${(0,a.tableNumbers)(o)} is not free.`:''}`:`There\u2019s no table ${t.table??''} on the plan.`:P},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),a=q(n.rid,t.table);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";if(!a)return'Nothing changed: I couldn\u2019t find that table on the plan.';const i=r.table;return await o.repo.bookings.update(r.id,{table:a,tableSetHere:!0}),'seated'===r.status&&((0,s.tablesOf)(i).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0})),F(n.rid,a)),`Done: ${r.name} moved to table ${a}.`}},G={id:'change_booking',apps:['owner','staff'],title:'Change a booking\u2019s time or party size',risk:'change',params:[M[0],{name:'time',type:'time',description:'New time HH:mm'},{name:'covers',type:'integer',description:'New party size'}],keywords:[],description:'Change the time or the number of people on a booking today. The guest is not messaged from here.',match:t=>k(t,/\b(change|make it|now|instead|update|actually)\b/)&&k(t,/\b(booking|reservation|party)\b/)&&k(t,/\b(\d|one|two|three|four|five|six|seven|eight|nine|ten)\b/)?6:0,parse:t=>{const n=t.toLowerCase(),r=n.match(/\b(?:to|for|now|of)\s+(\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\s*(?:people|covers|guests|pax)?\b(?!\s*[:.]\d)(?!\s*(?:am|pm|o'?clock))/),a=n.match(/\b(?:to|at)\s+(\d{1,2}(?::\d{2})?\s*(?:am|pm)|\d{1,2}:\d{2}|\d{1,2}\s*o'?clock)/);return{booking:t,covers:r&&/people|covers|guests|pax|party|for/.test(n)&&!a?.[1]?.startsWith(r[1])?S(r[1]):void 0,time:a?x(a[1].replace(/o'?clock/,''))??void 0:void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);return r?t.time||t.covers?`Change ${j(r)} to ${[t.covers?`${t.covers} people`:'',t.time?`${t.time}`:''].filter(Boolean).join(' at ')}? The guest is not messaged from here.`:`What should change on ${r.name}\u2019s booking? Say the new time or number of people.`:P},run:async(t,r)=>{const a=A(r.rid,r.today,t.booking,['confirmed','pending']);if(!a)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const i=S(t.covers);if(!(null==t.covers||i&&(0,n.validParty)(i)))return`Nothing changed: ${n.PARTY_RULE}`;const s=t.time?x(String(t.time)):null;return i||s?(await o.repo.bookings.update(a.id,{...i?{partySize:i}:{},...s?{time:s}:{}}),`Done: ${a.name} is now ${i??a.partySize} at ${s??a.time}.`):'Nothing changed.'}},U={id:'decide_booking',apps:['owner'],title:'Accept or decline a booking request',risk:'change',params:[M[0],{name:'outcome',type:'string',required:!0,description:'confirmed or declined',enum:['confirmed','declined']}],keywords:[],description:'Accept or decline a booking request that is waiting (the same as the Accept / Decline buttons).',match:t=>k(t,/\b(accept|approve|confirm|decline|reject|turn down)\b/)&&k(t,/\b(booking|request|reservation)\b/)?7:0,parse:t=>({booking:t,outcome:/\b(decline|reject|turn down)\b/i.test(t)?'declined':'confirmed'}),preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?`${'declined'===t.outcome?'Decline':'Accept'} the request from ${r.name}, ${r.partySize} on ${f(r.date)} at ${r.time}?`:'I couldn\u2019t find a waiting request with that name.'},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?(await o.repo.bookings.decide(r.id,'declined'===t.outcome?'declined':'confirmed',w(n)),`Done: ${r.name}\u2019s request ${'declined'===t.outcome?'declined':'accepted'}.`):'Nothing changed: I couldn\u2019t find a waiting request with that name.'}},V=[{name:'table',type:'string',required:!0,description:'Table name or number'}],Y={id:'table_cleared',apps:$,title:'Mark a table cleared',risk:'change',params:V,keywords:[],description:'Mark a table cleared and free (after clearing it down).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(cleared|clear(ed)? down|is clean|wiped|reset|is free|is ready|ready again)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} cleared and free?${O(n.rid,r).stage?' People are still marked as seated there.':''}`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!1,stage:void 0}),`Done: table ${r} is free.`):'Nothing changed: I couldn\u2019t find that table.'}},J={id:'table_needs_clearing',apps:$,title:'Mark a table as needing clearing',risk:'change',params:V,keywords:[],description:'Mark a table as needing clearing (dirty).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(needs? (clearing|clearing down|a clean|wiping)|dirty|to be cleared)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} as needing clearing?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!0,stage:void 0}),`Done: table ${r} needs clearing.`):'Nothing changed: I couldn\u2019t find that table.'}},K={id:'block_table',apps:$,title:'Block or unblock a table',risk:'change',params:[...V,{name:'blocked',type:'string',required:!0,description:'yes to block, no to unblock',enum:['yes','no']}],keywords:[],description:'Block a table (not used tonight) or unblock it.',match:t=>k(t,/\b(un.?block|block|out of use|not in use|close)\b/)&&k(t,/\btables?\b/)&&!k(t,/\barea\b/)?8:0,parse:t=>({table:L(t),blocked:/\b(un.?block|back in use|open)\b/i.test(t)?'no':'yes'}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`${'no'===t.blocked?'Unblock':'Block'} table ${r}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{blocked:'no'!==t.blocked}),`Done: table ${r} ${'no'===t.blocked?'unblocked':'blocked'}.`):'Nothing changed: I couldn\u2019t find that table.'}},Q={mains:'mains',main:'mains',dessert:'dessert',desserts:'dessert',pudding:'dessert',bill:'bill',check:'bill',seated:'seated',starters:'seated'},X={id:'table_stage',apps:$,title:'Set a table\u2019s course',risk:'change',params:[...V,{name:'stage',type:'string',required:!0,description:'seated, mains, dessert or bill',enum:['seated','mains','dessert','bill']}],keywords:[],description:'Set where a seated table is: seated (starters), mains, dessert or bill.',match:t=>k(t,/\btables?\b/)&&k(t,/\b(on|at|having|wants?|asked for|ready for|onto)\b.*\b(mains?|desserts?|pudding|bill|check)\b/)?8:0,parse:t=>{const n=t.toLowerCase().match(/\b(mains?|desserts?|pudding|bill|check|starters)\b/);return{table:L(t),stage:n?Q[n[1]]:void 0}},preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Set table ${r} to ${t.stage}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table),a=Q[String(t.stage??'').toLowerCase()];return r&&a?(s.useFloor.getState().setLive(n.rid,r,{stage:a,dirty:!1}),`Done: table ${r} is on ${a}.`):'Nothing changed: say the table and mains, dessert or bill.'}},Z=t=>/\b(how many|how much|what'?s|what is|what are|any|have we got|do we have|are there|is there)\b|\?\s*$/.test(t),ee=t=>/\b(roast|chickens?|beef)\b/.test(t)&&!/\b(sold out|86|off the menu|menu|dish|special|allerg)/.test(t)&&Object.values(d.useShellStore.getState().items).some(t=>t.some(t=>t.active&&(0,l.isRoastItem)(t))),te=t=>(d.useShellStore.getState().items[t]??[]).filter(t=>t.active),ne=(t,n)=>{const r=String(n??'').toLowerCase();return te(t).find(t=>[t.name,t.plural,t.key].some(t=>t&&new RegExp(`\\b${t.toLowerCase().replace(/[^a-z0-9 ]/g,'')}`).test(r)))},re={id:'shellfish_count',apps:C,title:'Shellfish count: sold, delivery or recount',risk:'change',params:[{name:'item',type:'string',required:!0,description:'Item, e.g. lobster'},{name:'qty',type:'string',required:!0,description:'How many (\xbd allowed for half items)'},{name:'mode',type:'string',required:!0,description:'sold, delivery or count',enum:['sold','delivery','count']}],keywords:[],description:'Record shellfish (or other counted stock) sold, a delivery in, or a recount (sets the count).',match:t=>!k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)&&!ee(t)||k(t,/\b(allerg|contain|chat|message|tell|text|post)/)||Z(t)||!k(t,/\b(\d+|\xbd|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|sold|deliver(ed|y)?|came in|arrived|got in|count(ed)?|recount)\b/)?0:7,parse:(n,r)=>{const a=n.toLowerCase(),o=a.match(/\b(\d+(?:\.5)?|\xbd|a half|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|fifteen|twenty)\b/),i=/\b(deliver(ed|y)?|came in|arrived|got in|received)\b/.test(a)?'delivery':/\b(count|we have|we'?ve got|there are|recount|left in)\b/.test(a)?'count':'sold',s=ne(r.rid,a);return s&&(0,t.fishInStone)(r.rid,s)?{item:s.name,qty:(0,t.parseStoneAmount)(n),mode:i}:{item:s?.name??n,qty:o?'\xbd'===o[1]||/half/.test(o[1])?.5:S(o[1]):1,mode:i}},preview:(n,a)=>{const o=ne(a.rid,n.item);if(!o||'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'I couldn\u2019t find that item in the shellfish counts.';if((0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||!Number.isInteger(2*r))return'Use stone in half-stone steps, for example one and a half stone.';const i=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,s=(0,t.fromStone)(r,o.unit),l='count'===n.mode?s:'delivery'===n.mode?i+s:i-s;return`${o.name}: ${n.mode} ${(0,t.stoneSpeech)(r)}, after ${(0,t.stoneSpeech)((0,t.toStone)(Math.max(0,l),o.unit))}?`}const i=S(n.qty)??0,s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c='count'===n.mode?i:'delivery'===n.mode?s+i:s-i;return`${'count'===n.mode?`Set ${o.plural||o.name} to ${(0,l.fmtCount)(i)}`:'delivery'===n.mode?`Add a delivery of ${(0,l.fmtCount)(i)} ${o.plural||o.name}`:`Record ${(0,l.fmtCount)(i)} ${1===i?o.name:o.plural||o.name} sold`} (now ${(0,l.fmtCount)(s)}, after ${(0,l.fmtCount)(Math.max(0,c))})?`},run:(n,a)=>{const o=ne(a.rid,n.item);if(o&&'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'Nothing changed: that item is not in Head Chef stock.';if(o&&(0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||r>500||!Number.isInteger(2*r))return'Nothing changed: use stone in half-stone steps.';const i=(0,t.fromStone)(r,o.unit),s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,l='count'===n.mode?i-s:'delivery'===n.mode?i:-i;return s+l<0?`Nothing changed: only ${(0,t.stoneSpeech)((0,t.toStone)(s,o.unit))} left.`:(l&&d.shellfish.append({rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner',delta:l,reason:'count'===n.mode?'count':'delivery'===n.mode?'delivery':'sold'}),`Done: ${o.name}, ${(0,t.stoneSpeech)((0,t.toStone)(s+l,o.unit))} left.`)}const i=S(n.qty);if(!o||null==i||!(i>=0)||i>500)return'Nothing changed: say the item and how many.';if('half'!==o.unit&&i%1)return`Nothing changed: ${o.plural||o.name} are counted whole.`;const s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c={rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner'};return'count'===n.mode?(i!==s&&d.shellfish.append({...c,delta:i-s,reason:'count'}),`Done: ${o.plural||o.name} counted at ${(0,l.fmtCount)(i)}.`):'delivery'===n.mode?i<=0?'Nothing changed.':(d.shellfish.append({...c,delta:i,reason:'delivery'}),`Done: ${(0,l.fmtCount)(i)} in. ${(0,l.fmtCount)(s+i)} now.`):s(k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)||ee(t))&&Z(t)&&!k(t,/\b(allerg|contain)/)?8:0,parse:(t,n)=>({item:ne(n.rid,t)?.name}),preview:()=>'Shellfish left',run:(n,a)=>{const o=(0,d.venueCounts)(d.useShellStore.getState(),a.rid),i=ne(a.rid,n.item),s=(i?[i]:te(a.rid).filter(t=>!(0,l.isRoastItem)(t)||(0,l.isSundayIn)(new Date))).filter(t=>'chef'!==a.app||(0,r.chefCanSee)(a.rid,t));return s.length?s.map(n=>`${n.plural||n.name}: ${(0,t.fishInStone)(a.rid,n)?(0,t.stoneSpeech)((0,t.toStone)(o[n.key]??0,n.unit)):(0,l.fmtCount)(o[n.key]??0)} left`).join('. ')+'.':'No shellfish counts are set up here.'}},oe={accept:'acknowledged',preparing:'preparing',ready:'ready',collected:'collected'},ie=(t,n)=>{const r=String(n??'').toLowerCase(),a=i.useStore.getState().orders.filter(n=>n.restaurantId===t&&!['closed','cancelled','collected','served'].includes(n.status));return a.find(t=>t.ref&&r.includes(t.ref.toLowerCase()))??a.find(t=>{const n=r.match(/\b(?:number|no\.?|order)\s*(\d{1,4})\b/);return!!n&&t.ref.replace(/\D/g,'').endsWith(n[1])})??(()=>{const t=a.filter(t=>D(t.customerName??'').some(t=>D(r).includes(t)));return 1===t.length?t[0]:void 0})()},se={id:'order_status',apps:C,title:'Move an order on: accept, preparing, ready or collected',risk:'change',params:[{name:'order',type:'string',required:!0,description:'Order reference, number or customer name'},{name:'status',type:'string',required:!0,description:'accept, preparing, ready or collected',enum:['accept','preparing','ready','collected']}],keywords:[],description:'Accept a takeaway or table order, or mark it preparing, ready or collected (the same as the order buttons).',match:t=>k(t,/\b(orders?|takeaways?|collection|ticket)\b/)&&k(t,/\b(accept|ready|collected|picked up|preparing|start(ed)?|on it)\b/)&&!k(t,/\b(read|any|list|what)\b/)?7:0,parse:t=>{const n=t.toLowerCase();return{order:t,status:/\baccept/.test(n)?'accept':/\b(collected|picked up)\b/.test(n)?'collected':/\bready\b/.test(n)?'ready':'preparing'}},preview:(t,n)=>{const r=ie(n.rid,t.order);return r?`Mark order ${r.ref} for ${r.customerName} as ${'accept'===t.status?'accepted':t.status}?`:'I couldn\u2019t find that order. Say the order number or the name.'},run:async(t,n)=>{const r=ie(n.rid,t.order),a=oe[String(t.status)];if(!r||!a)return'Nothing changed: I couldn\u2019t find that order.';if('acknowledged'===a){return await o.repo.orders.accept(r.id,w(n))?`Done: order ${r.ref} accepted.`:`Order ${r.ref} was already accepted.`}return await o.repo.orders.setStatus(r.id,a,w(n)),`Done: order ${r.ref} is ${a}.`}},de={id:'order_list_add',apps:C,title:'Add to an order list',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What we need'},{name:'qty',type:'integer',description:'How many (default 1)'},{name:'list',type:'string',description:'Which list (supplier), if said'}],keywords:[],description:'Add an item to an order list (or add to the quantity if it is already on it). Nothing is ordered from the supplier.',match:t=>k(t,/\b(add|put)\b.*\b(to|on)\b.*\b(order|shopping|cash and carry|list)\b|\bwe need (more )?\w+/)&&!k(t,/\b(chat|message|tell|text|post|shift|rota)\b/)?6:0,parse:t=>{const n=t.toLowerCase().replace(/[.?!]+$/,'').match(/\b(?:add|put|need(?: more)?)\s+(?:(\d+|an?|one|two|three|four|five|six|seven|eight|nine|ten|twelve|twenty)\s+)?(.+?)(?:\s+(?:to|on)\s+(?:the\s+)?(.+?)(?:\s+(?:order|list|order list))*)?$/);return n?{qty:S(n[1])??1,item:n[2].replace(/^(?:some|more)\s+/,'').trim(),list:n[3]?.replace(/\b(order|list|shopping)\b/g,'').trim()||void 0}:{item:t}},preview:(t,n)=>{const r=c.useOrderLists.getState().lists.filter(t=>t.rid===n.rid),a=String(t.list??'').toLowerCase(),o=a&&r.find(t=>t.name.toLowerCase().includes(a))||r[0];return o?`Add ${t.qty??1} ${t.item} to ${o.name}? Nothing is ordered from the supplier.`:'There are no order lists yet. Set one up in Order lists.'},run:(t,n)=>{const r=c.useOrderLists.getState(),a=r.lists.filter(t=>t.rid===n.rid),o=String(t.list??'').toLowerCase(),i=o&&a.find(t=>t.name.toLowerCase().includes(o))||a[0],s=String(t.item??'').trim().slice(0,60),d=Math.max(1,Math.min(99,Math.round(S(t.qty)??1)));if(!i||s.length<2)return'Nothing changed: say what we need.';const l={id:n.whoId??'assistant',name:w(n)},u=r.items.find(t=>t.rid===n.rid&&t.listId===i.id&&'open'===t.status&&t.name.toLowerCase()===s.toLowerCase());return u?(r.bump(u.id,d,l),`Done: added ${d} more ${s} on ${i.name}.`):(r.addItem(n.rid,{listId:i.id,name:s,qty:d,unit:'',addedBy:l.id,addedByName:l.name}),`Done: ${d} ${s} added to ${i.name}.`)}},le={in:'Clock you in',out:'Clock you out',break_start:'Start your break',break_end:'End your break'};function ce(t,n,r){return{id:t,apps:I,title:le[n].replace('you','me').replace('your','my'),risk:'change',params:[],keywords:[],description:`${le[n]} now (only for the person signed in; the same location check as the Clock tab).`,match:t=>k(t,r)?8:0,preview:()=>`${le[n]} now?`,run:async(t,r)=>{if(!r.whoId)return'Sign in to the Staff app first.';const a=y().toISOString(),o=await(0,b.clockAction)(n,{rid:r.rid,staffId:r.whoId,date:r.today,at:a});return o.ok?'Done: '+{in:'clocked in',out:'clocked out',break_start:'break started',break_end:'break ended'}[n]+` at ${new Date(a).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}.`+(o.warn?' '+o.warn:''):'Nothing changed: '+o.message}}}const ue=ce('clock_in','in',/\bclock (me )?in\b|\bclocking in\b|\bstart(ing)? my shift\b/),be=ce('clock_out','out',/\bclock (me )?out\b|\bclocking out\b|\b(finish|end)(ing)? my shift\b/),pe=ce('break_start','break_start',/\b(start|starting|taking|take|going on|begin)( my| a)? break\b|\bon (my )?break now\b/),he=ce('break_end','break_end',/\b(end|ending|finish|finished|back from)( my| a| the)? break\b|\bback from break\b/),me=t=>{const n=u.useOwner.getState().staff,r=String(t??'').toLowerCase();return n.find(n=>n.id===t)?.id??n.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>D(r).includes(t)))?.id},ge=(t,n)=>{if(!(0,p.hasRecipeCards)())return;const r=D(String(n??''));let a;for(const n of(0,p.recipeCards)().list(t)){const t=D(n.dish).filter(t=>r.includes(t)).length;t&&t>(a?.s??0)&&(a={c:n,s:t})}return a?.c},fe=t=>{const n=m.ALLERGENS.filter(n=>t[n.id]).map(n=>('may'===t[n.id]?'may contain ':'')+n.label.toLowerCase());return n.length?n.join(', '):'none of the 14 allergens'},ye=[B,E,R,H,W,G,U,Y,J,K,X,re,ae,se,de,ue,be,pe,he,{id:'decide_leave',apps:['owner'],title:'Approve or decline a holiday request',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff member id or first name'},{name:'outcome',type:'string',required:!0,description:'approved or declined',enum:['approved','declined']}],keywords:[],description:'Approve or decline someone\u2019s waiting holiday (leave) request.',match:t=>k(t,/\b(approve|accept|decline|reject|ok|okay)\b/)&&k(t,/\b(holiday|leave|time off|day off|days off)\b/)?7:0,parse:t=>{const n=t.toLowerCase(),r=u.useOwner.getState().staff.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>new RegExp(`\\b${t}\\b`).test(n)));return{staffId:r?.id,outcome:/\b(decline|reject|refuse)\b/.test(n)?'declined':'approved'}},preview:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status),o=n.staff.find(t=>t.id===r)?.name.replace(' (example)','');return a?`${'declined'===t.outcome?'Decline':'Approve'} ${o}\u2019s holiday, ${f(a.from)}${a.to!==a.from?` to ${f(a.to)}`:''}?`:`There\u2019s no waiting holiday request${o?` from ${o}`:''}.`},run:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status);return a?(n.setLeave(a.id,'declined'===t.outcome?'declined':'approved'),`Done: holiday ${'declined'===t.outcome?'declined':'approved'}.`):'Nothing changed: no waiting request found.'}},{id:'allergen_signoff',apps:['chef'],title:'Sign off a dish\u2019s allergens',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'}],keywords:[],description:'Head chef signs off a recipe card (its allergens). The allergens are read back first.',match:t=>k(t,/\bsign(ed)?.?off\b|\bapprove\b.*\b(card|recipe|allergens?)\b/)?8:0,parse:t=>({dish:t}),preview:(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?`${r.dish} can\u2019t be signed off yet: ${a}`:`Sign off ${r.dish}? Allergens: ${fe(r.allergens)}.`},run:async(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'Nothing changed: I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?'Nothing changed: '+a:(await(0,p.recipeCards)().signOff(r.id,{name:w(n),role:'head-chef'}),`Done: ${r.dish} signed off.`)}}]},1424,[982,1098,804,829,848,800,1014,981,983,1025,865,1071,856,832,830]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.spokenDate=j,Object.defineProperty(_e,"GAP_VOICE_ACTIONS",{enumerable:!0,get:function(){return be}});var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),l=_r(_d[12]),f=_r(_d[13]),u=_r(_d[14]),m=_r(_d[15]),g=_r(_d[16]),y=_r(_d[17]),b=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),S=_r(_d[21]),$=_r(_d[22]);const v=(e,t)=>t.test(e),I=e=>e.who??('display'===e.app?'Main Display':'Assistant'),N=e=>(e??'').replace(' (example)',''),A=e=>String(e).padStart(2,'0'),D=()=>{const e=(0,$.appNow)();return`${A(e.getHours())}:${A(e.getMinutes())}`},C=['owner','staff','display'],T=['owner'],q=['staff','owner'],O=['owner','chef'],_=e=>`\u201c${e}\u201d`,x=(e,t)=>n.useOwner.getState().sys(e,t,(0,$.appNow)().toISOString()),M=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],R=e=>`${A(Math.floor(e))}:${A(Math.round(e%1*60))}`,L=['january','february','march','april','may','june','july','august','september','october','november','december'];function j(e,t){const a=e.toLowerCase(),r=a.match(new RegExp(`\\b(\\d{1,2})(?:st|nd|rd|th)?(?:\\s+of)?\\s+(${L.join('|')})\\b`))??a.match(new RegExp(`\\b(${L.join('|')})\\s+(\\d{1,2})(?:st|nd|rd|th)?\\b`));if(r){const e=Number(/\d/.test(r[1])?r[1]:r[2]),a=L.indexOf(/\d/.test(r[1])?r[2]:r[1]);let n=Number(t.slice(0,4));return`${n}-${A(a+1)}-${A(e)}`e.active)){const r=[N(e.name).split(' ')[0],e.nickname].filter(Boolean).map(e=>e.toLowerCase()),n=Math.min(...r.map(e=>{const a=t.match(new RegExp(`\\b${e.replace(/[^a-z']/g,'')}\\b`));return a?.index??1/0}));n<1/0&&a.push({s:e,at:n})}return a.sort((e,t)=>e.at-t.at).map(e=>e.s)}const F=e=>n.useOwner.getState().staff.find(t=>t.id===e),E=e=>F(e)??W(String(e??''))[0],U=e=>a.useStore.getState().waitlist.filter(t=>t.restaurantId===e&&('waiting'===t.status||'notified'===t.status)).sort((e,t)=>e.number-t.number);function z(e,t){const a=String(t??'').toLowerCase(),r=U(e);if(!r.length)return;const n=a.match(/(?:#|number|no\.?)\s*(\d{1,3})\b/);if(n)return r.find(e=>e.number===Number(n[1]));const i=(0,$.tokensOf)(a).filter(e=>!['waitlist','wait','list','off','remove','told','ready','next'].includes(e)),s=r.filter(e=>(0,$.tokensOf)(e.name).some(e=>i.includes(e)));return s.length?s[0]:/\b(next|first)\b/.test(a)||1===r.length?r[0]:void 0}const Y=e=>`waitlist number ${e.number}, ${e.name}, party of ${e.partySize}`;function B(e,t){const n=a.useStore.getState(),i=n.restaurants.find(t=>t.id===e);if(!i)return;const s=(0,$.appNow)(),o=(0,l.ymdOf)(s),d=r.useFloor.getState(),c=d.plans[e]??(0,r.seedPlan)(e),h=n.bookings.filter(t=>t.restaurantId===e),p=(0,w.closedAreasAt)(w.useBlocks.getState().blocks,e,o,D()),f=(0,b.floorView)(c,h,n.orders.filter(t=>t.restaurantId===e),d.live[e]??{},s,i.settings.turnMins,p);return(0,b.suggestTable)(c,h.filter(e=>e.date===o),f,t,s,(0,b.turnFor)(t,i.settings.turnMins))?.table}const P=/\bwait ?(ing )?list\b|\bwaiting\b/,H=[{name:'who',type:'string',required:!0,description:'Waitlist number or name, as said (or "next")'}],K={id:'waitlist_seat',apps:C,title:'Seat someone from the waitlist',risk:'change',params:[...H,{name:'table',type:'string',required:!1,description:'Table (else the best free table)'}],keywords:[],description:'Seat a waiting party from the waitlist at a table (the suggested table unless one is said), like the Seat button.',match:e=>v(e,P)&&v(e,/\bseat\b|\bsit\b/)?9:0,parse:e=>({who:e,table:(0,$.tableIn)(e)}),preview:(e,t)=>{const a=z(t.rid,e.who);if(!a)return'I couldn\u2019t find that party on the waitlist. Say their number or name.';const r=(0,$.resolveTable)(t.rid,e.table)??B(t.rid,a.partySize);return r?`Seat ${Y(a)}, at table ${r}?`:`There\u2019s no free table for ${a.partySize} right now. Say a table to seat them anyway.`},run:async(e,a)=>{const n=z(a.rid,e.who);if(!n)return'Nothing changed: I couldn\u2019t find that party on the waitlist.';const i=(0,$.resolveTable)(a.rid,e.table)??B(a.rid,n.partySize);return i?(await t.repo.waitlist.setStatus(n.id,'seated'),await t.repo.bookings.seatWalkIn(a.rid,n.partySize,i,`From waitlist #${n.number}`),(0,r.tablesOf)(i).forEach(e=>r.useFloor.getState().setLive(a.rid,e,{stage:'seated',dirty:!1})),`Done: waitlist number ${n.number} seated at table ${i}.`):'Nothing changed: there\u2019s no free table for them. Say a table.'}};function V(e,t){if(!e.whoId)return;const a=n.useOwner.getState().shifts.filter(t=>t.staffId===e.whoId&&!1!==t.published&&t.date>=e.today).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start),r=j(String(t??''),e.today);return r?a.find(e=>e.date===r):a[0]}const G=e=>`${(0,$.niceDay)(e.date)}, ${R(e.start)} to ${R(e.end)}`,Q=/\b(approve|accept|decline|reject|okay|ok)\b/,Z='I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d.';function J(e,t){const a=e.toLowerCase(),r=a.match(/\bfrom\s+(.+?)\s+(?:to|until|till)\s+(.+)$/);if(r){const e=j(r[1],t),a=j(r[2],t)??e;return{from:e,to:a&&e&&a'open'===e.status&&(!r||e.kind===r)),s=W(String(e??'')).map(e=>e.id);return s.length?i.find(e=>s.includes(e.fromId)&&(!e.toId||1===s.length||s.includes(e.toId)))??i.find(e=>s.includes(e.fromId)||e.toId&&s.includes(e.toId)):1===i.length?i[0]:void 0}const ee=(t,a)=>'chef'!==a?.app||(0,e.chefCanSee)(a.rid,t)&&(0,e.chefCanSee)(a.rid,i.useSafety.getState().points.find(e=>e.id===t.pointId)),te=(e,t)=>{const a=i.useSafety.getState().entries.filter(a=>(0,l.ymdOf)(new Date(a.at))===e&&ee(a,t));return{n:a.length,bad:a.filter(e=>!e.ok).length,fixed:a.filter(e=>!e.ok&&e.corrective).length}},ae=/\b(food safety|safety diary|diary|haccp|safe methods|sfbb)\b/;function re(e,t){const a=(0,m.weekStart)(new Date(e+'T12:00:00')),r=new Date(a+'T00:00:00').getTime(),n=r+6048e5,s=i.useSafety.getState().entries.filter(e=>{const a=new Date(e.at).getTime();return a>=r&&a!e.ok).length,actions:s.filter(e=>!e.ok&&e.corrective).length,daysSigned:o.filter(e=>{const t=new Date(e.date+'T00:00:00').getTime();return t>=r&&te.test(t))?.[1]??'Other',location:s?s[1].replace(/^the /,''):'Not said',firstAid:o?o[1]:'',what:e.trim().replace(/^(?:please\s+)?(?:record|log|report|add|write up|put in the accident book)\s+(?:an?\s+)?(?:accident|near miss|injury)?\s*(?:in the accident book)?\s*[:,-]?\s*/i,'').replace(/^\w/,e=>e.toUpperCase())||e.trim()}}function se(e,t){const a=(0,d.ukClock)((0,$.appNow)()),r=new Date(`${a.ymd}T12:00:00Z`).getUTCDay(),n=(0,$.tokensOf)(String(t??'')).filter(e=>!['tick','ticked','task','off','mark','done','did','finished','completed','ive','i\u2019ve','list'].includes(e)),i=e=>(0,$.tokensOf)(e).filter(e=>n.some(t=>t===e||t.length>3&&e.startsWith(t.slice(0,4)))).length,h=e.whoId?(0,o.tasksFor)((0,s.tasksOf)(e.rid,e.whoId),r):[];let p=h.map(e=>({t:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.t;const l='chef'===e.app?['all','kitchen']:'staff'===e.app?['all','foh']:['all','foh','kitchen'],f=p?void 0:c.useReminders.getState().reminders.filter(t=>t.rid===e.rid&&!t.removed&&!t.paused&&t.days.includes(a.dow)&&l.includes(t.audience)).map(e=>({r:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.r;return{ymd:a.ymd,task:p,rem:f}}const oe=e=>a.useStore.getState().menu.filter(t=>t.restaurantId===e);function de(e,t){const a=(0,$.tokensOf)(String(t??''));let r;for(const t of oe(e)){const e=(0,$.tokensOf)(t.name).filter(e=>a.includes(e)).length;e&&e>(r?.s??0)&&(r={m:t,s:e})}return r?.m}const ce=e=>{const t=e.match(/\xa3\s?(\d+(?:\.\d{1,2})?)|\b(\d+(?:\.\d{2}))\b|\b(\d+)\s*(?:pounds|quid)(?:\s*(\d{1,2}))?/i);if(t)return t[1]?Number(t[1]):t[2]?Number(t[2]):Number(t[3])+(t[4]?Number(t[4])/100:0)},he={gram:'g',grams:'g',g:'g',kilo:'kg',kilos:'kg',kg:'kg',ml:'ml',millilitres:'ml',litre:'l',litres:'l',l:'l',tablespoon:'tbsp',tablespoons:'tbsp',tbsp:'tbsp',teaspoon:'tsp',teaspoons:'tsp',tsp:'tsp',pinch:'pinch',slice:'slice',slices:'slices',whole:'whole'};function pe(e){const t=e.match(/\badd\s+(\d+(?:\.\d+)?|a|an|one|two|three|four|five|six|half)\s*(grams?|g|kilos?|kg|ml|millilitres|litres?|l|tablespoons?|tbsp|teaspoons?|tsp|pinch|slices?|whole)?\s+(?:of\s+)?(.+?)\s+(?:to|into|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*$/i);if(t)return{qty:String((0,$.num)(t[1])??t[1]),unit:t[2]?he[t[2].toLowerCase()]??t[2]:'',name:t[3].trim(),dish:t[4]}}const le={in:'Clock {n} in',out:'Clock {n} out',break_start:'Start a break for {n}',break_end:'End {n}\u2019s break'},fe=e=>null==e?'not entered':`\xa3${e.toLocaleString('en-GB',{minimumFractionDigits:2,maximumFractionDigits:2})}`,ue=e=>'owner'===e.app&&'staff'!==e.role,me=['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];function ge(e){if(/\bweekdays?\b/.test(e))return[1,2,3,4,5];if(/\bweekends?\b/.test(e))return[0,6];const t=me.map((t,a)=>new RegExp(`\\b${t}s?\\b`).test(e)?a:-1).filter(e=>e>=0);return t.length?t:[0,1,2,3,4,5,6]}const ye={all:'everyone on shift',foh:'front of house',kitchen:'the kitchen'},be=[K,{id:'waitlist_remove',apps:C,title:'Take someone off the waitlist',risk:'change',params:H,keywords:[],description:'Take a party off the waitlist (they left or no longer need a table), like the Remove button. It stays in the records.',match:e=>v(e,P)&&v(e,/\b(remove|take .*off|cross .*off|strike .*off|gave up|have left|has left|left|gone)\b/)&&!v(e,/\b(seat|told|ready)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Take ${Y(a)}, off the waitlist?`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,a)=>{const r=z(a.rid,e.who);return r?(await t.repo.waitlist.setStatus(r.id,'removed'),`Done: number ${r.number} is off the waitlist.`):'Nothing changed: I couldn\u2019t find that party.'}},{id:'waitlist_told',apps:C,title:'Mark a waiting party as told their table is ready',risk:'change',params:H,keywords:[],description:'Record that a waiting party has been told their table is ready, like the Mark as told button. No text is sent.',match:e=>v(e,P)&&v(e,/\b(told|tell|let .* know|notif|ready|called)\b/)&&!v(e,/\b(seat|remove)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Mark ${Y(a)}, as told their table is ready? No text is sent from here.`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,n)=>{const i=z(n.rid,e.who);if(!i)return'Nothing changed: I couldn\u2019t find that party.';const s=a.useStore.getState().restaurants.find(e=>e.id===n.rid);return r.useFloor.getState().logSms(n.rid,(0,$.appNow)().toISOString(),`#${i.number} ${i.partySize}: Your table at ${s?.name??'the restaurant'} is ready.`),await t.repo.waitlist.setStatus(i.id,'notified'),`Done: number ${i.number} marked as told. No text was sent.`}},{id:'request_cover',apps:q,title:'Ask for cover for my shift',risk:'change',params:[{name:'day',type:'string',required:!1,description:'Day or date of your shift (else your next shift)'}],keywords:[],description:'Ask the team to cover one of your own shifts, like the Ask for cover button. A \u201cCover needed\u201d note goes in the team chat.',match:e=>v(e,/\bcover\b/)&&v(e,/\b(my|me)\b/)&&v(e,/\b(shift|ask|need|someone|anyone|can)\b/)&&!v(e,Q)?9:0,parse:e=>({day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day);return a?`Ask for cover for your shift on ${G(a)}? A \u201cCover needed\u201d note goes in the team chat.`:Z},run:(e,t)=>{const a=V(t,e.day);return a&&t.whoId?n.useOwner.getState().swaps.some(e=>e.shiftId===a.id&&'open'===e.status)?'There\u2019s already an open request for that shift.':(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,kind:'cover',note:'Can anyone cover?'}),x('all',`Cover needed: ${M[a.day]} ${R(a.start)}\u2013${R(a.end)} (${N(F(t.whoId)?.name??t.who)})`),`Done: cover asked for ${G(a)}. A manager approves it once someone takes it.`):"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_swap',apps:q,title:'Ask to swap my shift with someone',risk:'change',params:[{name:'with',type:'string',required:!0,description:'Who you agreed to swap with (first name)'},{name:'day',type:'string',required:!1,description:'Day or date of your shift'}],keywords:[],description:'Ask a manager to approve swapping one of your shifts with a colleague you agreed it with, like the Swap with button.',match:e=>v(e,/\bswap\b/)&&!v(e,Q)?9:0,parse:(e,t)=>({with:W(e).find(e=>e.id!==t?.whoId)?.id,day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day),r=E(e.with);return r&&r.id!==t.whoId?a?`Ask to swap your shift on ${G(a)} with ${N(r.name)}? A manager still approves it.`:Z:'Who are you swapping with? Say their first name.'},run:(e,t)=>{const a=V(t,e.day),r=E(e.with);return a&&t.whoId?r&&r.id!==t.whoId?(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,toId:r.id,kind:'swap',note:'Agreed between us'}),`Done: swap with ${N(r.name)} asked for. A manager approves it.`):'Nothing changed: say who you\u2019re swapping with.':"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_holiday',apps:q,title:'Ask for holiday',risk:'change',params:[{name:'from',type:'string',required:!0,description:'First day off, YYYY-MM-DD'},{name:'to',type:'string',required:!0,description:'Last day off, YYYY-MM-DD'},{name:'reason',type:'string',required:!1,description:'Reason (default Holiday)'}],keywords:[],description:'Send your own holiday (time off) request to a manager, like the Send request button.',match:e=>v(e,/\b(holiday|time off|day off|days off|annual leave|leave)\b/)&&v(e,/\b(request|book|ask|want|need|like|have|put in|take|off)\b/)&&!v(e,Q)&&!v(e,/\b(who|how many|when is)\b/)?8:0,parse:(e,t)=>{const a=J(e,t?.today??(0,l.ymdOf)((0,$.appNow)())),r=e.match(/\b(?:for|because)\s+(?:a |an |my )?([a-z][a-z ]{2,40}?)\s*$/i);return{...a,reason:r&&!/\b(from|to|monday|tuesday|wednesday|thursday|friday|saturday|sunday|tomorrow|\d)/i.test(r[1])?r[1]:void 0}},preview:(e,t)=>t.whoId?`Ask for ${e.reason??'holiday'} from ${(0,$.niceDay)(String(e.from))}${e.to!==e.from?` to ${(0,$.niceDay)(String(e.to))}`:''}? A manager approves it.`:'Sign in first so I know who\u2019s asking.',run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const a=e=>/^\d{4}-\d{2}-\d{2}$/.test(String(e));return!a(e.from)||!a(e.to)||String(e.to)v(e,Q)&&v(e,/\b(swap|cover|swaps)\b/)?9:0,parse:e=>({who:e,outcome:/\b(decline|reject|refuse|no)\b/i.test(e)?'declined':'approved'}),preview:e=>{const t=X(e.who);if(!t)return'I couldn\u2019t find that open swap or cover request. Say the name on it.';const a=n.useOwner.getState().shifts.find(e=>e.id===t.shiftId),r=N(F(t.fromId)?.name),i=N(F(t.toId)?.name),s='swap'===t.kind?`${r}\u2019s swap with ${i}`:t.toId?`${i} covering ${r}`:`${r}\u2019s cover request`;return'declined'===e.outcome||t.toId?`${'declined'===e.outcome?'Decline':'Approve'} ${s}${a?` for ${G(a)}`:''}?${'declined'===e.outcome?'':' The shift moves and a note goes in the team chat.'}`:`Nobody has taken ${r}\u2019s cover yet, so it can\u2019t be approved. You can decline it.`},run:e=>{const t=X(e.who);if(!t)return'Nothing changed: no open request found.';if('declined'!==e.outcome&&!t.toId)return'Nothing changed: nobody has taken that cover yet.';const a=n.useOwner.getState(),r=a.shifts.find(e=>e.id===t.shiftId);if(a.setSwap(t.id,'declined'===e.outcome?'declined':'approved'),'declined'===e.outcome)return'Done: request declined.';const i=e=>N(F(e)?.name);return x('all','swap'===t.kind?`Shift swap: ${i(t.fromId)} \u2194 ${i(t.toId)} approved`:`Cover approved: ${i(t.toId)} covers ${i(t.fromId)}${r?` (${M[r.day]} ${R(r.start)}\u2013${R(r.end)})`:''}`),'Done: approved and posted in the team chat.'}},{id:'sign_safety_day',apps:O,title:'Sign today\u2019s food safety diary',risk:'change',params:[],keywords:[],description:'Sign today\u2019s food safety diary: the opening and closing checks were done and the safe methods were followed, like the diary Sign button. Today only.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,ae)&&!v(e,/\bweek(ly)?\b/)?9:0,preview:(e,t)=>{const a=(i.useSafety.getState().daySigns??[]).find(e=>e.date===t.today);if(a)return`Today\u2019s diary is already signed by ${a.by}.`;const r=te(t.today,t);return`Sign today\u2019s food safety diary as ${I(t)}: the opening and closing checks were done and the safe methods were followed today? Today: ${r.n} checks, ${r.bad} out of range${r.bad?`, ${r.fixed} with an action`:''}.`},run:(e,t)=>'staff'===t.role?'Nothing changed: only a manager or the head chef signs the diary.':(i.useSafety.getState().daySigns??[]).some(e=>e.date===t.today)?'It\u2019s already signed today.':(i.useSafety.getState().signDay({date:t.today,by:N(I(t)),byId:t.whoId??'',at:(0,$.appNow)().toISOString()}),'Done: today\u2019s diary signed.')},{id:'sign_safety_week',apps:O,title:'Sign off this week\u2019s food safety review',risk:'change',params:[],keywords:[],description:'Weekly food safety review: reads the six statements back; Confirm means yes to all six. If any reading is out of range without an action, it must be done on screen with a note.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,/\bweek(ly)?\b/)&&(v(e,ae)||v(e,/\b(review|safety|checks)\b/))?9:0,preview:(e,t)=>{const{week:a,summary:r}=re(t.today,t),n=(i.useSafety.getState().weekly??[]).find(e=>e.week===a);if(n)return`This week is already signed off by ${n.by}.`;const s=`Week of ${(0,$.niceDay)(a)}: ${r.entries} checks, ${r.outOfRange} out of range, ${r.actions} with an action, diary signed ${r.daysSigned} of 7 days.`;return r.actions`${t+1}. ${e}.`).join(' ')} Sign off the week?`},run:(e,t)=>{if('staff'===t.role)return'Nothing changed: only a manager or the head chef signs off the week.';const{week:a,summary:r}=re(t.today,t);return(i.useSafety.getState().weekly??[]).some(e=>e.week===a)?'This week is already signed off.':r.actions!0),note:'Signed by voice: yes to all.',summary:r}),'Done: week signed off.')}},{id:'record_accident',title:'Record an accident or near miss',risk:'change',params:[{name:'what',type:'string',required:!0,description:'What happened, in the speaker\u2019s words'},{name:'person',type:'string',required:!1,description:'Who was hurt'},{name:'location',type:'string',required:!1,description:'Where'},{name:'injury',type:'string',required:!1,description:'The injury'},{name:'firstAid',type:'string',required:!1,description:'First aid given'}],keywords:[],description:'Add an entry to the accident book (accident or near miss) with what was said; every field is read back first.',match:e=>v(e,/\baccident book\b/)?10:v(e,/\b(accident|injur(y|ed)|near miss|hurt|cut (him|her|them|my)self|burn(ed|t)? (him|her|them|my)self|slipped|tripped|fell over|scalded)\b/)&&v(e,/\b(record|log|report|write|add|book|had|there was|has|have|just)\b/)&&!v(e,/\b(how many|show|read)\b/)?8:0,parse:e=>{const t=ie(e);return{what:t.what,person:t.person,location:t.location,firstAid:t.firstAid}},preview:e=>{const t=ie(String(e.what)),a=String(e.person??t.person),r=String(e.location??t.location);return`Add to the accident book: when, today at ${D()}; who, ${a} (${t.personType}); where, ${r}; type, ${t.category}; what happened, ${_(t.what)}; injury, ${e.injury?String(e.injury):'Near miss'===t.category?'none (near miss)':'not recorded'}; first aid, ${e.firstAid||t.firstAid||'none recorded'}; reported by you. Check it before you confirm; you can add more in the Accident book.`},run:(e,t)=>{const a=ie(String(e.what)),r='Near miss'===a.category,n=(0,$.appNow)();return i.useSafety.getState().addAccident({when:`${(0,l.ymdOf)(n)}T${D()}`,location:String(e.location??a.location),person:String(e.person??a.person),personType:a.personType,category:a.category,what:a.what,injury:String(e.injury??'')||(r?'None (near miss)':'Not recorded'),firstAid:String(e.firstAid||a.firstAid||'')||'None recorded',witnesses:'None',reportedBy:N(I(t)),reportedById:t.whoId??'',app:'staff'===t.app?'staff':'chef'===t.app?'chef':'managers'}),'Done: added to the accident book.'+(/(hospital|fracture|broke|unconscious|ambulance)/i.test(a.what)?' This may need reporting under RIDDOR; check the Accident book.':'')}},{id:'tick_task',apps:['staff','chef','owner'],title:'Tick off one of my tasks',risk:'change',params:[{name:'task',type:'string',required:!0,description:'The task or reminder, as said'}],keywords:[],description:'Tick off one of today\u2019s daily tasks (yours), or mark a venue reminder like \u201cchairs up\u201d as done, like the tick and Done buttons.',match:e=>v(e,/\btick(ed)?( off)?\b|\bmark .* (as )?done\b|\b(i'?ve|i have|we'?ve) (done|finished|completed)\b|\b(task|reminder) (is )?done\b|\bdone the\b/)&&!v(e,/\b(shift|break|order|table|booking|clock)\b/)?7:0,parse:e=>({task:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I tick your tasks.';const{ymd:a,task:r,rem:n}=se(t,e.task);return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?`${_(r.text)} is already ticked today.`:`Tick off today\u2019s task ${_(r.text)}?`:n?`Mark the reminder ${_(n.text)} as done for today?`:'I couldn\u2019t find that in today\u2019s tasks. Say a word from the task.'},run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const{ymd:a,task:r,rem:n}=se(t,e.task),i={id:t.whoId,name:N(I(t))};return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?'Already ticked today.':(s.useDailyTasks.getState().toggleTick(t.rid,t.whoId,r.id,a,i),`Done: ${_(r.text)} ticked.`):n?(c.useReminders.getState().markDone({rid:t.rid,reminderId:n.id,forDate:a,at:(0,$.appNow)().toISOString(),staffRef:t.whoId,staffName:i.name}),`Done: ${_(n.text)} marked done.`):'Nothing changed: I couldn\u2019t find that task.'}},{id:'add_dish',apps:T,title:'Add a dish to the menu',risk:'change',params:[{name:'name',type:'string',required:!0,description:'Dish name'},{name:'section',type:'string',required:!1,description:'Menu section'},{name:'price',type:'string',required:!0,description:'Price in pounds'},{name:'description',type:'string',required:!1,description:'Short description'}],keywords:[],description:'Add a new dish to the menu, like Manage \u203a Add dish. It stays off the menu until the head chef signs off its recipe card.',match:e=>v(e,/\b(add|new|put)\b/)&&v(e,/\b(dish|menu item|to the menu|on the menu|onto the menu)\b/)&&!v(e,/\b(special|specials|sold out|order list)\b/)?8:0,parse:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t?.rid),n=e.toLowerCase(),i=e.match(/\b(?:called|named)\s+(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i)??e.match(/\b(?:add|put)\s+(?:a |an |the )?(?:new )?(?:dish\s+)?(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i),s=r?.sections.find(e=>n.includes(e.toLowerCase())||n.includes(e.toLowerCase().replace(/s$/,''))),o=ce(e);return{name:i?.[1]?.replace(/^(?:a |an )?(?:new )?dish\s*/i,'').trim(),section:s,price:null!=o?String(o):void 0}},preview:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=String(e.section??r?.sections[0]??'Mains');return`Add ${_(String(e.name))} to ${n} at \xa3${Number(e.price).toFixed(2)}${e.description?`, described as ${_(String(e.description))}`:''}? It stays off the menu until the head chef signs off its recipe card.`},run:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=Number(e.price),i=String(e.name??'').trim();return i.length<2||!Number.isFinite(n)||n<=0?'Nothing changed: I need a dish name and a price.':de(t.rid,i)?.name.toLowerCase()===i.toLowerCase()?'That dish is already on the menu.':(a.useStore.getState().addMenuItem({restaurantId:t.rid,section:String(e.section??r?.sections[0]??'Mains'),name:i,description:String(e.description??''),price:n,dietary:[],allergens:{},prepMins:10,soldOut:!1,signOff:null}),`Done: ${i} added. The head chef needs to add its recipe card and sign off the allergens before it shows.`)}},{id:'edit_dish',apps:T,title:'Rename a dish or change its description',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name now'},{name:'field',type:'string',required:!0,description:'name or description',enum:['name','description']},{name:'value',type:'string',required:!0,description:'The new name or description'}],keywords:[],description:'Rename a dish or change its menu description, like Manage \u203a Save dish. Renaming changes its recipe card, so the head chef signs it off again.',match:e=>v(e,/\brename\b|\b(change|update|set|edit)\b.*\b(description|name)\b|\bdescri(be|ption)\b.*\bas\b/)&&!v(e,/\b(price|booking|special|my name)\b/)?8:0,parse:e=>{const t=e.match(/\brename\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i);if(t)return{dish:t[1],field:'name',value:t[2].trim()};const a=e.match(/\bname of\s+(?:the\s+)?(.+?)\s+to\s+(.+)$/i);if(a)return{dish:a[1],field:'name',value:a[2].trim()};const r=e.match(/\bdescription (?:of|for)\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i)??e.match(/\b(?:describe|change|update|set)\s+(?:the\s+)?(.+?)(?:'s|\u2019s)?\s+(?:description\s+)?(?:to|as)\s+(.+)$/i);return r?{dish:r[1],field:'description',value:r[2].trim()}:{dish:e}},preview:(e,t)=>{const a=de(t.rid,e.dish);return a?'name'===e.field?`Rename ${_(a.name)} to ${_(String(e.value))}? Its recipe card changes too, so the head chef signs it off again.`:`Change the description of ${a.name} to ${_(String(e.value))}?`:'I couldn\u2019t find that dish on the menu.'},run:(e,t)=>{const r=de(t.rid,e.dish),n=String(e.value??'').trim();return r?n.length<2?'Nothing changed: say the new wording.':(a.useStore.getState().updateMenuItem(r.id,'name'===e.field?{name:n}:{description:n}),'name'===e.field?`Done: renamed to ${n}.`:`Done: description of ${r.name} changed.`):'Nothing changed: I couldn\u2019t find that dish.'}},{id:'add_recipe_ingredient',apps:['chef'],title:'Add an ingredient to a recipe card',risk:'change',params:[{name:'text',type:'string',required:!0,description:'e.g. add 50 grams of butter to the haggis'}],keywords:[],description:'Add an ingredient line to a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\badd\b/)&&v(e,/\b(ingredient|recipe|card)\b|\badd\s+\d+\s*(g|grams?|kg|ml|tbsp|tsp)\b/)&&!v(e,/\b(step|method|order list|special)\b/)?8:0,parse:e=>({text:e}),preview:(e,t)=>{const a=pe(String(e.text));if(!a)return'Say it like \u201cadd 50 grams of butter to the haggis\u201d.';const r=(0,$.findCard)(t.rid,a.dish);return r?`Add ${[a.qty,a.unit].filter(Boolean).join(' ')} ${a.name} to ${r.dish}\u2019s recipe card?${r.signOff?' It\u2019s signed off now, so it will need signing off again.':''} Check its allergens on the card.`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=pe(String(e.text)),r=a&&(0,$.findCard)(t.rid,a.dish);return a&&r?(await(0,y.recipeCards)().update(r.id,{ingredients:[...r.ingredients,{id:(0,k.uuid)(),name:a.name,qty:a.qty,unit:a.unit}]},{name:N(I(t)),role:'head-chef'}),`Done: ${a.name} added to ${r.dish}.${r.signOff?' It needs signing off again.':''}`):'Nothing changed: I couldn\u2019t find that recipe card.'}},{id:'add_recipe_step',apps:['chef'],title:'Add a method step to a recipe card',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'},{name:'step',type:'string',required:!0,description:'The step wording'}],keywords:[],description:'Add a method step to the end of a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\b(add|new)\b/)&&v(e,/\b(step|method)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:to|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*[:,]\s*(.+)$/i)??e.match(/\bstep\s+(?:to|for)\s+(?:the\s+)?(.+?)\s+(?:saying|that says|reading)\s+(.+)$/i);return t?{dish:t[1],step:t[2].trim()}:{dish:e}},preview:(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0;return a?`Add step ${a.steps.length+1} to ${a.dish}: ${_(String(e.step))}?${a.signOff?' It will need signing off again.':''}`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0,r=String(e.step??'').trim();return!a||r.length<3?'Nothing changed: I need the dish and the step.':(await(0,y.recipeCards)().update(a.id,{steps:[...a.steps,r]},{name:N(I(t)),role:'head-chef'}),`Done: step added to ${a.dish}.`)}},{id:'manager_clock',apps:T,title:'Clock someone in or out (manager correction)',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff first name or id'},{name:'action',type:'string',required:!0,description:'in, out, break_start or break_end',enum:['in','out','break_start','break_end']},{name:'reason',type:'string',required:!0,description:'Why (at least 3 letters)'}],keywords:[],description:'A manager clocks a member of staff in or out, or starts or ends their break, now, with a reason, like the Clock tab\u2019s manager buttons. It is marked as a manager correction.',match:e=>v(e,/\bclock\s+\w+\s+(in|out)\b|\bclock (in|out)\s+[a-z]+\b|\b(start|end)\s+(a |the )?break for\b|\b(end|finish)\s+\w+'?s break\b/)&&!v(e,/\b(me|myself|my|who|is|are|has)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=W(e)[0],r=e.match(/\b(?:reason|because|as)\b[:,]?\s*(.+)$/i),n=/\bbreak\b/.test(t)?/\b(end|finish|back)\b/.test(t)?'break_end':'break_start':/\bout\b/.test(t)?'out':'in';return{staffId:a?.id,action:n,reason:r?.[1]?.trim()}},preview:e=>{const t=E(e.staffId);return t?`${le[e.action??'in'].replace('{n}',N(t.name))} now, at ${D()}? Reason: ${_(String(e.reason))}. It\u2019s marked as a manager correction.`:'Who? Say their first name.'},run:(e,t)=>{const a=E(e.staffId);if(!a)return'Nothing changed: I couldn\u2019t tell who.';const r=e.action??'in',n=(0,g.managerClockAction)(r,{rid:t.rid,staffId:a.id,date:t.today,at:(0,$.appNow)().toISOString()},{id:t.whoId??'manager',name:N(I(t))},String(e.reason??''));return n.ok?`Done: ${N(a.name)} ${{in:'clocked in',out:'clocked out',break_start:'on a break',break_end:'back from break'}[r]} at ${D()}.${n.warn?' '+n.warn:''}`:'Nothing changed: '+n.message}},{id:'tips_pot',apps:T,title:'What\u2019s in the tips pot',risk:'look',params:[],keywords:[],description:'Managers only: the confirmed tips held for the team since the last payout (the Tips pot card).',match:e=>v(e,/\btips? (pot|jar|so far|held|this (period|fortnight|month|week))\b|\bin the tips\b|\bhow much (have we got |is there )?in tips\b|\bwhat are the tips\b|\bhow much (are|is) (the )?tips\b/)&&!v(e,/\b(pay|payout|split|share out)\b/)?8:0,preview:()=>'Tips pot',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const r=h.useCashUp.getState(),n=a.useStore.getState().restaurants.find(e=>e.id===t.rid),i=(0,f.payFor)(t.rid,n?.settings.pay,u.useOnboard.getState().answers).pay,s=(0,p.tipsPot)(r.tips.filter(e=>e.rid===t.rid),r.pot.filter(e=>e.rid===t.rid),(0,l.tipsPeriod)(i,t.today).start,t.today);return`The tips pot holds ${fe(s.total)} from ${(0,$.niceDay)(s.from)} to today, from ${s.days.length} confirmed cash-up${1===s.days.length?'':'s'}.${s.lastPayout?` Last paid out through ${(0,$.niceDay)(s.lastPayout.throughDate)}.`:''}`}},{id:'cash_up_summary',apps:T,title:'Read the latest cash-up',risk:'look',params:[{name:'day',type:'string',required:!1,description:'Day (else the latest)'}],keywords:[],description:'Managers only: the latest (or a named day\u2019s) cash-up: gross takings, tips and who confirmed it.',match:e=>v(e,/\bcash.?up\b|\btakings\b|\bhow much did we take\b/)&&!v(e,/\b(add|enter|start|do the|unlock|edit)\b/)?8:0,parse:(e,t)=>({day:j(e.replace(/\btonight\b/i,'today'),t?.today??(0,l.ymdOf)((0,$.appNow)()))??(/\b(last night|yesterday)\b/i.test(e)?'yesterday':void 0)}),preview:()=>'Cash-up read-out',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const a=new Date(t.today+'T12:00:00');a.setDate(a.getDate()-1);const r='yesterday'===e.day?(0,l.ymdOf)(a):e.day,n=h.useCashUp.getState().cashUps.filter(e=>e.rid===t.rid&&(!r||e.date===r)).sort((e,t)=>t.date.localeCompare(e.date)),i=n[0];return i?`Cash-up for ${(0,$.niceDay)(i.date)}: gross takings ${fe((0,p.grossOf)(i.vals))}, tips ${fe((0,p.combinedTips)(i.vals))} (cash and card). ${i.confirmedAt?`Confirmed${i.confirmedBy?` by ${i.confirmedBy}`:''}.`:'Not confirmed yet.'}`:r?`There\u2019s no cash-up for ${(0,$.niceDay)(r)}.`:'There\u2019s no cash-up yet.'}},{id:'table_note',apps:C,title:'Add a note to a table',risk:'change',params:[{name:'table',type:'string',required:!0,description:'Table'},{name:'note',type:'string',required:!0,description:'The note (say \u201cclear\u201d to remove it)'}],keywords:[],description:'Put a short note on a table on the floor plan (e.g. \u201chigh chair\u201d, \u201cbirthday\u201d), like the table sheet\u2019s Note.',match:e=>v(e,/\btables?\s+\w+/)&&v(e,/\bnote\b/)&&!v(e,/\bshift note\b/)?9:0,parse:e=>{const t=e.match(/\bnote\b(?:\s+(?:on|for|to)\s+tables?\s+\w+)?\s*(?:[:,-]|saying|that says|that|says|reading)?\s*(.+)$/i),a=/\b(clear|remove|delete) (the )?note\b/i.test(e);return{table:(0,$.tableIn)(e),note:a?'clear':t?.[1]?.replace(/^(?:on|for|to)?\s*tables?\s+\w+\s*[:,-]?\s*/i,'').trim()}},preview:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);return a?'clear'===e.note?`Clear the note on table ${a}?`:`Note on table ${a}: ${_(String(e.note))}?`:'Which table?'},run:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);if(!a)return'Nothing changed: I couldn\u2019t find that table.';const n='clear'===e.note?'':String(e.note??'').trim().slice(0,80);return(0,r.tablesOf)(a).forEach(e=>r.useFloor.getState().setLive(t.rid,e,{note:n||void 0})),n?`Done: note on table ${a}.`:`Done: note cleared on table ${a}.`}},{id:'log_lost_property',apps:T,title:'Log lost property',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What was found'},{name:'where',type:'string',required:!1,description:'Where it was found'}],keywords:[],description:'Add an item to the lost property log (held), like Extras \u203a Lost property \u203a Add.',match:e=>v(e,/\blost property\b|\b(found|someone left|left behind|handed in)\b\s+(a|an|some|their|his|her)\b|\b(a|an)\s+\w+(\s+\w+)?\s+(was )?(left behind|handed in)\b/)&&!v(e,/\b(how many|what'?s in|list|read|returned)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:found|left(?: behind)?|handed in|log|add)\s+(?:a |an |some |their |his |her )?(.+?)(?=\s+(?:at|on|in|under|by|near|from)\s|[,.]|$)/i)??e.match(/\b(?:a|an)\s+(.+?)\s+(?:was )?(?:left behind|handed in)/i),a=e.match(/\s(?:at|on|in|under|by|near)\s+(?:the\s+)?(table\s+\w+|bar|toilets?|coat ?rack|cloakroom|door|entrance|terrace|garden|car park|dining room|booth\s+\w+|[a-z]+ table)\b/i);return{item:t?.[1]?.replace(/^(?:lost property|to lost property)\s*:?\s*/i,'').trim(),where:a?.[1]}},preview:e=>`Log lost property: ${_(String(e.item))}, found ${e.where?`at ${e.where}`:'(place not noted)'}, today at ${D()}? It\u2019s marked as held.`,run:(e,t)=>{const a=String(e.item??'').trim();if(a.length<2)return'Nothing changed: say what was found.';const r=(0,$.appNow)();return n.useOwner.getState().addLost({item:a,where:String(e.where??'').trim()||'Not noted',foundAt:`${(0,l.ymdOf)(r)} ${D()}`,foundBy:N(I(t))}),`Done: ${a} logged as held.`}},{id:'add_reminder',apps:T,title:'Add a venue reminder for staff',risk:'change',params:[{name:'text',type:'string',required:!0,description:'What it says'},{name:'time',type:'string',required:!0,description:'HH:MM, UK time'},{name:'days',type:'string',required:!1,description:'Days (default every day)'},{name:'audience',type:'string',required:!1,description:'all, foh or kitchen',enum:['all','foh','kitchen']}],keywords:[],description:'Add a venue reminder shown to staff on shift at a time on chosen days, like Settings \u203a Advanced \u203a Reminders \u203a Add.',match:e=>v(e,/\b(remind|reminder)\b/)&&v(e,/\b(add|set|new|create|every|daily|weekdays?|weekends?|at \d)\b/)&&!v(e,/\b(me|my)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=/\b(kitchen|chefs?)\b/.test(t)?'kitchen':/\b(front of house|foh|floor|waiters?|servers?)\b/.test(t)?'foh':'all',r=e.match(/\bremind(?:er)?\s+(?:for\s+)?(?:everyone|all staff|staff|the team|the kitchen|kitchen|front of house|foh|the floor|chefs?)?\s*(?:to|that|:)\s+(.+?)(?=\s+(?:at\s+\d|every\b|on\s+(?:mon|tue|wed|thu|fri|sat|sun)|daily|weekdays?|weekends?)|$)/i)??e.match(/\breminder\s*(?:saying|that says|:)\s*(.+?)(?=\s+(?:at\s+\d|every\b|daily)|$)/i),n=e.match(/\bat\s+(\d{1,2}(?:[:.]\d{2})?\s*(?:am|pm)?)/i);return{text:r?.[1]?.trim(),time:n?(0,$.hm)(n[1])??void 0:void 0,days:ge(t).join(','),audience:a}},preview:e=>{const t=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number),a=String(e.text??''),r=a.charAt(0).toUpperCase()+a.slice(1);return`Add a reminder for ${ye[e.audience??'all']}: ${_(r)}, ${7===t.length?'every day':'every '+t.map(e=>me[e].replace(/^\w/,e=>e.toUpperCase())).join(', ')} at ${e.time} (UK time)?`},run:(e,t)=>{const a=String(e.text??'').trim(),r=String(e.time??'');if(a.length<2||!/^\d{2}:\d{2}$/.test(r))return'Nothing changed: I need the wording and a time like 21:00.';const n=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number).filter(e=>e>=0&&e<=6).sort();return c.useReminders.getState().ensure(t.rid),c.useReminders.getState().add(t.rid,{text:a.charAt(0).toUpperCase()+a.slice(1),days:n,time:r,audience:e.audience??'all'}),'Done: reminder added.'}}]},1425,[804,848,800,1014,865,1019,1029,1030,1002,1001,1024,13,1049,1050,1051,1020,1071,856,1079,1011,839,1426,1424]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.dishesFor=R,_e.findDish=E,_e.allergensSaid=M,_e.timeFrom=Y,_e.coversFrom=G,_e.dateFrom=Z,_e.nameFrom=$,Object.defineProperty(_e,"VOICE_ACTIONS",{enumerable:!0,get:function(){return X}});var e=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),s=_r(_d[7]),d=_r(_d[8]),l=_r(_d[9]),c=_r(_d[10]),p=_r(_d[11]),u=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]),f=_r(_d[15]),g=_r(_d[16]),b=_r(_d[17]),y=_r(_d[18]);const w=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},v=e=>String(e).padStart(2,'0'),k=e=>e.getFullYear()+'-'+v(e.getMonth()+1)+'-'+v(e.getDate()),S=e=>{const[t,r,a]=e.split('-').map(Number);return new Date(t,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},N=(e,t)=>t.test(e),I=(e,t)=>e+' '+t+(1===e?'':'s'),A={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},T=e=>null==e?void 0:A[e.toLowerCase()]??(Number.isFinite(Number(e))?Number(e):void 0),x=e=>e.who??('display'===e.app?'Main Display':'Assistant'),D={owner:'Managers',staff:'Staff',chef:'Head Chef',display:'Main Display'},C=e=>D[e.app??'owner'],O=new Set(['the','and','with','our','for']),L=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').split(/\s+/).filter(e=>e.length>2&&!O.has(e));function R(e){const t=i.useStore.getState(),r=(0,c.resolveMenu)(t.menu.filter(t=>t.restaurantId===e&&!t.hidden)).map(e=>({kind:'menu',id:e.id,name:e.name,allergens:e.allergens,soldOut:e.soldOut,price:e.price,signedOff:!!e.signOff})),a=l.useSpecials.getState().current[e];return[...r,...(a?.items??[]).map(e=>({kind:'special',id:e.id,name:e.name,allergens:e.allergens,price:e.price,signedOff:!!a?.allergenCheck}))]}const _=e=>e.replace(/s$/,'');function E(e,t){const r=new Set(L(e).map(_)),a=e.toLowerCase();let n;for(const e of R(t)){const t=L(e.name);if(!t.length)continue;const o=t.filter(e=>r.has(_(e))).length;if(!o)continue;const i=o/t.length+.25*o+(a.includes(e.name.toLowerCase())?2:0);(o>=Math.min(2,t.length)||t.length<=3)&&(!n||i>n.s)&&(n={d:e,s:i})}return n?.d}const F=[[/\b(gluten|wheat|coeliac|celiac|barley|rye)\b/,['gluten']],[/\bpeanuts?\b/,['peanuts']],[/\b(tree ?nuts?|almonds?|walnuts?|hazelnuts?|cashews?|pecans?|pistachios?)\b/,['treenuts']],[/\bnuts?\b/,['peanuts','treenuts']],[/\b(dairy|milk|lactose|cheese|cream|butter)\b/,['milk']],[/\beggs?\b/,['eggs']],[/\b(shellfish|crustaceans?|prawns?|crab|langoustines?)\b/,['crustaceans']],[/\b(molluscs?|mussels?|oysters?|squid|scallops?|clams?)\b/,['molluscs']],[/\bfish\b/,['fish']],[/\b(soya|soy)\b/,['soya']],[/\bcelery\b/,['celery']],[/\bmustard\b/,['mustard']],[/\bsesame\b/,['sesame']],[/\b(sulphites?|sulfites?|sulphur)\b/,['sulphites']],[/\blupin\b/,['lupin']]];function M(e){const t=new Set;for(const[r,a]of F)r.test(e)&&a.forEach(e=>t.add(e));return[...t]}const q=e=>p.ALLERGENS.find(t=>t.id===e)?.short??e,z='Always check the signed-off recipe card and tell the kitchen about any allergy.';function B(t,r){if('chef'===r?.app&&(0,e.isAnchorage)(r.rid)&&(0,e.isBarFridge)(t))return[];const a=d.useSafety.getState().points.filter(t=>'chef'!==r?.app||(0,e.chefCanSee)(r.rid,t)),n=/\b(done|complete|completed|finished|ok|okay|checked)\b/i.test(t);return(0,f.parseQuick)(t,a).filter(e=>e.point).map(e=>{const t=(0,f.isTempKind)(e.point.kind);return{pointId:e.point.id,value:t?e.value:null,done:t?void 0:n}})}const j=e=>{try{return JSON.parse(String(e.readings??'[]'))}catch{return[]}};function H(e){const t=d.useSafety.getState().points.find(t=>t.id===e.pointId);return t?(0,f.isTempKind)(t.kind)?null==e.value?t.name+': no temperature heard':t.name+': '+e.value+'\xb0C '+((0,f.inRange)(t,e.value)?'(safe)':'OUT OF RANGE (safe: '+(0,f.limitText)(t)+')'):t.name+': '+(e.done?'done':'NOT done'):'?'}function Y(e){const t=e.match(/\b(?:at|around|about)\s+(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})[:.](\d{2})\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})()\s*(am|pm)\b/);if(!t){const t=e.match(new RegExp("\\bhalf (?:past )?(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b"));if(!t)return;let r=T(t[1])??0;return r>=1&&r<=10&&(r+=12),v(r)+':30'}let r=Number(t[1]);const a=Number(t[2]||0),n=t[3];return'pm'===n&&r<12&&(r+=12),'am'===n&&12===r&&(r=0),!n&&r>=1&&r<=10&&(r+=12),r>23||a>59?void 0:v(r)+':'+v(a)}function G(e){const r=e.match(new RegExp("\\b(?:table for|party of|for|of)\\s+(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))"))??e.match(new RegExp("\\b(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\s*(?:covers|people|guests|adults|of us)\\b")),a=T(r?.[1]);return a&&(0,t.validParty)(a)?a:void 0}const P=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function Z(e,t){const r=new Date(t+'T12:00:00');if(/\btomorrow\b/.test(e))return r.setDate(r.getDate()+1),k(r);const a=P.findIndex(t=>e.includes(t));if(a>=0){const t=(r.getDay()+6)%7;return r.setDate(r.getDate()+((a-t+7)%7||(/\bnext\b/.test(e)?7:0))),k(r)}return t}function U(e,t,r,a){const n=i.useStore.getState(),o=n.restaurants.find(t=>t.id===e),d=s.useFloor.getState().plans[e]??(0,s.seedPlan)(e),l=o?.settings.turnMins??90,c=n.bookings.filter(r=>r.restaurantId===e&&r.date===t);return(0,u.freeTablesAt)(d,c,a,new Date(t+'T'+r+':00'),(0,u.turnFor)(a,l),l)}const K=(e,t)=>{const[r,a]=e.split(':').map(Number),n=60*r+a+t;return v(Math.floor(n/60))+':'+v(n%60)},W=e=>e.replace(/^\w/,e=>e.toUpperCase());function $(e){const t=e.match(/\b(?:under|name of|named|called)\s+([A-Za-z][A-Za-z'\u2019-]+(?:\s+[A-Z][A-Za-z'\u2019-]+)?)/i)??e.match(/\bname(?:'s| is)?\s+([A-Za-z][A-Za-z'\u2019-]+)/i);return t?W(t[1]):void 0}const J=e=>!/\b(how do i|how do you|where do i|how to)\b/.test(e),V=e=>!['collected','served','closed','cancelled'].includes(e.status),Q=e=>e.toUpperCase().replace(/[\s-]/g,''),X=[{id:'next_table_free',title:'When is the next table free?',risk:'look',description:'Estimate when the next table frees up, and how long a walk-in for 2 or 4 would wait.',params:[],keywords:['next table','table free'],match:e=>N(e,/\b(next|soonest|first)\b.*\btables?\b.*\b(free|ready|available|clear)\b|\bhow long\b.*\b(wait|walk)|\bwait(ing)? (time|for a table)\b|\bwhen\b.*\btable\b.*\b(free|ready)\b/)?4:0,preview:()=>'Next table free',run:(e,t)=>{const r=i.useStore.getState(),a=w(),n=k(a),o=r.restaurants.find(e=>e.id===t.rid);if(!o)return'I can\u2019t see this venue\u2019s tables yet.';const d=s.useFloor.getState(),l=d.plans[t.rid]??(0,s.seedPlan)(t.rid),c=r.bookings.filter(e=>e.restaurantId===t.rid),p=(0,m.closedAreasAt)(m.useBlocks.getState().blocks,t.rid,n,v(a.getHours())+':'+v(a.getMinutes())),f=(0,u.floorView)(l,c,r.orders.filter(e=>e.restaurantId===t.rid),d.live[t.rid]??{},a,o.settings.turnMins,p);return(0,h.nextFreeSentence)((0,h.nextTablesFree)(o,f,c.filter(e=>e.date===n),a,c),a)+' It\u2019s an estimate.'}},{id:'log_check',title:'Log a temperature or kitchen check',risk:'change',description:'Record fridge, freezer, cooking, cooling, hot-hold or delivery temperatures, or a cleaning or kitchen check, in the food safety log. Out-of-range readings are flagged.',params:[{name:'readings',type:'string',required:!0,description:'JSON list of {pointId, value in \xb0C or null, done for non-temperature checks}'}],keywords:['fridge','freezer','temperature','probe'],match:e=>J(e)&&N(e,/\b(fridges?|freezers?|walk.?in|cold room|temps?|temperatures?|degrees|probe|core temp|hot hold|cooling|cleaning|clean down|deep clean)\b/)&&(!N(e,/\b(seat|seated|party|covers?|people|guests?|table \w+|walk.?ins? (of|for)|just arrived)\b/)||N(e,/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus)\b/))?3:0,parse:(e,t)=>({readings:JSON.stringify(B(e,t))}),preview:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));return n.length?'Log in the food safety log: '+n.map(H).join('; ')+'?':'I didn\u2019t catch which fridge, freezer or check. Try \u201cwalk-in fridge 3 degrees\u201d.'},run:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));if(!n.length)return'Nothing logged: I didn\u2019t catch which unit or check.';if(n.some(e=>{const t=a.find(t=>t.id===e.pointId);return!!t&&(0,f.isTempKind)(t.kind)&&null==e.value}))return'Nothing logged: a temperature was missing. Say the number, for example \u201cfreezer minus 19\u201d.';const o=w().toISOString(),i='chef'===r.app?'chef':'owner'===r.app?'managers':'staff',s=n.filter(e=>a.some(t=>t.id===e.pointId)).map(e=>{const t=a.find(t=>t.id===e.pointId),n=(0,f.isTempKind)(t.kind),s=n?(0,f.inRange)(t,e.value):!!e.done,d=['display'===r.app?'Logged on the Main Display.':'',s?'':'Out of range: add the corrective action.'].filter(Boolean).join(' ');return{pointId:t.id,name:t.name,kind:t.kind,at:o,by:x(r),byId:r.whoId??'voice-'+(r.app??'owner'),app:i,value:n?e.value:void 0,done:n?void 0:!!e.done,ok:s,source:'voice',note:d||void 0}});d.useSafety.getState().addEntries(s);const l=s.filter(e=>!e.ok);return l.length?'Logged. '+l.map(e=>e.name+' is OUT OF RANGE').join(', ')+'. Check it now and add what you did in the food safety log.':'Logged: '+s.map(e=>e.name+' '+(null!=e.value?e.value+'\xb0C':'done')).join(', ')+'. All fine.'}},{id:'allergen_info',title:'Allergen question',risk:'look',description:'Answer allergen questions from the recipe cards and the menu: what a dish contains or may contain, or which dishes are free of an allergen.',params:[{name:'dish',type:'string',description:'Dish name'},{name:'allergens',type:'string',description:'Comma-separated allergen ids'}],keywords:['allergen','allergy','contain'],match:e=>!N(e,/(allergens?|allerg(y|ic|ies)|contains?|coeliac|celiac|safe for|free from|.free\b|intoleran)/)||N(e,/\b(sold out|price|draft)\b/)||N(e,/\btables?\b.*\bfree\b|\bfree\b.*\btables?\b/)?0:3,parse:(e,t)=>{const r=E(e,t.rid);let a=e.toLowerCase();if(r)for(const e of L(r.name))a=a.replace(new RegExp('\\b'+e+'\\b','g'),' ');return{dish:r?.name,allergens:M(a).join(',')}},preview:e=>'Allergens'+(e.dish?' in '+e.dish:''),run:(e,t)=>{const r=R(t.rid),a=e.dish?r.find(t=>t.name===e.dish):void 0,n=String(e.allergens??'').split(',').filter(Boolean);if(a){const e=p.ALLERGENS.filter(e=>'contains'===a.allergens[e.id]).map(e=>e.short),t=p.ALLERGENS.filter(e=>'may'===a.allergens[e.id]).map(e=>e.short);return(n.length?n.map(e=>'contains'===a.allergens[e]?a.name+' CONTAINS '+q(e)+'.':'may'===a.allergens[e]?a.name+' MAY CONTAIN '+q(e)+'.':'No '+q(e)+' is listed for '+a.name+'.').join(' '):a.name+' contains '+(e.length?e.join(', '):'none of the 14 allergens')+(t.length?', and may contain '+t.join(', '):'')+'.')+(a.signedOff?'':' Its allergens are NOT signed off yet.')+' '+z}if(n.length){const e=r.filter(e=>!e.soldOut&&n.every(t=>!e.allergens[t])),t=r.filter(e=>n.some(t=>'contains'===e.allergens[t]));return e.length+(1===e.length?' dish has':' dishes have')+' no '+n.map(q).join(' or ')+' listed'+(e.length?', for example '+e.slice(0,5).map(e=>e.name).join(', '):'')+'. '+t.length+' contain it. '+z}return'Which dish, or which allergen? For example \u201cdoes the fish supper contain gluten?\u201d.'}},{id:'set_sold_out',title:'Mark a dish sold out or back on',risk:'change',description:'Mark a menu dish sold out or back on. A reminder for staff: it shows on the Display and in the Sold out list.',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'soldOut',type:'string',required:!0,description:'yes = sold out, no = back on',enum:['yes','no']}],keywords:['sold out','back on','86'],match:e=>N(e,/\b(sold out|run out|ran out|out of stock|86|eighty.?six|back on|available again|back in stock|un.?86|none left)\b/)?4:0,parse:(e,t)=>{const r=E(e,t.rid),a=/\b(back on|available again|back in stock|un.?86)\b/i.test(e);return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,soldOut:a?'no':'yes'}},preview:e=>e.itemId?'Mark '+e.name+' '+('no'===e.soldOut?'back on':'sold out')+'?':e.name?e.name+' is on the Specials board; change it there.':'I couldn\u2019t find that dish on the menu.',run:async e=>e.itemId?(await o.repo.menu.updateItem(String(e.itemId),{soldOut:'no'!==e.soldOut}),'Done: '+e.name+' is '+('no'===e.soldOut?'back on':'sold out')+'.'):'Nothing changed: I couldn\u2019t find that dish on the menu.'},{id:'change_price',apps:['owner'],title:'Change a menu price',risk:'change',description:'Change the price of a menu dish (managers only).',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'pence',type:'integer',required:!0,description:'New price in pence'}],keywords:['price'],match:e=>N(e,/\b(price|charge|cost)\b/)&&N(e,/(\xa3|\d|pound)/)&&!N(e,/\b(special|offer)\b/)?3:0,parse:(e,t)=>{const r=E(e,t.rid),a=e.match(/\b(?:to|at)\s*\xa3?\s*(\d{1,3})(?:[.:](\d{1,2}))?/i)??e.match(/\xa3\s*(\d{1,3})(?:\.(\d{1,2}))?/)??e.match(/(\d{1,3})\s*pounds?(?:\s*(\d{1,2}))?/i),n=a?100*Number(a[1])+Number((a[2]??'0').padEnd(2,'0')):void 0;return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,pence:n,old:r?.price??void 0}},preview:e=>e.itemId?'Change '+e.name+' from '+(null!=e.old?(0,g.gbp)(Number(e.old)):'its current price')+' to '+(null!=e.pence?(0,g.gbp)(Number(e.pence)):'?')+'?':'I couldn\u2019t find that dish on the menu.',run:async(e,t)=>{if(t.role&&!['owner','manager'].includes(t.role))return'Only managers can change prices.';const r=Number(e.pence);return e.itemId&&r>0&&r<1e5?(await o.repo.menu.updateItem(String(e.itemId),{price:r}),'Done: '+e.name+' is now '+(0,g.gbp)(r)+'.'):'Nothing changed: I need the dish and a price.'}},{id:'draft_special',apps:['owner','chef'],title:'Draft a special',risk:'draft',description:'Save a special as a draft for the owner to approve. It goes on the Specials board only after its allergens are checked.',params:[{name:'text',type:'string',required:!0,description:'The special, e.g. \u201cHake with mussels, \xa318\u201d'}],keywords:['special'],match:e=>N(e,/\bspecials?\b/)&&N(e,/\b(add|new|put|draft|today'?s|tonight'?s|change|set)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\bspecials?\b(?:\s*(?:board|is|are|to|:))?\s*/i,'').trim()||e}),preview:e=>'Save a draft special: \u201c'+e.text+'\u201d. Its allergens get checked before it goes on the board.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'special',title:'New special',lines:[String(e.text),'Add its allergens and post it on the Specials board when approved.'],by:x(t),app:C(t)}),'Saved as a draft special for the owner to approve. It isn\u2019t on the board yet.')},{id:'check_availability',title:'Check table availability',risk:'look',description:'Check whether a table is free for a party at a date and time, and suggest nearby times if not.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'}],keywords:['availability','table for','free table'],match:e=>N(e,/\b(availability|available|space|room for|any room|got room|any tables?|got a table|free table|have we got|is there a table|can we fit|fit in)\b/)&&!N(e,/\b(sold|back on|allerg)/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r)}},preview:e=>'Check a table for '+(e.covers??'?')+' at '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'today'),run:(e,t)=>{const r=Number(e.covers),a=String(e.time),n=String(e.date??t.today),o=U(t.rid,n,a,r);if(o.length)return'Yes, there\u2019s room for '+r+' at '+a+' on '+S(n)+'. Best fit: table '+o[0].table+(o[0].area?' ('+o[0].area+')':'')+'.';const i=[];for(const e of[-30,30,-60,60,-90,90]){const o=K(a,e);if(U(t.rid,n,o,r).length&&i.push(o),i.length>=3)break}return'No table for '+r+' at '+a+' on '+S(n)+'.'+(i.length?' Free nearby: '+i.sort().join(', ')+'.':' Nothing free within 90 minutes either.')}},{id:'draft_booking',title:'Take a booking (draft)',risk:'draft',description:'Take a booking as a DRAFT for the owner to confirm in Bookings. The guest confirmation is only sent from there.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'},{name:'name',type:'string',description:'Guest name'}],keywords:['book','booking','reserve'],match:e=>N(e,/\b(book|booking|reserve|reservation)\b/)&&!N(e,/\b(availability|any tables?|have we got|is there|how many|move|cancel|booker)\b/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r),name:$(e)}},preview:(e,t)=>{const r=e.covers&&e.time?U(t.rid,String(e.date??t.today),String(e.time),Number(e.covers)):[],a=e.covers&&e.time?r.length?' Table '+r[0].table+' is free.':' NO table is free then.':'';return'Draft booking: '+(e.name??'guest')+', '+(e.covers??'?')+' covers, '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'?')+'.'+a+' The owner confirms it in Bookings; nothing is sent to the guest now.'},run:(e,r)=>(0,t.validParty)(Number(e.covers))?(b.useDrafts.getState().add({rid:r.rid,kind:'booking',title:'Booking: '+(e.name??'guest')+', '+e.covers+' covers',lines:[S(String(e.date))+' at '+e.time,'Take their phone number when you confirm it in Bookings.'],data:{covers:e.covers,date:e.date,time:e.time,name:e.name},by:x(r),app:C(r)}),'Saved as a draft booking for the owner to confirm. No confirmation has been sent.'):`Nothing saved. ${t.PARTY_RULE} How many people?`},{id:'add_waitlist',title:'Add to the waitlist',risk:'change',description:'Add a party to the waitlist. Nobody is messaged.',params:[{name:'name',type:'string',description:'Name'},{name:'covers',type:'integer',required:!0,description:'Party size'}],keywords:['waitlist','waiting list'],match:e=>N(e,/\b(wait ?list|waiting list|queue)\b/)?4:0,parse:e=>({name:$(e)??e.match(/\badd\s+([A-Z][a-z'\u2019-]+)\b/)?.[1],covers:G(e.toLowerCase())}),preview:e=>'Add '+(e.name??'a guest')+', '+(e.covers??'?')+' covers, to the waitlist?',run:async(e,r)=>{const a=Number(e.covers);if(!(0,t.validParty)(a))return`Nothing added: how many people? ${t.PARTY_RULE}`;return'Done: '+(await o.repo.waitlist.join(r.rid,String(e.name??'Guest'),a)).name+' is on the waitlist. Nobody has been messaged.'}},{id:'read_orders',title:'Read out orders',risk:'look',description:'Read out the live orders and takeaways.',params:[],keywords:['orders'],match:e=>N(e,/\b(orders?|takeaways?|tickets?|collections?)\b/)&&N(e,/\b(read|what|any|list|how many|open|live|waiting|outstanding|pending|due|next)\b/)&&!N(e,/\b(shopping|booker|bidfood|supplier)\b/)?3:0,preview:()=>'Read out the live orders',run:(e,t)=>{const a=i.useStore.getState().orders.filter(e=>e.restaurantId===t.rid&&V(e)).sort((e,t)=>(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt));if(!a.length)return'No live orders right now.';const n=a.filter(e=>'takeaway'===e.type).length;return I(a.length,'live order')+' ('+n+' takeaway). '+a.slice(0,6).map(e=>{return('takeaway'===e.type?'Takeaway ':(0,r.tableNumbers)(e.tableNo)+' ')+e.ref+' for '+e.customerName+', '+I(e.lines.reduce((e,t)=>e+t.qty,0),'item')+', '+e.status+(e.slotTime?', due '+(t=e.slotTime,new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})):'')+(e.allergies.length?', HAS ALLERGIES':'');var t}).join('. ')+(a.length>6?'. And '+(a.length-6)+' more.':'.')}},{id:'day_numbers',title:'Covers, sales and forecast',risk:'look',description:'How many covers are booked today and tomorrow, sales through CoverCharge so far today, and the forecast for the rest of today.',params:[],keywords:['covers','sales','forecast'],match:e=>N(e,/\b(covers|sales|takings|revenue|forecast|how busy|busy tonight|expected|how many (people|guests|bookings))\b/)&&!N(e,/\b(walk|seat|wait ?list|add|book (a|for|in))\b/)?3:0,preview:()=>'Today\u2019s covers, sales and forecast',run:(e,t)=>{const r=i.useStore.getState(),n=w(),o=k(n),s=r.restaurants.find(e=>e.id===t.rid),d=r.bookings.filter(e=>e.restaurantId===t.rid),l=d.filter(e=>e.date===o&&['confirmed','seated','finished'].includes(e.status)),c=l.reduce((e,t)=>e+t.partySize,0),p=l.filter(e=>e.walkIn).reduce((e,t)=>e+t.partySize,0),u=new Date(n);u.setDate(u.getDate()+1);const h=k(u),m=d.filter(e=>e.date===h&&['confirmed','pending'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),f=r.orders.filter(e=>e.restaurantId===t.rid),b=f.filter(e=>e.createdAt.slice(0,10)===o&&'cancelled'!==e.status),y=b.reduce((e,t)=>e+t.subtotal,0);let v='';if(s){const e=(0,a.forecastToday)(s,d,f,r.events,n);v=e.open?e.enough?' Forecast for the rest of today: about '+e.restOfDay.covers+' covers ('+(0,a.coversRange)(e.restOfDay.low,e.restOfDay.high,!1)+')'+(e.example?', example figures.':'.'):' No forecast yet: not enough history ('+e.restOfDay.booked+' covers booked for the rest of today).':''}return'Today: '+c+' covers booked or seated'+(p?', including '+p+' walk-in':'')+'. '+I(b.length,'order')+' through CoverCharge so far'+('display'===t.app||'staff'===t.app||'staff'===t.role?'.':', '+(0,g.gbp)(y)+' before tips (till sales aren\u2019t included).')+v+' Tomorrow: '+m+' covers booked so far.'}},{id:'supplier_list',title:'Add to a Booker or Bidfood shopping list',risk:'draft',description:'Add items to a DRAFT shopping list for Booker or Bidfood for the owner to check and order on the supplier\u2019s site. Never places an order.',params:[{name:'supplier',type:'string',required:!0,description:'Supplier',enum:['booker','bidfood']},{name:'items',type:'string',required:!0,description:'Items separated by semicolons'}],keywords:['booker','bidfood','shopping list'],match:e=>N(e,/\b(booker|bidfood|bid food)\b/)?4:N(e,/\b(shopping list|order list|we need more|we'?re low on|running low)\b/)?3:0,parse:e=>({supplier:/\bbid ?food\b/i.test(e)?'bidfood':'booker',items:e.replace(/\b(to|on|onto)\s+(the\s+)?(booker|bidfood|bid food)?\s*(shopping\s+|order\s+)?list\b.*$/i,'').replace(/\b(from|at)\s+(booker|bidfood|bid food)\b/i,'').replace(/[,.]?\s*\b(put|add|stick)\s+(it|them|that|those)\b.*$/i,'').replace(/^.*?\b(add|need|order|get|put|low on)\b\s*/i,'').trim().split(/\s*(?:,|\band\b)\s*/i).map(e=>e.trim()).filter(Boolean).join('; ')}),preview:e=>'Add to the draft '+('bidfood'===e.supplier?'Bidfood':'Booker')+' list: '+String(e.items??'').split('; ').join(', ')+'. Nothing is ordered; the owner checks it and orders on the supplier\u2019s site.',run:(e,t)=>{const r=String(e.items??'').split('; ').filter(Boolean);if(!r.length)return'Nothing added: which items?';const a=b.useDrafts.getState().addToList(t.rid,'bidfood'===e.supplier?'bidfood':'booker',r,x(t),C(t));return'Added to the draft '+a.title+' ('+I(a.lines.length,'item')+'). Nothing has been ordered.'}},{id:'draft_offer',title:'Draft an offer',risk:'draft',description:'Save an offer or promotion as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The offer'}],keywords:['offer','promotion'],match:e=>N(e,/\b(offer|promotion|promo|deal|discount|happy hour|two for one|2 for 1)\b/)&&N(e,/\b(draft|create|make|set up|new|add|run|do)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\b(?:offer|promotion|promo|deal)\b\s*(?:for|of|:)?\s*/i,'').trim()||e}),preview:e=>'Save a draft offer for the owner to approve: \u201c'+e.text+'\u201d. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'offer',title:'New offer',lines:[String(e.text)],by:x(t),app:C(t)}),'Saved as a draft offer for the owner to approve. Nothing was published or sent.')},{id:'draft_event',title:'Draft an event',risk:'draft',description:'Save an event (quiz, live music, tasting night) as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The event'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['event'],match:e=>N(e,/\b(event|quiz|live music|tasting|gig|party night|music night|open mic|ceilidh)\b/)&&N(e,/\b(draft|create|make|plan|set up|new|add|put on|run)\b/)?3:0,parse:(e,t)=>({text:e.replace(/^.*?\b(?:draft|create|make|plan|set up|add|put on|run)\b\s*(?:an?|the)?\s*(?:new\s+)?(?:event)?\s*(?:for|:)?\s*/i,'').trim()||e,date:/\b(tomorrow|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i.test(e)?Z(e.toLowerCase(),t.today):void 0}),preview:e=>'Save a draft event for the owner to approve: \u201c'+e.text+'\u201d'+(e.date?' on '+S(String(e.date)):'')+'. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'event',title:'New event',lines:[String(e.text),...e.date?[S(String(e.date))]:[]],data:{date:e.date},by:x(t),app:C(t)}),'Saved as a draft event for the owner to approve. Nothing was published or sent.')},{id:'card_balance',apps:['owner','chef'],title:'Gift card or stamp card balance',risk:'look',description:'Look up a gift card balance by its code, or a summary of stamp cards.',params:[{name:'code',type:'string',description:'Gift card code'},{name:'kind',type:'string',description:'gift or stamp',enum:['gift','stamp']}],keywords:['gift card','voucher','stamp card'],match:e=>N(e,/\b(gift ?cards?|gift vouchers?|vouchers?|stamp ?cards?|stamps|loyalty)\b/)?3:0,parse:e=>{const t=e.toUpperCase().replace(/\b(GIFT|CARDS?|VOUCHERS?|BALANCE|CHECK|WHAT'?S|WHAT|THE|ON|IS|CODE|FOR|OF|HOW|MUCH|LEFT|STAMPS?|A)\b/g,' ').match(/[A-Z0-9][A-Z0-9 -]{3,}[A-Z0-9]/);return{kind:/stamp|loyalty/i.test(e)?'stamp':'gift',code:t?Q(t[0]):void 0}},preview:e=>'stamp'===e.kind?'Stamp cards':'Gift card '+(e.code??''),run:(e,t)=>{const r=i.useStore.getState();if('stamp'===e.kind&&(0,n.staffServer)())return(0,n.loyaltySummary)().then(e=>I(e.members,'guest')+' have stamp cards here; '+I(e.rewardsReady,'reward')+' ready to use. To check one guest, open Stamp card and find or scan them.',()=>'I couldn\u2019t reach the stamp cards just now. Try again in a moment.');if('stamp'===e.kind){const e=r.stampCards.filter(e=>e.restaurantId===t.rid),a=e.reduce((e,t)=>e+t.rewardsAvailable,0);return I(e.length,'guest')+' have stamp cards here; '+I(a,'reward')+' ready to claim. To check one guest, scan their card in Stamp cards.'}if(!e.code)return'Read me the code on the gift card, letter by letter.';const a=String(e.code),o=r.giftCards.filter(e=>e.restaurantId===t.rid).find(e=>Q(e.code)===a||a.length>=4&&Q(e.code).includes(a));return o?'Gift card '+o.code+': '+(0,g.gbp)(o.balance)+' left of '+(0,g.gbp)(o.initial)+'.':'I couldn\u2019t find a gift card with that code. Check it and try again.'}},{id:'feedback_summary',title:'Summarise feedback',risk:'look',description:'Summarise the last 7 days of guest ratings and comments.',params:[],keywords:['feedback','reviews'],match:e=>N(e,/\b(feedback|reviews?|ratings?|complaints?|comments?|what are (guests|people) saying)\b/)?3:0,preview:()=>'Summarise this week\u2019s feedback',run:(e,t)=>{const r=w().getTime()-6048e5,a=i.useStore.getState().ratings.filter(e=>e.restaurantId===t.rid&&new Date(e.createdAt).getTime()>=r);if(!a.length)return'No guest feedback in the last 7 days.';const n=a.reduce((e,t)=>e+t.stars,0)/a.length,o=a.filter(e=>e.stars<=3&&e.comment).slice(0,2),s=a.filter(e=>e.stars>=5&&e.comment).slice(0,1);return I(a.length,'rating')+' in the last 7 days, averaging '+n.toFixed(1)+' stars.'+(s.length?' Best: \u201c'+s[0].comment+'\u201d.':'')+(o.length?' To look at: '+o.map(e=>'\u201c'+e.comment+'\u201d ('+e.stars+' stars)').join('; ')+'.':' No low scores.')}},{id:'shift_note',title:'Leave a shift note',risk:'change',description:'Leave a note for the next shift.',params:[{name:'text',type:'string',required:!0,description:'The note'}],keywords:['shift note','handover'],match:e=>N(e,/\b(shift note|leave a note|note for|handover|tell the next shift|let the next shift know|note that)\b/)&&!N(e,/\b(read|any notes|what notes)\b/)?4:0,parse:e=>({text:e.replace(/^.*?\b(?:shift note|leave a note|note for (?:the )?(?:next shift|tomorrow|tonight|morning|evening)|handover note|handover|tell the next shift|let the next shift know|note that)\b\s*(?:that|:|,|for the next shift)?\s*/i,'').trim()||e}),preview:e=>'Leave a shift note: \u201c'+e.text+'\u201d?',run:(e,t)=>(y.useShiftNotes.getState().add({rid:t.rid,text:String(e.text),by:x(t),app:C(t)}),'Shift note saved. It shows on the Shift notes screen.')},{id:'read_shift_notes',title:'Read shift notes',risk:'look',description:'Read out the latest open shift notes.',params:[],keywords:['notes'],match:e=>N(e,/\b(read|any|what|latest)\b.*\b(shift notes?|notes|handover)\b/)?5:0,preview:()=>'Read the latest shift notes',run:(e,t)=>{const r=y.useShiftNotes.getState().notes.filter(e=>e.rid===t.rid&&!e.done).slice(0,5);return r.length?r.map(e=>e.by+', '+new Date(e.at).toLocaleString('en-GB',{weekday:'short',hour:'2-digit',minute:'2-digit'})+': '+e.text).join('. '):'No open shift notes.'}}]},1426,[804,1098,829,1120,1199,848,800,1014,1019,989,831,830,1079,1080,1011,1020,836,1427,1428]); +__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return f}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},d=r(_d[1]),n=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},f=(0,d.create)()((0,n.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,d,n,o,f)=>{const p=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===d&&'draft'===e.status);if(p){const t={...p,lines:[...p.lines,...n]};return e(e=>({drafts:e.drafts.map(e=>e.id===p.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:d,title:('bidfood'===d?'Bidfood':'Booker')+" shopping list",lines:n,by:o,app:f})},decide:(t,s,d)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:d,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,n.createJSONStorage)(()=>s.default)}))},1427,[808,815,818]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1428,[808,815,818]); +__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,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1429,[798,34,283,364,236,402,102,815,794,840,25]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return a}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],o=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from Bidfood or Booker',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add Bidfood or Booker for this venue, with your account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add Bidfood or Add Booker (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and Booker or Bidfood lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cwalk-in fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, Booker and Bidfood shopping lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cwalk-in fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Take a picture of the taking sheet, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Take a picture of the taking sheet, or upload a spreadsheet',keywords:['cash up','photo','spreadsheet','csv','excel','xlsx','camera','sheet','gross','card','cash','tips','takings'],body:'In Cash up & sales tap Take a picture of the taking sheet: the camera opens and the figures are filled in from the photo. Check every figure beside the photo (gross, card, cash, tips, food and drink), change anything that is wrong, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. If the photo can\u2019t be read, type the figures in.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'The taking sheet buttons are here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display then shows a Buy a gift card button with a large QR code. Guests buy on your website; the Display shows no prices or balances.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per person, the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Upload cash up sheet. Your phone camera opens; take a photo of the paper sheet (you can add several). The review screen shows the photo beside the figures. Automatic reading isn\u2019t switched on yet, so type each figure from the photo; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],a=t=>o.find(o=>o.id===t)},1430,[]); +__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1431,[]); +__d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return x}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]);const i=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},h=e=>String(e).padStart(2,'0'),c=e=>e.getFullYear()+'-'+h(e.getMonth()+1)+'-'+h(e.getDate()),d=e=>{const t=new Date(e);return h(t.getHours())+':'+h(t.getMinutes())},l=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return h(Math.floor(t/60))+':'+h(t%60)},u=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),h=new Date(i());return h.setDate(h.getDate()+1),e===c(h)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},m=(e,t)=>t.test(e),p=e=>(e??'').replace(' (example)',''),f=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),b=['staff'],k=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],w={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function y(e,t){return'all'===e||(0,n.inChannel)(e,t)}function S(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:p(e.name),nickname:e.nickname},o))}const v=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>m(e,/\bkitchen (chat|group|channel)\b/)&&!m(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:b,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>m(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&m(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!m(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=S(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:p(o.name)};const h=k.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(w[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=f(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||y(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(w[s]??'the team chat')+'.'):'You can\u2019t post in '+(w[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:b,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>m(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=f(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||y(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),l=e=>'system'===e.from?'CoverCharge':p(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return l(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(w[t]??t))+' at ')+d(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:b,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>m(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&m(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!m(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=i(),h=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>h)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+u(c.date,s)+', '+l(c.start)+' to '+l(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>u(e.date,s)+' '+l(e.start)+'\u2013'+l(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:b,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>m(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),h=a.today,c=o.getHours()+o.getMinutes()/60,u=s.shifts.find(e=>e.staffId===a.whoId&&e.published&&e.date===h);return n?'You\u2019re clocked in since '+d(n.in)+'.'+(u?' Your shift ends at '+l(u.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':u&&u.end>c?'You\u2019re not clocked in. Your shift today is '+l(u.start)+' to '+l(u.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(u?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:b,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>m(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const h=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+d(e.start)+'. Breaks today: '+h+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return h?'You\u2019ve had '+h+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:b,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>m(e,/\bspecials?\b/)&&!m(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:b,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>m(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],x=new Set(['log_check','allergen_info','next_table_free',...v.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1432,[800,865,989,836,1426,1032]); +__d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1433,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_KEYTERMS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"MAX_APP_KEYTERMS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"VENUE_WORDS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"cleanTerm",{enumerable:!0,get:function(){return u}}),e.venueKeyterms=function(l){const b=[],f=new Set,h=t=>{const a=u(t??''),n=a.toLowerCase();a.length>=2&&!f.has(n)&&b.lengtht.active).forEach(t=>h(String(t.name).split(/\s+/)[0]))}catch{}try{(n.useFloor.getState().plans[l]??(0,n.seedPlan)(l)).areas.forEach(t=>h(t.name))}catch{}try{s.forEach(h)}catch{}try{a.useStore.getState().menu.filter(t=>!t.restaurantId||t.restaurantId===l).forEach(t=>h(t.name))}catch{}return b};var t=r(d[0]),a=r(d[1]),n=r(d[2]);const l=100,c=80,o=['walk-in','covers','table','seat','seated','clear','cleared','needs clearing','block','unblock','waitlist','lobster','crab','langoustines','scallops','sold out','no-show','Sitooterie','Beer Garden','Main Restaurant','party of','people'],s=['table one','table two','table three','table four','table five','table six','table seven','table eight','table nine','table ten','table eleven','table twelve'],u=t=>t.replace(/\([^)]*\)/g,' ').replace(/[^\p{L}\p{N} '&.-]/gu,' ').replace(/\s+/g,' ').trim().slice(0,50).trim()},1434,[865,800,1014]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useVoiceNav",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(()=>({go:null}))},1435,[815]); +__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_TASKS_PER_MONTH",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"VOICE_WARN_AT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"VOICE_FAIR_USAGE",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"monthKey",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"voiceUsage",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"REACHED_TEXT",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"WARN_TEXT",{enumerable:!0,get:function(){return v}}),_e.useVoiceUsage=function(e,t=new Date){const n=h(n=>n.used[e]?.[f(t)]??0);return _(n)};var e,t=r(_d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(_d[1]),s=r(_d[2]);const u=1e3,c=.8,d='Fair usage: 1,000 voice tasks a month per venue',l=new Set(['log_check']),f=(e=new Date)=>e.getFullYear()+'-'+String(e.getMonth()+1).padStart(2,'0'),h=(0,o.create)()((0,s.persist)(e=>({used:{},add:(t,n)=>e(e=>({used:{...e.used,[t]:{[n]:(e.used[t]?.[n]??0)+1}}}))}),{name:'covercharge-voice-usage-v1',version:1,storage:(0,s.createJSONStorage)(()=>n.default)})),_=e=>{const t=e/u;return{used:e,limit:u,pct:t,warn:t>=c,reached:e>=u,line:'Voice assistant: '+e.toLocaleString('en-GB')+' of 1,000 tasks used this month, resets on the 1st'}},b={get:(e,t=new Date)=>_(h.getState().used[e]?.[f(t)]??0),allowed:(e,t,n=new Date)=>null!=t&&l.has(t)||!b.get(e,n).reached,record:(e,t=new Date)=>h.getState().add(e,f(t))},p='This venue has used its fair-usage allowance of 1,000 voice tasks for this month. It starts again on the 1st. Food safety logging still works, and the owner can contact CoverCharge if you need more.',v=e=>e.line+'. That\u2019s '+Math.round(100*e.pct)+'% of this venue\u2019s fair-usage allowance.'},1436,[808,815,818]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useVoiceKeys",{enumerable:!0,get:function(){return e}}),_e.installVoiceKeys=function(){if('undefined'==typeof window||!window.addEventListener)return()=>{};let n=!1;const o=o=>(o.metaKey||o.ctrlKey)&&o.shiftKey&&'g'===o.key.toLowerCase()?(o.preventDefault(),void(o.repeat||e.getState().send('toggle'))):!o.metaKey&&!o.ctrlKey||o.shiftKey||'/'!==o.key?void('Space'!==o.code||o.metaKey||o.ctrlKey||o.altKey||t(o.target)||(o.preventDefault(),o.repeat||n||(n=!0,e.getState().send('start')))):(o.preventDefault(),void e.getState().send('type')),s=t=>{'Space'===t.code&&n&&(t.preventDefault(),n=!1,e.getState().send('stop'))},l=()=>{n&&(n=!1,e.getState().send('stop'))};return window.addEventListener('keydown',o,!0),window.addEventListener('keyup',s,!0),window.addEventListener('blur',l),()=>{window.removeEventListener('keydown',o,!0),window.removeEventListener('keyup',s,!0),window.removeEventListener('blur',l)}};const e=(0,r(d[0]).create)((e,t)=>({last:null,send:n=>e({last:{cmd:n,n:(t().last?.n??0)+1}})})),t=e=>{const t=e?.tagName;return'INPUT'===t||'TEXTAREA'===t||'SELECT'===t||!!e?.isContentEditable}},1437,[815]); +__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=u(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),k=[],A=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);if(i.includes(c))continue;k.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0});const u='st-jack'===t?{auto:'rota'}:{};d=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:f(d,23.5)}:void 0,...u}):d===y&&e<=m&&A.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:f(d,u.auto?e:e-.05),inSite:!0,...u})}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!k.some(e=>e.staffId===t.staffId&&e.date===t.date)),...k],attendance:[...S.attendance,...A]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:f(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:f((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',u=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,f=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1438,[848,800,865,1024,15,997,846]); +__d(function(e,s,o,p,t,a,n){"use strict";t.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},1439,[]); +__d(function(s,o,p,e,d,t,c){"use strict";d.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},1440,[]); +__d(function(o,s,p,e,d,t,f){"use strict";d.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},1441,[]); +__d(function(o,s,p,d,e,t,n){"use strict";e.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},1442,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1443,[30,34,846,25]); +__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 t.Head}});const t=(n=r(d[0]),c=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(c,t)||Object.defineProperty(c,t,{enumerable:!0,get:function(){return n[t]}})}),n);var n,c},1444,[1445]); +__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var c in n)Object.defineProperty(t,c,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,c).get})})(e,{get Head(){return u},get default(){return s}});const n=r(d[1]),c=r(d[2]);function o({children:c}){return(0,t().jsx)(n.Helmet,{children:c})}const u=({children:n})=>(0,c.useIsFocused)()?(0,t().jsx)(o,{children:n}):null;u.Provider=n.HelmetProvider;const s=u},1445,[25,1446,591]); +__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>fe,HelmetData:()=>se,HelmetProvider:()=>oe}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[0])),T=u(r(d[0])),A=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(A||{}),O={rel:["amphtml","canonical","alternate"]},C={type:["application/ld+json"]},w={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x=Object.values(A),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},$=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",k="defaultTitle",S="defer",E="encodeSpecialCharacters",M="onChangeClientState",P="titleTemplate",H="prioritizeSeoTags",D=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},L=t=>{let n=D(t,"title");const s=D(t,P);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=D(t,k);return n||i||void 0},I=t=>D(t,M)||(()=>{}),U=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),N=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;it.push(n));const l=Object.keys(o);for(let t=0;t{if(Array.isArray(t)&&t.length)for(let s=0;sArray.isArray(t)?t.join(""):t,z=(t,n)=>{const s=Object.keys(t);for(let i=0;iArray.isArray(t)?t.reduce((t,s)=>(z(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},F=(t,n)=>({...t,[n]:void 0}),Y=["noscript","script","style"],K=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),G=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${K(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),W=(t,n,s,i)=>{const o=G(s),l=R(n);return o?`<${t} ${j}="true" ${o}>${K(l,i)}`:`<${t} ${j}="true">${K(l,i)}`},J=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${K(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===Y.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}`}`},""),Q=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),V=(t,n,s)=>{const i=Q(s,{key:n,[j]:!0});return[T.default.createElement("title",i,n)]},X=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),T.default.createElement(t,i)}),Z=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>V(0,n.title,n.titleAttributes),toString:()=>W(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Q(n),toString:()=>G(n)};default:return{toComponent:()=>X(t,n),toString:()=>J(t,n,s)}}},ee=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=B(t,w),l=B(n,O),c=B(s,C);return{priorityMethods:{toComponent:()=>[...X("meta",o.priority),...X("link",l.priority),...X("script",c.priority)],toString:()=>`${Z("meta",o.priority,i)} ${Z("link",l.priority,i)} ${Z("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},te=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=ee(t)),{priority:T,base:Z("base",n,i),bodyAttributes:Z("bodyAttributes",s,i),htmlAttributes:Z("htmlAttributes",o,i),link:Z("link",y,i),meta:Z("meta",f,i),noscript:Z("noscript",l,i),script:Z("script",b,i),style:Z("style",c,i),title:Z("title",{title:p,titleAttributes:u},i)}},re=[],ne=!("undefined"==typeof window||!window.document||!window.document.createElement),se=class{instances=[];canUseDOM=ne;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?re:this.instances,add:t=>{(this.canUseDOM?re:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?re:this.instances).indexOf(t);(this.canUseDOM?re:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=te({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ie=b.default.createContext({}),oe=class t extends b.Component{static canUseDOM=ne;constructor(n){super(n),this.helmetData=new se(this.props.context||{},t.canUseDOM)}render(){return b.default.createElement(ie.Provider,{value:this.helmetData.value},this.props.children)}},ae=r(d[0]),le=(t,n)=>{if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;const s=Object.keys(t),i=Object.keys(n);return s.length===i.length&&s.every(s=>Object.prototype.hasOwnProperty.call(n,s)&&t[s]===n[s])},ce=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},pe=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},ue=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=R(t)),pe("title",n)},de=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;pe("body",i),pe("html",o),ue(f,b);const T={baseTag:ce("base",s),linkTags:ce("link",l),metaTags:ce("meta",c),noscriptTags:ce("noscript",p),scriptTags:ce("script",h),styleTags:ce("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},he=null,me=t=>{he&&cancelAnimationFrame(he),t.defer?he=requestAnimationFrame(()=>{de(t,()=>{he=null})}):(de(t),he=null)},ye=class extends ae.Component{rendered=!1;shouldComponentUpdate(t){return!le(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:N(["href"],o),bodyAttributes:U("bodyAttributes",o),defer:D(o,S),encode:D(o,E),htmlAttributes:U("htmlAttributes",o),linkTags:q("link",["rel","href"],o),metaTags:q("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:q("noscript",["innerHTML"],o),onChangeClientState:I(o),scriptTags:q("script",["src","innerHTML"],o),styleTags:q("style",["cssText"],o),title:L(o),titleAttributes:U("titleAttributes",o),prioritizeSeoTags:_(o,H)});var o;oe.canUseDOM?me(i):te&&(s=te(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},fe=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(F(this.props,"helmetData"),F(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){if(!x.some(n=>t.type===n))throw new Error("function"==typeof t.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`);if(n&&"string"!=typeof n&&(!Array.isArray(n)||n.some(t=>"string"!=typeof t)))throw new Error(`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`} ) Refer to our API for more information.`);return!0}mapChildrenToProps(t,n){let s={};return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[$[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof se)){i=new se(i.context,!0),delete s.helmetData}return i?y.default.createElement(ye,{...s,context:i.value}):y.default.createElement(ie.Consumer,null,t=>y.default.createElement(ye,{...s,context:t}))}}},1446,[34,172]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1447,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";function t(){const e=r(d[0]);return t=function(){return e},e}function e(){const t=r(d[1]);return e=function(){return t},t}function n(){const t=f(r(d[2]));return n=function(){return t},t}function o(){const t=r(d[3]);return o=function(){return t},t}Object.defineProperty(_e,"__esModule",{value:!0}),Object.defineProperty(_e,"renderRootComponent",{enumerable:!0,get:function(){return y}});const u=f(r(d[4]));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}function f(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=c(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var s=u?Object.getOwnPropertyDescriptor(t,f):null;s&&(s.get||s.set)?Object.defineProperty(o,f,s):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o}function s(t){if('[object Object]'!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function p(t){return t&&'object'==typeof t&&'string'==typeof t.name&&'string'==typeof t.message}function l(t){return p(t)?t:s(t)?new Error(JSON.stringify(t)):new Error(String(t))}function y(c){try{setTimeout(()=>{u._internal_preventAutoHideAsync?.()}),n().startTransition(()=>{(0,e().registerRootComponent)(c)})}catch(n){u.hideAsync();const c=l(n);(0,e().registerRootComponent)(()=>(0,t().jsx)(o().View,{})),console.error(c),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw c})}}},1448,[25,499,34,270,651]); __r(501); __r(21); __r(0); \ No newline at end of file diff --git a/display-app/admin.html b/display-app/admin.html index 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 178a1783348e257cab73bce1bb6e4d251d3cf40e..3a696208f72bd31f59a756d61d92a7264dd35e20 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 7c8a76c2126375379597b0c1aa1c06845b1fd2a6..e1d507010954a43d66280c7ea9dd2e06ad260fa0 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-1979ddd168"; +const V = "cc-display-76fc37c633"; 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=1979ddd16813c81821860e8eaafd5a5bb998a4ab41c042b851d7fda4dd7bd396"]; +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=76fc37c633c32b0d754f927f2c918cc012de789cd09d24eaa9ede0eaeb041cd0"]; // 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 52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb..19e3976fe8479482b25d17b6d066f17faa4d0856 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 46838ba0258899d1dfb77921eaa2db80e2594f93..06e823b08879c0030106e9a8fa7298c11edf9dff 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ -Cover Charge: try the apps (v0.3.12.122) +Cover Charge: try the apps (v0.3.12.123) @@ -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.122)

+

Cover Charge: try the apps (v0.3.12.123)

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.122

+

Cover Charge v0.3.12.123

diff --git a/owner-app/_expo/static/js/web/bundle.js b/owner-app/_expo/static/js/web/bundle.js index 9b02153b1679809e799bad0ee58f0ba7400b437b..eb9a5f413690195d8e910bb2d58166b258d62c01 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.122'},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.123'},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]); @@ -1195,7 +1195,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}),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: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";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)(!0);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]); @@ -1359,7 +1359,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}),_e.TableOrderLive=function({token:e}){const[s,m]=(0,l.useState)(null),[x,y]=(0,l.useState)(null),[j,f]=(0,l.useState)([]),[k,w]=(0,l.useState)(null),T=(0,h.useCustomer)(),[C,S]=(0,l.useState)(()=>(T?.allergies??[]).map(e=>e.allergen)),[v,O]=(0,l.useState)(''),[P,R]=(0,l.useState)(''),[I,M]=(0,l.useState)(''),[L,N]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),[B,D]=(0,l.useState)([]),q=(0,l.useCallback)(async()=>{try{m(await(0,c.tablePublic)(e)),y(null)}catch(e){y((0,d.tableOrderError)(e,'menu'))}},[e]),_=(0,l.useCallback)(async()=>{try{D(await(0,c.myTableOrders)(e))}catch{}},[e]);(0,l.useEffect)(()=>{q(),_();const e=setInterval(()=>{_(),q()},8e3);return()=>clearInterval(e)},[q,_]);const W=s?.menu??[];(0,l.useEffect)(()=>{f(e=>e.filter(e=>W.some(t=>t.id===e.id&&!t.soldOut)))},[s]);const E=(0,l.useMemo)(()=>{const e=new Map;for(const t of W)e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()]},[s]),Y=(0,d.cartTotal)(j,W),z='yes'===k?C.map(e=>({allergen:e,severity:T?.allergies?.find(t=>t.allergen===e)?.severity??'allergy'})):[],G=(0,d.allergyClashes)(j,W,z.map(e=>e.allergen)),V=e=>j.find(t=>t.id===e)?.qty??0,F=(e,t)=>f(n=>t<=0?n.filter(t=>t.id!==e):n.some(t=>t.id===e)?n.map(n=>n.id===e?{...n,qty:t}:n):[...n,{id:e,qty:t,note:''}]),H=(e,t)=>f(n=>n.map(n=>n.id===e?{...n,note:t}:n)),J=async()=>{N(!0),A(null);try{const t=await(0,c.sendTableOrder)(e,j,{note:I,name:v,phone:P,allergies:z});f([]),M(''),A({kind:'success',text:t.held?`Order ${t.ref} sent. A member of staff will check it, then it goes to the kitchen.`:`Order ${t.ref} sent to the kitchen.`}),_()}catch(e){A({kind:'warn',text:(0,d.tableOrderError)(e,'send')}),q()}finally{N(!1)}};if(x)return(0,p.jsxs)(o.Screen,{title:"Order at the table",children:[(0,p.jsx)(o.Banner,{kind:"warn",title:"Couldn't open the menu",children:x}),(0,p.jsx)(o.Button,{label:"Try again",onPress:()=>{q()}})]});if(!s)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Muted,{children:"Opening the menu\u2026"})});if(!s.ok)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Banner,{kind:"warn",title:"This code isn't working",children:s.reason??'Please ask a member of staff.'})});const K=s.open&&j.length>0&&null!==k&&('none'===k||C.length>0)&&(0,d.nameOk)(v)&&(0,d.phoneOk)(P)&&!L,Q=s.askServer??[],U=[...new Set(Q.map(e=>e.section))],X=L?'Sending\u2026':j.length?null===k?'Answer the allergy question':(0,d.nameOk)(v)?(0,d.phoneOk)(P)?`Send order to the kitchen (${(0,i.gbp)(Y)})`:'Check the phone number':'Add your name to send':'Add a dish to order';return(0,p.jsxs)(o.Screen,{title:`Table ${(0,n.tableNumbers)(s.table)}`,subtitle:s.venueName,footer:s.open?(0,p.jsx)(o.Button,{label:X,disabled:!K,onPress:()=>{J()},testID:"send-table-order-live"}):void 0,children:[(0,p.jsxs)(o.Muted,{center:!0,children:["Tip: add dishes, answer the allergy question, add your name, then send. Staff bring it to table ",(0,n.tableNumbers)(s.table),". ",d.PAY_WORDS]}),s.tip?(0,p.jsx)(o.Banner,{kind:"demo",children:s.tip}):null,s.open?null:(0,p.jsx)(o.Banner,{kind:"warn",title:"Not taking table orders right now",children:s.reason}),s.open&&s.staffAccept&&!B.some(e=>e.accepted)?(0,p.jsx)(o.Muted,{children:"The first order from your phone is checked by a member of staff before it goes to the kitchen."}):null,$?(0,p.jsx)(o.Banner,{kind:$.kind,children:$.text}):null,B.length?(0,p.jsx)(r.default,{testID:"my-table-orders",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Your orders at this table"}),B.map(e=>(0,p.jsxs)(r.default,{style:{gap:2,paddingVertical:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e.ref}),(0,p.jsx)(o.T,{size:13,colour:'cancelled'===e.status?u.colours.amber:u.colours.gold,children:(0,d.guestStatusWords)(e)})]}),(0,p.jsxs)(o.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,i.gbp)(e.totalPence)," to pay at the bar or with the server"]})]},e.id))]})}):null,s.open?E.map(([e,t])=>(0,p.jsxs)(r.default,{style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:e}),t.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,p.jsxs)(r.default,{style:{flex:1,gap:2},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),e.description?(0,p.jsx)(o.Muted,{children:e.description}):null,(0,p.jsxs)(o.T,{size:13,colour:u.colours.muted,children:[e.allergens.length?`Contains: ${e.allergens.map(a.allergenLabel).join(', ')}`:'No allergens listed: ask staff if unsure',e.mayContain.length?` \xb7 May contain: ${e.mayContain.map(a.allergenLabel).join(', ')}`:'']})]}),(0,p.jsx)(o.T,{weight:"semibold",colour:u.colours.gold,children:(0,i.gbp)(e.pricePence)})]}),e.soldOut?(0,p.jsx)(o.Badge,{kind:"amber",label:"Sold out today"}):V(e.id)?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:V(e.id),min:0,max:20,onChange:t=>F(e.id,t),label:e.name}),(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>F(e.id,0)})]}):(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"Add",accessibilityLabel:`Add ${e.name}`,onPress:()=>F(e.id,1)})]},e.id))]},e)):null,s.open&&!W.length?(0,p.jsx)(o.Banner,{kind:"demo",title:"No dishes to order from your phone yet",children:"The kitchen is still checking the allergens on the menu. Please order with your server or at the bar."}):null,s.open&&Q.length?(0,p.jsxs)(r.default,{testID:"table-ask-server",style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:W.length?'Also on the menu':'On the menu'}),(0,p.jsx)(o.Muted,{center:!0,children:"Ask your server for these. They can't be ordered from your phone yet, while the kitchen checks their allergens."}),U.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:e}),Q.filter(t=>t.section===e).map((e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{style:{flex:1},children:e.name}),(0,p.jsx)(o.T,{colour:u.colours.muted,children:(0,i.gbp)(e.pricePence)})]},`${e.name}-${t}`))]},e))]}):null,s.open&&j.length?(0,p.jsx)(r.default,{testID:"table-cart",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:"Review your order"}),j.map(e=>{const n=W.find(t=>t.id===e.id);return(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{children:[e.qty,"\xd7 ",n?.name]}),(0,p.jsx)(o.T,{children:(0,i.gbp)(e.qty*(n?.pricePence??0))})]}),(0,p.jsx)(t.TextInput,{style:b,value:e.note,onChangeText:t=>H(e.id,t),placeholder:"Note for the kitchen (optional), e.g. no onions",placeholderTextColor:u.colours.muted,maxLength:140,accessibilityLabel:`Note for ${n?.name}`,testID:`table-note-${e.id}`})]},e.id)}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Total"}),(0,p.jsx)(o.T,{weight:"semibold",children:(0,i.gbp)(Y)})]})]})}):null,s.open?(0,p.jsx)(r.default,{testID:"table-allergy",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Does anyone at the table have a food allergy?"}),(0,p.jsx)(o.Muted,{center:!0,children:"We ask everyone, so the kitchen can keep you safe."}),(0,p.jsxs)(o.Row,{gap:8,style:{justifyContent:'center'},children:[(0,p.jsx)(o.Chip,{label:"No allergies",selected:'none'===k,onPress:()=>w('none')}),(0,p.jsx)(o.Chip,{label:"Yes, allergies",selected:'yes'===k,onPress:()=>w('yes')})]}),'yes'===k?(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:a.ALLERGENS.map(e=>(0,p.jsx)(o.Chip,{label:e.short,selected:C.includes(e.id),onPress:()=>S(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},e.id))}):null,G.length?(0,p.jsxs)(o.Banner,{kind:"warn",title:"Check with staff",children:[G.map(e=>e.name).join(', ')," ",G.length>1?'contain':'contains'," or may contain an allergy you picked. The kitchen will see your allergies on the ticket."]}):null]})}):null,s.open?(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Who's the order for?"}),(0,p.jsx)(t.TextInput,{style:b,value:v,onChangeText:O,placeholder:"Your name (needed)",placeholderTextColor:u.colours.muted,maxLength:40,accessibilityLabel:"Your name, needed",testID:"table-name",autoComplete:"name"}),(0,p.jsx)(t.TextInput,{style:b,value:P,onChangeText:R,placeholder:"Phone number (optional)",placeholderTextColor:u.colours.muted,maxLength:20,keyboardType:"phone-pad",accessibilityLabel:"Phone number, optional",testID:"table-phone",autoComplete:"tel"}),P&&!(0,d.phoneOk)(P)?(0,p.jsx)(o.Muted,{center:!0,children:"Please check the phone number, or leave it blank."}):null,(0,p.jsx)(o.Muted,{center:!0,children:"We only use these for this order."}),(0,p.jsx)(t.TextInput,{style:b,value:I,onChangeText:M,placeholder:"Note for the staff (optional)",placeholderTextColor:u.colours.muted,maxLength:300,accessibilityLabel:"Note for the staff (optional)"})]}):null,(0,p.jsx)(r.default,{testID:"pay-placeholder",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Paying"}),(0,p.jsx)(o.T,{center:!0,children:d.PAY_WORDS}),(0,p.jsx)(o.Muted,{center:!0,children:"No card details are asked for or kept in this app."})]})})]})};var e,t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),r=(e=s)&&e.__esModule?e:{default:e},o=_r(_d[4]),a=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]);const b={borderWidth:1,borderColor:u.colours.border,borderRadius:10,padding:10,color:u.colours.text,backgroundColor:u.colours.surface2}},1276,[796,829,34,102,794,830,836,1131,1277,848,840,25]); __d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tablePublic",{enumerable:!0,get:function(){return s}}),e.sendTableOrder=async function(t,r,a){if(!await(0,n.guestSession)())throw new Error('No connection. Try again when you are back online.');const o=await(0,n.rpc)('guest_table_order_v2',{p_phone:(a.phone??'').trim().slice(0,20)||null,p_token:t,p_lines:r.map(t=>({id:t.id,qty:t.qty,note:t.note.trim().slice(0,140)})),p_note:a.note.trim().slice(0,300)||null,p_allergies:a.allergies.map(t=>({allergen:t.allergen,severity:t.severity})),p_name:a.name.trim().slice(0,40)||null});if(!o||!1===o.ok||!o.id)throw new Error(o?.reason||'This table code isn\u2019t working any more. Please ask a member of staff.');return{id:o.id,ref:o.ref,held:!!o.held,totalPence:o.totalPence}},e.myTableOrders=async function(t){return await(0,n.guestSession)()?await(0,n.rpc)('guest_table_my_orders',{p_token:t})??[]:[]},e.loadTableSettings=async function(){const{data:t,error:n}=await a().from('table_order_settings').select('*').eq('venue_id',o()).maybeSingle();if(n)throw n;return(0,r.fromRow)(t)},e.saveTableSettings=async function(t,n){const{error:s}=await a().from('table_order_settings').upsert({venue_id:o(),...(0,r.toRow)(t),updated_at:(new Date).toISOString(),updated_by:n.slice(0,80)});if(s)throw s},e.listTableCodes=async function(){const{data:t,error:n}=await a().from('table_qr_codes').select('table_no, token, created_at').eq('venue_id',o()).eq('is_on',!0);if(n)throw n;return(t??[]).map(t=>({table:String(t.table_no),token:String(t.token),createdAt:String(t.created_at)})).sort((t,n)=>Number(t.table)-Number(n.table))},Object.defineProperty(e,"tableReadiness",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"makeTableCodes",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"renewTableCode",{enumerable:!0,get:function(){return u}}),e.watchTableSettings=function(t){const r=n.useSync.getState().venueId;if(!r)return()=>{};const o=a().channel(`tos-${r}-${Math.random().toString(36).slice(2,8)}`).on('postgres_changes',{event:'*',schema:'public',table:'table_order_settings',filter:`venue_id=eq.${r}`},()=>t()).subscribe();return()=>{a().removeChannel(o)}};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const a=()=>(0,t.getSupabase)(),o=()=>{const t=n.useSync.getState().venueId;if(!t)throw new Error('Not connected to the venue yet.');return t},s=t=>(0,n.rpc)('table_public',{p_token:t});const l=()=>(0,n.rpc)('table_order_readiness',{p_venue:o()}),c=t=>(0,n.rpc)('table_qr_make',{p_venue:o(),p_tables:t}),u=t=>(0,n.rpc)('table_qr_renew',{p_venue:o(),p_table:t})},1277,[931,985,1131]); __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 l}});var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]);function l(){return(0,t.canShow)('display')?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.DisplayBoard,{}),(0,c.jsx)(u.DisplayPairing,{})]}):(0,c.jsx)(n.Redirect,{href:t.ENTRY[t.APP_VARIANT]})}},1278,[30,34,846,1279,1334,25]); -__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Pe}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:G,subHeader:Le,noVoice:We=!1}={}){const Oe=(0,P.default)(),Ve=g??Oe.width,Ue=Oe.height,Ke=Ve<700,qe=Ve>=Ue,Ye=!Ke&&qe&&Ve>=600,Qe=Ye,Je=Math.round(Math.min(520,Math.max(Ve>=1e3?448:280,.3*Ve))),Xe=S.default.useRef(null),Ze=S.default.useRef(0),[et,tt]=(0,v.useState)({w:0,h:0}),lt=(0,q.useOwner)(e=>e.site),st=(0,V.useRestaurant)(lt);(0,me.useAlertWatcher)(lt,{enabled:!e});const it=(0,V.useOrders)(lt),ot=(0,V.useBookings)(lt),nt=(0,V.useEvents)(lt),at=(0,V.useStore)(e=>e.skipMinutes),rt=(0,V.useStore)(e=>e.clock.mode),dt=(0,V.useNow)(5e3),ct=(0,q.useOwner)(e=>e.staff),ut=(0,q.useOwner)(e=>e.attendance),ht=(0,q.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,Q.ensureAttendance)((0,F.ymd)(dt),dt)},[(0,F.ymd)(dt)]);const gt=ut.filter(e=>e.in&&!e.out&&dt.getTime()-new Date(e.in).getTime()<72e6&&dt.getTime()>=new Date(e.in).getTime()),bt=Ee(ct.find(e=>e.id===gt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,bt,!e);const yt=(0,F.ymd)(dt),pt=(0,T.useTravelDay)('display',yt),xt=(0,Y.useFrontDoor)(yt,qe),ft=(0,J.useDisplaySettings)(lt),mt=ft.privacy,jt=(0,ne.useSaverSync)(),wt=(0,J.usePlan)(lt),kt=(0,J.useFloor)(e=>e.live[lt]),It=(0,je.useBlocks)(e=>e.blocks),[Dt,vt]=(0,v.useState)('plan'),[St,Ct]=(0,v.useState)('all'),[Tt,$t]=(0,v.useState)(null),[Bt,Rt]=(0,v.useState)(null),[Lt,Wt]=(0,v.useState)(null),[zt,Mt]=(0,v.useState)(!1),[Ht,Pt]=(0,v.useState)(!1),[Et,At]=(0,v.useState)(null),[Ot,Nt]=(0,v.useState)(!1),[_t,Gt]=(0,v.useState)(!1),[Ft,Vt]=(0,v.useState)(null),[Ut,Kt]=(0,v.useState)(null),[qt,Yt]=(0,v.useState)(null),Qt=S.default.useRef(0),Jt=e=>{Qt.current=Date.now(),Yt(e)};S.default.useEffect(()=>{if(!qt)return;const e=setInterval(()=>{Date.now()-Qt.current>=De.DAY_IDLE_MS&&Yt(null)},5e3);return()=>clearInterval(e)},[qt]);const Xt=(0,V.useWaitlist)(lt),Zt=(0,V.useStore)(e=>e.walkIns[lt]??0),[el,tl]=(0,v.useState)(!1),[ll,sl]=(0,v.useState)(!1),[il,ol]=(0,v.useState)(!1);(0,N.useReviewAlerts)(lt);const[nl,al]=(0,v.useState)({view:0,content:0}),[rl,dl]=(0,v.useState)(null);S.default.useEffect(()=>{rl&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:rl,timeoutMs:4500,big:!0,testID:'floor-toast'}),dl(null))},[rl]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[cl,ul]=(0,v.useState)(null),hl=S.default.useRef(0),[gl,bl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!cl)return;hl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-hl.current;if(e>=Pe)return ul(null),void dl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');bl(e>=105e3?Math.ceil((Pe-e)/1e3):null)},1e3);return()=>clearInterval(e)},[cl]);const yl=e=>e.date!==yt?Wt({title:`Guest details \xb7 ${(0,De.dayWord)(e.date,yt)} ${e.time}`,body:(0,He.jsx)(He.Fragment,{children:(0,ye.bookingDetails)(e)})}):Wt({title:`Guest details \xb7 ${e.time}`,body:(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Fe,{rid:lt,id:e.id,turnBase:st.settings.turnMins}),e.walkIn?null:(0,He.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Wt(null),At(e.id)},style:{minHeight:56}}),e.walkIn?(0,He.jsx)(ue.CancelWalkInButton,{rid:lt,b:e,big:!0,onDone:e=>{Wt(null),dl(e)}}):null,e.walkIn?(0,He.jsx)(ue.ReinstateWalkInButton,{rid:lt,b:e,today:yt,onDone:e=>{Wt(null),dl(e)}}):null,(0,ye.bookingDetails)(e)]})}),pl=ot.filter(e=>e.date===yt).sort((e,t)=>e.time.localeCompare(t.time)),xl=pl.filter(e=>!['cancelled','noshow'].includes(e.status)),fl=it.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),ml=(0,v.useMemo)(()=>(0,d.forecastToday)(st,ot,it,nt,dt),[st,ot,it,nt,dt.getTime()/6e4|0]),jl=(0,je.closedAreasAt)(It,lt,yt,(0,F.hm)(dt)),wl=[...jl].join(','),kl=(0,v.useMemo)(()=>(0,X.floorView)(wt,ot,it,kt??{},dt,st.settings.turnMins,jl),[wt,ot,it,kt,dt.getTime(),wl]),Il=(0,be.hoursFor)(st,dt),Dl=Il?.open??new Date(`${yt}T12:00:00`),vl=Il?.close??new Date(`${yt}T21:00:00`),Sl=(0,F.addMins)(Dl,-Dl.getMinutes()),Cl=(0,F.addMins)(vl,90),Tl=e=>new Date(`${yt}T${e}:00`),$l=(0,je.blocksOn)(It,lt,yt).map(e=>({from:Tl(e.from),to:Tl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(st,dt,yt)),Bl=Object.keys(kl).filter(e=>'blocked'===kl[e]?.status),Rl=qt&&qt!==yt?qt:yt,Ll=Rl!==yt,Wl=(0,De.dayWord)(Rl,yt),zl=/^(Today|Yesterday|Tomorrow)$/.test(Wl),Ml=Ll?(0,De.bookingsForDay)(ot,Rl,yt).sort((e,t)=>e.time.localeCompare(t.time)):pl,Hl=(0,F.parseYmd)(Rl);Hl.setHours(12);const Pl=Ll?(0,be.hoursFor)(st,Hl):Il,El=Pl?.open??new Date(`${Rl}T12:00:00`),Al=Pl?.close??new Date(`${Rl}T21:00:00`),Ol=e=>new Date(`${Rl}T${e}:00`),Nl=[...Ll?(0,je.blocksOn)(It,lt,Rl).map(e=>({from:Ol(e.from),to:Ol(e.to),label:e.reason??'Paused'})):$l,...Ll?(0,i.queuedServicePauses)(st,Hl,Rl):[]],_l=(0,i.queuedServiceSessions)(st,Hl),Gl=l.IS_QUEUED_VENUE&&(void 0===_l||!_l.length),Fl=(0,He.jsxs)(H.default,{testID:"queued-hours-gate",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:void 0===_l?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,He.jsx)(A.Muted,{children:s.queuedVenues[lt]?.hours.note})]}),Vl=Ll?Pl||Ml.length?RlLl?(0,X.dayFloorView)(wt,Ml,Rl):kl,[Ll,wt,Ml,Rl,kl]),[Kl,ql]=(0,v.useState)(null),Yl=Ll?Ml.filter(e=>!['cancelled','noshow'].includes(e.status)):xl,Ql=Yl.reduce((e,t)=>e+t.partySize,0),Jl=(0,c.coversSplit)(Yl,Rl),Xl=(0,ve.cancelledDayTally)(ot,Rl),Zl=(0,Se.cancellationsFor)(ot,Rl,e=>e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)','')),es=(0,ve.cancelledTallyWords)(Xl,zl?Wl.toLowerCase():Ll?`on ${Wl}`:'today'),ts=It.filter(e=>e.rid===lt&&e.date===Rl&&!e.removedAt),ls=(0,Ie.chartBands)(ts,60*El.getHours()+El.getMinutes(),60*Al.getHours()+Al.getMinutes()),ss=new Set((0,Ie.blockedHours)(ls)),is=dt.getHours()+(dt.getMinutes()>=30?1:0),os=ml.hours.filter(e=>e.hour>=is&&!ss.has(e.hour)),ns=os.reduce((e,t)=>e+t.coversHigh,0),as=os.reduce((e,t)=>e+t.coversLow,0),rs=Math.round((as+ns)/2),ds=!ml.example&&ml.open&&ml.enough&&ns>0?`Usually ${(0,d.coversRange)(rs,rs)} more`:void 0,cs=async(e,t)=>{const l=kl[e]?.booking;if(!l||e===t)return;const s=kl[t]?.status;if(s&&!['free','soon'].includes(s))return void dl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${X.STATUS[s].label.toLowerCase()}. Pick a free table.`);await V.repo.bookings.update(l.id,{table:t});const i=kt?.[e]?.stage;J.useFloor.getState().setLive(lt,t,{stage:i??'seated',dirty:!1}),J.useFloor.getState().setLive(lt,e,{stage:void 0,dirty:!0}),dl(`${(0,ae.privName)(l,mt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},us=Ut?ot.find(e=>e.id===Ut.id):void 0,hs=Ut&&us?(()=>{const e=us.walkIn?(0,ae.privName)(us,mt):Ee(us.name),t=(0,ge.seatsOf)(wt,Ut.tables).total,l=(0,ge.seatLine)(t,us.partySize),s=(0,ge.pickClashes)(us,Ut.tables,ot.filter(e=>e.date===us.date),st.settings.turnMins),i=(0,ge.tableKey)(Ut.tables)!==(0,ge.tableKey)((0,J.tablesOf)(us.table));return(0,He.jsxs)(H.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:U.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,padding:10},children:[(0,He.jsxs)(H.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,De.dayWord)(us.date,yt)} ${us.time}. Tap tables on the plan to add or take them off. ${(0,ge.tablesWords)(Ut.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,De.dayWord)(us.date,yt)," ",us.time]}),(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[(0,ge.tablesWords)(Ut.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,He.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,He.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,ge.tablesWords)(Ut.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(us){try{await(0,he.saveBookingTables)(lt,us,Ut.tables),dl((0,ge.savedWords)(e,us.partySize,Ut.tables,t))}catch(t){dl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Kt(null)}else Kt(null)}}),(0,He.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Kt(null)})]})]})})():null,gs=wt.areas.filter(e=>wt.tables.some(t=>t.areaId===e.id)),bs=e=>{const t=wt.tables.filter(t=>t.areaId===e);return Ll?`${t.filter(e=>!Ul[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(kl[e.name]?.status??'free')).length}/${t.length} free`},ys='all'===St||gs.some(e=>e.id===St)?St:'all',ps=e=>(0,He.jsx)(Z.FloorCanvas,{plan:wt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Ye,big:!0,view:Ul,privacy:mt,turnBase:st.settings.turnMins,highlight:Ut?Ut.tables:Bt?[Bt]:void 0,onTap:e=>{return t=e.name,void(Ut?Kt(e=>e?{...e,tables:(0,ge.toggleTable)(e.tables,t)}:e):Ll?ql(t):Bt?(t!==Bt&&cs(Bt,t),Rt(null)):$t(t));var t},onDrop:(e,t)=>Ut||Ll?void 0:cs(e.name,t.name)}),xs=Ke?1:qe||gs.length>2?2:1,fs=e=>{const t=wt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ms=[];for(let e=0;e{const t=(0,Z.areaBounds)(wt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,Z.minReadableScale)(wt,e.id)}}),et.w,et.h):null,ws=e=>(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',height:ee.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:bs(e.id)})]}),ks=(0,He.jsx)(H.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-et.w)>1||Math.abs(l-et.h)>1)&&tt({w:t,h:l})},children:js?(0,He.jsx)(M.default,{style:{flex:1},scrollEnabled:js.scroll,showsVerticalScrollIndicator:js.scroll,contentContainerStyle:{gap:ee.GRID_GAP},children:js.rows.map((e,t)=>(0,He.jsx)(H.default,{style:{height:js.rowHeights[t],flexDirection:'row',gap:ee.GRID_GAP},children:e.map(e=>{const t=gs.find(t=>t.id===e);return(0,He.jsxs)(H.default,{testID:`area-cell-${e}`,style:{width:js.cellW,gap:2},children:[ws(t),(0,He.jsx)(H.default,{style:{flex:1},children:ps(e)})]},e)})},t))}):null}),Is=(0,He.jsxs)(H.default,{testID:"venue-plan",style:{flex:Ke?void 0:1,gap:10,minWidth:0},children:[(0,He.jsx)(a.TableNumberWarning,{plan:wt}),wt.tables.length?null:(0,He.jsxs)(H.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,He.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,He.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,He.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,He.jsx)(_e,{chipId:"all",compact:!Ke,label:"Whole venue",selected:'all'===ys,onPress:()=>Ct('all')},"__all"),...gs.map(e=>(0,He.jsx)(_e,{chipId:e.id,compact:!Ke,label:`${e.name}${(0,te.areaMarks)(e)}`,colour:(0,U.brandColour)(e.colour),sub:Ke?jl.has(e.id)?'closed':ys===e.id?bs(e.id):void 0:void 0,selected:ys===e.id,onPress:()=>Ct(e.id)},e.id))];return Ke?(0,He.jsx)(H.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,He.jsx)(M.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;al(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>al(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:nl.view>0&&nl.content>0&&nl.content<=nl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:nl.view>0&&nl.content<=nl.view+1?'100%':void 0},children:e})})(),(0,He.jsx)(h.FloorLegend,{}),hs,Bt?(0,He.jsxs)(A.Row,{gap:8,style:{backgroundColor:U.colours.goldTint,borderRadius:10,padding:8},children:[(0,He.jsxs)(A.T,{weight:"semibold",colour:U.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Bt),": tap the new table."]}),(0,He.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Rt(null)})]}):null,'all'===ys&&Ye?ks:'all'===ys?(0,He.jsx)(H.default,{style:{flex:Ke?void 0:1,gap:12,minHeight:Qe?void 0:360},children:ms.map((e,t)=>(0,He.jsxs)(H.default,{style:{flex:Ke?void 0:Math.max(.3,...e.map(e=>fs(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,He.jsxs)(H.default,{style:{flex:1,gap:2},children:[Ke?(0,He.jsxs)(H.default,{style:{alignItems:'center',gap:4},children:[(0,He.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{center:!0,children:bs(e.id)})]}):(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{children:bs(e.id)})]}),(0,He.jsx)(H.default,{style:Ke?{height:Math.max(280,Math.round((Ve-40)*fs(e.id)))}:{flex:1},children:ps(e.id)})]},e.id)),e.length{if(Ll)return void Vt(e.id);const t=(0,J.tablesOf)(e.table)[0];t&&kl[t]?$t(t):yl(e)}},Rl)}),vs='timeline'===Dt,Ss=Ll?(0,He.jsxs)(H.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,backgroundColor:U.colours.goldTint},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:zl?`Showing ${Wl} \xb7 ${(0,F.niceDate)((0,F.parseYmd)(Rl))}`:`Showing ${(0,De.dayWord)(Rl,yt)}`}),(0,He.jsx)(H.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${es}. Showing ${(0,De.dayLong)(Rl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,He.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Kt(null),Jt(null)},style:{minHeight:44}})]}):null,Cs=(0,He.jsx)(H.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:Ke?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===vs;return(0,He.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},onPress:()=>vt(e),style:{flex:Ke?1:void 0,minHeight:Ke?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?U.colours.gold:'transparent',...$e.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,He.jsx)(A.T,{size:Ke?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ts=(0,u.useBookingWrite)(),$s=e=>(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Be.BigAction,{premium:!0,label:"Walk-in",onPress:xt.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"New booking",onPress:xt.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"Edit booking",onPress:()=>Pt(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint})]});(0,Me.useDisplayNotices)(lt,!e);const Bs=Ke?180:168,[Rs,Ls]=(0,v.useState)(Bs),Ws=S.default.useRef(Bs),zs=S.default.useRef(null),Ms=S.default.useRef(null),Hs=()=>{const e=zs.current,t=Ms.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ue<820?8:12,o=44+(Ue<820?4:8),n=i>Ws.current?Math.ceil(i-Ws.current):ke.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Bs,Math.floor(t-s-l)-n-o));Math.abs(Ws.current-a)>=2&&(Ws.current=a,Ls(a))})})};S.default.useEffect(()=>{const e=setTimeout(Hs,60);return()=>clearTimeout(e)},[Ve,Ue]);const Ps=(0,He.jsxs)(H.default,{ref:Ms,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),Hs()},style:{flexDirection:'row',flexWrap:Ve>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:Ke?12:6,justifyContent:Ke?'center':void 0,borderTopWidth:1,borderTopColor:U.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,He.jsx)(ze.DisplayClockButton,{}),(0,He.jsx)(se.HoldToEdit,{quiet:!0,onUnlock:()=>{bl(null),ul({at:Date.now()})},onHint:()=>dl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,He.jsx)(we.BlockBookingsButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,display:!0,day:Rl}),wt.areas.some(e=>e.outdoor)?(0,He.jsx)(we.CloseGardenButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,short:!0}):null,(0,He.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>ol(!0),style:({pressed:e})=>({...$e.look.quiet(e),flexGrow:1}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,He.jsx)(p.GiftQrButton,{rid:lt,venue:st.name})]}),Es=fl.length?(0,He.jsxs)(H.default,{testID:"takeaway-panel",style:[$e.look.panel,{overflow:'hidden'}],children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,He.jsxs)(A.T,{size:12,colour:U.colours.muted,children:[fl.length," live"]})]}),(0,He.jsx)(H.default,{style:{padding:10},children:(0,He.jsx)(Ge,{list:fl,me:bt,compact:!0,bookings:ot})})]}):null,As=(Te.DueToday,Ll?Ml:pl.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Os=Ll?zl?`${Wl}\u2019s guests`:`Guests ${Wl}`:'Today\u2019s guests',Ns=(0,He.jsxs)(He.Fragment,{children:[0===As.length?(0,He.jsx)(A.Muted,{children:Ll?Rl{const t=(0,K.isSeatedHighlight)(e.status,{otherDay:Ll}),l=(0,re.guestRowText)(e,{name:e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)',''),seated:t}),s=t?K.SEATED_FG:U.colours.text,i=t?K.SEATED_MUTED:U.colours.muted,o=t?K.SEATED_FG:U.colours.gold,n=l.depositWarn?U.colours.amber:t?K.SEATED_FG:U.colours.goldLight;return(0,He.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:Ll?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Gt(!1),Vt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,K.seatedHighlightStyle)({backgroundColor:e?U.colours.goldLight:U.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:U.colours.hairline,backgroundColor:e?U.colours.tilePressed:'transparent'},children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,He.jsx)(H.default,{style:{paddingTop:2},children:(0,He.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':U.colours.amber,ink:t?U.colours.gold:U.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,He.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,He.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,He.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,He.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,He.jsx)(H.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,He.jsx)(de.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,He.jsx)(Ce.CancellationsSection,{items:Zl,dayWord:Ll?zl?Wl.toLowerCase():`on ${Wl}`:'today'})]}),_s=(0,He.jsx)(M.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Ns}),Gs=W.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Gt(!1)}}),Fs=(0,He.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Os}, ${As.length}`,accessibilityState:{expanded:_t},'aria-expanded':_t,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Gt(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:_t?U.colours.gold:U.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?U.colours.tilePressed:_t?U.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,He.jsx)(A.T,{size:16,weight:"bold",colour:U.colours.gold,children:As.length}),(0,He.jsx)(H.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(H.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,He.jsxs)(A.T,{size:13,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,children:[Os," ",_t?'\u2039':'\u203a']})})})]}),Vs=_t?(0,He.jsxs)(H.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,He.jsxs)(H.default,{testID:"guests-drawer",...Gs.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ve)),backgroundColor:U.colours.surface,borderRightWidth:1,borderColor:U.colours.gold,borderRadius:14,...$e.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Os.toUpperCase()," (",As.length,")"]}),Xl.count?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:es}):null,(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Os}`,onPress:()=>Gt(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:18,colour:U.colours.muted,children:"\u2715"})})]}),_s]}),(0,He.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Os}`,accessibilityRole:"button",onPress:()=>Gt(!1),style:{flex:1}})]}):null,Us=Gl?Fl:l.IS_KIRKTON&&!Object.values(st.kitchenHours??{}).some(Boolean)?(0,He.jsxs)(H.default,{testID:"kirkton-hours-to-confirm",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,He.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,He.jsx)(ke.DayGraph,{busyThreshold:(0,t.venueBusy)(st,ot,dt).busy,todays:Ml,open:El,close:Al,now:dt,turnBase:st.settings.turnMins,blocks:ts,pauses:Nl,compact:Ke,dense:!Ke,height:Ye?Rs:Bs,forecastNote:Ll?void 0:ds,emptyText:Vl,past:Rl{Ll?Gt(!0):vt('timeline')},Qs=(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',padding:Ue<820?8:12,paddingTop:Ue<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[pt?null:Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[pt?null:Ss,pt?(0,He.jsx)(M.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"})}):vs?Ds:Is,Vs]}),(0,He.jsxs)(H.default,{testID:"display-side",style:{width:Je,gap:Ue<820?4:8,minHeight:0},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:$s(!1)}),(0,He.jsx)(H.default,{style:{flexShrink:0},children:Cs}),pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:Ue<820,snug:Ue<820,tight:Ue<700,aside:`${Yl.length} ${1===Yl.length?'table':'tables'} booked${fl.length?` \xb7 ${fl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{ref:zs,testID:"day-graph-slot",onLayout:Hs,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Ks}),(0,He.jsxs)(M.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,He.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,He.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),Es,(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt})]})]})]});return(0,He.jsxs)(E.SafeAreaView,{style:{flex:1,backgroundColor:U.colours.bg},onTouchStart:()=>{Qt.current=Date.now()},onMouseDown:()=>{Qt.current=Date.now()},children:[Ke?(0,He.jsxs)(H.default,{style:{flex:1},children:[(0,He.jsxs)(M.default,{ref:Xe,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,He.jsx)(H.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,He.jsx)(f.ExitButton,{})}),(0,He.jsx)(_.RestaurantLogo,{rid:lt,size:64}),(0,He.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:st.name}),(0,He.jsx)(_.PoweredBy,{}),(0,He.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,He.jsx)(H.default,{accessible:!0,accessibilityLabel:`Current time ${(0,F.hm)(dt)}`,children:(0,He.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:U.colours.goldLight,children:(0,F.hm)(dt)})}),(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:"m"}),(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:"m"}),G]}),Le,qs,(0,He.jsx)(H.default,{testID:"phone-glance",style:{width:'100%'},children:(0,He.jsx)(Ne,{phone:!0,split:Jl,items:[{label:`Tables \xb7 ${Wl}`,value:Yl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Wl}`,value:Ql,testID:'badge-covers'},{label:'Takeaway',value:fl.length,alert:fl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Mt(!0)}]})}),(0,He.jsx)(H.default,{testID:"primary-actions",style:{gap:8},children:$s(!0)}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),Cs,(0,He.jsx)(H.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:vs?Ds:Is}),(0,He.jsxs)(H.default,{onLayout:e=>{Ze.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[$e.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,He.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:U.colours.goldLight,accessibilityRole:"header",children:[Os," (",As.length,")"]}),(0,He.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{gap:4},children:Ns})]}),Es,Ks,(0,He.jsx)(H.default,{testID:"covers-dock",children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Xe.current?.scrollTo({y:Ze.current,animated:!0})})}),(0,He.jsxs)(H.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,He.jsx)(A.T,{center:!0,size:14,colour:mt?U.colours.muted:U.colours.amber,children:mt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,He.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,He.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ps]}),e?null:(0,He.jsx)(H.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:U.colours.hairline},children:(0,He.jsx)(R.VoiceSlot,{size:56})})]}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ve>=1e3?18:14,paddingVertical:Ue<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...$e.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,He.jsx)(H.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,He.jsx)(_.RestaurantBrand,{rid:st.id,size:Ve<900?32:40,beside:!0})}),(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,He.jsx)(A.T,{size:Ve<900?18:21,weight:"semibold",colour:U.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,F.hm)(dt)}),Ve>=900?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:(0,F.niceDate)(dt)}):null]})]}),pt?(0,He.jsx)(H.default,{style:{width:220}}):(0,He.jsx)(H.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:qs}),(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:Ve<900?'xs':Ve<1100||Ue<700?'s':'m'}),(0,He.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.muted,children:"?"})}),'simulated'===rt?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>at(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:11,colour:U.colours.muted,children:"+15"})}):null,e?null:(0,He.jsx)(f.ExitButton,{}),G,We?null:(0,He.jsx)(R.VoiceSlot,{size:44})]})]}),Le,pt?null:(0,He.jsxs)(H.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,He.jsx)(Ne,{splitOnly:!0,split:Jl,items:[]}),(0,He.jsx)(H.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ve>=1e3?18:14)+(e?0:52)+('simulated'===rt?52:0),zIndex:4},children:(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:Ve<1100||Ue<700?'s':'m'})})]}),Ye?Qs:(Js=(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"front-door-bar",style:{gap:10},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:$s(!1)}),Cs]}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),pt?(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"}):(0,He.jsx)(He.Fragment,{children:(0,He.jsxs)(H.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Ss,vs?Ds:Is,Vs]})]})}),Es,pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Bs+ke.DAY_GRAPH_CHROME},children:Ks})]}),(0,He.jsx)(M.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:Js})),Ps]}),(0,He.jsx)(j.SoldOutStrip,{rid:lt,by:bt,onOpen:()=>ol(!0)}),(0,He.jsx)(w.SoldOutSheet,{visible:il,onClose:()=>ol(!1),rid:lt,by:bt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,He.jsx)(y.TableOrderCue,{rid:lt}),xt.elements,Ht?(0,He.jsx)(b.EditBookingPicker,{rid:lt,today:yt,who:bt,hidePrivate:!0,onClose:()=>Pt(!1)}):null,Et?(0,He.jsx)(b.EditBookingSheet,{rid:lt,id:Et,who:bt,hidePrivate:!0,onClose:()=>At(null)}):null,Tt?(0,He.jsx)(ye.TableSheet,{rid:lt,name:Tt,view:kl,plan:wt,todays:pl,now:dt,privacy:mt,turnBase:st.settings.turnMins,onClose:()=>$t(null),onWalkIn:e=>xt.openWalkInAt(e),onMove:e=>Rt(e),onDetails:yl}):null,Kl?(()=>{const e=Ul[Kl],t=e?.dayBookings??[];return(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>ql(null),title:`${(0,r.tableNumbers)(Kl)} \xb7 ${zl?Wl:(0,De.dayLong)(Rl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${zl?Wl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${zl?Wl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,ae.privName)(e,mt):Ee(e.name);return(0,He.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,ge.tablesWords)((0,J.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{ql(null),Vt(e.id)},style:{minHeight:56}},e.id)}),(0,He.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>ql(null),style:{minHeight:56}})]})})():null,Ft?(()=>{const e=ot.find(e=>e.id===Ft);return e?(0,He.jsx)(ce.GuestActionsSheet,{rid:lt,b:e,name:e.walkIn?(0,ae.privName)(e,mt):Ee(e.name),view:kl,now:dt,otherDay:e.date!==yt,turnBase:st.settings.turnMins,onClose:()=>Vt(null),onDetails:yl,onDone:dl,onPickOnPlan:(e,t)=>{Gt(!1),vt('plan'),Ct('all'),Kt({id:e.id,tables:t})}}):null})():null,Lt?(0,He.jsx)(ye.DetailsPanel,{title:Lt.title,onClose:()=>Wt(null),children:Lt.body}):null,Ot?(0,He.jsx)(ye.ServiceSummary,{r:st,todays:pl,orders:it,waitlistAll:Xt,walkInCount:Zt,onClose:()=>Nt(!1)}):null,el?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>tl(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,He.jsx)(h.FloorLegend,{}),(0,He.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>tl(!1)})]}):null,ll?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>sl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,He.jsx)(O.ReviewsSection,{rid:lt,mode:"read",venueName:st.name}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>sl(!1)})]}):null,zt?(0,He.jsxs)(ye.DetailsPanel,{title:"Takeaway",onClose:()=>Mt(!1),children:[(0,He.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,He.jsx)(Ge,{list:fl,me:bt,bookings:ot})]}):null,cl?(0,He.jsx)(H.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:U.colours.bg},children:(0,He.jsx)(le.PlanDesigner,{initial:wt,venue:st.name,mode:"display",startStep:"arrange",onActivity:()=>{hl.current=Date.now(),null!==gl&&bl(null)},notice:null!==gl?`Locking again in ${gl} s \xb7 touch to keep editing`:null,onSave:e=>{J.useFloor.getState().setPlan(lt,e),ul(null),dl('Table plan saved. Editing is locked again.')},onCancel:()=>{ul(null),dl('No changes kept. Editing is locked again.')}},cl.at)}):null,e?null:(0,He.jsx)(oe.Screensaver,{rid:lt,idleMins:ft.idleMins,pinOn:ft.pinOn,wake:ft,tonightCards:ft.tonightCards,cfg:jt}),e?null:(0,He.jsx)(xe.PrintHost,{rid:lt}),e?null:(0,He.jsx)(pe.AlertHost,{variant:"display",rid:lt,skipTakeaway:!0}),e?null:(0,He.jsx)(B.SeatAllergenReminder,{rid:lt}),e?null:(0,He.jsx)(fe.TakeawayTakeover,{rid:lt,me:bt})]});var Js};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),z=e(_r(_d[31])),M=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=_r(_d[35]),A=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),ze=_r(_d[85]),Me=_r(_d[86]),He=_r(_d[87]);const Pe=12e4,Ee=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Oe=e=>e.slotTime?(0,F.hm)(new Date(e.slotTime)):'ASAP';function Ne({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,He.jsxs)(H.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,He.jsx)(H.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,He.jsxs)(H.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,He.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?U.colours.amber:U.colours.text,children:e.value}),(0,He.jsx)(A.T,{size:l?14:12,colour:U.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,He.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,He.jsx)(H.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,He.jsx)(A.T,{size:14,colour:U.colours.muted,children:"No Covers yet"}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:U.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,He.jsxs)(H.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:U.colours.gold},children:[(0,He.jsx)(H.default,{style:{width:`${s.walkInPct}%`,backgroundColor:U.colours.gold}}),(0,He.jsx)(H.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function _e({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,He.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,He.jsx)(H.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,He.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?U.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,He.jsx)(A.T,{size:12,colour:U.colours.muted,children:l}):null]})}function Ge({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,We.statusBlock)(e,t,(0,We.linkedBooking)(e,s));return e.length?(0,He.jsx)(H.default,{style:{gap:8},children:e.map(e=>(0,He.jsxs)(H.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:U.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?U.colours.ok:e.allergies.length?U.colours.red:U.colours.gold},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Oe(e)," \xb7 ",Ee(e.customerName)]}),(0,He.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,He.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:U.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,G.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,He.jsx)(Le.AllergyChain,{o:e,me:t,compact:!0}):null,(0,He.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,He.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>V.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,He.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,He.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'collected',t)}):null,(0,He.jsx)(xe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,He.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Fe({rid:e,id:t,turnBase:l}){const s=(0,V.useBookings)(e).find(e=>e.id===t);return s?(0,He.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1279,[1121,5,6,1280,798,822,1094,829,1120,1281,1282,1283,1091,1115,1284,1285,1287,1288,1289,1130,977,1099,1290,34,1073,1148,1033,1087,1116,1291,380,402,295,102,426,36,794,1186,1190,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1292,1107,1293,1296,1298,1301,1304,1300,1305,1307,1308,1112,1093,1095,852,1310,1175,1311,1185,1177,1011,1316,1324,1326,1076,1114,1328,1329,1330,1143,1331,1142,1136,838,1332,1333,25]); +__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Ee}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:F,subHeader:We,noVoice:Me=!1}={}){const Ne=(0,E.default)(),Ue=g??Ne.width,Ke=Ne.height,qe=Ue<700,Ye=Ue>=Ke,Qe=!qe&&Ye&&Ue>=600,Je=Qe,Xe=Math.round(Math.min(520,Math.max(Ue>=1e3?448:280,.3*Ue))),Ze=S.default.useRef(null),et=S.default.useRef(0),[tt,lt]=(0,v.useState)({w:0,h:0}),st=(0,Y.useOwner)(e=>e.site),it=(0,U.useRestaurant)(st);(0,je.useAlertWatcher)(st,{enabled:!e});const ot=(0,U.useOrders)(st),nt=(0,U.useBookings)(st),at=(0,U.useEvents)(st),rt=(0,U.useStore)(e=>e.skipMinutes),dt=(0,U.useStore)(e=>e.clock.mode),ct=(0,U.useNow)(5e3),ut=(0,Y.useOwner)(e=>e.staff),ht=(0,Y.useOwner)(e=>e.attendance),gt=(0,Y.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,J.ensureAttendance)((0,V.ymd)(ct),ct)},[(0,V.ymd)(ct)]);const bt=ht.filter(e=>e.in&&!e.out&&ct.getTime()-new Date(e.in).getTime()<72e6&&ct.getTime()>=new Date(e.in).getTime()),yt=Oe(ut.find(e=>e.id===bt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,yt,!e);const pt=(0,V.ymd)(ct),xt=(0,T.useTravelDay)('display',pt),ft=(0,Q.useFrontDoor)(pt,Ye),mt=(0,X.useDisplaySettings)(st),jt=mt.privacy,wt=(0,ae.useSaverSync)(),kt=(0,X.usePlan)(st),It=(0,X.useFloor)(e=>e.live[st]),Dt=(0,we.useBlocks)(e=>e.blocks),[vt,St]=(0,v.useState)('plan'),[Ct,Tt]=(0,v.useState)(!1),[$t,Bt]=(0,v.useState)('all'),[Rt,Lt]=(0,v.useState)(null),[Wt,Mt]=(0,v.useState)(null),[zt,Ht]=(0,v.useState)(null),[Pt,Et]=(0,v.useState)(!1),[Ot,At]=(0,v.useState)(!1),[Nt,_t]=(0,v.useState)(null),[Gt,Ft]=(0,v.useState)(!1),[Vt,Ut]=(0,v.useState)(!1),[Kt,qt]=(0,v.useState)(null),[Yt,Qt]=(0,v.useState)(null),[Jt,Xt]=(0,v.useState)(null),Zt=S.default.useRef(0),el=e=>{Zt.current=Date.now(),Xt(e)};S.default.useEffect(()=>{if(!Jt)return;const e=setInterval(()=>{Date.now()-Zt.current>=ve.DAY_IDLE_MS&&Xt(null)},5e3);return()=>clearInterval(e)},[Jt]);const tl=(0,U.useWaitlist)(st),ll=(0,U.useStore)(e=>e.walkIns[st]??0),[sl,il]=(0,v.useState)(!1),[ol,nl]=(0,v.useState)(!1),[al,rl]=(0,v.useState)(!1);(0,_.useReviewAlerts)(st);const[dl,cl]=(0,v.useState)({view:0,content:0}),[ul,hl]=(0,v.useState)(null);S.default.useEffect(()=>{ul&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:ul,timeoutMs:4500,big:!0,testID:'floor-toast'}),hl(null))},[ul]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[gl,bl]=(0,v.useState)(null),yl=S.default.useRef(0),[pl,xl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!gl)return;yl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-yl.current;if(e>=Ee)return bl(null),void hl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');xl(e>=105e3?Math.ceil((Ee-e)/1e3):null)},1e3);return()=>clearInterval(e)},[gl]);const fl=e=>e.date!==pt?Ht({title:`Guest details \xb7 ${(0,ve.dayWord)(e.date,pt)} ${e.time}`,body:(0,Pe.jsx)(Pe.Fragment,{children:(0,pe.bookingDetails)(e)})}):Ht({title:`Guest details \xb7 ${e.time}`,body:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ve,{rid:st,id:e.id,turnBase:it.settings.turnMins}),e.walkIn?null:(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Ht(null),_t(e.id)},style:{minHeight:56}}),e.walkIn?(0,Pe.jsx)(he.CancelWalkInButton,{rid:st,b:e,big:!0,onDone:e=>{Ht(null),hl(e)}}):null,e.walkIn?(0,Pe.jsx)(he.ReinstateWalkInButton,{rid:st,b:e,today:pt,onDone:e=>{Ht(null),hl(e)}}):null,(0,pe.bookingDetails)(e)]})}),ml=nt.filter(e=>e.date===pt).sort((e,t)=>e.time.localeCompare(t.time)),jl=ml.filter(e=>!['cancelled','noshow'].includes(e.status)),wl=ot.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),kl=(0,v.useMemo)(()=>(0,d.forecastToday)(it,nt,ot,at,ct),[it,nt,ot,at,ct.getTime()/6e4|0]),Il=(0,we.closedAreasAt)(Dt,st,pt,(0,V.hm)(ct)),Dl=[...Il].join(','),vl=(0,v.useMemo)(()=>(0,Z.floorView)(kt,nt,ot,It??{},ct,it.settings.turnMins,Il),[kt,nt,ot,It,ct.getTime(),Dl]),Sl=(0,ye.hoursFor)(it,ct),Cl=Sl?.open??new Date(`${pt}T12:00:00`),Tl=Sl?.close??new Date(`${pt}T21:00:00`),$l=(0,V.addMins)(Cl,-Cl.getMinutes()),Bl=(0,V.addMins)(Tl,90),Rl=e=>new Date(`${pt}T${e}:00`),Ll=(0,we.blocksOn)(Dt,st,pt).map(e=>({from:Rl(e.from),to:Rl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(it,ct,pt)),Wl=Object.keys(vl).filter(e=>'blocked'===vl[e]?.status),Ml=Jt&&Jt!==pt?Jt:pt,zl=Ml!==pt,Hl=(0,ve.dayWord)(Ml,pt),Pl=/^(Today|Yesterday|Tomorrow)$/.test(Hl),El=zl?(0,ve.bookingsForDay)(nt,Ml,pt).sort((e,t)=>e.time.localeCompare(t.time)):ml,Ol=(0,V.parseYmd)(Ml);Ol.setHours(12);const Al=zl?(0,ye.hoursFor)(it,Ol):Sl,Nl=Al?.open??new Date(`${Ml}T12:00:00`),_l=Al?.close??new Date(`${Ml}T21:00:00`),Gl=e=>new Date(`${Ml}T${e}:00`),Fl=[...zl?(0,we.blocksOn)(Dt,st,Ml).map(e=>({from:Gl(e.from),to:Gl(e.to),label:e.reason??'Paused'})):Ll,...zl?(0,i.queuedServicePauses)(it,Ol,Ml):[]],Vl=(0,i.queuedServiceSessions)(it,Ol),Ul=l.IS_QUEUED_VENUE&&(void 0===Vl||!Vl.length),Kl=(0,Pe.jsxs)(P.default,{testID:"queued-hours-gate",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:void 0===Vl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Pe.jsx)(A.Muted,{children:s.queuedVenues[st]?.hours.note})]}),ql=zl?Al||El.length?Mlzl?(0,Z.dayFloorView)(kt,El,Ml):vl,[zl,kt,El,Ml,vl]),[Ql,Jl]=(0,v.useState)(null),Xl=zl?El.filter(e=>!['cancelled','noshow'].includes(e.status)):jl,Zl=Xl.reduce((e,t)=>e+t.partySize,0),es=(0,c.coversSplit)(Xl,Ml),ts=(0,Se.cancelledDayTally)(nt,Ml),ls=(0,Ce.cancellationsFor)(nt,Ml,e=>e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)','')),ss=(0,Se.cancelledTallyWords)(ts,Pl?Hl.toLowerCase():zl?`on ${Hl}`:'today'),is=Dt.filter(e=>e.rid===st&&e.date===Ml&&!e.removedAt),os=(0,De.chartBands)(is,60*Nl.getHours()+Nl.getMinutes(),60*_l.getHours()+_l.getMinutes()),ns=new Set((0,De.blockedHours)(os)),as=ct.getHours()+(ct.getMinutes()>=30?1:0),rs=kl.hours.filter(e=>e.hour>=as&&!ns.has(e.hour)),ds=rs.reduce((e,t)=>e+t.coversHigh,0),cs=rs.reduce((e,t)=>e+t.coversLow,0),us=Math.round((cs+ds)/2),hs=!kl.example&&kl.open&&kl.enough&&ds>0?`Usually ${(0,d.coversRange)(us,us)} more`:void 0,gs=async(e,t)=>{const l=vl[e]?.booking;if(!l||e===t)return;const s=vl[t]?.status;if(s&&!['free','soon'].includes(s))return void hl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${Z.STATUS[s].label.toLowerCase()}. Pick a free table.`);await U.repo.bookings.update(l.id,{table:t});const i=It?.[e]?.stage;X.useFloor.getState().setLive(st,t,{stage:i??'seated',dirty:!1}),X.useFloor.getState().setLive(st,e,{stage:void 0,dirty:!0}),hl(`${(0,re.privName)(l,jt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},bs=Yt?nt.find(e=>e.id===Yt.id):void 0,ys=Yt&&bs?(()=>{const e=bs.walkIn?(0,re.privName)(bs,jt):Oe(bs.name),t=(0,be.seatsOf)(kt,Yt.tables).total,l=(0,be.seatLine)(t,bs.partySize),s=(0,be.pickClashes)(bs,Yt.tables,nt.filter(e=>e.date===bs.date),it.settings.turnMins),i=(0,be.tableKey)(Yt.tables)!==(0,be.tableKey)((0,X.tablesOf)(bs.table));return(0,Pe.jsxs)(P.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:K.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,padding:10},children:[(0,Pe.jsxs)(P.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,ve.dayWord)(bs.date,pt)} ${bs.time}. Tap tables on the plan to add or take them off. ${(0,be.tablesWords)(Yt.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,ve.dayWord)(bs.date,pt)," ",bs.time]}),(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[(0,be.tablesWords)(Yt.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,Pe.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,Pe.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,be.tablesWords)(Yt.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(bs){try{await(0,ge.saveBookingTables)(st,bs,Yt.tables),hl((0,be.savedWords)(e,bs.partySize,Yt.tables,t))}catch(t){hl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Qt(null)}else Qt(null)}}),(0,Pe.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Qt(null)})]})]})})():null,ps=kt.areas.filter(e=>kt.tables.some(t=>t.areaId===e.id)),xs=e=>{const t=kt.tables.filter(t=>t.areaId===e);return zl?`${t.filter(e=>!Yl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(vl[e.name]?.status??'free')).length}/${t.length} free`},fs='all'===$t||ps.some(e=>e.id===$t)?$t:'all',ms=e=>(0,Pe.jsx)(ee.FloorCanvas,{plan:kt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Qe,big:!0,view:Yl,privacy:jt,turnBase:it.settings.turnMins,highlight:Yt?Yt.tables:Wt?[Wt]:void 0,onTap:e=>{return t=e.name,void(Yt?Qt(e=>e?{...e,tables:(0,be.toggleTable)(e.tables,t)}:e):zl?Jl(t):Wt?(t!==Wt&&gs(Wt,t),Mt(null)):Lt(t));var t},onDrop:(e,t)=>Yt||zl?void 0:gs(e.name,t.name)}),js=qe?1:Ye||ps.length>2?2:1,ws=e=>{const t=kt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ks=[];for(let e=0;e{const t=(0,ee.areaBounds)(kt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ee.minReadableScale)(kt,e.id)}}),tt.w,tt.h):null,Ds=e=>(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',height:te.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:xs(e.id)})]}),vs=(0,Pe.jsx)(P.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-tt.w)>1||Math.abs(l-tt.h)>1)&<({w:t,h:l})},children:Is?(0,Pe.jsx)(H.default,{style:{flex:1},scrollEnabled:Is.scroll,showsVerticalScrollIndicator:Is.scroll,contentContainerStyle:{gap:te.GRID_GAP},children:Is.rows.map((e,t)=>(0,Pe.jsx)(P.default,{style:{height:Is.rowHeights[t],flexDirection:'row',gap:te.GRID_GAP},children:e.map(e=>{const t=ps.find(t=>t.id===e);return(0,Pe.jsxs)(P.default,{testID:`area-cell-${e}`,style:{width:Is.cellW,gap:2},children:[Ds(t),(0,Pe.jsx)(P.default,{style:{flex:1},children:ms(e)})]},e)})},t))}):null}),Ss=(0,Pe.jsxs)(P.default,{testID:"venue-plan",style:{flex:qe?void 0:1,gap:10,minWidth:0},children:[(0,Pe.jsx)(a.TableNumberWarning,{plan:kt}),kt.tables.length?null:(0,Pe.jsxs)(P.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Pe.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Pe.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,Pe.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Pe.jsx)(Ge,{chipId:"all",compact:!qe,label:"Whole venue",selected:'all'===fs,onPress:()=>Bt('all')},"__all"),...ps.map(e=>(0,Pe.jsx)(Ge,{chipId:e.id,compact:!qe,label:`${e.name}${(0,le.areaMarks)(e)}`,colour:(0,K.brandColour)(e.colour),sub:qe?Il.has(e.id)?'closed':fs===e.id?xs(e.id):void 0:void 0,selected:fs===e.id,onPress:()=>Bt(e.id)},e.id))];return qe?(0,Pe.jsx)(P.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Pe.jsx)(H.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;cl(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>cl(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:dl.view>0&&dl.content>0&&dl.content<=dl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:dl.view>0&&dl.content<=dl.view+1?'100%':void 0},children:e})})(),(0,Pe.jsx)(h.FloorLegend,{}),ys,Wt?(0,Pe.jsxs)(A.Row,{gap:8,style:{backgroundColor:K.colours.goldTint,borderRadius:10,padding:8},children:[(0,Pe.jsxs)(A.T,{weight:"semibold",colour:K.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Wt),": tap the new table."]}),(0,Pe.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Mt(null)})]}):null,'all'===fs&&Qe?vs:'all'===fs?(0,Pe.jsx)(P.default,{style:{flex:qe?void 0:1,gap:12,minHeight:Je?void 0:360},children:ks.map((e,t)=>(0,Pe.jsxs)(P.default,{style:{flex:qe?void 0:Math.max(.3,...e.map(e=>ws(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Pe.jsxs)(P.default,{style:{flex:1,gap:2},children:[qe?(0,Pe.jsxs)(P.default,{style:{alignItems:'center',gap:4},children:[(0,Pe.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{center:!0,children:xs(e.id)})]}):(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{children:xs(e.id)})]}),(0,Pe.jsx)(P.default,{style:qe?{height:Math.max(280,Math.round((Ue-40)*ws(e.id)))}:{flex:1},children:ms(e.id)})]},e.id)),e.length{if(zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},Ml)}),Ts='timeline'===vt,$s=Ct?(0,Pe.jsx)(W.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Tt(!1),supportedOrientations:['landscape','portrait'],children:(0,Pe.jsxs)(P.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:K.colours.bg,padding:10,gap:8},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Pe.jsx)(z.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Tt(!1),style:{minHeight:64,minWidth:180,paddingHorizontal:22,borderRadius:16,borderWidth:2,borderColor:K.colours.goldLight,backgroundColor:K.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Pe.jsx)(P.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Pe.jsx)(A.T,{size:22,weight:"semibold",colour:K.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${zl?(0,ve.dayLong)(Ml):'Today'}`})}),(0,Pe.jsx)(P.default,{style:{minWidth:180}})]}),Ul?Kl:(0,Pe.jsx)(P.default,{style:{flex:1,minHeight:0},children:(0,Pe.jsx)(oe.Timeline,{hideNow:!0,plan:kt,bookings:zl?El:ml,now:zl?Nl:ct,privacy:jt,turnBase:it.settings.turnMins,t0:zl?(0,V.addMins)(Nl,-Nl.getMinutes()):$l,t1:zl?(0,V.addMins)(_l,90):Bl,pauses:zl?Fl:Ll,blockedTables:zl?[]:Wl,onOpen:e=>{if(Tt(!1),zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},`full-${Ml}`)})]})}):null,Bs=zl?(0,Pe.jsxs)(P.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,backgroundColor:K.colours.goldTint},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:Pl?`Showing ${Hl} \xb7 ${(0,V.niceDate)((0,V.parseYmd)(Ml))}`:`Showing ${(0,ve.dayWord)(Ml,pt)}`}),(0,Pe.jsx)(P.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${ss}. Showing ${(0,ve.dayLong)(Ml)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Pe.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Qt(null),el(null)},style:{minHeight:44}})]}):null,Rs=(0,Pe.jsx)(P.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:qe?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(Ts||Ct);return(0,Pe.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},accessibilityHint:'timeline'===e?'Opens the timeline over the whole screen':void 0,onPress:()=>{'timeline'===e?(St('plan'),Tt(!0)):(Tt(!1),St('plan'))},style:{flex:qe?1:void 0,minHeight:qe?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?K.colours.gold:'transparent',...Be.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,Pe.jsx)(A.T,{size:qe?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ls=(0,u.useBookingWrite)(),Ws=e=>(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Walk-in",onPress:ft.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"New booking",onPress:ft.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Edit booking",onPress:()=>At(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint})]});(0,He.useDisplayNotices)(st,!e);const Ms=qe?180:168,[zs,Hs]=(0,v.useState)(Ms),Ps=S.default.useRef(Ms),Es=S.default.useRef(null),Os=S.default.useRef(null),As=()=>{const e=Es.current,t=Os.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ke<820?8:12,o=44+(Ke<820?4:8),n=i>Ps.current?Math.ceil(i-Ps.current):Ie.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Ms,Math.floor(t-s-l)-n-o));Math.abs(Ps.current-a)>=2&&(Ps.current=a,Hs(a))})})};S.default.useEffect(()=>{const e=setTimeout(As,60);return()=>clearTimeout(e)},[Ue,Ke]);const Ns=(0,Pe.jsxs)(P.default,{ref:Os,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),As()},style:{flexDirection:'row',flexWrap:Ue>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:qe?12:6,justifyContent:qe?'center':void 0,borderTopWidth:1,borderTopColor:K.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Pe.jsx)(ze.DisplayClockButton,{}),(0,Pe.jsx)(ie.HoldToEdit,{quiet:!0,onUnlock:()=>{xl(null),bl({at:Date.now()})},onHint:()=>hl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Pe.jsx)(ke.BlockBookingsButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,display:!0,day:Ml}),kt.areas.some(e=>e.outdoor)?(0,Pe.jsx)(ke.CloseGardenButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,short:!0}):null,(0,Pe.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>rl(!0),style:({pressed:e})=>({...Be.look.quiet(e),flexGrow:1}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,Pe.jsx)(p.GiftQrButton,{rid:st,venue:it.name})]}),_s=wl.length?(0,Pe.jsxs)(P.default,{testID:"takeaway-panel",style:[Be.look.panel,{overflow:'hidden'}],children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Pe.jsxs)(A.T,{size:12,colour:K.colours.muted,children:[wl.length," live"]})]}),(0,Pe.jsx)(P.default,{style:{padding:10},children:(0,Pe.jsx)(Fe,{list:wl,me:yt,compact:!0,bookings:nt})})]}):null,Gs=($e.DueToday,zl?El:ml.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Fs=zl?Pl?`${Hl}\u2019s guests`:`Guests ${Hl}`:'Today\u2019s guests',Vs=(0,Pe.jsxs)(Pe.Fragment,{children:[0===Gs.length?(0,Pe.jsx)(A.Muted,{children:zl?Ml{const t=(0,q.isSeatedHighlight)(e.status,{otherDay:zl}),l=(0,de.guestRowText)(e,{name:e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)',''),seated:t}),s=t?q.SEATED_FG:K.colours.text,i=t?q.SEATED_MUTED:K.colours.muted,o=t?q.SEATED_FG:K.colours.gold,n=l.depositWarn?K.colours.amber:t?q.SEATED_FG:K.colours.goldLight;return(0,Pe.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:zl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Ut(!1),qt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,q.seatedHighlightStyle)({backgroundColor:e?K.colours.goldLight:K.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:K.colours.hairline,backgroundColor:e?K.colours.tilePressed:'transparent'},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Pe.jsx)(P.default,{style:{paddingTop:2},children:(0,Pe.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':K.colours.amber,ink:t?K.colours.gold:K.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Pe.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,Pe.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,Pe.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,Pe.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,Pe.jsx)(P.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Pe.jsx)(ce.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,Pe.jsx)(Te.CancellationsSection,{items:ls,dayWord:zl?Pl?Hl.toLowerCase():`on ${Hl}`:'today'})]}),Us=(0,Pe.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Vs}),Ks=M.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Ut(!1)}}),qs=(0,Pe.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Fs}, ${Gs.length}`,accessibilityState:{expanded:Vt},'aria-expanded':Vt,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Ut(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:Vt?K.colours.gold:K.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?K.colours.tilePressed:Vt?K.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Pe.jsx)(A.T,{size:16,weight:"bold",colour:K.colours.gold,children:Gs.length}),(0,Pe.jsx)(P.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(P.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Pe.jsxs)(A.T,{size:13,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,children:[Fs," ",Vt?'\u2039':'\u203a']})})})]}),Ys=Vt?(0,Pe.jsxs)(P.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Pe.jsxs)(P.default,{testID:"guests-drawer",...Ks.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ue)),backgroundColor:K.colours.surface,borderRightWidth:1,borderColor:K.colours.gold,borderRadius:14,...Be.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Fs.toUpperCase()," (",Gs.length,")"]}),ts.count?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:ss}):null,(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Fs}`,onPress:()=>Ut(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:18,colour:K.colours.muted,children:"\u2715"})})]}),Us]}),(0,Pe.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Fs}`,accessibilityRole:"button",onPress:()=>Ut(!1),style:{flex:1}})]}):null,Qs=Ul?Kl:l.IS_KIRKTON&&!Object.values(it.kitchenHours??{}).some(Boolean)?(0,Pe.jsxs)(P.default,{testID:"kirkton-hours-to-confirm",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Pe.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,Pe.jsx)(Ie.DayGraph,{busyThreshold:(0,t.venueBusy)(it,nt,ct).busy,todays:El,open:Nl,close:_l,now:ct,turnBase:it.settings.turnMins,blocks:is,pauses:Fl,compact:qe,dense:!qe,height:Qe?zs:Ms,forecastNote:zl?void 0:hs,emptyText:ql,past:Ml{zl?Ut(!0):Tt(!0)},ei=(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',padding:Ke<820?8:12,paddingTop:Ke<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[xt?null:qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[xt?null:Bs,xt?(0,Pe.jsx)(H.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"})}):Ts?Cs:Ss,$s,Ys]}),(0,Pe.jsxs)(P.default,{testID:"display-side",style:{width:Xe,gap:Ke<820?4:8,minHeight:0},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Ws(!1)}),(0,Pe.jsx)(P.default,{style:{flexShrink:0},children:Rs}),xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:Ke<820,snug:Ke<820,tight:Ke<700,aside:`${Xl.length} ${1===Xl.length?'table':'tables'} booked${wl.length?` \xb7 ${wl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{ref:Es,testID:"day-graph-slot",onLayout:As,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Js}),(0,Pe.jsxs)(H.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,Pe.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Pe.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),_s,(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt})]})]})]});return(0,Pe.jsxs)(O.SafeAreaView,{style:{flex:1,backgroundColor:K.colours.bg},onTouchStart:()=>{Zt.current=Date.now()},onMouseDown:()=>{Zt.current=Date.now()},children:[qe?(0,Pe.jsxs)(P.default,{style:{flex:1},children:[(0,Pe.jsxs)(H.default,{ref:Ze,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Pe.jsx)(P.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Pe.jsx)(f.ExitButton,{})}),(0,Pe.jsx)(G.RestaurantLogo,{rid:st,size:64}),(0,Pe.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:it.name}),(0,Pe.jsx)(G.PoweredBy,{}),(0,Pe.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Pe.jsx)(P.default,{accessible:!0,accessibilityLabel:`Current time ${(0,V.hm)(ct)}`,children:(0,Pe.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:K.colours.goldLight,children:(0,V.hm)(ct)})}),(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:"m"}),(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:"m"}),F]}),We,Xs,(0,Pe.jsx)(P.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Pe.jsx)(_e,{phone:!0,split:es,items:[{label:`Tables \xb7 ${Hl}`,value:Xl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Hl}`,value:Zl,testID:'badge-covers'},{label:'Takeaway',value:wl.length,alert:wl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Et(!0)}]})}),(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{gap:8},children:Ws(!0)}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),Rs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[Ts?Cs:Ss,$s]}),(0,Pe.jsxs)(P.default,{onLayout:e=>{et.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Be.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Pe.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:K.colours.goldLight,accessibilityRole:"header",children:[Fs," (",Gs.length,")"]}),(0,Pe.jsx)(P.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{gap:4},children:Vs})]}),_s,Js,(0,Pe.jsx)(P.default,{testID:"covers-dock",children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Ze.current?.scrollTo({y:et.current,animated:!0})})}),(0,Pe.jsxs)(P.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Pe.jsx)(A.T,{center:!0,size:14,colour:jt?K.colours.muted:K.colours.amber,children:jt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Pe.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,Pe.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ns]}),e?null:(0,Pe.jsx)(P.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:K.colours.hairline},children:(0,Pe.jsx)(R.VoiceSlot,{size:56})})]}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ue>=1e3?18:14,paddingVertical:Ke<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Be.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,Pe.jsx)(P.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Pe.jsx)(G.RestaurantBrand,{rid:it.id,size:Ue<900?32:40,beside:!0})}),(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Pe.jsx)(A.T,{size:Ue<900?18:21,weight:"semibold",colour:K.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,V.hm)(ct)}),Ue>=900?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:(0,V.niceDate)(ct)}):null]})]}),xt?(0,Pe.jsx)(P.default,{style:{width:220}}):(0,Pe.jsx)(P.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:Xs}),(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:Ue<900?'xs':Ue<1100||Ke<700?'s':'m'}),(0,Pe.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.muted,children:"?"})}),'simulated'===dt?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>rt(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:11,colour:K.colours.muted,children:"+15"})}):null,e?null:(0,Pe.jsx)(f.ExitButton,{}),F,Me?null:(0,Pe.jsx)(R.VoiceSlot,{size:44})]})]}),We,xt?null:(0,Pe.jsxs)(P.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,Pe.jsx)(_e,{splitOnly:!0,split:es,items:[]}),(0,Pe.jsx)(P.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ue>=1e3?18:14)+(e?0:52)+('simulated'===dt?52:0),zIndex:4},children:(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:Ue<1100||Ke<700?'s':'m'})})]}),Qe?ei:(ti=(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Ws(!1)}),Rs]}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),xt?(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"}):(0,Pe.jsx)(Pe.Fragment,{children:(0,Pe.jsxs)(P.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Bs,Ts?Cs:Ss,$s,Ys]})]})}),_s,xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Ms+Ie.DAY_GRAPH_CHROME},children:Js})]}),(0,Pe.jsx)(H.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:ti})),Ns]}),(0,Pe.jsx)(j.SoldOutStrip,{rid:st,by:yt,onOpen:()=>rl(!0)}),(0,Pe.jsx)(w.SoldOutSheet,{visible:al,onClose:()=>rl(!1),rid:st,by:yt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Pe.jsx)(y.TableOrderCue,{rid:st}),ft.elements,Ot?(0,Pe.jsx)(b.EditBookingPicker,{rid:st,today:pt,who:yt,hidePrivate:!0,onClose:()=>At(!1)}):null,Nt?(0,Pe.jsx)(b.EditBookingSheet,{rid:st,id:Nt,who:yt,hidePrivate:!0,onClose:()=>_t(null)}):null,Rt?(0,Pe.jsx)(pe.TableSheet,{rid:st,name:Rt,view:vl,plan:kt,todays:ml,now:ct,privacy:jt,turnBase:it.settings.turnMins,onClose:()=>Lt(null),onWalkIn:e=>ft.openWalkInAt(e),onMove:e=>Mt(e),onDetails:fl}):null,Ql?(()=>{const e=Yl[Ql],t=e?.dayBookings??[];return(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>Jl(null),title:`${(0,r.tableNumbers)(Ql)} \xb7 ${Pl?Hl:(0,ve.dayLong)(Ml)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${Pl?Hl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${Pl?Hl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,re.privName)(e,jt):Oe(e.name);return(0,Pe.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,be.tablesWords)((0,X.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Jl(null),qt(e.id)},style:{minHeight:56}},e.id)}),(0,Pe.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>Jl(null),style:{minHeight:56}})]})})():null,Kt?(()=>{const e=nt.find(e=>e.id===Kt);return e?(0,Pe.jsx)(ue.GuestActionsSheet,{rid:st,b:e,name:e.walkIn?(0,re.privName)(e,jt):Oe(e.name),view:vl,now:ct,otherDay:e.date!==pt,turnBase:it.settings.turnMins,onClose:()=>qt(null),onDetails:fl,onDone:hl,onPickOnPlan:(e,t)=>{Ut(!1),St('plan'),Bt('all'),Qt({id:e.id,tables:t})}}):null})():null,zt?(0,Pe.jsx)(pe.DetailsPanel,{title:zt.title,onClose:()=>Ht(null),children:zt.body}):null,Gt?(0,Pe.jsx)(pe.ServiceSummary,{r:it,todays:ml,orders:ot,waitlistAll:tl,walkInCount:ll,onClose:()=>Ft(!1)}):null,sl?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>il(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Pe.jsx)(h.FloorLegend,{}),(0,Pe.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>il(!1)})]}):null,ol?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>nl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Pe.jsx)(N.ReviewsSection,{rid:st,mode:"read",venueName:it.name}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>nl(!1)})]}):null,Pt?(0,Pe.jsxs)(pe.DetailsPanel,{title:"Takeaway",onClose:()=>Et(!1),children:[(0,Pe.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Pe.jsx)(Fe,{list:wl,me:yt,bookings:nt})]}):null,gl?(0,Pe.jsx)(P.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:K.colours.bg},children:(0,Pe.jsx)(se.PlanDesigner,{initial:kt,venue:it.name,mode:"display",startStep:"arrange",onActivity:()=>{yl.current=Date.now(),null!==pl&&xl(null)},notice:null!==pl?`Locking again in ${pl} s \xb7 touch to keep editing`:null,onSave:e=>{X.useFloor.getState().setPlan(st,e),bl(null),hl('Table plan saved. Editing is locked again.')},onCancel:()=>{bl(null),hl('No changes kept. Editing is locked again.')}},gl.at)}):null,e?null:(0,Pe.jsx)(ne.Screensaver,{rid:st,idleMins:mt.idleMins,pinOn:mt.pinOn,wake:mt,tonightCards:mt.tonightCards,cfg:wt}),e?null:(0,Pe.jsx)(fe.PrintHost,{rid:st}),e?null:(0,Pe.jsx)(xe.AlertHost,{variant:"display",rid:st,skipTakeaway:!0}),e?null:(0,Pe.jsx)(B.SeatAllergenReminder,{rid:st}),e?null:(0,Pe.jsx)(me.TakeawayTakeover,{rid:st,me:yt})]});var ti};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),M=e(_r(_d[31])),z=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=e(_r(_d[35])),O=_r(_d[36]),A=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),Me=_r(_d[85]),ze=_r(_d[86]),He=_r(_d[87]),Pe=_r(_d[88]);const Ee=12e4,Oe=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Ne=e=>e.slotTime?(0,V.hm)(new Date(e.slotTime)):'ASAP';function _e({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,Pe.jsxs)(P.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,Pe.jsx)(P.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,Pe.jsxs)(P.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,Pe.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?K.colours.amber:K.colours.text,children:e.value}),(0,Pe.jsx)(A.T,{size:l?14:12,colour:K.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Pe.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,Pe.jsx)(P.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,Pe.jsx)(A.T,{size:14,colour:K.colours.muted,children:"No Covers yet"}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:K.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,Pe.jsxs)(P.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:K.colours.gold},children:[(0,Pe.jsx)(P.default,{style:{width:`${s.walkInPct}%`,backgroundColor:K.colours.gold}}),(0,Pe.jsx)(P.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function Ge({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,Pe.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,Pe.jsx)(P.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,Pe.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?K.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,Pe.jsx)(A.T,{size:12,colour:K.colours.muted,children:l}):null]})}function Fe({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,Me.statusBlock)(e,t,(0,Me.linkedBooking)(e,s));return e.length?(0,Pe.jsx)(P.default,{style:{gap:8},children:e.map(e=>(0,Pe.jsxs)(P.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:K.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?K.colours.ok:e.allergies.length?K.colours.red:K.colours.gold},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Ne(e)," \xb7 ",Oe(e.customerName)]}),(0,Pe.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,Pe.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:K.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,F.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Pe.jsx)(We.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Pe.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Pe.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>U.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Pe.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Pe.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Pe.jsx)(fe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Pe.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Ve({rid:e,id:t,turnBase:l}){const s=(0,U.useBookings)(e).find(e=>e.id===t);return s?(0,Pe.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1279,[1121,5,6,1280,798,822,1094,829,1120,1281,1282,1283,1091,1115,1284,1285,1287,1288,1289,1130,977,1099,1290,34,1073,1148,1033,1087,1116,1291,395,380,402,295,102,426,36,794,1186,1190,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1292,1107,1293,1296,1298,1301,1304,1300,1305,1307,1308,1112,1093,1095,852,1310,1175,1311,1185,1177,1011,1316,1324,1326,1076,1114,1328,1329,1330,1143,1331,1142,1136,838,1332,1333,25]); __d(function(g,_r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.queuedServiceSessions=u,e.queuedServicePauses=function(n,t,s){const i=u(n,t);return i?i.slice(1).flatMap((n,t)=>{const u=i[t][1],r=n[0];return u!!t.walkIn||'walk-in'===t.source},1281,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useBookingWrite=function(){const t=(0,s.useSignedIn)(),c=(0,n.canChangeBookings)(t);return{ok:c,hint:c?void 0:n.BOOKING_VIEW_ONLY,lock:s=>c?{disabled:!1,accessibilityLabel:s}:{disabled:!0,accessibilityLabel:s,accessibilityHint:n.BOOKING_VIEW_ONLY}}};var n=r(d[0]),s=r(d[1])},1282,[1012,1100]); @@ -1473,7 +1473,7 @@ __d(function(g,r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModu __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"READY_ITEMS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"NOT_ANSWERED",{enumerable:!0,get:function(){return t}});const n=['A drawing or other picture of the table plan with area names labelled and how many people each seats','Opening hours','Staff and roles','Pay and tips dates','Supplier account numbers','Logo','Menu','Allergens'],t='Not answered yet'},1390,[]); __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,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1391,[798,34,283,364,236,402,102,815,794,840,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.StaffHome=function({go:e}){const L=(0,m.useInStaffApp)(),{now:N,meId:A,me:O,r:R,today:z}=(0,m.useCtx)(3e4),H=(0,s.useTravelDay)('staff',z),P=(0,h.useOwner)(e=>e.shifts),F=(0,h.useOwner)(e=>e.attendance),_=(0,h.useOwner)(e=>e.staffCanViewSuppliers),E=(0,h.useOwner)(e=>e.quickLinks),W=(0,h.useOwner)(e=>e.chat),q=(0,h.useOwner)(e=>e.swaps),V=(0,h.useOwner)(e=>e.leave),G=P.filter(e=>e.staffId===A&&e.published&&e.date>=z).sort((e,s)=>e.date.localeCompare(s.date)||e.start-s.start),U=G.find(e=>e.date===z),Y=F.filter(e=>e.staffId===A&&e.in&&!e.out&&N.getTime()-new Date(e.in).getTime()<72e6).sort((e,s)=>s.in.localeCompare(e.in))[0],Q=(0,x.usePay)(A,0),K=(0,b.useOrders)(R.id),J=(0,b.useBookings)(R.id),X=K.filter(e=>(0,T.LIVE)(e)&&e.allergies.length&&(0,k.nextStep)(e,(0,k.linkedBooking)(e,J))),Z=J.filter(e=>e.date===z&&['confirmed','seated'].includes(e.status)&&(0,k.bookingNeedsAction)(e,K.filter(T.LIVE))),ee=J.filter(e=>(0,S.undoKind)(e,z)||e.walkIn&&'cancelled'===e.status&&e.date===z).sort((e,s)=>e.time.localeCompare(s.time)).slice(0,12),se=W.filter(e=>'all'===e.ch&&e.pinned&&!e.removed).slice(-1)[0],te=q.filter(e=>e.fromId===A&&'open'===e.status).length+V.filter(e=>e.staffId===A&&'pending'===e.status).length,ie=[['Clock in / out',()=>e('more','clock')],['My rota, swaps & time off',()=>e('more','rota')],['Staff chat',()=>e('chat')],['Recipe cards',()=>e('more','recipecards')],['My hours & pay',()=>e('more','mypay')],['My tips',()=>e('more','mytips')],['Post to social (draft)',()=>e('more','social')],..._?[['Suppliers',()=>e('more','suppliers')]]:[]];return!L&&H?(0,v.jsxs)(o.default,{style:{gap:10},children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(s.DayView,{rid:R.id,day:H,today:z,app:"staff"})]}):(0,v.jsxs)(o.default,{style:{gap:10},children:[L?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(t.CoversToday,{rid:R.id})]}),(0,v.jsxs)(r.Card,{highlight:u.colours.accentBorder,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.Row,{gap:10,style:{flex:1},children:[(0,v.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"My avatar",onPress:()=>e('more','avatar'),children:(0,v.jsx)(C.StaffAvatar,{id:A,size:52})}),(0,v.jsxs)(r.T,{size:18,weight:"bold",children:["Hi ",O.replace(' (example)','').split(' ')[0]]})]}),(0,v.jsx)(r.Badge,{kind:"gold",label:L?R.name:'Staff app preview'})]}),(0,v.jsx)(r.Muted,{children:L?`${N.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})}`:'This is what staff will see in the separate Staff app.'})]}),(0,v.jsx)(M.StaffTipsTile,{rid:R.id,today:z,onPress:()=>e('more','mytips')}),(0,v.jsxs)(r.Card,{highlight:Y?u.colours.ok:void 0,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{weight:"semibold",children:Y?`On shift since ${(0,c.hm)(new Date(Y.in))}`:'Not clocked in'}),Y?(0,v.jsx)(r.Badge,{kind:"ok",label:(0,m.hmDur)(Math.max(0,Math.round((N.getTime()-new Date(Y.in).getTime())/6e4)))}):null]}),U?(0,v.jsxs)(r.Muted,{children:["Today on the rota: ",(0,m.fmtH)(U.start),"\u2013",(0,m.fmtH)(U.end)]}):G[0]?(0,v.jsxs)(r.Muted,{children:["Next on the rota: ",m.DAY3[G[0].day]," ",Number(G[0].date.slice(8))," ",(0,m.fmtH)(G[0].start),"\u2013",(0,m.fmtH)(G[0].end)]}):(0,v.jsx)(r.Muted,{children:"No shifts on the rota this week."}),(0,v.jsx)(r.Button,{small:!0,kind:Y?'secondary':'success',label:Y?'Clock out':'Clock in',onPress:()=>e('more','clock')})]}),A?(0,v.jsx)($.RequestTimeOff,{meId:A,me:O,testID:"staff-home-time-off"}):null,(0,v.jsx)(p.ShellfishTile,{rid:R.id,by:O.replace(' (example)',''),app:"staff"}),ee.length?(0,v.jsx)(r.Card,{children:(0,v.jsxs)(o.default,{testID:"staff-seated-today",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Seated and finished today (",ee.length,")"]}),(0,v.jsx)(r.Muted,{children:"Seated someone by mistake? Tap Unseat: they go back to Booked and their tables are freed. Finished or No-show by mistake? Tap Undo."}),ee.map(e=>{const s=e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;return(0,v.jsxs)(o.default,{testID:(0,f.isSeatedHighlight)(e.status)?`staff-seated-row-${e.id}`:`staff-done-row-${e.id}`,style:(0,f.isSeatedHighlight)(e.status)?{gap:6,padding:10,borderRadius:12,marginTop:4,...(0,f.seatedHighlightStyle)()}:{gap:6,borderTopWidth:1,borderTopColor:u.colours.hairline,paddingTop:8,opacity:'finished'===e.status||'noshow'===e.status?.7:1},children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.T,{size:17,weight:"semibold",colour:(0,f.isSeatedHighlight)(e.status)?f.SEATED_FG:u.colours.text,children:[e.time," \xb7 ",s]}),(0,v.jsx)(r.Badge,{kind:'noshow'===e.status?'red':'seated'===e.status?'ok':'neutral',label:'noshow'===e.status?'No-show':'seated'===e.status?'Seated':'Finished'})]}),(0,v.jsxs)(r.Muted,{children:[e.table?(0,I.tableCardLabel)(e.table):'No table'," \xb7 ",e.ref]}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsxs)(r.Row,{wrap:!0,gap:6,children:['seated'===e.status?(0,v.jsx)(r.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${s}`,onPress:()=>(0,B.finishBookingNow)(R.id,e)}):null,e.walkIn?(0,v.jsx)(a.CancelWalkInButton,{rid:R.id,b:e,small:!0}):null,e.walkIn?(0,v.jsx)(a.ReinstateWalkInButton,{rid:R.id,b:e,today:z,small:!0}):null,(0,v.jsx)(S.BookingUndo,{b:e,rid:R.id,today:z,who:s})]})]},e.id)})]})}):null,X.length+Z.length?(0,v.jsxs)(o.default,{testID:"staff-allergy-signoffs",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Allergy sign-offs (",X.length+Z.length,")"]}),(0,v.jsx)(r.Muted,{children:"Tap Sign off for your step. Your name and the time are recorded."}),X.map(e=>(0,v.jsx)(j.AllergyChain,{o:e,me:O},e.id)),Z.map(e=>(0,v.jsxs)(o.default,{accessible:!0,accessibilityLabel:`Booking ${e.time}, ${e.name}, ${e.partySize}${e.table?`, ${(0,D.tableNumbersA11y)(e.table)}`:''}`,style:{gap:4},children:[(0,v.jsxs)(r.Muted,{children:["Booking ",e.time," \xb7 ",e.name," (",e.partySize,")",e.table?` \xb7 ${(0,I.tablesLabel)(e.table)}`:'']}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsx)(j.BookingAllergyChain,{b:e,me:O}),(0,v.jsx)(o.default,{style:{flexDirection:'row'},children:(0,v.jsx)(w.WhatsAppGuest,{b:e,rid:R.id,kind:"auto"})})]},e.id))]}):null,se?(0,v.jsxs)(r.Card,{onPress:()=>e('chat'),children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{size:12,weight:"semibold",colour:u.colours.gold,children:"\ud83d\udccc PINNED IN ALL STAFF"}),(0,v.jsx)(r.Muted,{children:"Open chat \u203a"})]}),(0,v.jsx)(r.T,{size:14,children:se.text})]}):null,(0,v.jsxs)(r.Card,{children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Hours this pay period"}),(0,v.jsxs)(r.T,{size:18,weight:"semibold",colour:u.colours.goldLight,children:[(0,m.hmDur)(Q.paid)," paid hours"]})]}),te?(0,v.jsx)(r.Card,{onPress:()=>e('more','rota'),children:(0,v.jsxs)(r.T,{size:14,children:["You have ",te," request",te>1?'s':''," waiting for a manager \u203a"]})}):null,(0,y.visibleLinks)(E,'staff').length?(0,v.jsxs)(o.default,{testID:"quick-links",style:{gap:6},children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Quick links"}),(0,v.jsx)(y.QuickLinksRow,{compact:!0})]}):null,L?null:(0,v.jsx)(o.default,{style:{gap:6},children:ie.map(([e,s])=>(0,v.jsx)(r.Button,{kind:"secondary",label:e,onPress:s},e))})]})};var s=_r(d[0]),t=_r(d[1]),a=_r(d[2]),l=_r(d[3]);_r(d[4]);var n=e(_r(d[5])),o=e(_r(d[6])),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),f=_r(d[11]),p=_r(d[12]),m=_r(d[13]),x=_r(d[14]),y=_r(d[15]),j=_r(d[16]),b=_r(d[17]),w=_r(d[18]),k=_r(d[19]),T=_r(d[20]),C=_r(d[21]),S=_r(d[22]),I=_r(d[23]),D=_r(d[24]),B=_r(d[25]),M=_r(d[26]),$=_r(d[27]),v=_r(d[28])},1392,[1148,1073,1112,1089,34,402,102,794,865,827,840,1090,1142,1100,1145,1367,1136,850,1149,838,1147,899,1346,1014,829,1096,1154,1159,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.Forecasts=function({go:e}){const{rid:v,r:C,now:$,today:S}=(0,x.useCtx)(3e4),{width:T}=(0,r.default)(),B=(0,n.useBookings)(v),M=(0,n.useOrders)(v),D=(0,n.useEvents)(v),[H,R]=(0,t.useState)(7),A=(0,b.useRealHistory)(v,$),P=(0,t.useMemo)(()=>(0,s.forecastToday)(C,B,M,D,$,A??void 0),[C,B,M,D,A,$.getTime()/6e4|0]),E=(0,t.useMemo)(()=>Array.from({length:H},(e,t)=>{const o=(0,c.addMins)((0,c.parseYmd)(S),1440*t);return{d:o,f:(0,s.forecastToday)(C,B,M,D,o,A??void 0)}}),[C,B,M,D,S,H,A]),F=P.hours.reduce((e,s)=>e+s.booked,0),L=Math.max(C.settings.capacityPerHour,...P.hours.map(e=>e.coversHigh)),I=(0,i.showTakeaway)(C),[N,O]=(0,t.useState)(I),_=D.filter(e=>e.date>=S).sort((e,s)=>e.date.localeCompare(s.date)).slice(0,14),z=Math.min(T,900)-60,Y=e=>E.map(s=>{const t='booked'===e?s.f.hours.reduce((e,s)=>e+s.booked,0):s.f.restOfDay.covers;return{key:(0,c.ymd)(s.d),label:(0,c.dayShort)(s.d),spoken:(0,c.dayLong)(s.d),value:s.f.open?t:0,open:!!s.f.open}}),G=(0,p.jsx)(d.Row,{gap:4,style:{justifyContent:'center'},children:[7,14].map(e=>(0,p.jsx)(d.Chip,{label:`${e}d`,accessibilityLabel:`Next ${e} days`,selected:H===e,onPress:()=>R(e),testID:`forecast-range-${e}`},e))});return P.enough?(0,p.jsxs)(a.default,{style:{gap:12},children:[(0,p.jsx)(d.T,{center:!0,size:18,testID:"forecast-busy-level",children:P.busy.words}),(0,p.jsxs)(d.Muted,{children:["Hourly labels use the upper end of the Covers range. Steady starts at ",P.busy.steady,"; Busy starts at ",P.busy.busy,"."]}),(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(d.T,{weight:"semibold",colour:u.colours.gold,children:["Today by hour \xb7 ",(0,c.niceDate)($)]}),P.example?(0,p.jsx)(b.ExampleBadge,{}):(0,p.jsx)(d.Badge,{kind:"amber",label:"ESTIMATE"})]}),P.open?(0,p.jsx)(y.Bars,{data:P.hours.map(e=>({key:String(e.hour),label:String(e.hour),a:e.booked,b:e.walkIns})),max:L,highlight:P.nextHour?String(P.nextHour.hour):void 0}):(0,p.jsx)(d.Muted,{children:"Closed today."}),(0,p.jsxs)(d.Row,{gap:12,children:[(0,p.jsxs)(d.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:10,height:10,backgroundColor:'#9C7C45'}}),(0,p.jsx)(d.Muted,{children:"Booked"})]}),(0,p.jsxs)(d.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:10,height:10,backgroundColor:'#6B5A3A'}}),(0,p.jsx)(d.Muted,{children:"Expected walk-ins and later bookings"})]})]}),P.hours.map(e=>{const t=(0,y.busyLevel)(e.coversHigh,P.busy.busy);return(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(d.T,{size:14,children:(0,x.fmtH)(e.hour)}),(0,p.jsxs)(d.T,{size:14,colour:u.colours.muted,children:[(0,s.coversRange)(e.coversLow,e.coversHigh),I?` \xb7 about ${e.takeaway} takeaway`:'']}),(0,p.jsx)(d.T,{size:14,weight:"semibold",colour:t.colour,children:t.label})]},e.hour)})]}),(0,p.jsxs)(d.Card,{children:[(0,p.jsx)(d.T,{weight:"semibold",colour:u.colours.gold,children:"Suggested actions"}),P.suggestions.map((e,s)=>(0,p.jsxs)(d.T,{size:14,children:["\u2022 ",e]},s)),(0,p.jsx)(d.Muted,{children:P.example?`${l.EXAMPLE_ACCURACY}. Example figures: confirmed bookings + example weekday/hour averages + expected walk-ins, adjusted for calendar events.`:'Baseline: confirmed bookings + your own weekday/hour averages from past bookings, walk-ins and takeaway, adjusted for calendar events. An estimate, never a promise.'})]}),(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.T,{center:!0,weight:"semibold",colour:u.colours.gold,children:["Next ",H," days (covers)"]}),G,(0,p.jsx)(j.DaysLineGraph,{days:Y('forecast'),titleSpoken:`Covers for the next ${H} days`}),E.filter(e=>e.f.flags.length).map(e=>(0,p.jsxs)(d.Muted,{children:[(0,c.niceDate)(e.d),": ",e.f.flags.join(', ')," (\xd7",e.f.multiplier.toFixed(2),")"]},(0,c.ymd)(e.d)))]}),(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(d.T,{weight:"semibold",colour:I?u.colours.gold:u.colours.muted,children:"Takeaway"}),(0,p.jsx)(d.Button,{small:!0,kind:"ghost",label:N?'Hide':'Show',testID:"forecast-takeaway-toggle",onPress:()=>O(!N)})]}),N?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d.Muted,{children:"Takeaway orders by hour (forecast vs placed)"}),(0,p.jsx)(j.LineChart,{width:z,series:[P.hours.map(e=>e.takeaway),P.hours.map(e=>e.takeawayPlaced)],labels:P.hours.map(e=>String(e.hour))}),(0,p.jsxs)(d.Row,{gap:12,children:[(0,p.jsx)(d.Muted,{children:"Gold: forecast"}),(0,p.jsx)(d.Muted,{children:"Blue: placed so far"})]})]}):null]}),(0,p.jsx)(y.SectionHead,{title:"Holidays & local events",sub:"Scottish bank holidays (gov.uk), South Ayrshire school holidays, key dining dates and your events"}),_.map(s=>(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(d.T,{weight:"semibold",style:{flex:1},children:(0,o.holidayName)(s.title)}),(0,p.jsx)(d.Badge,{kind:w[s.kind][1],label:w[s.kind][0]})]}),(0,p.jsxs)(d.Muted,{children:[(0,c.niceDate)((0,c.parseYmd)(s.date))," ",s.date.slice(0,4),s.description?` \xb7 ${s.description}`:'']}),'regular'===s.source?(0,p.jsx)(d.Muted,{children:[s.time?`From ${(0,i.fmt12)(s.time)}`:'',s.lastFood?`last food orders ${(0,i.fmt12)(s.lastFood)}`:'',s.busier?'expect busier':''].filter(Boolean).join(' \xb7 ')}):null,'regular'===s.source?(0,p.jsx)(d.Button,{small:!0,kind:"secondary",testID:`promote-${s.id}`,label:`Promote: ${s.title} ${k(s.date,S)}`,onPress:()=>{h.useOwner.getState().setOwner({marketingDraft:{title:`${s.title} ${k(s.date,S)}`,body:`${s.title} at ${C.name} ${k(s.date,S)}${s.time?` from ${(0,i.fmt12)(s.time)}`:''}.${s.lastFood?` Food until ${(0,i.fmt12)(s.lastFood)}.`:''} Book a table in the app.`}}),e('more','marketing')}}):'school-holiday'!==s.kind?(0,p.jsx)(d.Button,{small:!0,kind:"secondary",label:`Promote: "${f(s.title)}"`,onPress:()=>{h.useOwner.getState().setOwner({marketingDraft:{title:f(s.title),body:`${f(s.title)} at ${C.name}. Book in the app.`}}),e('more','marketing')}}):null]},s.id)),(0,p.jsx)(d.Button,{kind:"secondary",label:"Add an event",onPress:()=>e('more','events')})]}):(0,p.jsxs)(a.default,{style:{gap:12},testID:"forecast-not-enough",children:[(0,p.jsx)(d.T,{center:!0,size:18,testID:"forecast-busy-level",children:P.busy.words}),(0,p.jsx)(b.NotEnoughHistory,{weeks:P.minWeeks,booked:F}),(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.T,{center:!0,weight:"semibold",colour:u.colours.gold,children:["Booked, next ",H," days"]}),G,(0,p.jsx)(j.DaysLineGraph,{days:Y('booked'),titleSpoken:`Booked covers for the next ${H} days`}),(0,p.jsx)(d.Muted,{children:"Confirmed bookings only. No estimate is added until there is enough history."})]}),(0,p.jsx)(y.SectionHead,{title:"Holidays & local events",sub:"Scottish bank holidays (gov.uk), South Ayrshire school holidays, key dining dates and your events"}),_.slice(0,6).map(e=>(0,p.jsxs)(d.Card,{children:[(0,p.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(d.T,{weight:"semibold",style:{flex:1},children:(0,o.holidayName)(e.title)}),(0,p.jsx)(d.Badge,{kind:w[e.kind][1],label:w[e.kind][0]})]}),(0,p.jsxs)(d.Muted,{children:[(0,c.niceDate)((0,c.parseYmd)(e.date))," ",e.date.slice(0,4)]})]},e.id)),(0,p.jsx)(d.Button,{kind:"secondary",label:"Add an event",onPress:()=>e('more','events')})]})};var s=_r(_d[0]),t=_r(_d[1]),o=_r(_d[2]),a=e(_r(_d[3])),r=e(_r(_d[4])),d=_r(_d[5]),n=_r(_d[6]),l=_r(_d[7]),i=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),y=_r(_d[12]),x=_r(_d[13]),j=_r(_d[14]),b=_r(_d[15]),p=_r(_d[16]);const k=(e,s)=>{const t=(0,c.parseYmd)(e),o=Math.round((t.getTime()-(0,c.parseYmd)(s).getTime())/864e5),a=t.toLocaleDateString('en-GB',{weekday:'long'});return o<=0?'tonight':1===o?'tomorrow':o<=6?`this ${a}`:`on ${(0,c.niceDate)(t)}`},f=e=>`${(0,o.holidayName)(e).replace(/ \(example\)| Supper/g,'')} booking now open`,w={'bank-holiday':['Bank holiday','red'],'school-holiday':['School holiday','blue'],occasion:['Key date','gold'],event:['Event','amber']}},1393,[1120,34,1075,102,426,794,848,1122,851,827,840,865,1147,1100,1366,1125,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.Forecasts=function({go:e}){const{rid:v,r:$,now:S,today:T}=(0,x.useCtx)(3e4),{width:B}=(0,a.default)(),C=(0,r.useBookings)(v),D=(0,r.useOrders)(v),M=(0,r.useEvents)(v),[P,A]=(0,s.useState)(7),F=(0,k.useRealHistory)(v,S),E=(0,s.useMemo)(()=>(0,l.forecastToday)($,C,D,M,S,F??void 0),[$,C,D,M,F,S.getTime()/6e4|0]),I=(0,s.useMemo)(()=>Array.from({length:P},(e,s)=>{const t=(0,c.addMins)((0,c.parseYmd)(T),1440*s);return{d:t,f:(0,l.forecastToday)($,C,D,M,t,F??void 0)}}),[$,C,D,M,T,P,F]),R=E.hours.reduce((e,s)=>e+s.booked,0),H=(0,i.showTakeaway)($),[L,N]=(0,s.useState)(H),O=M.filter(e=>e.date>=T).sort((e,s)=>e.date.localeCompare(s.date)).slice(0,14),_=Math.min(B,900)-60,Y=e=>I.map(s=>{const t='booked'===e?s.f.hours.reduce((e,s)=>e+s.booked,0):s.f.restOfDay.covers;return{key:(0,c.ymd)(s.d),label:(0,c.dayShort)(s.d),spoken:(0,c.dayLong)(s.d),value:s.f.open?t:0,open:!!s.f.open}}),G=(0,j.jsx)(d.Row,{gap:4,style:{justifyContent:'center'},children:[7,14].map(e=>(0,j.jsx)(d.Chip,{label:`${e}d`,accessibilityLabel:`Next ${e} days`,selected:P===e,onPress:()=>A(e),testID:`forecast-range-${e}`},e))});return E.enough?(0,j.jsxs)(o.default,{style:{gap:12},children:[(0,j.jsx)(d.T,{center:!0,size:18,testID:"forecast-busy-level",children:E.busy.words}),(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(o.default,{testID:"forecast-week",style:{flexDirection:'row',justifyContent:'center',alignItems:'center',gap:8,flexWrap:'wrap'},children:[(0,j.jsxs)(d.T,{center:!0,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:[7===P?'This week':`Next ${P} days`," \xb7 forecast covers"]}),E.example?(0,j.jsx)(k.ExampleBadge,{}):(0,j.jsx)(d.Badge,{kind:"amber",label:"ESTIMATE"})]}),G,(0,j.jsx)(f.DaysLineGraph,{days:Y('forecast'),titleSpoken:`Forecast covers for the next ${P} days`}),I.filter(e=>e.f.flags.length).map(e=>(0,j.jsxs)(d.Muted,{center:!0,children:[(0,c.niceDate)(e.d),": ",e.f.flags.join(', ')," (\xd7",e.f.multiplier.toFixed(2),")"]},(0,c.ymd)(e.d)))]}),(0,j.jsxs)(d.Card,{children:[(0,j.jsx)(d.T,{weight:"semibold",colour:u.colours.gold,children:"Suggested actions"}),E.suggestions.map((e,s)=>(0,j.jsxs)(d.T,{size:14,children:["\u2022 ",e]},s)),(0,j.jsx)(d.Muted,{children:E.example?`${n.EXAMPLE_ACCURACY}. Example figures: confirmed bookings + example weekday/hour averages + expected walk-ins, adjusted for calendar events.`:'Baseline: confirmed bookings + your own weekday/hour averages from past bookings, walk-ins and takeaway, adjusted for calendar events. An estimate, never a promise.'})]}),(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(d.T,{weight:"semibold",colour:H?u.colours.gold:u.colours.muted,children:"Takeaway"}),(0,j.jsx)(d.Button,{small:!0,kind:"ghost",label:L?'Hide':'Show',testID:"forecast-takeaway-toggle",onPress:()=>N(!L)})]}),L?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d.Muted,{children:"Takeaway orders by hour (forecast vs placed)"}),(0,j.jsx)(f.LineChart,{width:_,series:[E.hours.map(e=>e.takeaway),E.hours.map(e=>e.takeawayPlaced)],labels:E.hours.map(e=>String(e.hour))}),(0,j.jsxs)(d.Row,{gap:12,children:[(0,j.jsx)(d.Muted,{children:"Gold: forecast"}),(0,j.jsx)(d.Muted,{children:"Blue: placed so far"})]})]}):null]}),(0,j.jsx)(y.SectionHead,{title:"Holidays & local events",sub:"Scottish bank holidays (gov.uk), South Ayrshire school holidays, key dining dates and your events"}),O.map(s=>(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(d.T,{weight:"semibold",style:{flex:1},children:(0,t.holidayName)(s.title)}),(0,j.jsx)(d.Badge,{kind:w[s.kind][1],label:w[s.kind][0]})]}),(0,j.jsxs)(d.Muted,{children:[(0,c.niceDate)((0,c.parseYmd)(s.date))," ",s.date.slice(0,4),s.description?` \xb7 ${s.description}`:'']}),'regular'===s.source?(0,j.jsx)(d.Muted,{children:[s.time?`From ${(0,i.fmt12)(s.time)}`:'',s.lastFood?`last food orders ${(0,i.fmt12)(s.lastFood)}`:'',s.busier?'expect busier':''].filter(Boolean).join(' \xb7 ')}):null,'regular'===s.source?(0,j.jsx)(d.Button,{small:!0,kind:"secondary",testID:`promote-${s.id}`,label:`Promote: ${s.title} ${p(s.date,T)}`,onPress:()=>{h.useOwner.getState().setOwner({marketingDraft:{title:`${s.title} ${p(s.date,T)}`,body:`${s.title} at ${$.name} ${p(s.date,T)}${s.time?` from ${(0,i.fmt12)(s.time)}`:''}.${s.lastFood?` Food until ${(0,i.fmt12)(s.lastFood)}.`:''} Book a table in the app.`}}),e('more','marketing')}}):'school-holiday'!==s.kind?(0,j.jsx)(d.Button,{small:!0,kind:"secondary",label:`Promote: "${b(s.title)}"`,onPress:()=>{h.useOwner.getState().setOwner({marketingDraft:{title:b(s.title),body:`${b(s.title)} at ${$.name}. Book in the app.`}}),e('more','marketing')}}):null]},s.id)),(0,j.jsx)(d.Button,{kind:"secondary",label:"Add an event",onPress:()=>e('more','events')})]}):(0,j.jsxs)(o.default,{style:{gap:12},testID:"forecast-not-enough",children:[(0,j.jsx)(d.T,{center:!0,size:18,testID:"forecast-busy-level",children:E.busy.words}),(0,j.jsx)(k.NotEnoughHistory,{weeks:E.minWeeks,booked:R}),(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.T,{center:!0,weight:"semibold",colour:u.colours.gold,children:["Booked, next ",P," days"]}),G,(0,j.jsx)(f.DaysLineGraph,{days:Y('booked'),titleSpoken:`Booked covers for the next ${P} days`}),(0,j.jsx)(d.Muted,{children:"Confirmed bookings only. No estimate is added until there is enough history."})]}),(0,j.jsx)(y.SectionHead,{title:"Holidays & local events",sub:"Scottish bank holidays (gov.uk), South Ayrshire school holidays, key dining dates and your events"}),O.slice(0,6).map(e=>(0,j.jsxs)(d.Card,{children:[(0,j.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(d.T,{weight:"semibold",style:{flex:1},children:(0,t.holidayName)(e.title)}),(0,j.jsx)(d.Badge,{kind:w[e.kind][1],label:w[e.kind][0]})]}),(0,j.jsxs)(d.Muted,{children:[(0,c.niceDate)((0,c.parseYmd)(e.date))," ",e.date.slice(0,4)]})]},e.id)),(0,j.jsx)(d.Button,{kind:"secondary",label:"Add an event",onPress:()=>e('more','events')})]})};var s=_r(_d[0]),t=_r(_d[1]),o=e(_r(_d[2])),a=e(_r(_d[3])),d=_r(_d[4]),r=_r(_d[5]),n=_r(_d[6]),l=_r(_d[7]),i=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),y=_r(_d[12]),x=_r(_d[13]),f=_r(_d[14]),k=_r(_d[15]),j=_r(_d[16]);const p=(e,s)=>{const t=(0,c.parseYmd)(e),o=Math.round((t.getTime()-(0,c.parseYmd)(s).getTime())/864e5),a=t.toLocaleDateString('en-GB',{weekday:'long'});return o<=0?'tonight':1===o?'tomorrow':o<=6?`this ${a}`:`on ${(0,c.niceDate)(t)}`},b=e=>`${(0,t.holidayName)(e).replace(/ \(example\)| Supper/g,'')} booking now open`,w={'bank-holiday':['Bank holiday','red'],'school-holiday':['School holiday','blue'],occasion:['Key date','gold'],event:['Event','amber']}},1393,[34,1075,102,426,794,848,1122,1120,851,827,840,865,1147,1100,1366,1125,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useShellBadges",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(()=>({notifCount:0}))},1394,[815]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.OrderCard=P,_e.Orders=function(){const{rid:e,r:t,now:l,me:s}=(0,w.useCtx)(5e3),n=(0,u.useOrders)(e),[c,h]=(0,r.useState)(!1),[b,x]=(0,r.useState)(null),[f,T]=(0,r.useState)('all'),C=n.filter(k.LIVE).filter(e=>'all'===f||e.type===f).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),v=n.filter(e=>!(0,k.LIVE)(e)).slice(0,8),R=n.filter(k.LIVE).flatMap(e=>(0,m.readinessFor)(e,t,l).map(t=>({...t,order:e}))),A=R.filter(e=>'due'===e.state||'overdue'===e.state),M=R.filter(e=>'upcoming'===e.state).sort((e,t)=>e.due.getTime()-t.due.getTime()).slice(0,5),N={cook:'START COOKING',bag:'BAG IT',ready:'READY'};return(0,B.jsxs)(o.default,{style:{gap:12},children:[(0,B.jsx)(i.Button,{testID:"take-order",label:"Take an order",sub:(0,p.orderAtTableOn)(t)?'(phone, walk-in or table)':'(phone or walk-in takeaway)',accessibilityLabel:(0,p.orderAtTableOn)(t)?'Take an order, phone, walk-in or table':'Take an order, phone or walk-in takeaway',style:{minHeight:64},onPress:()=>h(!0)}),b?(0,B.jsx)(i.Banner,{kind:"success",title:`Order ${b} sent to the kitchen`,children:"It is on the live board below."}):null,(0,B.jsx)(i.Row,{gap:8,children:[['new','acknowledged'],['preparing'],['ready']].map((e,t)=>(0,B.jsxs)(o.default,{style:{flex:1,backgroundColor:j.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:j.colours.border},children:[(0,B.jsx)(i.T,{size:12,colour:j.colours.muted,children:['New','Preparing','Ready'][t]}),(0,B.jsx)(i.T,{size:22,weight:"bold",colour:[j.colours.red,j.colours.amber,j.colours.ok][t],children:n.filter(t=>e.includes(t.status)).length})]},t))}),(0,B.jsx)(k.SectionHead,{title:"Collection readiness",sub:`Takeaway timings: slot \u2212 prep \u2212 ${t.settings.bufferMins} min buffer`}),0===A.length?(0,B.jsx)(i.Muted,{children:"Nothing due right now."}):null,A.map(e=>(0,B.jsxs)(k.AlertBox,{colour:'overdue'===e.state?j.colours.red:j.colours.amber,title:`${N[e.stage]} \xb7 ${e.order.ref} \xb7 pickup ${(0,y.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,B.jsx)(i.T,{size:14,children:e.detail}),'ready'===e.stage?(0,B.jsx)(i.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>u.repo.orders.setStatus(e.orderId,'ready',s)}):(0,B.jsx)(i.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:!!(0,S.statusBlock)(e.order,'preparing',(0,S.linkedBooking)(e.order,u.useStore.getState().bookings)),onPress:()=>u.repo.orders.acknowledgeReadiness(e.orderId,e.stage,s)})]},e.id)),M.map(e=>(0,B.jsxs)(i.Muted,{children:[(0,y.hm)(e.due)," \xb7 ",N[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,y.hm)(new Date(e.order.slotTime)),")"]},e.id)),(0,B.jsx)(k.SectionHead,{title:"Live orders",right:(0,B.jsx)(i.Row,{gap:4,children:((0,p.orderAtTableOn)(t)?['all','takeaway','table']:['all','takeaway']).map(e=>(0,B.jsx)(i.Chip,{label:'all'===e?'All':'takeaway'===e?'Takeaway':'Table',selected:f===e,onPress:()=>T(e)},e))})}),0===C.length?(0,B.jsx)(i.Muted,{children:"No live orders."}):null,C.map(e=>(0,B.jsx)(P,{o:e},e.id)),v.length?(0,B.jsx)(k.SectionHead,{title:"Recently completed"}):null,v.map(e=>(0,B.jsx)(i.Card,{style:{opacity:.7},children:(0,B.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(i.T,{children:[e.ref," \xb7 ",'table'===e.type?`${(0,a.tableNumbers)(e.tableNo)}`:e.customerName]}),(0,B.jsx)(i.Badge,{kind:(0,k.statusKind)(e.status),label:(0,k.statusLabel)(e)})]})},e.id)),c?(0,B.jsx)(O,{onClose:e=>{h(!1),e&&x(e)}}):null]})};var e,t=_r(d[0]),l=_r(d[1]),a=_r(d[2]),s=_r(d[3]),r=_r(d[4]),n=_r(d[5]),o=(e=n)&&e.__esModule?e:{default:e},i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),p=_r(d[9]),h=_r(d[10]),b=_r(d[11]),m=_r(d[12]),x=_r(d[13]),y=_r(d[14]),j=_r(d[15]),k=_r(d[16]),w=_r(d[17]),f=_r(d[18]),T=_r(d[19]),S=_r(d[20]),C=_r(d[21]),v=_r(d[22]),B=_r(d[23]);const R={app:'App',phone:'Phone','walk-in':'Walk-in','staff-table':'Staff (table)','table-qr':'Table QR'};function O({onClose:e}){const{rid:a,r:s,now:n,me:m}=(0,w.useCtx)(3e4),y=(0,c.useAllMenu)(a).filter(e=>!e.hidden&&null!=e.price),k=(0,u.useOrders)(a),[T,S]=(0,r.useState)('phone'),[C,R]=(0,r.useState)(''),[O,P]=(0,r.useState)(''),[A,M]=(0,r.useState)(null),[N,$]=(0,r.useState)({}),[I,L]=(0,r.useState)([]),[D,E]=(0,r.useState)(''),[z,F]=(0,r.useState)(''),[_,G]=(0,r.useState)(''),[H,V]=(0,r.useState)(s.sections[0]??'All'),q=(0,x.takeawaySlots)(s,k,n).filter(e=>!e.full).slice(0,8),K=Object.entries(N).filter(([,e])=>e>0),W=K.reduce((e,[t,l])=>e+(y.find(e=>e.id===t)?.price??0)*l,0),Q='staff-table'===T,U=(0,v.ukPhone)(z),Y=Q||('phone'===T?U.ok:!z.trim()||U.ok)&&(0,v.emailOk)(_),J=K.length>0&&Y&&(Q?O.trim().length>0:C.trim().length>1&&('walk-in'===T||A)),X=s.sections.length?s.sections:Array.from(new Set(y.map(e=>e.section)));return(0,B.jsxs)(i.Sheet,{visible:!0,onClose:()=>e(),title:"Take an order",children:[(0,B.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,B.jsx)(i.Chip,{label:"Phone takeaway",selected:'phone'===T,onPress:()=>S('phone')}),(0,B.jsx)(i.Chip,{label:"Walk-in takeaway",selected:'walk-in'===T,onPress:()=>S('walk-in')}),(0,p.orderAtTableOn)(s)?(0,B.jsx)(i.Chip,{label:"Table",selected:Q,onPress:()=>S('staff-table')}):null]}),Q?(0,B.jsx)(i.Field,{label:"Table number",value:O,onChangeText:P,keyboardType:"number-pad",placeholder:"e.g. 6"}):(0,B.jsx)(i.Field,{label:"Customer name",value:C,onChangeText:R,placeholder:"e.g. Mrs Reid"}),Q?null:(0,B.jsx)(i.Field,{label:'phone'===T?'Mobile or phone number (needed)':'Mobile number (optional, for a text when it\u2019s ready)',value:z,onChangeText:F,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123"}),Q||!z||U.ok?null:(0,B.jsx)(i.T,{size:13,colour:j.colours.amber,children:U.error}),Q?null:(0,B.jsx)(i.Field,{label:"Email (optional)",value:_,onChangeText:G,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too"}),'phone'===T?(0,B.jsxs)(o.default,{style:{gap:4},children:[(0,B.jsxs)(i.Muted,{children:["Collection slot (cap ",s.settings.slotCap," per ",s.settings.slotMinutes," min)"]}),(0,B.jsx)(i.Row,{wrap:!0,gap:6,children:q.map(e=>(0,B.jsx)(i.Chip,{label:e.label,sub:e.cap-e.taken+" left",selected:A===e.time.toISOString(),onPress:()=>M(e.time.toISOString())},e.label))}),q.length?null:(0,B.jsx)(i.Muted,{children:"No slots left today."})]}):null,(0,B.jsx)(i.Row,{wrap:!0,gap:6,children:X.map(e=>(0,B.jsx)(i.Chip,{label:e,selected:H===e,onPress:()=>V(e)},e))}),y.filter(e=>e.section===H||!X.includes(e.section)).map(e=>(0,B.jsxs)(i.Row,{style:{justifyContent:'space-between',opacity:e.soldOut?.4:1},children:[(0,B.jsxs)(o.default,{style:{flex:1},children:[(0,B.jsx)(i.T,{size:15,children:e.name}),(0,B.jsxs)(i.Muted,{children:[(0,b.gbp)(e.price??0),e.soldOut?' \xb7 sold out':'']})]}),e.soldOut?null:(0,B.jsx)(i.Stepper,{value:N[e.id]??0,min:0,max:20,label:e.name,onChange:t=>$({...N,[e.id]:t})})]},e.id)),(0,B.jsx)(i.Muted,{children:"Allergies (ask every customer)"}),(0,B.jsx)(i.Row,{wrap:!0,gap:6,children:h.ALLERGENS.map(e=>{const t=I.some(t=>t.allergen===e.id);return(0,B.jsx)(i.Chip,{label:e.short,selected:t,onPress:()=>L(t?I.filter(t=>t.allergen!==e.id):[...I,{allergen:e.id,severity:'allergy'}])},e.id)})}),(0,B.jsx)(i.Field,{label:"Notes",value:D,onChangeText:E,placeholder:"e.g. extra salt, call on arrival"}),t.IS_GREENSIDE?(0,B.jsx)(l.GreensideCashOnly,{}):(0,B.jsx)(i.Banner,{kind:"demo",title:"Card payments: not set up yet",children:"Pay on collection or at the table. Nothing is charged in the app."}),(0,B.jsx)(i.Button,{label:`Place order \xb7 ${(0,b.gbp)(W)}`,disabled:!J,onPress:()=>{const t=u.useStore.getState().placeManualOrder({restaurantId:a,type:Q?'table':'takeaway',channel:T,customerName:C.trim(),tableNo:Q?O.trim():void 0,slotTime:'phone'===T?A:'walk-in'===T?new Date(n.getTime()+9e5).toISOString():void 0,lines:K.map(([e,t])=>({itemId:e,qty:t})),allergies:I,notes:D.trim()||void 0,by:m,phone:!Q&&U.ok?U.pretty:void 0,email:Q?void 0:_.trim()||void 0});I.length&&(0,f.autoPost)('kitchen',`Allergy alert ${Q?`table ${O.trim()}`:t.ref}: ${I.map(e=>(0,h.allergenLabel)(e.allergen).toLowerCase()).join(', ')}`),e(t.ref)}})]})}function P({o:e}){const{r:t,now:l,me:r}=(0,w.useCtx)(1e4),n=(0,k.nextStatus)(e),c=(0,u.useStore)(e=>e.bookings),p=(0,S.linkedBooking)(e,c),m=e.allergies.length>0&&!!(0,S.nextStep)(e,p)&&!('table'===(0,S.nextStep)(e,p)&&!['ready','served'].includes(e.status)),x=!!n&&!!(0,S.statusBlock)(e,n.to,p);return(0,B.jsxs)(o.default,{style:[i.styles.card,{borderColor:m?j.colours.red:'new'===e.status?j.colours.amber:j.colours.border}],children:[(0,B.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,B.jsxs)(i.T,{weight:"semibold",children:[e.ref," \xb7 ",'table'===e.type?`${(0,a.tableNumbers)(e.tableNo)}`:e.customerName]}),(0,B.jsx)(i.Badge,{kind:(0,k.statusKind)(e.status),label:(0,k.statusLabel)(e)})]}),(0,B.jsxs)(i.Muted,{children:['takeaway'===e.type?"Takeaway"+(e.slotTime?` \xb7 pickup ${(0,y.hm)(new Date(e.slotTime))}`:''):'Dine-in'," \xb7 ",R[e.channel??(e.type,'app')]," \xb7 ",(0,y.minsBetween)(new Date(e.createdAt),l)," min ago \xb7 ",(0,b.gbp)(e.total),e.paid>=e.total?' paid':' unpaid']}),e.lines.map((e,t)=>(0,B.jsxs)(i.T,{size:14,children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'',e.notes?` \xb7 ${e.notes}`:'']},t)),e.notes?(0,B.jsxs)(i.Muted,{children:["Note: ",e.notes]}):null,e.allergies.length?(0,B.jsx)(i.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,B.jsx)(i.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \xb7 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,e.allergies.length?(0,B.jsx)(T.AllergyChain,{o:e,me:r}):null,e.accepted?(0,B.jsxs)(i.T,{size:13,colour:j.colours.ok,children:["Accepted by ",e.accepted.by,e.readyBy?` \xb7 ready by ${(0,y.hm)(new Date(e.readyBy))}`:'']}):null,'takeaway'===e.type?(0,B.jsx)(C.ConfirmTimeline,{refId:e.id}):null,'takeaway'===e.type?(0,B.jsx)(s.ReprintButton,{rid:t.id,o:e}):null,e.customerSignal?(0,B.jsx)(i.Badge,{kind:"blue",label:'here'===e.customerSignal?'Customer is here':'Customer on the way'}):null,(0,B.jsxs)(i.Row,{wrap:!0,gap:6,children:[n?(0,B.jsx)(i.Button,{small:!0,kind:'ready'===n.to?'success':'primary',label:n.label,testID:`next-${e.ref}`,disabled:x,onPress:()=>u.repo.orders.setStatus(e.id,n.to,r)}):null,'takeaway'!==e.type||'new'!==e.status||e.accepted?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(i.Button,{small:!0,kind:"success",label:"Accept",onPress:()=>u.repo.orders.accept(e.id,r)}),[15,20,30].map(t=>(0,B.jsx)(i.Button,{small:!0,kind:"secondary",label:`Ready in ${t}`,onPress:()=>u.repo.orders.accept(e.id,r,t)},t))]}),'new'===e.status?(0,B.jsx)(i.Button,{small:!0,kind:"ghost",label:"Reject",onPress:()=>u.repo.orders.setStatus(e.id,'cancelled',r)}):null]})]})}},1395,[5,1342,829,1311,34,102,794,848,850,855,830,836,1134,1104,827,840,1147,1100,1135,1136,838,1348,833,25]); __d(function(g,_r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"tableOnHere",{enumerable:!0,get:function(){return le}});var e,t=_r(d[0]),s=_r(d[1]),r=_r(d[2]),o=_r(d[3]),n=_r(d[4]),l=_r(d[5]),u=_r(d[6]),c=_r(d[7]),p=_r(d[8]),b=_r(d[9]),h=_r(d[10]),f=_r(d[11]),y=_r(d[12]),C=_r(d[13]),S=_r(d[14]),k=_r(d[15]),v=_r(d[16]),w=_r(d[17]),E=_r(d[18]),N=_r(d[19]),P=_r(d[20]),W=_r(d[21]),A=_r(d[22]),T=_r(d[23]),R=_r(d[24]),M=(e=R)&&e.__esModule?e:{default:e},B=_r(d[25]),O=_r(d[26]),G=_r(d[27]),x=_r(d[28]),D=_r(d[29]),I=_r(d[30]),L=_r(d[31]),H=_r(d[32]),F=_r(d[33]),_=_r(d[34]),Q=_r(d[35]),V=_r(d[36]),q=_r(d[37]),U=_r(d[38]),Y=_r(d[39]),j=_r(d[40]),z=_r(d[41]),$=_r(d[42]),J=_r(d[43]),K=_r(d[44]),X=_r(d[45]),Z=_r(d[46]),ee=_r(d[47]),te=_r(d[48]),ae=_r(d[49]),se=_r(d[50]),ie=_r(d[51]),re=_r(d[52]),oe=_r(d[53]),ne=_r(d[54]),de=_r(d[55]);const le=()=>{const e=n.useOwner.getState().site;return(0,p.orderAtTableOn)(c.useStore.getState().restaurants.find(t=>t.id===e))},ue=e=>n.CAN.manage(e);(0,y.register)([{id:'lookback',title:'Look back',sub:'Bookings on one exact past date: times, party sizes, recorded tables and Booked covers',group:'Run the day',can:e=>ue(e)&&'owner'===r.APP_VARIANT,C:s.LookBack},{id:'serviceboard',title:'Restaurant dashboard',sub:'The Display in Managers: any day, plan, Timeline, guests, Covers and all service actions',group:'Run the day',can:ue,C:o.ServiceBoard},{id:'info',title:'Info & hours',sub:'Tagline, phone, about, kitchen hours',group:'Manage app',can:ue,C:f.InfoHours},{id:'photos',title:'Photos',sub:'Gallery shown in the customer app',group:'Manage app',can:ue,C:f.Photos},{id:'recipecards',title:'Recipe cards',sub:'Photo, ingredients, method, allergens, section and price; head chef signs off',group:'Manage app',badge:'NEW',C:k.RecipeCardsPage},{id:'menu',title:'Menu & allergens',sub:'Add, hide, mark sold out, descriptions and options; allergens come from the recipe cards',group:'Manage app',can:ue,C:f.MenuManager},{id:'offers',title:'Specials & offers',sub:'Live specials; notifications are not connected',group:'Manage app',can:ue,C:f.Offers},{id:'events',title:'Events',sub:"What's on, feeds the forecast",group:'Manage app',can:ue,C:f.EventsPage},{id:'feedback',title:'Feedback inbox',sub:'Private ratings after each visit',group:'Manage app',can:ue,C:f.Feedback},{id:'staff',title:'Staff & roles',sub:'Team, roles and role preview',group:'Team',C:b.StaffRoles},{id:'branding',title:'Branding',sub:'Your logo and accent colour in all five apps',group:'Account',can:ue,badge:'NEW',C:S.BrandingSettings},{id:'plan',title:'Plan & billing',sub:h.PLAN_SUB,group:'Account',can:n.CAN.billing,C:h.PlanBilling}]),(0,y.register)([{id:'avatar',title:'My avatar',sub:'Original icons, Bar & kitchen, animals, sea, sport, patterns or your own photo',group:'Team',badge:'NEW',C:W.MyAvatar},{id:'clock',title:'Clock in / out',sub:'Geofenced, break prompt, privacy-first',group:'Team',badge:'NEW',C:N.ClockInOut},{id:'rota',title:'Rota',sub:'Shift builder, swaps, leave, availability, labour vs forecast',group:'Team',C:N.Rota},{id:'signoff',title:'Sign off hours',sub:'Rostered vs actual, flags, fix times, confirm hours for pay',group:'Team',badge:'NEW',can:ue,C:P.SignOff},{id:'timesheets',title:'Timesheets',sub:'Scheduled vs actual, breaks, paid hours, payroll export',group:'Team',C:N.Timesheets}]),(0,y.register)([{id:'insights',title:'Insights',sub:'Smart suggestions from your data',group:'Run the day',can:n.CAN.forecasts,badge:'AI',C:A.Insights},{id:'prep',title:'Prep & stock list',sub:'What to prep from tonight\u2019s forecast',group:'Run the day',C:A.PrepList},{id:'blocks',title:'Block bookings',sub:'Block now, add a block for a future date, time, area or tables, and see every future block',group:'Run the day',badge:'NEW',can:ue,C:w.BlocksPage},{id:'spendhead',title:'Spend per head',sub:'Takings \xf7 covers by day, week and service, from your cash ups',group:'Run the day',badge:'NEW',can:ue,C:E.SpendPerHeadPage},{id:'cashup',title:'Cash up & sales',sub:'Photo of the cash up sheet, weekly sales report, graphs, Today\u2019s tips and the Tips pot',group:'Run the day',badge:'NEW',can:ue,C:v.CashUpPage},{id:'notifications',title:'Notifications',sub:'Orders, allergies, requests, reviews',group:'Run the day',C:A.Notifications},{id:'search',title:'Search',sub:'Dishes, orders, bookings, customers, staff',group:'Run the day',C:A.Search},{id:'analytics',title:'Sales & analytics',sub:'Revenue by channel, top dishes, commission saved',group:'Grow',can:n.CAN.takings,C:A.Analytics},{id:'engineering',title:'Menu engineering',sub:'Margin vs popularity, sold out toggle',group:'Grow',can:ue,C:A.MenuEngineering},{id:'crm',title:'Customers (CRM)',sub:'Profiles, visits, allergies, tags, segments',group:'Grow',can:ue,C:A.Crm},{id:'marketing',title:'Marketing',sub:'Saved campaign drafts; delivery is not connected',group:'Grow',can:ue,C:A.Marketing},{id:'reviews',title:'Reviews',sub:'Look through reviews, publish or remove with a recorded reason',group:'Grow',can:ue,C:A.Reviews},{id:'reviewemail',title:'Review emails',sub:'Ask guests for a review after their visit',group:'Settings',can:ue,C:A.ReviewEmailSettings},{id:'compliance',title:'Daily checks & allergen log',sub:'Fridge temps, opening checks, audit log',group:'Compliance',C:A.Compliance},{id:'lost',title:'Lost property & coat check',sub:'Found items and coat-check tickets',group:'Compliance',C:A.LostProperty},{id:'apps',title:'Your apps',sub:'Links to all five apps (customer, Staff, Display, Head Chef, Managers)',group:'Account',can:ue,badge:'NEW',C:A.YourApps},{id:'demo',title:'Example data',sub:'Example service time, reset',group:'Account',can:()=>!t.LIVE_VENUE_BUILD,C:A.DemoTools}]),(0,y.register)([{id:'features',title:'All features',sub:'Every CoverCharge feature, one tap away',group:'Start here',badge:'19',C:T.AllFeatures},{id:'tables',title:'Tables & QR codes',sub:'QR order & pay at table, live table orders',group:'Run the day',can:()=>le(),C:T.TablesQr},{id:'takeaway',title:'Takeaway settings',sub:'Slots, capacity, pause, live queue',group:'Run the day',can:ue,C:T.TakeawaySettings},{id:'bookingsettings',title:'Booking settings',sub:'Deposits, reminders',group:'Run the day',can:ue,C:T.BookingSettings},{id:'allergy',title:'Allergy hub',sub:'14 allergens, alerts, verification, audit log',group:'Compliance',C:T.AllergyHub},{id:'loyalty',title:'Stamp card',sub:'Settings, members, add/redeem stamps, stats',group:'Grow',can:ue,C:T.Loyalty},{id:'referrals',title:'Bring a friend',sub:'Referral rewards, list and stats',group:'Grow',can:ue,C:T.Referrals},{id:'giftcards',title:'Gift cards & vouchers',sub:'Sell, balance, redeem, honour website bookings cards',group:'Grow',can:ue,C:T.GiftVouchers},{id:'merch',title:'Merch shop',sub:'Optional: products, stock, orders',group:'Grow',can:ue,C:T.Merch},{id:'tablet',title:'Staff tablet preview',sub:'Tablet app coming later',group:'Account',C:T.TabletPreview}]);const ge=e=>'staff'!==e;(0,y.register)([{id:'mypay',title:'My hours & pay',sub:'Hours worked and gross pay, before tax (estimate)',group:'Team',badge:'NEW',C:()=>M.default.createElement(O.MyHoursPay)},{id:'mytips',title:'Tips',sub:'The venue tip pot and today\u2019s tips',group:'Team',C:B.MyTips},{id:'tips',title:'Tips',sub:'Split tips fairly, approve, compliance checklist',group:'Team',badge:'NEW',can:ge,C:B.Tips},{id:'payroll',title:'Payroll & pay rates',sub:'Hourly rates, team gross pay for the period',group:'Team',badge:'NEW',can:ge,C:O.Payroll},{id:'suppliers',title:'Suppliers',sub:'Contacts, cut-offs, call, email, order log',group:'Run the day',badge:'NEW',can:e=>'staff'!==e||n.useOwner.getState().staffCanViewSuppliers,C:G.Suppliers}]),(0,y.register)([{id:'social',title:'Post to social',sub:'Publishing is not connected',group:'Grow',badge:'NEW',C:x.SocialPage},{id:'socialaccounts',title:'Social posting accounts',sub:'No social publishing accounts are connected',group:'Grow',can:ue,C:x.SocialAccounts},{id:'quicklinks',title:'Quick links',sub:'Work email (Gmail), website bookings and your own shortcuts',group:'Account',can:ue,badge:'NEW',C:x.QuickLinksSettings}]),(0,y.register)([{id:'tableplan',title:'Table plan',sub:'Areas, tables, seats, joins; used by the Display floor view',group:'Run the day',can:ue,badge:'NEW',C:D.TablePlan},{id:'displaysettings',title:'Display settings',sub:'Privacy mode, screensaver, PIN on wake',group:'Run the day',can:ue,badge:'NEW',C:D.DisplaySettingsPage}]);const ce=e=>'owner'===e||'manager'===e;I.ASSISTANT_AVAILABLE&&(0,y.register)([{id:'assistant',title:'Assistant',sub:'Ask in plain English; you confirm every action. Activity log',group:'Start here',can:ce,badge:'NEW',C:I.AssistantPage},{id:'assistantsettings',title:'Assistant settings',sub:'On/off, voice, connected services',group:'Account',can:ce,C:I.AssistantSettings}]),(0,y.register)([{id:'carscreen',title:'Car screen',sub:'Sign the car in with its 6-digit code, or sign a car out. Parked only',group:'Run the day',badge:'NEW',can:e=>'owner'===e&&!r.IS_CAR,C:H.CarScreen}]);const pe=e=>'owner'===e||'manager'===e,be=()=>{const e=l.useSession.getState().meId;if(!e)return!0;const t=n.useOwner.getState().staff.find(t=>t.id===e);return!!t&&t.active&&(0,u.costsAllowedFor)(t)},he=e=>pe(e)&&be();(0,y.register)([{id:'specialsboard',title:'Specials board',sub:'Photo of the chalkboard or typed specials with allergens; shown in the customer app',group:'Run the day',can:pe,badge:'NEW',C:L.SafetyPages.Specials},{id:'dishcreator',title:'New dish creator',sub:'Cost a dish, set GP % or multiple, price it, publish to the menu',group:'Manage app',can:he,badge:'NEW',C:L.SafetyPages.Creator},{id:'ingredientprices',title:'Ingredient prices',sub:'What you pay per pack and what it averages; recipe cards work out their GP from it',group:'Manage app',can:he,badge:'NEW',C:L.SafetyPages.Prices},{id:'haccp',title:'Food safety log (HACCP)',sub:'Temperatures, cleaning, allergen checks; filters; CSV and print for the EHO',group:'Compliance',can:pe,badge:'NEW',C:L.SafetyPages.Haccp},{id:'allergen-signoffs',title:'Allergen sign-off log',sub:'Five-step sign-off chain for every guest allergy, with names and times',group:'Compliance',can:pe,badge:'NEW',C:C.AllergenSignOffLog},{id:'accidents',title:'Accident book',sub:'Accidents and near misses; RIDDOR prompt for serious ones',group:'Compliance',badge:'NEW',C:L.SafetyPages.Accidents}]),(0,y.register)([{id:'alerts',title:'Alerts & sounds',sub:'Live alerts, chime, which alerts, test alert, phone notifications',group:'Run the day',can:ue,badge:'NEW',C:F.AlertSettings},{id:'guestmsgs',title:'Guest texts & emails',sub:'Booking and order confirmations, with live preview',group:'Manage app',can:ue,badge:'NEW',C:F.GuestTemplates},{id:'outbox',title:'Outbox',sub:'Every guest text and email (preview mode)',group:'Run the day',can:ue,badge:'NEW',C:F.Outbox}]);const fe=e=>'owner'===e||'manager'===e;(0,y.register)([{id:'advanced',title:'Advanced',sub:'Bookings questions, table times, platters, regular events, kitchen hours and seasons, home screens',group:'Settings',can:fe,badge:'NEW',C:Q.AdvancedSettings},{id:'setup',title:'Guided setup',sub:'Nine steps with a progress bar: venue, hours, table plan, pay, staff, permissions, links',group:'Settings',can:fe,badge:'NEW',C:_.SetupGuide},{id:'orderattable',title:'Order at table',sub:'On or off for this venue: QR order & pay at table. Takeaway is separate',group:'Settings',can:fe,badge:'NEW',C:V.OrderAtTableSettings},{id:'ordersheets',title:'Supplier order sheets',sub:'Suppliers, delivery days, cut-offs and how to order; used by the Head Chef app',group:'Settings',can:fe,badge:'NEW',C:q.OrderSheetSettings},...U.SETUP_STEPS.flatMap(e=>[{id:`setup-${e.id}`,title:e.title,sub:e.sub,group:'Settings',can:fe,C:(0,_.stepPage)(e.id)},...'venue'===e.id?[{id:'screensaver',title:'Display screensaver',sub:'What the Display shows when it\'s idle',group:'Settings',can:fe,badge:'NEW',C:Y.DisplaySaverSettings}]:[]])]),(0,y.register)([{id:'displays',title:'Displays',sub:'Pair a tablet with a one-time code, or switch one off',group:'Settings',can:fe,badge:'NEW',C:j.DisplaysPage},{id:'trackedstock',title:'Tracked stock',sub:'Live counters (lobster, crab or anything else): units, low warning, supplier',group:'Settings',can:ue,badge:'NEW',C:j.TrackedStockPage},{id:'breakroom',title:'Break room game',sub:'On or off for the team',group:'Settings',can:fe,badge:'NEW',C:j.BreakRoomSettings}]),(0,y.register)([{id:'tableqr',title:'Table QR codes',sub:'Scan to order: on or off, hours, print and renew each table\'s QR',group:'Run the day',can:fe,badge:'NEW',C:z.TableQrPage}]),(0,y.register)([{id:'hours',title:'Payroll hours',sub:'Confirmed hours per person for a pay or tips period; copy into your spreadsheet, CSV or print',group:'Team',can:ue,badge:'NEW',C:$.PayrollHours},{id:'tipsday',title:'Tips day',sub:'Enter the total; it\u2019s shared by confirmed hours to the penny',group:'Team',can:ue,badge:'NEW',C:$.TipsDay},{id:'paysettings',title:'Pay & tips',sub:'Tips payday and frequency, wage pay day and cut-off',group:'Settings',can:ue,badge:'NEW',C:$.PayTipsSettings}]),(0,y.register)([{id:'setupchecklist',title:'Setup checklist',sub:'Your setup progress, replay the welcome, questionnaire answers',group:'Settings',can:ue,badge:'NEW',C:J.SetupChecklist}]),(0,y.register)([{id:'help',title:'Help & tutorials',sub:'Search how-tos, Show me where, or ask the Assistant',group:'Start here',can:ue,badge:'NEW',C:K.HelpPage}]),(0,y.register)([{id:'connections',title:'Connected accounts',sub:'Email, website, work socials, bookings, payments, accounting and supplier links',group:'Settings',can:ue,badge:'NEW',C:Z.ConnectionsPage}]),(0,y.register)([{id:'drafts',title:'Drafts for approval',sub:'Bookings, Booker and Bidfood lists, offers, events and specials the voice helper prepared; nothing is sent',group:'Run the day',can:ue,badge:'NEW',C:ee.DraftsPage},{id:'shiftnotes',title:'Shift notes',sub:'Notes for the next shift, left by voice or typing',group:'Run the day',badge:'NEW',C:ee.ShiftNotesPage},{id:'voice',title:'Voice helper',sub:'Hold-to-talk input, text-only replies, who gets it and microphone privacy',group:'Settings',can:ue,badge:'NEW',C:ee.VoiceSettingsPage}]),(0,y.register)([{id:'orderlists',title:'Order lists',sub:'Alsons drinks, Cash and carry: add items, tick on the day, history',group:'Run the day',badge:'NEW',C:function(){const{rid:e,role:t,me:s,today:r}=(0,se.useCtx)(6e4),o=(0,se.useSignedIn)();return M.default.createElement(te.OrderListsScreen,{rid:e,today:r,editor:'staff'!==t,who:{id:o?.id??'manager',name:(o?.name??s).replace(' (example)','')}})}},{id:'foodsafety',title:'Food safety (CookSafe)',sub:'Based on CookSafe (Food Standards Scotland). Full logs coming in the next update',group:'Compliance',can:pe,badge:'NEW',C:function(){return M.default.createElement(ae.FoodSafetyCard,null)}}]),(0,y.register)([{id:'board',title:'Question board',sub:'Anonymous questions from the team: vote, reply, hide (logged)',group:'Team',badge:'NEW',C:function(){const{rid:e,role:t,me:s,today:r}=(0,se.useCtx)(6e4),o=(0,se.useSignedIn)();return M.default.createElement(ie.QuestionBoard,{rid:e,today:r,manager:'owner'===t||'manager'===t,by:(o?.name??s).replace(' (example)','')})}},{id:'morale',title:'Team morale',sub:'Morale over time, staffing vs Covers each night, shout-outs. Anonymous',group:'Team',can:pe,badge:'NEW',C:function(){const{rid:e,today:t}=(0,se.useCtx)(6e4);return M.default.createElement(ie.MoraleTrend,{rid:e,today:t})}}]),(0,y.register)([{id:'soldout',title:'Sold out',sub:'Mark dishes sold out or back on. A reminder for staff, shown on the Display',group:'Run the day',badge:'NEW',C:function(){const{rid:e,me:t}=(0,se.useCtx)(6e4),s=(0,se.useSignedIn)();return M.default.createElement(re.SoldOutList,{rid:e,by:(s?.name??t).replace(' (example)','')})}}]),(0,y.register)([{id:'printerhelp',title:'Connect a ticket printer',sub:'Wi-Fi, network and Bluetooth printers for kitchen tickets, in plain words',group:'Start here',can:ue,badge:'NEW',C:X.PrinterHelpPage}]),(0,y.register)([{id:'guests',title:'Guest profiles',sub:'Visits and Covers from bookings, allergies checked with the guest, preferences, GDPR export and erase requests',group:'Grow',badge:'NEW',C:function(){const{me:e,role:t}=(0,se.useCtx)(6e4),s=(0,se.useSignedIn)();return M.default.createElement(oe.GuestProfiles,{me:(s?.name??e).replace(' (example)',''),manager:'owner'===t||'manager'===t})}}]),(0,y.register)([{id:'nightly',title:'Nightly report',sub:'Spend per head, Covers, takings, tips and no-shows from the cash-up',group:'Run the day',can:ue,C:ne.NightlyReportPage},{id:'support',title:'Chat with CoverCharge support',sub:'A message to the CoverCharge team',group:'Start here',can:ue,C:de.SupportChatPage}])},1396,[806,1397,846,1400,865,997,988,800,855,1402,1409,1419,1379,1420,1421,1423,1424,1425,1426,1155,1157,1428,1377,1429,34,1154,1145,1378,1367,1380,1413,1434,1435,1436,1370,1357,1384,1437,925,1438,1439,1440,1151,1385,1441,1311,1386,1453,1082,1043,1100,1156,1130,1454,1457,1460]); @@ -1553,12 +1553,12 @@ __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.MenuEditor=function({rid:e,me:o,role:s}){const a=(0,d.useAllMenu)(e),c=(0,l.useStore)(o=>o.restaurants.find(o=>o.id===e)),[u,h]=(0,t.useState)('dishes'),[D,O]=(0,t.useState)(null),[k,w]=(0,t.useState)(null),[C,I]=(0,t.useState)(''),z=(0,t.useMemo)(()=>{const e=[...c?.sections??[]];return a.forEach(o=>{e.includes(o.section)||e.push(o.section)}),e},[c?.sections,a]),M=a.filter(e=>!e.hidden||e.recipeCardId),P=e=>(0,p.hasRecipeCards)()?(0,p.recipeCards)().byMenuItem(e):void 0,T={name:o,role:s},R=(0,b.useHistory)(()=>({sections:[...z],items:Object.fromEntries(l.useStore.getState().menu.filter(o=>o.restaurantId===e).map(e=>{const o=a.find(o=>o.id===e.id)??e;return[e.id,{section:o.section,sort:e.sort,price:o.price,allergens:{...o.allergens},soldOut:e.soldOut,photo:P(e.id)?.photo}]}))}),o=>{const t=l.useStore.getState();c&&o.sections.join('|')!==(c.sections??[]).join('|')&&t.updateRestaurant(e,{sections:o.sections});for(const[e,s]of Object.entries(o.items)){const o=a.find(o=>o.id===e),n=t.menu.find(o=>o.id===e);if(!o||!n)continue;const r={};o.section!==s.section&&(r.section=s.section),n.sort!==s.sort&&(r.sort=s.sort),o.price!==s.price&&(r.price=s.price),JSON.stringify(o.allergens)!==JSON.stringify(s.allergens)&&(r.allergens=s.allergens),n.soldOut!==s.soldOut&&(r.soldOut=s.soldOut),Object.keys(r).length&&t.updateMenuItem(e,r);const d=P(e);d&&d.photo!==s.photo&&(0,p.recipeCards)().update(d.id,{photo:s.photo},T)}},'menu change'),B=(e,o,t)=>{const s=a.find(o=>o.id===e);if(!s)return;R.record(`moved ${s.name}`);const n=l.useStore.getState(),r=a.map(t=>t.id===e?{...t,section:o}:t);s.section!==o&&n.updateMenuItem(e,{section:o}),(0,y.reorder)(r,e,o,t).forEach(e=>n.updateMenuItem(e.id,{sort:e.sort})),I(`${s.name} moved${s.section!==o?` to ${o}`:''}.`)},F=async(o,t)=>{const s=P(o),n=a.find(e=>e.id===o);if(s&&n)try{const o=await(0,f.shrinkImage)(t,1024);R.record(`photo for ${n.name}`);const r=await(0,p.recipeCards)().savePhoto(e,s.id,{dataUrl:o,width:0,height:0,bytes:Math.round(.75*o.length)});await(0,p.recipeCards)().update(s.id,{photo:r},T),I(`Photo added to ${n.name}. The dish needs the Head Chef\u2019s sign-off again.`)}catch{I('That picture couldn\u2019t be read. Try a JPEG or PNG.')}else I('This dish has no recipe card yet, so it can\u2019t hold a photo.')},_=a.find(e=>e.id===D),E=({m:e})=>{const o=P(e.id),t=o?.photo&&(0,p.hasRecipeCards)()?(0,p.recipeCards)().photoSource(o.photo):null,s=t?.uri,n=D===e.id,r=k===`d:${e.id}`;return(0,S.jsxs)("div",{"data-testid":`menu-dish-${e.id}`,draggable:!0,onDragStart:o=>(0,f.dragData)(o,'dish',e.id),onClick:()=>O(e.id),onDragOver:o=>{o.preventDefault(),w(`d:${e.id}`)},onDragLeave:()=>w(null),onDrop:o=>{o.preventDefault(),o.stopPropagation(),w(null);const t=(0,f.filesOf)(o)[0];if(t)return void F(e.id,t);const s=(0,f.readDrag)(o);'dish'===s?.kind&&s.id!==e.id&&B(s.id,e.section,e.id)},style:(0,j.box)({display:'flex',alignItems:'center',gap:10,padding:'8px 10px',borderRadius:10,cursor:'grab',userSelect:'none',marginBottom:6,background:n?x.colours.goldTint:x.colours.tile,border:`1px solid ${r?x.colours.gold:n?x.colours.accentBorder:x.colours.hairline}`,borderTop:r?`3px solid ${x.colours.gold}`:void 0}),children:[(0,S.jsx)("span",{style:(0,j.box)({color:x.colours.muted,fontSize:16}),children:"\u283f"}),(0,S.jsx)("div",{style:(0,j.box)({width:40,height:40,borderRadius:8,background:x.colours.surface2,backgroundImage:s?`url(${s})`:void 0,backgroundSize:'cover',backgroundPosition:'center',flexShrink:0,display:'flex',alignItems:'center',justifyContent:'center',fontSize:10,color:x.colours.muted}),children:s?'':'photo'}),(0,S.jsxs)("div",{style:(0,j.box)({flex:1,minWidth:0}),children:[(0,S.jsx)("div",{style:(0,j.box)({fontFamily:'Poppins_600SemiBold',fontSize:14,whiteSpace:'nowrap',overflow:'hidden',textOverflow:'ellipsis',textDecoration:e.soldOut?'line-through':void 0}),children:e.name}),(0,S.jsxs)("div",{style:(0,j.box)({fontSize:12,color:x.colours.muted}),children:[Object.keys(e.allergens).length?Object.keys(e.allergens).length+' allergens':'No allergens',e.hidden?' \xb7 hidden':'']})]}),e.soldOut?(0,S.jsx)("span",{style:(0,j.box)({fontSize:11,color:x.colours.amber,border:`1px solid ${x.colours.amber}`,borderRadius:6,padding:'1px 6px'}),children:"Sold out"}):null,(0,S.jsx)("span",{style:(0,j.box)({fontFamily:'Poppins_600SemiBold',color:x.colours.gold,fontSize:14}),children:v(e.price)})]})};return(0,S.jsxs)(n.default,{style:{flex:1,gap:10},testID:"desk-menu",children:[(0,S.jsx)(j.Tip,{children:"Drag a dish (\u283f) to put it in order or onto another section. Drag a section name to move the whole section. Drop a photo from Finder onto a dish. \u2318Z undoes."}),(0,S.jsxs)(r.Row,{gap:8,children:[(0,S.jsx)(r.Chip,{label:"Dishes",selected:'dishes'===u,onPress:()=>h('dishes'),testID:"menu-tab-dishes"}),(0,S.jsx)(r.Chip,{label:"Sold out & counts",selected:'soldout'===u,onPress:()=>h('soldout'),testID:"menu-tab-soldout"}),(0,S.jsx)(n.default,{style:{flex:1}}),C?(0,S.jsx)(r.T,{size:13,colour:x.colours.goldLight,children:C}):null,(0,S.jsx)(r.Button,{small:!0,kind:"secondary",label:"Undo",disabled:!R.canUndo,onPress:R.undo,testID:"menu-undo"}),(0,S.jsx)(r.Button,{small:!0,kind:"secondary",label:"Redo",disabled:!R.canRedo,onPress:R.redo,testID:"menu-redo"})]}),'soldout'===u?(0,S.jsx)(n.default,{style:{maxWidth:760},children:(0,S.jsx)(m.SoldOutList,{rid:e,by:o})}):(0,S.jsxs)(n.default,{style:{flex:1,flexDirection:'row',gap:14,minHeight:0},children:[(0,S.jsx)("div",{style:(0,j.box)({flex:1,overflowY:'auto',paddingRight:6}),"data-testid":"menu-sections",children:z.map(o=>{const t=M.filter(e=>e.section===o),s=k===`s:${o}`;return(0,S.jsxs)("div",{style:(0,j.box)({marginBottom:14}),onDragOver:e=>{e.preventDefault(),w(`s:${o}`)},onDragLeave:()=>w(null),onDrop:t=>{t.preventDefault(),w(null);const s=(0,f.readDrag)(t);var n,r;'dish'===s?.kind&&B(s.id,o,null),'section'===s?.kind&&s.id!==o&&(n=s.id,r=o,c&&(R.record(`moved section ${n}`),l.useStore.getState().updateRestaurant(e,{sections:(0,y.moveSection)(z,n,r)}),I(`${n} moved.`)))},children:[(0,S.jsxs)("div",{draggable:!0,onDragStart:e=>(0,f.dragData)(e,'section',o),"data-testid":`menu-section-${o}`,style:(0,j.box)({display:'flex',alignItems:'center',gap:8,padding:'6px 4px',cursor:'grab',borderBottom:`${s?2:1}px solid ${s?x.colours.gold:x.colours.border}`,marginBottom:8}),children:[(0,S.jsx)("span",{style:(0,j.box)({color:x.colours.muted}),children:"\u283f"}),(0,S.jsx)("span",{style:(0,j.box)({fontFamily:'Poppins_700Bold',fontSize:16,color:x.colours.goldMuted,letterSpacing:.5,textTransform:'uppercase'}),children:o}),(0,S.jsxs)("span",{style:(0,j.box)({fontSize:12,color:x.colours.muted}),children:[t.length," dishes"]})]}),t.map(e=>(0,S.jsx)(E,{m:e},e.id)),t.length?null:(0,S.jsx)("div",{style:(0,j.box)({fontSize:12,color:x.colours.muted,padding:8,border:`1px dashed ${x.colours.border}`,borderRadius:8}),children:"Drop a dish here"})]},o)})}),(0,S.jsx)(n.default,{style:{width:340,gap:10},testID:"menu-inspector",children:_?(0,S.jsx)($,{rid:e,m:_,me:o,record:R.record,onPhoto:e=>{F(_.id,e)}},_.id):(0,S.jsx)(r.Muted,{children:"Click a dish to change its price, allergens and sold-out state."})})]})]})};var e,o=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),n=(e=s)&&e.__esModule?e:{default:e},r=_r(_d[3]),d=_r(_d[4]),l=_r(_d[5]),a=_r(_d[6]),c=_r(_d[7]),u=_r(_d[8]),h=_r(_d[9]),p=_r(_d[10]),m=_r(_d[11]),x=_r(_d[12]),f=_r(_d[13]),b=_r(_d[14]),j=_r(_d[15]),y=_r(_d[16]),S=_r(_d[17]);const v=e=>null==e?'Board':`\xa3${(e/100).toFixed(2)}`,D={none:'contains',contains:'may',may:void 0};function $({rid:e,m:s,me:d,record:p,onPhoto:m}){const[b,y]=(0,t.useState)(null==s.price?'':(s.price/100).toFixed(2)),v=(e,o)=>{p(o),l.useStore.getState().updateMenuItem(s.id,e)},$=(0,c.dishUsesFor)(e).find(e=>e.id===s.id),O=(0,c.itemsFor)(e),k=()=>{const e=b.trim(),o=''===e?null:Number(e.replace('\xa3',''));if(null!==o&&(!isFinite(o)||o<0))return void y(null==s.price?'':(s.price/100).toFixed(2));const t=null==o?null:Math.round(100*o);t!==s.price&&v({price:t},`price of ${s.name}`)},w=e=>{const o=s.allergens[e]??'none',t=D[o],n={...s.allergens};t?n[e]=t:delete n[e],v({allergens:n},`allergens on ${s.name}`)};return(0,S.jsxs)(n.default,{style:{gap:10,backgroundColor:x.colours.surface,borderRadius:12,borderWidth:1,borderColor:x.colours.border,padding:12},children:[(0,S.jsx)(r.T,{size:17,weight:"bold",children:s.name}),(0,S.jsxs)(r.Muted,{size:12,children:[s.section,s.signOff?` \xb7 signed off by ${s.signOff.by}`:' \xb7 awaiting Head Chef sign-off']}),(0,S.jsx)("div",{onDragOver:e=>{(0,f.hasFiles)(e)&&e.preventDefault()},onDrop:e=>{e.preventDefault();const o=(0,f.filesOf)(e)[0];o&&m(o)},"data-testid":"menu-photo-drop",style:(0,j.box)({border:`1px dashed ${x.colours.accentBorder}`,borderRadius:10,padding:12,textAlign:'center',fontSize:12,color:x.colours.muted}),children:"Drop a photo from Finder here"}),(0,S.jsxs)(n.default,{style:{gap:4},children:[(0,S.jsx)(r.T,{size:13,weight:"semibold",children:"Price (\xa3)"}),(0,S.jsx)(o.TextInput,{testID:"menu-price",value:b,onChangeText:y,onBlur:k,onSubmitEditing:k,placeholder:"Blank = on the specials board",placeholderTextColor:x.colours.muted,style:[r.styles.input,{width:160}]})]}),(0,S.jsxs)(n.default,{style:{gap:4},children:[(0,S.jsx)(r.T,{size:13,weight:"semibold",children:"Allergens"}),(0,S.jsx)(r.Muted,{size:12,children:"Click to cycle: contains \u2192 may contain \u2192 none. Changes go to the recipe card and need the Head Chef\u2019s sign-off."}),(0,S.jsx)(r.Row,{gap:6,wrap:!0,children:h.ALLERGENS.map(e=>{const o=s.allergens[e.id];return(0,S.jsx)(r.Chip,{testID:`menu-al-${e.id}`,label:'may'===o?`${e.short} (may)`:e.short,selected:!!o,onPress:()=>w(e.id)},e.id)})})]}),(0,S.jsx)(r.Toggle,{label:"Sold out now",value:s.soldOut,onChange:e=>{p(`sold out ${s.name}`),(0,a.setSoldOut)(s.id,e,d)},testID:"menu-soldout"}),(0,S.jsxs)(n.default,{style:{gap:4},children:[(0,S.jsx)(r.T,{size:13,weight:"semibold",children:"Sold-out link"}),$&&$.uses.length?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r.Muted,{size:12,children:(0,u.usesText)($.uses,O)}),(0,S.jsx)(r.Badge,{kind:"gold",label:"Sells out on its own when the count runs out"})]}):(0,S.jsx)(r.Muted,{size:12,children:"Not linked to a count. Link it in \u201cSold out & counts\u201d."})]})]})}},1470,[796,34,102,794,850,800,977,979,980,830,856,1130,840,1467,1468,1469,1471,25]); __d(function(g,r,_i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.reorder=function(t,n,i,f){const c=t.filter(t=>t.section===i&&t.id!==n).map(t=>t.id),o=f?c.indexOf(f):-1;return c.splice(o<0?c.length:o,0,n),c.map((t,n)=>({id:t,sort:10*(n+1)}))},e.moveSection=function(t,n,i){const f=t.filter(t=>t!==n),c=i?f.indexOf(i):-1;return f.splice(c<0?f.length:c,0,n),f},e.moveShift=function(n,i,f,c,o,s){const u=n.find(t=>t.id===i);if(!u)return n;if(!o&&u.staffId===f&&u.date===c)return n;const l={...u,staffId:f,date:c,day:(0,t.weekdayOf)(c)};return o?[...n,{...l,id:s(),published:!1,changed:!1}]:n.map(t=>t.id===i?{...l,changed:!!u.published||u.changed}:t)};var t=r(d[0])},1471,[865]); __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.RotaEditor=function({today:e}){const y=(0,i.useOwner)(e=>e.staff).filter(e=>e.active),S=(0,i.useOwner)(e=>e.shifts),[$,j]=(0,t.useState)((0,i.mondayOfDate)(e)),[v,k]=(0,t.useState)(null),[w,D]=(0,t.useState)(''),B=(0,c.useHistory)(()=>i.useOwner.getState().shifts,e=>i.useOwner.getState().setShifts(e),'rota change'),O=b.map((e,t)=>(0,i.addDays)($,t)),P=(e,t,o)=>{e.preventDefault(),k(null);const d=(0,u.readDrag)(e);if('shift'!==d?.kind)return;const s=S.find(e=>e.id===d.id);if(!s)return;const n=!!e.altKey,c=y.find(e=>e.id===t)?.name??'';(n||s.staffId!==t||s.date!==o)&&(S.some(e=>e.staffId===t&&e.date===o&&e.id!==s.id&&e.starte.date>=$&&e.date<=O[6]),I=T.filter(e=>!e.published||e.changed).length;return(0,p.jsxs)(d.default,{style:{flex:1,gap:10},testID:"desk-rota",children:[(0,p.jsx)(h.Tip,{children:"Drag a shift to another day or person. Hold Option (Alt) while you drop to copy it instead. Nothing goes to staff until you press Publish."}),(0,p.jsxs)(s.Row,{gap:8,children:[(0,p.jsx)(s.Button,{small:!0,kind:"secondary",label:"\u2039 Week before",onPress:()=>j((0,i.addDays)($,-7))}),(0,p.jsxs)(s.T,{weight:"semibold",children:["Week of ",new Date($+'T12:00:00').toLocaleDateString('en-GB',{day:'numeric',month:'long'})]}),(0,p.jsx)(s.Button,{small:!0,kind:"secondary",label:"Next week \u203a",onPress:()=>j((0,i.addDays)($,7))}),(0,p.jsx)(d.default,{style:{flex:1}}),w?(0,p.jsx)(s.T,{size:13,colour:n.colours.goldLight,children:w}):null,(0,p.jsx)(s.Button,{small:!0,kind:"secondary",label:"Undo",disabled:!B.canUndo,onPress:B.undo,testID:"rota-undo"}),(0,p.jsx)(s.Button,{small:!0,kind:"secondary",label:"Redo",disabled:!B.canRedo,onPress:B.redo,testID:"rota-redo"}),(0,p.jsx)(s.Button,{small:!0,label:I?`Publish (${I})`:'Published',disabled:!I,onPress:()=>{B.record('published the week');const e=i.useOwner.getState().publishWeek($);D(`${e} shifts published.`)},testID:"rota-publish"})]}),(0,p.jsx)("div",{style:(0,h.box)({flex:1,overflow:'auto',border:`1px solid ${n.colours.border}`,borderRadius:12}),"data-testid":"rota-grid",children:(0,p.jsxs)("div",{style:(0,h.box)({display:'grid',gridTemplateColumns:"180px repeat(7, minmax(110px, 1fr))",minWidth:960}),children:[(0,p.jsx)("div",{style:(0,h.box)({position:'sticky',top:0,background:n.colours.surface,padding:8,borderBottom:`1px solid ${n.colours.border}`,zIndex:1})}),O.map((t,o)=>(0,p.jsxs)("div",{style:(0,h.box)({position:'sticky',top:0,zIndex:1,background:t===e?n.colours.goldTint:n.colours.surface,padding:8,borderBottom:`1px solid ${n.colours.border}`,fontFamily:'Poppins_600SemiBold',fontSize:13,color:t===e?n.colours.gold:n.colours.text}),children:[b[o]," ",Number(t.slice(8))]},t)),y.map(e=>(0,p.jsxs)(o.default.Fragment,{children:[(0,p.jsxs)("div",{style:(0,h.box)({padding:8,borderBottom:`1px solid ${n.colours.hairline}`,fontSize:13}),children:[(0,p.jsx)("div",{style:(0,h.box)({fontFamily:'Poppins_600SemiBold'}),children:e.name}),(0,p.jsx)("div",{style:(0,h.box)({fontSize:11,color:n.colours.muted}),children:e.job})]}),O.map(t=>{const o=`${e.id}|${t}`,d=T.filter(o=>o.staffId===e.id&&o.date===t);return(0,p.jsx)("div",{"data-testid":`rota-cell-${e.id}-${t}`,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=e.altKey?'copy':'move',k(o)},onDragLeave:()=>k(null),onDrop:o=>P(o,e.id,t),style:(0,h.box)({padding:5,minHeight:54,borderBottom:`1px solid ${n.colours.hairline}`,borderLeft:`1px solid ${n.colours.hairline}`,background:v===o?n.colours.accentBg:void 0,outline:v===o?`2px dashed ${n.colours.gold}`:void 0,outlineOffset:-3}),children:d.map(e=>(0,p.jsxs)("div",{draggable:!0,onDragStart:t=>(0,u.dragData)(t,'shift',e.id),"data-testid":`rota-shift-${e.id}`,title:e.note??'',style:(0,h.box)({cursor:'grab',userSelect:'none',borderRadius:8,padding:'4px 6px',marginBottom:4,fontSize:12,fontFamily:'Poppins_600SemiBold',background:e.published&&!e.changed?n.colours.gold:n.colours.goldTint,color:e.published&&!e.changed?n.colours.onGold:n.colours.goldLight,border:`1px solid ${n.colours.accentBorder}`}),children:[(0,l.fmtH)(e.start),"\u2013",(0,l.fmtH)(e.end),!e.published||e.changed?' \u2022':'']},e.id))},o)})]},e.id))]})}),(0,p.jsx)(s.Muted,{size:12,children:"Solid gold = published. Outlined with a dot = not yet published (new or changed)."})]})};var t=r(_d[0]),o=e(t),d=e(r(_d[1])),s=r(_d[2]),i=r(_d[3]),l=r(_d[4]),n=r(_d[5]),u=r(_d[6]),c=r(_d[7]),h=r(_d[8]),f=r(_d[9]),p=r(_d[10]);const b=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],x=()=>`sh-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`},1472,[34,102,794,865,1103,840,1467,1468,1469,1471,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.micAvailable=R,_e.CarApp=function(){const{width:e,height:d}=(0,l.default)(),{role:h,today:b,now:y}=(0,f.useCtx)(3e4),[w,W]=(0,t.useState)(d),v=(0,D.railSizes)(e,w),$=Math.max(320,e-v.railW-1),[M,P]=(0,t.useState)(null),[A,_]=(0,t.useState)(null),[E,N]=(0,t.useState)(!1),[U,V]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(0,f.ensureAttendance)(b,y),(0,u.ensureChat)(y)},[b]),(0,t.useEffect)(()=>{R().then(_)},[]),(0,t.useEffect)(()=>{if(I.PITCH)return;const e=setInterval(()=>{(0,C.carPairPoll)()},6e4);return()=>clearInterval(e)},[]),(0,t.useEffect)(()=>{'owner'!==h&&j.useOwner.getState().setPreviewRole('owner')},[h]);const F=(0,t.useCallback)(()=>P(null),[]);(0,p.useBackLayer)(!!M,F);const Y=e=>P({btn:e,page:e.pages[0].id}),G=(0,t.useCallback)((e,t)=>{const n=e=>D.CAR_BUTTONS.find(t=>t.pages.some(t=>t.id===e));if('home'===e)return P(null);if('bookings'===e)return P({btn:n('@bookings'),page:'@bookings'});if('chat'===e)return P({btn:n('@chat'),page:'@chat'});if('orders'===e||'forecast'===e)return P(t=>({btn:t?.btn??D.CAR_BUTTONS[3],page:'orders'===e?'@orders':'@forecast'}));if('more'===e&&t){const e=n(t);return P(n=>({btn:e??n?.btn??D.CAR_BUTTONS[0],page:t}))}P(null)},[]),q=$<1400?$:Math.round(Math.min($,Math.max(960,.72*$))),J=M?M.btn.pages.find(e=>e.id===M.page)?.label??(0,c.pageFor)(M.page)?.title??M.btn.label:'';return(0,B.jsxs)(s.default,{testID:"car-app",onLayout:e=>{const t=Math.round(e.nativeEvent.layout.height);t>200&&Math.abs(t-w)>1&&W(t)},style:{flex:1,flexDirection:'row',backgroundColor:T.colours.bg,minHeight:0},children:[(0,B.jsxs)(s.default,{testID:"car-board",style:{width:$,minWidth:0,minHeight:0},children:[(0,B.jsx)(a.DisplayBoard,{embedded:!0,noVoice:!0,boardW:$,headerExtra:(0,B.jsx)(S.ParkedOnly,{small:e<1400}),subHeader:(0,B.jsx)(L,{onRota:()=>Y(D.CAR_BUTTONS[0]),onAccount:()=>N(!0)})}),M?(0,B.jsxs)(s.default,{testID:"car-panel",accessibilityViewIsModal:!0,style:{position:'absolute',top:0,bottom:0,right:0,width:q,zIndex:40,backgroundColor:T.colours.bg,borderLeftWidth:1,borderColor:T.colours.gold,boxShadow:'-18px 0 40px rgba(0,0,0,0.55)'},children:[(0,B.jsxs)(s.default,{testID:"car-panel-head",style:{flexDirection:'row',alignItems:'center',gap:8,paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderColor:T.colours.hairline},children:[(0,B.jsx)(n.default,{testID:"car-panel-close",accessibilityRole:"button",accessibilityLabel:`Close ${J}, back to the board`,onPress:()=>{(0,p.runBackLayer)()||F()},style:{minHeight:56,minWidth:96,paddingHorizontal:14,borderRadius:14,borderWidth:1,borderColor:T.colours.border,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{weight:"semibold",center:!0,children:"Close"})}),(0,B.jsx)(s.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,B.jsx)(x.T,{size:20,weight:"semibold",colour:T.colours.gold,center:!0,numberOfLines:1,accessibilityRole:"header",children:M.btn.label})}),(0,B.jsx)(s.default,{style:{minWidth:96}})]}),M.btn.pages.length>1?(0,B.jsx)(s.default,{testID:"car-panel-tabs",style:{flexDirection:'row',justifyContent:'center',flexWrap:'wrap',gap:8,paddingHorizontal:12,paddingVertical:8},children:M.btn.pages.map(e=>{const t=e.id===M.page;return(0,B.jsx)(n.default,{testID:`car-tab-${e.id.replace('@','')}`,accessibilityRole:"tab",accessibilityState:{selected:t},accessibilityLabel:e.label,onPress:()=>P({btn:M.btn,page:e.id}),style:{minHeight:48,paddingHorizontal:18,borderRadius:999,borderWidth:1,borderColor:t?T.colours.gold:T.colours.border,backgroundColor:t?H:'transparent',alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{weight:"semibold",colour:t?T.colours.goldLight:T.colours.text,center:!0,children:e.label})},e.id)})}):null,(0,B.jsx)(o.default,{testID:"car-panel-scroll",style:{flex:1},contentContainerStyle:{padding:16,paddingBottom:32,gap:12,width:'100%',maxWidth:1200,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:'assistant'===M.page&&!1===A?(0,B.jsx)(O,{}):(0,B.jsx)(z,{id:M.page,go:G},M.page)})]}):null]}),(0,B.jsxs)(s.default,{testID:"car-rail",accessibilityRole:"toolbar",accessibilityLabel:"Owner tools",style:{width:v.railW+1,borderLeftWidth:1,borderColor:T.colours.border,backgroundColor:'#0A0A0A',paddingTop:6,paddingBottom:6,alignItems:'stretch',minHeight:0,overflow:'hidden'},children:[(0,B.jsx)(s.default,{style:{height:D.RAIL_TITLE,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{size:11,weight:"semibold",colour:T.colours.goldMuted,center:!0,style:{letterSpacing:1},children:"OWNER"})}),(0,B.jsx)(s.default,{testID:"car-rail-grid",style:{flex:1,flexDirection:'row',flexWrap:'wrap',alignContent:'flex-start',minHeight:0},children:D.CAR_BUTTONS.map(e=>{const t=M?.btn.id===e.id;return(0,B.jsxs)(n.default,{testID:`car-btn-${e.id}`,accessibilityRole:"button",accessibilityState:{selected:t},accessibilityLabel:t?`${e.label}, open`:e.label,onPress:()=>t?F():Y(e),style:{width:v.colW,height:v.per,alignItems:'center',justifyContent:'center',gap:4,overflow:'hidden'},children:[(0,B.jsx)(s.default,{style:{width:v.circle,height:v.circle,borderRadius:v.circle/2,borderWidth:1.5,borderColor:T.colours.gold,backgroundColor:t?T.colours.gold:H,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(k.CarGlyph,{name:e.icon,size:v.icon,colour:t?'#0B0B0B':T.colours.goldLight})}),(0,B.jsx)(x.T,{size:v.label,weight:t?'semibold':'medium',colour:t?T.colours.goldLight:T.colours.text,center:!0,numberOfLines:1,style:{lineHeight:v.lineH,maxWidth:v.colW-6},children:v.colW<150?e.short:e.label})]},e.id)})})]}),E?(0,B.jsxs)(x.Sheet,{visible:!0,onClose:()=>N(!1),title:"This car",maxWidth:560,testID:"car-account-sheet",children:[(0,B.jsx)(x.T,{center:!0,children:"This car is signed in to The Anchorage as you, with your own rights. Use it only when the car is in Park."}),(0,B.jsx)(x.Muted,{center:!0,children:"To sign it out from your phone: Managers, More, Car screen."}),(0,B.jsx)(x.Button,{testID:"car-sign-out",kind:"secondary",label:"Sign this car out",onPress:()=>{N(!1),V(!0)},style:{minHeight:56}}),(0,B.jsx)(x.Button,{kind:"ghost",label:"Close",onPress:()=>N(!1),style:{minHeight:56}})]}):null,U?(0,B.jsxs)(x.Sheet,{visible:!0,onClose:()=>V(!1),title:"Sign this car out?",maxWidth:520,testID:"car-sign-out-confirm",children:[(0,B.jsx)(x.T,{center:!0,children:"You\u2019ll need a new code, approved on your phone, to use it again."}),(0,B.jsx)(x.Button,{testID:"car-sign-out-yes",label:"Yes, sign this car out",onPress:()=>{V(!1),(0,C.carSignOut)()},style:{minHeight:56}}),(0,B.jsx)(x.Button,{kind:"secondary",label:"Cancel",onPress:()=>V(!1),style:{minHeight:56}})]}):null]})};var t=r(_d[0]);r(_d[1]);var n=e(r(_d[2])),o=e(r(_d[3])),s=e(r(_d[4])),l=e(r(_d[5])),a=r(_d[6]),c=r(_d[7]);r(_d[8]);var d=r(_d[9]),u=r(_d[10]),h=r(_d[11]),b=r(_d[12]),f=r(_d[13]),p=r(_d[14]),x=r(_d[15]),y=r(_d[16]),j=r(_d[17]),w=r(_d[18]),C=r(_d[19]),I=r(_d[20]),T=r(_d[21]),D=r(_d[22]),k=r(_d[23]),S=r(_d[24]),W=r(_d[25]),v=r(_d[26]),B=r(_d[27]);const H='rgba(201,162,74,0.14)';async function R(){try{const e='undefined'!=typeof navigator?navigator.mediaDevices:null;if(!e?.getUserMedia||!e?.enumerateDevices)return!1;return(await e.enumerateDevices()).some(e=>'audioinput'===e.kind)}catch{return!1}}function L({onRota:e,onAccount:o}){const l=(0,f.useSignedIn)(),a=(0,j.useOwner)(e=>e.attendance),c=(0,j.useOwner)(e=>e.staff),[d,u]=(0,t.useState)(()=>Date.now());(0,t.useEffect)(()=>{const e=setInterval(()=>u(Date.now()),3e4);return()=>clearInterval(e)},[]);const h=a.filter(e=>e.in&&!e.out&&d-new Date(e.in).getTime()<72e6&&d>=new Date(e.in).getTime()).map(e=>(c.find(t=>t.id===e.staffId)?.name??'').replace(' (example)','')).filter(Boolean),b=[...new Set(h)],p=b.length?`On now: ${b.join(' \xb7 ')}`:'Nobody clocked in';return(0,B.jsxs)(s.default,{testID:"car-strip",style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',justifyContent:'center',gap:10,paddingHorizontal:12,paddingVertical:2,minHeight:44,borderBottomWidth:1,borderColor:T.colours.hairline},children:[(0,B.jsx)(n.default,{testID:"car-whos-on",accessibilityRole:"button",accessibilityLabel:`${p}. Opens the rota.`,onPress:e,style:{flexShrink:1,minHeight:44,justifyContent:'center',paddingHorizontal:8},children:(0,B.jsx)(x.T,{size:14,weight:"semibold",colour:T.colours.goldLight,numberOfLines:1,center:!0,children:p})}),l?(0,B.jsx)(n.default,{testID:"car-account",accessibilityRole:"button",accessibilityLabel:`Signed in as ${l.name}. Car sign-in options.`,onPress:o,style:{minHeight:44,justifyContent:'center',paddingHorizontal:12,borderRadius:22,borderWidth:1,borderColor:T.colours.gold,flexShrink:0},children:(0,B.jsx)(x.T,{size:13,weight:"semibold",colour:T.colours.gold,center:!0,numberOfLines:1,children:l.name.replace(' (example)','')})}):null,(0,B.jsx)(W.CarGameButton,{}),(0,B.jsx)(v.CarFullscreenButton,{})]})}function $({go:e}){const{rid:t,now:n}=(0,f.useCtx)(3e4),o=(0,y.useBookings)(t),l=(0,w.ymd)(n),a=(0,w.ymd)(new Date(n.getTime()-24192e5)),c=o.filter(e=>'noshow'===e.status&&e.date>=a&&e.date<=l).sort((e,t)=>(t.date+t.time).localeCompare(e.date+e.time)),d=o.filter(e=>e.date===l&&'confirmed'===e.status&&!e.walkIn&&new Date(`${e.date}T${e.time}:00`).getTime()e+(t.partySize||0),0);return(0,B.jsxs)(s.default,{testID:"car-noshows",style:{gap:10},children:[(0,B.jsx)(x.T,{center:!0,size:18,weight:"semibold",colour:T.colours.goldLight,children:c.length?`${c.length} no-show${1===c.length?'':'s'} in the last 28 days \xb7 ${u} Covers`:'No no-shows in the last 28 days'}),d.length?(0,B.jsxs)(s.default,{testID:"car-late",style:{gap:6,borderWidth:1,borderColor:T.colours.amber,borderRadius:12,padding:12},children:[(0,B.jsx)(x.T,{center:!0,weight:"semibold",colour:T.colours.amber,children:"Running more than 15 minutes late"}),d.map(e=>(0,B.jsx)(x.T,{center:!0,children:`${e.time} \xb7 ${e.name} \xb7 ${e.partySize} Covers${e.table?` \xb7 Table ${e.table}`:''}`},e.id)),(0,B.jsx)(x.Muted,{center:!0,children:"Call them first. If they don\u2019t come, mark No-show on their booking."})]}):null,c.map(e=>(0,B.jsxs)(s.default,{style:{borderWidth:1,borderColor:T.colours.border,borderRadius:12,padding:12,gap:2},children:[(0,B.jsx)(x.T,{center:!0,weight:"semibold",children:`${e.date===l?'Today':(0,w.niceDate)((0,w.parseYmd)(e.date))} \xb7 ${e.time} \xb7 ${e.name}`}),(0,B.jsx)(x.Muted,{center:!0,children:`${e.partySize} Covers${e.table?` \xb7 Table ${e.table}`:''}${e.phone?' \xb7 phone on the booking':''}`})]},e.id)),(0,B.jsx)(x.Button,{testID:"car-noshows-bookings",label:"Open Bookings to mark or undo a no-show",onPress:()=>e('bookings'),style:{minHeight:56}})]})}function O(){return(0,B.jsxs)(s.default,{testID:"car-no-mic",accessibilityLiveRegion:"polite",style:{gap:10,alignItems:'center',paddingVertical:24},children:[(0,B.jsx)(x.T,{center:!0,size:20,weight:"semibold",colour:T.colours.goldLight,children:"The Assistant needs the car\u2019s microphone"}),(0,B.jsx)(x.Muted,{center:!0,style:{maxWidth:520},children:"Sorry, this car\u2019s browser isn\u2019t letting the page use a microphone. For now, please use the Assistant in Managers on your phone."})]})}function z({id:e,go:t}){if('@bookings'===e)return(0,B.jsx)(d.Bookings,{go:t});if('@chat'===e)return(0,B.jsx)(u.Chat,{go:t});if('@noshows'===e)return(0,B.jsx)($,{go:t});if('@orders'===e)return(0,B.jsx)(h.Orders,{});if('@forecast'===e)return(0,B.jsx)(b.Forecasts,{go:t});const n=(0,c.pageFor)(e);if(!n)return(0,B.jsx)(x.Muted,{center:!0,children:"This screen isn\u2019t in the car yet. Open it in Managers on your phone."});const o=n.C;return(0,B.jsx)(o,{go:t})}},1473,[34,236,402,295,102,426,1279,1379,1396,1341,1135,1395,1393,1100,1041,794,848,865,827,985,2,840,1474,1475,1476,1477,1478,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=32;const l=s=>s.split('').join(' ')},1474,[]); +__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.micAvailable=L,_e.CarApp=function(){(0,v.useCarViewport)();const{width:e,height:c}=(0,a.default)(),[h,b]=(0,t.useState)(0),y=Math.max(320,z(e)-h);(0,t.useEffect)(()=>{b(0)},[e]);const{role:j,today:W,now:M}=(0,f.useCtx)(3e4),[A,P]=(0,t.useState)(c),_=(0,D.railSizes)(y,A),E=Math.max(320,y-_.railW-1),[N,V]=(0,t.useState)(null),[U,F]=(0,t.useState)(null),[Y,q]=(0,t.useState)(!1),[G,J]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(0,f.ensureAttendance)(W,M),(0,u.ensureChat)(M)},[W]),(0,t.useEffect)(()=>{L().then(F)},[]),(0,t.useEffect)(()=>{if(I.PITCH)return;const e=setInterval(()=>{(0,C.carPairPoll)()},6e4);return()=>clearInterval(e)},[]),(0,t.useEffect)(()=>{'owner'!==j&&w.useOwner.getState().setPreviewRole('owner')},[j]);const K=(0,t.useCallback)(()=>V(null),[]);(0,p.useBackLayer)(!!N,K);const Q=e=>V({btn:e,page:e.pages[0].id}),X=(0,t.useCallback)((e,t)=>{const n=e=>D.CAR_BUTTONS.find(t=>t.pages.some(t=>t.id===e));if('home'===e)return V(null);if('bookings'===e)return V({btn:n('@bookings'),page:'@bookings'});if('chat'===e)return V({btn:n('@chat'),page:'@chat'});if('orders'===e||'forecast'===e)return V(t=>({btn:t?.btn??D.CAR_BUTTONS[3],page:'orders'===e?'@orders':'@forecast'}));if('more'===e&&t){const e=n(t);return V(n=>({btn:e??n?.btn??D.CAR_BUTTONS[0],page:t}))}V(null)},[]),Z=E<1400?E:Math.round(Math.min(E,Math.max(960,.72*E))),ee=N?N.btn.pages.find(e=>e.id===N.page)?.label??(0,d.pageFor)(N.page)?.title??N.btn.label:'';return(0,B.jsxs)(s.default,{testID:"car-app",onLayout:e=>{const t=Math.round(e.nativeEvent.layout.height);t>200&&Math.abs(t-A)>1&&P(t)},style:{flex:1,flexDirection:'row',backgroundColor:T.colours.bg,minHeight:0,width:y,maxWidth:'100%',overflow:'hidden'},children:[(0,B.jsxs)(s.default,{testID:"car-board",style:{width:E,minWidth:0,minHeight:0},children:[(0,B.jsx)(l.DisplayBoard,{embedded:!0,noVoice:!0,boardW:E,headerExtra:(0,B.jsx)(k.ParkedOnly,{small:y<1400}),subHeader:(0,B.jsx)(R,{onRota:()=>Q(D.CAR_BUTTONS[0]),onAccount:()=>q(!0)})}),N?(0,B.jsxs)(s.default,{testID:"car-panel",accessibilityViewIsModal:!0,style:{position:'absolute',top:0,bottom:0,right:0,width:Z,zIndex:40,backgroundColor:T.colours.bg,borderLeftWidth:1,borderColor:T.colours.gold,boxShadow:'-18px 0 40px rgba(0,0,0,0.55)'},children:[(0,B.jsxs)(s.default,{testID:"car-panel-head",style:{flexDirection:'row',alignItems:'center',gap:8,paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderColor:T.colours.hairline},children:[(0,B.jsx)(n.default,{testID:"car-panel-close",accessibilityRole:"button",accessibilityLabel:`Close ${ee}, back to the board`,onPress:()=>{(0,p.runBackLayer)()||K()},style:{minHeight:56,minWidth:96,paddingHorizontal:14,borderRadius:14,borderWidth:1,borderColor:T.colours.border,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{weight:"semibold",center:!0,children:"Close"})}),(0,B.jsx)(s.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,B.jsx)(x.T,{size:20,weight:"semibold",colour:T.colours.gold,center:!0,numberOfLines:1,accessibilityRole:"header",children:N.btn.label})}),(0,B.jsx)(s.default,{style:{minWidth:96}})]}),N.btn.pages.length>1?(0,B.jsx)(s.default,{testID:"car-panel-tabs",style:{flexDirection:'row',justifyContent:'center',flexWrap:'wrap',gap:8,paddingHorizontal:12,paddingVertical:8},children:N.btn.pages.map(e=>{const t=e.id===N.page;return(0,B.jsx)(n.default,{testID:`car-tab-${e.id.replace('@','')}`,accessibilityRole:"tab",accessibilityState:{selected:t},accessibilityLabel:e.label,onPress:()=>V({btn:N.btn,page:e.id}),style:{minHeight:48,paddingHorizontal:18,borderRadius:999,borderWidth:1,borderColor:t?T.colours.gold:T.colours.border,backgroundColor:t?H:'transparent',alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(x.T,{weight:"semibold",colour:t?T.colours.goldLight:T.colours.text,center:!0,children:e.label})},e.id)})}):null,(0,B.jsx)(o.default,{testID:"car-panel-scroll",style:{flex:1},contentContainerStyle:{padding:16,paddingBottom:32,gap:12,width:'100%',maxWidth:1200,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:'assistant'===N.page&&!1===U?(0,B.jsx)($,{}):(0,B.jsx)(O,{id:N.page,go:X},N.page)})]}):null]}),(0,B.jsxs)(s.default,{testID:"car-rail",onLayout:()=>{'undefined'!=typeof document&&requestAnimationFrame(()=>{const e=document.querySelector('[data-testid=car-rail]');if(!e)return;const t=Math.ceil(e.getBoundingClientRect().right-z(window.innerWidth));t>0&&b(e=>Math.min(400,e+t))})},accessibilityRole:"toolbar",accessibilityLabel:"Owner tools",style:{width:_.railW+1,borderLeftWidth:1,borderColor:T.colours.border,backgroundColor:'#0A0A0A',paddingTop:6,paddingBottom:6,alignItems:'stretch',minHeight:0,overflow:'hidden'},children:[(0,B.jsx)(s.default,{testID:"car-fullscreen-slot",style:{height:D.RAIL_TITLE,alignItems:'center',justifyContent:'center',paddingHorizontal:6},children:(0,B.jsx)(v.CarFullscreenButton,{place:"rail",width:_.railW-12})}),(0,B.jsx)(s.default,{testID:"car-rail-grid",style:{flex:1,flexDirection:'row',flexWrap:'wrap',alignContent:'flex-start',minHeight:0},children:D.CAR_BUTTONS.map(e=>{const t=N?.btn.id===e.id;return(0,B.jsxs)(n.default,{testID:`car-btn-${e.id}`,accessibilityRole:"button",accessibilityState:{selected:t},accessibilityLabel:t?`${e.label}, open`:e.label,onPress:()=>t?K():Q(e),style:{width:_.colW,height:_.per,alignItems:'center',justifyContent:'center',gap:4,overflow:'hidden'},children:[(0,B.jsx)(s.default,{style:{width:_.circle,height:_.circle,borderRadius:_.circle/2,borderWidth:1.5,borderColor:T.colours.gold,backgroundColor:t?T.colours.gold:H,alignItems:'center',justifyContent:'center'},children:(0,B.jsx)(S.CarGlyph,{name:e.icon,size:_.icon,colour:t?'#0B0B0B':T.colours.goldLight})}),(0,B.jsx)(x.T,{size:_.label,weight:t?'semibold':'medium',colour:t?T.colours.goldLight:T.colours.text,center:!0,numberOfLines:1,style:{lineHeight:_.lineH,maxWidth:_.colW-6},children:_.colW<150?e.short:e.label})]},e.id)})})]}),Y?(0,B.jsxs)(x.Sheet,{visible:!0,onClose:()=>q(!1),title:"This car",maxWidth:560,testID:"car-account-sheet",children:[(0,B.jsx)(x.T,{center:!0,children:"This car is signed in to The Anchorage as you, with your own rights. Use it only when the car is in Park."}),(0,B.jsx)(x.Muted,{center:!0,children:"To sign it out from your phone: Managers, More, Car screen."}),(0,B.jsx)(x.Button,{testID:"car-sign-out",kind:"secondary",label:"Sign this car out",onPress:()=>{q(!1),J(!0)},style:{minHeight:56}}),(0,B.jsx)(x.Button,{kind:"ghost",label:"Close",onPress:()=>q(!1),style:{minHeight:56}})]}):null,G?(0,B.jsxs)(x.Sheet,{visible:!0,onClose:()=>J(!1),title:"Sign this car out?",maxWidth:520,testID:"car-sign-out-confirm",children:[(0,B.jsx)(x.T,{center:!0,children:"You\u2019ll need a new code, approved on your phone, to use it again."}),(0,B.jsx)(x.Button,{testID:"car-sign-out-yes",label:"Yes, sign this car out",onPress:()=>{J(!1),(0,C.carSignOut)()},style:{minHeight:56}}),(0,B.jsx)(x.Button,{kind:"secondary",label:"Cancel",onPress:()=>J(!1),style:{minHeight:56}})]}):null]})};var t=r(_d[0]);r(_d[1]);var n=e(r(_d[2])),o=e(r(_d[3])),s=e(r(_d[4])),a=e(r(_d[5])),l=r(_d[6]),d=r(_d[7]);r(_d[8]);var c=r(_d[9]),u=r(_d[10]),h=r(_d[11]),b=r(_d[12]),f=r(_d[13]),p=r(_d[14]),x=r(_d[15]),y=r(_d[16]),w=r(_d[17]),j=r(_d[18]),C=r(_d[19]),I=r(_d[20]),T=r(_d[21]),D=r(_d[22]),S=r(_d[23]),k=r(_d[24]),W=r(_d[25]),v=r(_d[26]),B=r(_d[27]);const H='rgba(201,162,74,0.14)';async function L(){try{const e='undefined'!=typeof navigator?navigator.mediaDevices:null;if(!e?.getUserMedia||!e?.enumerateDevices)return!1;return(await e.enumerateDevices()).some(e=>'audioinput'===e.kind)}catch{return!1}}function R({onRota:e,onAccount:o}){const a=(0,f.useSignedIn)(),l=(0,w.useOwner)(e=>e.attendance),d=(0,w.useOwner)(e=>e.staff),[c,u]=(0,t.useState)(()=>Date.now());(0,t.useEffect)(()=>{const e=setInterval(()=>u(Date.now()),3e4);return()=>clearInterval(e)},[]);const h=l.filter(e=>e.in&&!e.out&&c-new Date(e.in).getTime()<72e6&&c>=new Date(e.in).getTime()).map(e=>(d.find(t=>t.id===e.staffId)?.name??'').replace(' (example)','')).filter(Boolean),b=[...new Set(h)],p=b.length?`On now: ${b.join(' \xb7 ')}`:'Nobody clocked in';return(0,B.jsxs)(s.default,{testID:"car-strip",style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',justifyContent:'center',gap:10,paddingHorizontal:12,paddingVertical:2,minHeight:44,borderBottomWidth:1,borderColor:T.colours.hairline},children:[(0,B.jsx)(n.default,{testID:"car-whos-on",accessibilityRole:"button",accessibilityLabel:`${p}. Opens the rota.`,onPress:e,style:{flexShrink:1,minHeight:44,justifyContent:'center',paddingHorizontal:8},children:(0,B.jsx)(x.T,{size:14,weight:"semibold",colour:T.colours.goldLight,numberOfLines:1,center:!0,children:p})}),a?(0,B.jsx)(n.default,{testID:"car-account",accessibilityRole:"button",accessibilityLabel:`Signed in as ${a.name}. Car sign-in options.`,onPress:o,style:{minHeight:44,justifyContent:'center',paddingHorizontal:12,borderRadius:22,borderWidth:1,borderColor:T.colours.gold,flexShrink:0},children:(0,B.jsx)(x.T,{size:13,weight:"semibold",colour:T.colours.gold,center:!0,numberOfLines:1,children:a.name.replace(' (example)','')})}):null,(0,B.jsx)(W.CarGameButton,{})]})}function M({go:e}){const{rid:t,now:n}=(0,f.useCtx)(3e4),o=(0,y.useBookings)(t),a=(0,j.ymd)(n),l=(0,j.ymd)(new Date(n.getTime()-24192e5)),d=o.filter(e=>'noshow'===e.status&&e.date>=l&&e.date<=a).sort((e,t)=>(t.date+t.time).localeCompare(e.date+e.time)),c=o.filter(e=>e.date===a&&'confirmed'===e.status&&!e.walkIn&&new Date(`${e.date}T${e.time}:00`).getTime()e+(t.partySize||0),0);return(0,B.jsxs)(s.default,{testID:"car-noshows",style:{gap:10},children:[(0,B.jsx)(x.T,{center:!0,size:18,weight:"semibold",colour:T.colours.goldLight,children:d.length?`${d.length} no-show${1===d.length?'':'s'} in the last 28 days \xb7 ${u} Covers`:'No no-shows in the last 28 days'}),c.length?(0,B.jsxs)(s.default,{testID:"car-late",style:{gap:6,borderWidth:1,borderColor:T.colours.amber,borderRadius:12,padding:12},children:[(0,B.jsx)(x.T,{center:!0,weight:"semibold",colour:T.colours.amber,children:"Running more than 15 minutes late"}),c.map(e=>(0,B.jsx)(x.T,{center:!0,children:`${e.time} \xb7 ${e.name} \xb7 ${e.partySize} Covers${e.table?` \xb7 Table ${e.table}`:''}`},e.id)),(0,B.jsx)(x.Muted,{center:!0,children:"Call them first. If they don\u2019t come, mark No-show on their booking."})]}):null,d.map(e=>(0,B.jsxs)(s.default,{style:{borderWidth:1,borderColor:T.colours.border,borderRadius:12,padding:12,gap:2},children:[(0,B.jsx)(x.T,{center:!0,weight:"semibold",children:`${e.date===a?'Today':(0,j.niceDate)((0,j.parseYmd)(e.date))} \xb7 ${e.time} \xb7 ${e.name}`}),(0,B.jsx)(x.Muted,{center:!0,children:`${e.partySize} Covers${e.table?` \xb7 Table ${e.table}`:''}${e.phone?' \xb7 phone on the booking':''}`})]},e.id)),(0,B.jsx)(x.Button,{testID:"car-noshows-bookings",label:"Open Bookings to mark or undo a no-show",onPress:()=>e('bookings'),style:{minHeight:56}})]})}function $(){return(0,B.jsxs)(s.default,{testID:"car-no-mic",accessibilityLiveRegion:"polite",style:{gap:10,alignItems:'center',paddingVertical:24},children:[(0,B.jsx)(x.T,{center:!0,size:20,weight:"semibold",colour:T.colours.goldLight,children:"The Assistant needs the car\u2019s microphone"}),(0,B.jsx)(x.Muted,{center:!0,style:{maxWidth:520},children:"Sorry, this car\u2019s browser isn\u2019t letting the page use a microphone. For now, please use the Assistant in Managers on your phone."})]})}function O({id:e,go:t}){if('@bookings'===e)return(0,B.jsx)(c.Bookings,{go:t});if('@chat'===e)return(0,B.jsx)(u.Chat,{go:t});if('@noshows'===e)return(0,B.jsx)(M,{go:t});if('@orders'===e)return(0,B.jsx)(h.Orders,{});if('@forecast'===e)return(0,B.jsx)(b.Forecasts,{go:t});const n=(0,d.pageFor)(e);if(!n)return(0,B.jsx)(x.Muted,{center:!0,children:"This screen isn\u2019t in the car yet. Open it in Managers on your phone."});const o=n.C;return(0,B.jsx)(o,{go:t})}function z(e){if('undefined'==typeof document)return e;const t=document.documentElement?.clientWidth||e,n=window.visualViewport?.width||e;return Math.floor(Math.min(e,t,n))}},1473,[34,236,402,295,102,426,1279,1379,1396,1341,1135,1395,1393,1100,1041,794,848,865,827,985,2,840,1474,1475,1476,1477,1478,25]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=64;const l=s=>s.split('').join(' ')},1474,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CarGlyph=function({name:e,size:x,colour:n}){const c={stroke:n,strokeWidth:1.8,fill:'none',strokeLinecap:'round',strokeLinejoin:'round'},l={rota:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Rect,{x:"3",y:"5",width:"18",height:"16",rx:"2",...c}),(0,h.jsx)(s.Path,{d:"M3 10h18M8 3v4M16 3v4M7 14h3M14 14h3M7 17h3",...c})]}),signoff:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Circle,{cx:"12",cy:"12",r:"9",...c}),(0,h.jsx)(s.Path,{d:"M12 7v5l3 2",...c}),(0,h.jsx)(s.Path,{d:"M15.5 18.5l1.8 1.8 3.4-3.6",...c})]}),menu:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Path,{d:"M6 3v8a2 2 0 0 0 2 2v8M10 3v8a2 2 0 0 1-2 2M8 3v6",...c}),(0,h.jsx)(s.Path,{d:"M16 21V3c2.5 1.5 3 5 3 8h-3",...c})]}),bookings:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Rect,{x:"3",y:"5",width:"18",height:"16",rx:"2",...c}),(0,h.jsx)(s.Path,{d:"M3 10h18M8 3v4M16 3v4M9 15l2 2 4-4",...c})]}),noshow:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Circle,{cx:"10",cy:"8",r:"4",...c}),(0,h.jsx)(s.Path,{d:"M3 21c0-4 3-6 7-6s7 2 7 6M17 9l4 4M21 9l-4 4",...c})]}),chat:(0,h.jsx)(s.Path,{d:"M4 5h16v11H9l-5 4z",...c}),stock:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Path,{d:"M3 7l9-4 9 4-9 4z",...c}),(0,h.jsx)(s.Path,{d:"M3 7v10l9 4 9-4V7M12 11v10",...c})]}),loyalty:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Rect,{x:"3",y:"6",width:"18",height:"12",rx:"2",...c}),(0,h.jsx)(s.Circle,{cx:"8",cy:"12",r:"1.5",...c}),(0,h.jsx)(s.Circle,{cx:"12",cy:"12",r:"1.5",...c}),(0,h.jsx)(s.Circle,{cx:"16",cy:"12",r:"1.5",...c})]}),takings:(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.Path,{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",...c})}),safety:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Path,{d:"M10 14V5a2 2 0 0 1 4 0v9a4 4 0 1 1-4 0z",...c}),(0,h.jsx)(s.Path,{d:"M12 9v7",...c})]}),reviews:(0,h.jsx)(s.Path,{d:"M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z",...c}),assistant:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",...c}),(0,h.jsx)(s.Path,{d:"M5 11a7 7 0 0 0 14 0M12 18v3M9 21h6",...c})]})};return(0,h.jsx)(t.default,{width:x,height:x,viewBox:"0 0 24 24",children:l[e]})},_e.GameGlyph=function({size:e,colour:x}){const n={stroke:x,strokeWidth:1.8,fill:'none',strokeLinecap:'round',strokeLinejoin:'round'};return(0,h.jsxs)(t.default,{width:e,height:e,viewBox:"0 0 24 24",children:[(0,h.jsx)(s.Path,{d:"M7 8h10a4 4 0 0 1 4 4v3a3 3 0 0 1-5.4 1.8L14.5 15h-5l-1.1 1.8A3 3 0 0 1 3 15v-3a4 4 0 0 1 4-4z",...n}),(0,h.jsx)(s.Path,{d:"M7 11v3M5.5 12.5h3",...n}),(0,h.jsx)(s.Circle,{cx:"16",cy:"11.5",r:"0.9",...n}),(0,h.jsx)(s.Circle,{cx:"18",cy:"13.5",r:"0.9",...n})]})},r(d[0]);var e,s=r(d[1]),t=(e=s)&&e.__esModule?e:{default:e},h=r(d[2])},1475,[34,900,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1476,[34,102,794,840,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CarGameButton=function(){const e=(0,u.useStore)(e=>!1!==e.restaurants.find(e=>e.id===f.VENUE_RID)?.settings?.games),s=(0,c.useSession)(e=>e.meId),j=(0,b.useSignedIn)(),[C,S]=(0,n.useState)(!1),[k]=(0,n.useState)(()=>new Date),x=(0,o.useGameClock)(s,C?new Date:k);return e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(t.default,{testID:"car-game-open",accessibilityRole:"button",accessibilityLabel:"Game: Lenny's Kitchen Chaos. Parked only.",onPress:()=>S(!0),style:{minHeight:44,justifyContent:'center',paddingHorizontal:14,borderRadius:22,borderWidth:1,borderColor:y.colours.gold,flexShrink:0},children:(0,_.jsx)(h.T,{size:13,weight:"semibold",colour:y.colours.gold,center:!0,numberOfLines:1,children:"Game"})}),C?(0,_.jsx)(o.BreakRoom,{car:!0,staffId:s??null,name:j?.name??'Owner',playable:(0,l.gamePlayable)(x),clock:x,onClose:()=>S(!1)}):null]}):null};var e,n=r(d[0]),s=r(d[1]),t=(e=s)&&e.__esModule?e:{default:e},o=r(d[2]),l=r(d[3]),u=r(d[4]),c=r(d[5]),b=r(d[6]),f=r(d[7]),h=r(d[8]),y=r(d[9]),_=r(d[10])},1477,[34,402,1137,1138,800,997,1100,5,794,840,25]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"FS_KEY",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"THEATRE_KEY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"EASY_LINK",{enumerable:!0,get:function(){return b}}),_e.theatreUrl=p,_e.inTheatre=v,_e.CarFullscreenButton=function(){const[t,n]=(0,e.useState)(y),[f,T]=(0,e.useState)(!1),[x]=(0,e.useState)(v);(0,e.useEffect)(()=>{if(!u)return;const e=()=>{const e=y();n(e),e||w.set(h,null)};document.addEventListener('fullscreenchange',e),document.addEventListener('webkitfullscreenchange',e);let t='1'===w.get(h)&&!y();const c=()=>{t&&(t=!1,E())};return t&&(document.addEventListener('click',c,!0),document.addEventListener('touchend',c,!0)),()=>{document.removeEventListener('fullscreenchange',e),document.removeEventListener('webkitfullscreenchange',e),document.removeEventListener('click',c,!0),document.removeEventListener('touchend',c,!0)}},[]);const k=(0,e.useCallback)(async()=>{if(y()){w.set(h,null);try{await((document.exitFullscreen??document.webkitExitFullscreen)?.call(document))}catch{}return}const e=window.innerHeight;await E()?(w.set(h,'1'),setTimeout(()=>{(!y()||window.innerHeight<=e+8)&&T(!0)},900)):T(!0)},[]);return!u||x?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.default,{testID:"car-fullscreen",accessibilityRole:"button",accessibilityLabel:t?'Exit full screen':'Full screen: hide the browser bar',onPress:()=>{k()},style:{minHeight:44,justifyContent:'center',paddingHorizontal:14,borderRadius:22,borderWidth:1,borderColor:l.colours.gold,backgroundColor:t?'rgba(201,162,74,0.14)':'transparent',flexShrink:0},children:(0,o.jsx)(s.T,{size:13,weight:"semibold",colour:l.colours.gold,center:!0,numberOfLines:1,children:t?'Exit full screen':'Full screen'})}),f?(0,o.jsxs)(s.Sheet,{visible:!0,onClose:()=>T(!1),title:"Full screen in the car",maxWidth:600,testID:"car-fullscreen-help",children:[(0,o.jsx)(s.T,{center:!0,children:"The car\u2019s browser keeps its bar at the top. The car\u2019s own full-screen view has no bar at all."}),(0,o.jsx)(s.T,{center:!0,children:"Tap Open full screen. A YouTube page says you\u2019re leaving YouTube: tap the link on it. The car screen then opens with no bar."}),(0,o.jsx)(s.Muted,{center:!0,children:"The first time only, sign the car in again with a new code from your phone: the full-screen view keeps its own sign-in. The Assistant\u2019s microphone doesn\u2019t work there. To leave, tap the car\u2019s \u2715 in the top corner."}),(0,o.jsx)(s.Muted,{center:!0,children:`Easy link to save as a favourite: ${b}`}),(0,o.jsx)(s.Button,{testID:"car-fullscreen-theatre",label:"Open full screen",onPress:()=>{location.href=p(location.origin)},style:{minHeight:56}}),(0,o.jsx)(s.Button,{kind:"secondary",label:"Not now",onPress:()=>T(!1),style:{minHeight:56}})]}):null]})};var e=r(d[0]);r(d[1]);var t,n=r(d[2]),c=(t=n)&&t.__esModule?t:{default:t},s=r(d[3]),l=r(d[4]),o=r(d[5]);const u='undefined'!=typeof document,h='cc-car-fullscreen',f='cc-car-theatre',b='covercharge-apps.static.hf.space/car?full';function p(e){return`https://www.youtube.com/redirect?q=${encodeURIComponent(`${e}/car-app/index.html?theatre=1`)}`}const w={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}};function v(){if(!u)return!1;try{return/[?&]theatre=1\b/.test(location.search)&&w.set(f,'1'),/TESLA_AUTO/i.test(navigator.userAgent)||'1'===w.get(f)}catch{return!1}}const y=()=>u&&!(!document.fullscreenElement&&!document.webkitFullscreenElement);async function E(){const e=document.documentElement,t=e.requestFullscreen??e.webkitRequestFullscreen;if(!t)return!1;try{return await t.call(e,{navigationUI:'hide'}),!0}catch{return!1}}},1478,[34,236,402,794,840,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,"FS_KEY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"FS_BUTTON_H",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"NOT_ALLOWED",{enumerable:!0,get:function(){return b}}),_e.useCarViewport=function(){(0,t.useEffect)(()=>{if(!u)return;const e=document.documentElement,t=document.body,n=[e.style.cssText,t.style.cssText];for(const n of[e.style,t.style])n.height='100%',n.margin='0',n.overflow='hidden',n.overscrollBehavior='none',n.touchAction='manipulation';return()=>{e.style.cssText=n[0],t.style.cssText=n[1]}},[])},_e.CarFullscreenButton=function({place:e="rail",width:E}){const[x,p]=(0,t.useState)(y),[L,T]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!u)return;const e=()=>{const e=y();p(e),e||v.set(f,null)};document.addEventListener('fullscreenchange',e),document.addEventListener('webkitfullscreenchange',e);let t='1'===v.get(f)&&!y();const n=()=>{t&&(t=!1,w())};return t&&(document.addEventListener('click',n,!0),document.addEventListener('touchend',n,!0)),()=>{document.removeEventListener('fullscreenchange',e),document.removeEventListener('webkitfullscreenchange',e),document.removeEventListener('click',n,!0),document.removeEventListener('touchend',n,!0)}},[]),(0,t.useEffect)(()=>{if(!L)return;const e=setTimeout(()=>T(null),9e3);return()=>clearTimeout(e)},[L]);const F=(0,t.useCallback)(async()=>{if(T(null),y()){v.set(f,null);try{await((document.exitFullscreen??document.webkitExitFullscreen)?.call(document))}catch{}return}const e=window.innerHeight;await w()?(v.set(f,'1'),setTimeout(()=>{(!y()||window.innerHeight<=e+8)&&T(b)},900)):T(b)},[]);if(!u)return null;const k=x?'Exit full screen':'Full screen',j='corner'===e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{testID:"car-fullscreen",accessibilityRole:"button",accessibilityLabel:k,accessibilityHint:x?'Shows the browser bar again':'Hides the browser bar, if the car allows it',onPress:()=>{F()},style:[{minHeight:h,minWidth:j?220:void 0,width:j?void 0:E,alignSelf:j?void 0:'center',justifyContent:'center',alignItems:'center',paddingHorizontal:12,borderRadius:14,borderWidth:2,borderColor:o.colours.goldLight,backgroundColor:x?'#1d1708':o.colours.gold},j?{position:'fixed',top:12,right:12,zIndex:1200}:null],children:(0,s.jsx)(l.T,{size:j?20:17,weight:"bold",colour:x?o.colours.goldLight:'#1a1407',center:!0,numberOfLines:1,children:k})}),L?(0,s.jsx)(c.default,{testID:"car-fullscreen-msg",accessible:!0,accessibilityLiveRegion:"assertive",accessibilityLabel:L,style:{position:'fixed',top:j?76:12,right:j?12:220,maxWidth:420,zIndex:1300,padding:14,borderRadius:14,borderWidth:1.5,borderColor:o.colours.amber,backgroundColor:'#1d1708'},children:(0,s.jsx)(l.T,{size:17,center:!0,colour:"#FFE2A8",children:L})}):null]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),c=e(r(d[3])),l=r(d[4]),o=r(d[5]),s=r(d[6]);const u='undefined'!=typeof document,f='cc-car-fullscreen',h=56,b='The car\u2019s browser kept its address bar, so full screen isn\u2019t available here. The car screen already uses all the space it is given.',v={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}},y=()=>u&&!(!document.fullscreenElement&&!document.webkitFullscreenElement);async function w(){const e=document.documentElement,t=e.requestFullscreen??e.webkitRequestFullscreen;if(!t)return!1;try{return await t.call(e,{navigationUI:'hide'}),!0}catch{return!1}}},1478,[34,236,402,102,794,840,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),f=r(d[3]),u=r(d[4]);function c(){return(0,n.canShow)('staff')?(0,u.jsx)(f.StaffApp,{}):(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1479,[30,34,846,1480,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.StaffApp=function(){return(0,me.jsx)(J.StaffAppCtx.Provider,{value:!0,children:(0,me.jsx)(we,{})})};var s=_r(d[0]),t=_r(d[1]),o=_r(d[2]),i=_r(d[3]),r=_r(d[4]),l=_r(d[5]),n=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),f=_r(d[10]),p=_r(d[11]),b=_r(d[12]),y=_r(d[13]),x=_r(d[14]),j=_r(d[15]),k=_r(d[16]),w=_r(d[17]),v=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),M=_r(d[22]),R=_r(d[23]),B=_r(d[24]),P=e(_r(d[25])),A=e(_r(d[26])),I=e(_r(d[27])),O=e(_r(d[28])),L=e(_r(d[29])),W=_r(d[30]),z=_r(d[31]),H=_r(d[32]),E=_r(d[33]),D=_r(d[34]),N=_r(d[35]),_=_r(d[36]),V=_r(d[37]),F=_r(d[38]),U=_r(d[39]),$=_r(d[40]),G=_r(d[41]),Y=_r(d[42]),Q=_r(d[43]),J=_r(d[44]),K=_r(d[45]),q=_r(d[46]),X=_r(d[47]),Z=_r(d[48]),ee=_r(d[49]),se=_r(d[50]);_r(d[51]);var te=_r(d[52]),ae=_r(d[53]),oe=_r(d[54]),ie=_r(d[55]),re=_r(d[56]),le=_r(d[57]),ne=_r(d[58]),de=_r(d[59]),ce=_r(d[60]),ue=_r(d[61]),he=_r(d[62]),fe=_r(d[63]),pe=_r(d[64]),ge=_r(d[65]),me=_r(d[66]);const be=ce.ROSTER.find(e=>'chef'===e.app)?.id,ye=[{id:'home',label:'Home',icon:'home'},{id:'clock',label:'Clock',icon:'clock'},{id:'rota',label:'Rota',icon:'bookings'},{id:'chat',label:'Chat',icon:'chat'},{id:'me',label:'Me',icon:'user'}],xe={home:'Today',clock:'Clock in / out',rota:'Rota, swaps & leave',chat:'Staff chat',me:'Me'},je=[{id:'mytips',title:'Tips',sub:'The venue tip pot and today\u2019s tips'},{id:'reviews',title:'Reviews',sub:'Published reviews, newest first'},{id:'bookings',title:'Bookings',sub:'Any day, back or forward: tables, Covers, Unseat and Undo'},{id:'loyalty',title:'Stamp card',sub:'Find a guest, add a stamp or use a reward'},{id:'guests',title:'Guest profiles',sub:'Look a guest up: visits, Covers, allergies they told us, preferences'},{id:'giftcards',title:'Gift cards',sub:'Check a balance, take it off the bill, mark paid at the till'},{id:'tableorders',title:'Table orders',sub:'Orders from guests\u2019 phones at the table: accept, mark served or cancel'},{id:'soldout',title:'Sold out',sub:'What\u2019s run out today. Mark sold out or Back on; shows on the Display'},{id:'board',title:'Question board',sub:'Ask the team anything anonymously, and vote'},{id:'recipecards',title:'Recipe cards',sub:'Signed-off dishes: photo, ingredients, method and allergens (read-only)'},{id:'avatar',title:'My avatar',sub:'Your space-age avatar, or create one from a photo'},{id:'cashup',title:'Cash up',sub:'End-of-night takings: take a picture of the taking sheet or upload a spreadsheet (if a manager has switched it on for you)'},{id:'haccp',title:'Food safety checks',sub:'Record fridge, freezer, cooking and other checks (say or type)'},{id:'accidents',title:'Accident book',sub:'Report an accident or near miss; see your own entries'},{id:'mypay',title:'My hours & pay',sub:'Shifts, paid hours and estimated pay'},{id:'timesheets',title:'My timesheets',sub:'Your clock-ins, breaks and any changes'},{id:'orderlists',title:'Order lists',sub:'Add what\u2019s running low (Alsons drinks, Cash and carry)'},{id:'phone',title:'Phone notifications',sub:'Turn on reminders on this phone'},{id:'suppliers',title:'Suppliers',sub:'Contacts and order days (if your manager allows)'},{id:'privacy',title:'Privacy & location',sub:'What CoverCharge for Staff stores about you'}],ke=[{id:'mgr-plan',title:'Tables & areas',sub:'Edit the table plan, areas, seats and joined tables'},{id:'mgr-times',title:'Booking times',sub:'Kitchen hours, table times and Covers per booking slot'},{id:'mgr-bookings',title:'Bookings (manager)',sub:'New, edit and cancel bookings, walk-ins, seat, move and finish tables, deposit status'},{id:'mgr-clear',title:'Tables to clear',sub:'Tables waiting to be cleared; mark them cleared'},{id:'mgr-blocks',title:'Block bookings',sub:'Block now, add a block, close the garden'},{id:'mgr-allergy',title:'Allergy checks',sub:'Every allergy order\u2019s sign-offs and the allergen log'},{id:'mgr-stock',title:'Tracked stock',sub:'What\u2019s counted live through service; add or change items'},{id:'mgr-clock',title:'Who\u2019s clocked in',sub:'Today\u2019s clock-ins for the team (read only)'},{id:'mgr-swaps',title:'Shift swaps',sub:'Approve swaps and cover, or give a shift to someone else'}];function we(){const{r:e,rid:r,me:n,meId:w,today:v,now:S}=(0,J.useCtx)(3e4);(0,R.useReviewAlerts)(r),(0,le.useStaffTipsNotice)(r,v);const ne=(0,J.useSignedIn)(),de=ne?.ownerAccess&&'owner'!==ne.role?'owner privileges':ne?.managerAccess&&'staff'===ne.role?'manager privileges':'',ce=(0,J.useShiftManager)(),we=(0,ge.useSync)(e=>e.perms),Ce=ke.filter(e=>'mgr-swaps'===e.id?we.includes('rota.swap'):'mgr-times'!==e.id||(we.includes('bookings.settings')||we.includes('*')));(0,y.useSoldOutLink)(!0,n);(0,D.useOwner)(e=>e.staff);const Te=(0,D.useOwner)(e=>e.staffCanViewSuppliers),[Me,Re]=(0,C.useState)('home'),[Be,Pe]=(0,C.useState)(null),[Ae,Ie]=(0,C.useState)(!1),Oe=(0,C.useRef)(null);(0,C.useEffect)(()=>{(0,J.ensureAttendance)(v,S),(0,_.ensureChat)(S)},[v]),globalThis.__ccNow=S.getTime();const Le=(0,_.useChatUnread)().total,We=(0,C.useRef)({t:'home',s:null});We.current={t:Me,s:Be};const ze=(0,C.useRef)([]),He=(0,C.useCallback)((e,s=null)=>{const t=We.current;t.t===e&&t.s===s||(ze.current=[...ze.current,{...t,y:Ne.leave()}].slice(-30),Ne.restore(0)),Re(e),Pe(s)},[]),Ee=(0,C.useCallback)(()=>{if((0,u.runBackLayer)())return!0;const e=We.current;let s=ze.current.pop();for(;s&&s.t===e.t&&s.s===e.s;)s=ze.current.pop();if(!s&&'home'===e.t&&!e.s)return!1;const t=s??{t:'home',s:null};return Ne.leave(),Re(t.t),Pe(t.s),Ne.restore(t.y??0),!0},[]);(0,u.useWebBack)(Ee);const De=(0,u.useInnerBackShown)();(0,C.useEffect)(()=>{j.PITCH&&(globalThis.__pitchGo=He)},[He]),(0,F.useShiftReminders)({rid:r,staffId:w,name:n,onStartBreak:()=>He('clock')}),(0,U.useScheduledNotices)({rid:r,staffId:ne?.id??'',name:n,onOpen:()=>He('me','orderlists')}),(0,$.useOffRotaPrompt)({rid:r,staffId:ne?.id??''});const Ne=(0,c.useScrollMemory)(Oe),Ve=(0,C.useCallback)((e,s=null)=>'chat'===e?He('chat'):'clock'===s?He('clock'):'rota'===s?He('rota'):s&&je.some(e=>e.id===s)?He('me',s):'blocks'===s&&ce?He('me','mgr-blocks'):void He('home'===e?'home':'me'),[He,ce]);(0,C.useEffect)(()=>{const e=P.default.addEventListener('hardwareBackPress',Ee);return()=>e.remove()},[Ee]);const Fe='me'===Me&&Be?je.find(e=>e.id===Be)??(ce?Ce.find(e=>e.id===Be):void 0):void 0,Ue=(0,Q.useOrderLists)(e=>e.settings[r]?.allowStaff??!0),$e=je.filter(e=>('suppliers'!==e.id||Te)&&('orderlists'!==e.id||Ue||ne&&'staff'!==ne.role));(0,C.useEffect)(()=>{D.useOwner.getState().staffAs&&D.useOwner.setState({staffAs:void 0})},[]);(0,L.default)().width;return(0,me.jsxs)(W.SafeAreaView,{style:{flex:1,backgroundColor:N.colours.bg},edges:['top','left','right','bottom'],children:[(0,me.jsxs)(O.default,{style:{position:'relative',paddingHorizontal:14,paddingTop:6,paddingBottom:8,borderBottomWidth:1,borderColor:N.colours.border,gap:6},children:[(0,me.jsx)(O.default,{style:{position:'absolute',top:4,right:6,zIndex:5,flexDirection:'row',alignItems:'center'},children:(0,me.jsx)(E.VoiceSlot,{size:44})}),(0,me.jsx)(O.default,{testID:"header-me-wrap",style:{alignItems:'flex-start',minHeight:44,justifyContent:'center',maxWidth:'70%'},children:(0,me.jsx)(A.default,{testID:"header-me",accessibilityRole:"button",accessibilityLabel:`${(0,i.privateClockVenue)(r)?`Signed in as ${n}`:'Signed in as'}${de?`, ${de}`:''}`,onPress:()=>Ie(!0),hitSlop:6,style:{borderWidth:1,borderColor:N.colours.gold,borderRadius:22,paddingHorizontal:10,paddingVertical:4,maxWidth:'100%',minHeight:44,justifyContent:'center'},children:(0,me.jsxs)(z.Row,{gap:6,style:{justifyContent:'flex-start'},children:[(0,me.jsx)(fe.StaffAvatar,{id:w,size:24,ring:!1}),(0,me.jsxs)(O.default,{style:{flexShrink:1},children:[(0,me.jsxs)(z.T,{size:13,weight:"semibold",colour:N.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[n.replace(' (example)',''),ne?'':' (preview)'," \u25be"]}),de?(0,me.jsx)(z.Muted,{center:!1,size:10,numberOfLines:1,children:de}):null]})]})})}),(0,me.jsx)(H.VenueHeaderBlock,{rid:e.id,name:e.name,badge:"STAFF",place:"Front of House"+(e.location?` \xb7 ${e.location.split(',').slice(0,2).join(',')}`:'')})]}),(0,me.jsxs)(I.default,{ref:Oe,...Ne.props,contentContainerStyle:{padding:14,paddingBottom:16,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,me.jsx)(u.BackTitleRow,{back:!('home'===Me&&!Be||De),onBack:Ee,title:Fe?Fe.title:xe[Me]}),'home'===Me&&ce?(0,me.jsx)(Z.ManagerFeaturesNote,{}):null,'home'===Me&&ne&&'staff'!==ne.role&&!ce&&'undefined'!=typeof window?(0,me.jsxs)(O.default,{testID:"manager-access-banner",style:{borderWidth:1,borderColor:N.colours.gold,borderRadius:12,padding:10,gap:6},children:[(0,me.jsx)(z.T,{weight:"semibold",colour:N.colours.gold,children:"You have manager access"}),(0,me.jsx)(z.Muted,{children:"The Manager app has everything here plus bookings, the rota, staff and settings."}),(0,me.jsx)(A.default,{accessibilityRole:"button",onPress:()=>{const e=(0,se.appUrl)('owner');e&&window.location.assign(e)},style:{alignSelf:'flex-start',borderWidth:1,borderColor:N.colours.gold,borderRadius:14,paddingHorizontal:12,paddingVertical:5,minHeight:44,justifyContent:'center'},children:(0,me.jsx)(z.T,{size:14,colour:N.colours.gold,children:"Open the Managers app \u203a"})})]}):null,'home'===Me&&ne?(0,me.jsx)(k.MyTasksToday,{rid:r,staffId:ne.id,name:ne.name,onShift:(0,F.shiftNow)(ne.id,S.getTime()).on}):null,'home'===Me?(0,me.jsx)(ve,{go:Ve}):null,'clock'===Me?(0,me.jsx)(re.ClockInOut,{}):null,'rota'===Me?(0,me.jsx)(re.Rota,{}):null,'chat'===Me?(0,me.jsx)(_.Chat,{go:Ve}):null,'me'!==Me||Fe?null:(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(O.default,{style:{borderRadius:14,borderWidth:1,borderColor:N.colours.border,backgroundColor:N.colours.surface,overflow:'hidden'},children:$e.map((e,s)=>(0,me.jsx)(A.default,{testID:`audit-page-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>He('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:N.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,me.jsxs)(z.Row,{style:{justifyContent:'space-between'},children:[(0,me.jsxs)(O.default,{style:{flex:1},children:[(0,me.jsx)(z.T,{weight:"medium",children:e.title}),(0,me.jsx)(z.Muted,{children:e.sub})]}),(0,me.jsx)(z.T,{colour:N.colours.muted,children:"\u203a"})]})},e.id))}),ce?(0,me.jsxs)(O.default,{testID:"manager-features",style:{gap:6},children:[(0,me.jsx)(z.T,{weight:"semibold",colour:N.colours.gold,children:"Manager features"}),(0,me.jsx)(O.default,{style:{borderRadius:14,borderWidth:1,borderColor:N.colours.gold,backgroundColor:N.colours.surface,overflow:'hidden'},children:Ce.map((e,s)=>(0,me.jsx)(A.default,{testID:`audit-page-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>He('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:N.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,me.jsxs)(z.Row,{style:{justifyContent:'space-between'},children:[(0,me.jsxs)(O.default,{style:{flex:1},children:[(0,me.jsx)(z.T,{weight:"medium",children:e.title}),(0,me.jsx)(z.Muted,{children:e.sub})]}),(0,me.jsx)(z.T,{colour:N.colours.muted,children:"\u203a"})]})},e.id))}),(0,me.jsx)(Z.ManagerFeaturesAbout,{})]}):null,Te?null:(0,me.jsx)(z.Muted,{children:"Suppliers are hidden: your manager hasn\u2019t shared them with staff."}),(0,me.jsxs)(z.Muted,{center:!0,children:["Staff app \xb7 ",x.APP_VERSION," \xb7 ",'live'===ge.useSync.getState().mode?'shared with your team':'saved on this device until it connects']})]}),ce&&Fe?.id.startsWith('mgr-')?(0,me.jsxs)(J.ShiftMgrScope.Provider,{value:!0,children:['mgr-plan'===Fe.id?(0,me.jsx)(s.TablePlan,{}):null,'mgr-times'===Fe.id?(0,me.jsx)(t.StaffBookingTimes,{}):null,'mgr-bookings'===Fe.id?(0,me.jsx)(V.Bookings,{}):null,'mgr-clear'===Fe.id?(0,me.jsx)(Z.TablesToClear,{rid:r}):null,'mgr-blocks'===Fe.id?(0,me.jsx)(K.BlocksPage,{}):null,'mgr-allergy'===Fe.id?(0,me.jsx)(q.AllergenSignOffLog,{}):null,'mgr-stock'===Fe.id?(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(X.TrackedStockPage,{}),(0,me.jsx)(b.SoldOutList,{rid:r,by:n.replace(' (example)','')})]}):null,'mgr-clock'===Fe.id?(0,me.jsx)(Z.ClockOverview,{today:v,now:S}):null,'mgr-swaps'===Fe.id?(0,me.jsx)(Z.SwapApprovals,{today:v,me:n}):null]}):null,'loyalty'===Fe?.id?(0,me.jsx)(h.StaffLoyalty,{venue:e.name}):null,'guests'===Fe?.id?(0,me.jsx)(f.GuestProfiles,{me:n.replace(' (example)',''),manager:!1}):null,'bookings'===Fe?.id?(0,me.jsx)(V.Bookings,{}):null,'giftcards'===Fe?.id?(0,me.jsx)(p.GiftCardsPage,{me:n.replace(' (example)','')}):null,'tableorders'===Fe?.id?(0,me.jsx)(l.StaffTableOrders,{rid:r,me:n.replace(' (example)','')}):null,'soldout'===Fe?.id?(0,me.jsx)(b.SoldOutList,{rid:r,by:n.replace(' (example)','')}):null,'board'===Fe?.id?(0,me.jsx)(B.QuestionBoard,{rid:r,today:v,manager:!1,by:""}):null,'recipecards'===Fe?.id?(0,me.jsx)(T.RecipeCards,{rid:e.id,actor:{name:n,role:'staff'},mode:"read"}):null,'avatar'===Fe?.id?(0,me.jsx)(pe.AvatarMaker,{meId:w,me:n}):null,'cashup'===Fe?.id?(0,me.jsx)(Se,{rid:r,today:v,meId:w,me:n}):null,'haccp'===Fe?.id?(0,me.jsx)(he.HaccpLog,{mode:"staff",me:n,meId:w,now:S}):null,'accidents'===Fe?.id?(0,me.jsx)(ue.AccidentBook,{app:"staff",me:n,meId:w,now:S,seeAll:!1}):null,'mypay'===Fe?.id?(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(oe.MyPeriods,{staffId:w}),(0,me.jsx)(ae.MyHoursPay,{staffId:w})]}):null,'mytips'===Fe?.id?(0,me.jsx)(le.MyTips,{}):null,'reviews'===Fe?.id?(0,me.jsx)(M.ReviewsSection,{rid:r,mode:"read",venueName:e.name}):null,'timesheets'===Fe?.id?(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(oe.MyPeriods,{staffId:w}),(0,me.jsx)(re.Timesheets,{})]}):null,'orderlists'===Fe?.id?(0,me.jsx)(G.OrderListsScreen,{rid:r,today:v,editor:!!ne&&'staff'!==ne.role&&!ce,who:{id:w,name:n.replace(' (example)','')}}):null,'phone'===Fe?.id?(0,me.jsxs)(O.default,{style:{gap:8},children:[(0,me.jsx)(z.Muted,{children:"Get reminders like \u201cMills milk order\u201d on this phone, even with the app closed (once your manager switches phone notifications on). iPhone: add the app to your Home Screen first (iOS 16.4 or later)."}),(0,me.jsx)(Y.PushButton,{})]}):null,'suppliers'===Fe?.id?Te?(0,me.jsx)(ie.Suppliers,{}):(0,me.jsx)(z.Muted,{children:"Your manager hasn\u2019t shared suppliers with staff."}):null,'privacy'===Fe?.id?(0,me.jsxs)(O.default,{style:{gap:8},children:[(0,i.privateClockVenue)(r)?(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(z.T,{size:14,children:"Location is checked only when you choose Clock in at the pub. Only a pass or fail is saved with the clock-in time, or an audited manager override."}),(0,me.jsx)(z.T,{size:14,children:"Your position, accuracy and distance are never saved. There are no location trails, background/arrival checks, clock-out checks or break checks."})]}):(0,me.jsxs)(me.Fragment,{children:[" ",(0,me.jsx)(z.T,{size:14,children:"\u2022 Location is checked when you tap Clock in, Clock out, Start break or End break, and (if you allowed location) while the app is open to ask if you want to clock in when you\u2019re at the venue but not on the rota. Never in the background."}),(0,me.jsx)(z.T,{size:14,children:"\u2022 Each clock record keeps the location reading, how accurate it was, whether it was inside the venue area, and the time. Managers can see these."})]}),(0,me.jsx)(z.T,{size:14,children:"\u2022 You see only your own hours, pay estimates and tips. Managers see the team\u2019s."}),(0,me.jsxs)(z.T,{size:14,children:["\u2022 Chat messages stay within ",e.name,"\u2019s team."]}),(0,me.jsx)(z.T,{size:14,children:"\u2022 Pay figures are estimates before tax and deductions; your payslip is the official record."})]}):null]}),(0,me.jsx)(te.BottomTabs,{background:(0,o.soutersSurface)('#0d0d0d'),active:Me,onPress:e=>He(e),tabs:ye.map(e=>({id:e.id,label:e.label,icon:e.icon,badge:'chat'===e.id&&Le?{text:String(Le),bg:N.colours.red}:null}))}),(0,me.jsx)(z.Sheet,{visible:Ae,onClose:()=>Ie(!1),title:"Signed in as",children:ne?(0,me.jsxs)(O.default,{style:{gap:8},children:[(0,me.jsxs)(z.Row,{gap:10,children:[(0,me.jsx)(fe.StaffAvatar,{id:ne.id,size:48}),(0,me.jsxs)(O.default,{style:{flex:1},children:[(0,me.jsx)(z.T,{weight:"semibold",children:ne.name}),(0,me.jsx)(z.Muted,{children:(0,se.levelJob)(ne.level??'Staff',ne.job)})]})]}),(0,me.jsx)(z.Muted,{children:"Signed in with your personal link. This phone remembers you."}),ce?(0,me.jsx)(z.Muted,{children:"Manager features are on for you in this app."}):null,'staff'===ne.role||ce?null:(0,me.jsx)(z.Button,{kind:"secondary",label:"Back to CoverCharge for Managers",onPress:()=>{const e=(0,se.appUrl)('owner');e&&window.location.assign(e)}}),ne.id===be?(0,me.jsx)(z.Button,{kind:"secondary",label:"Back to CoverCharge for Head Chef",onPress:()=>{const e=(0,se.appUrl)('chef');e&&window.location.assign(e)}}):null]}):(0,me.jsxs)(O.default,{style:{gap:8},children:[(0,me.jsx)(z.Muted,{children:"Not signed in: this is a preview. Open your personal link, or paste it here, to sign in as yourself."}),(0,me.jsx)(ee.SignInWithLink,{})]})})]})}function ve({go:e}){const{rid:s,today:t}=(0,J.useCtx)(3e4),o=(0,de.useTravelDay)('staff',t);return(0,me.jsxs)(O.default,{style:{gap:10},children:[(0,me.jsx)(n.WhoBar,{}),(0,me.jsx)(de.DayBar,{app:"staff",today:t}),o?null:(0,me.jsx)(r.CoversToday,{rid:s}),o?(0,me.jsx)(de.DayView,{rid:s,day:o,today:t,app:"staff"}):(0,me.jsx)(ne.StaffHome,{go:e})]})}function Se({rid:e,today:s,meId:t,me:o}){return!0!==(0,S.useCashAccess)(e=>e.mine)?(0,me.jsx)(v.NoCashUpAccess,{}):(0,me.jsx)(w.CashUpScreen,{rid:e,today:s,canEdit:!0,who:{id:t??'me',name:o.replace(' (example)','')}})}},1480,[1380,1481,798,991,1073,1430,1161,1040,1041,1431,1454,1433,1130,977,1042,2,1047,1048,1407,993,34,1132,1186,1190,1156,373,402,295,102,426,36,794,847,1116,865,840,1135,1341,1070,1085,1086,1082,1043,1025,1100,1425,1420,1439,1482,1349,997,236,1192,1145,1151,1378,1155,1154,1392,1148,15,1162,1163,899,793,985,25]); __d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffBookingTimes=function(){const{r:e,rid:n}=(0,l.useCtx)(),[u,c]=(0,t.useState)(()=>Object.fromEntries(d.map(([t])=>[t,e.kitchenHours?.[t]??null]))),[b,h]=(0,t.useState)(String(e.settings.turnMins??'')),[y,v]=(0,t.useState)(String(e.settings.bookingCoversPerSlot??'')),[x,j]=(0,t.useState)(''),[f,k]=(0,t.useState)(!1),M=(e,t,n)=>c(s=>({...s,[e]:0===t?[n,s[e]?.[1]??'']:[s[e]?.[0]??'',n]})),S=Object.values(u).every(e=>!e||e.every(e=>/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(e))&&e[0]=30&&Number(b)<=360&&Number(y)>=1&&Number(y)<=1e3;return(0,r.jsxs)(s.default,{style:{gap:12,width:'100%',minWidth:0},testID:"staff-booking-times",children:[(0,r.jsx)(i.T,{center:!0,weight:"bold",children:"Booking times"}),(0,r.jsx)(i.Muted,{center:!0,children:"Change kitchen hours, table time and the Covers offered in each booking slot. Table layout and blocks have their own screens."}),d.map(([e,t])=>(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.T,{center:!0,weight:"semibold",children:t}),(0,r.jsx)(i.Toggle,{label:`${t} open`,value:!!u[e],onChange:t=>c(n=>({...n,[e]:t?['','']:null}))}),u[e]?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Field,{label:`${t} opens (HH:MM)`,value:u[e][0],placeholder:"HH:MM",onChangeText:t=>M(e,0,t)}),(0,r.jsx)(i.Field,{label:`${t} closes (HH:MM)`,value:u[e][1],placeholder:"HH:MM",onChangeText:t=>M(e,1,t)})]}):(0,r.jsx)(i.Muted,{center:!0,children:"Closed"})]},e)),(0,r.jsxs)(i.Card,{children:[(0,r.jsx)(i.Field,{label:"Typical table time, minutes",value:b,onChangeText:h,keyboardType:"number-pad"}),(0,r.jsx)(i.Field,{label:"Covers per 30-minute booking slot",value:y,onChangeText:v,keyboardType:"number-pad"})]}),(0,r.jsx)(i.Button,{label:f?'Saving\u2026':'Save booking times',disabled:!S||f,accessibilityLabel:"Save booking times without changing other venue settings",onPress:async()=>{k(!0);try{await(0,o.saveStaffBookingTimes)(n,u,Number(b),Number(y)),j('Booking times saved.')}catch(e){j(e.message)}finally{k(!1)}}}),x?(0,r.jsx)(i.Muted,{center:!0,children:x}):null]})};var e,t=_r(_d[0]),n=_r(_d[1]),s=(e=n)&&e.__esModule?e:{default:e},i=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]);const d=[[1,'Monday'],[2,'Tuesday'],[3,'Wednesday'],[4,'Thursday'],[5,'Friday'],[6,'Saturday'],[0,'Sunday']]},1481,[34,102,794,1100,985,25]); @@ -1594,7 +1594,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,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},1511,[34,1486]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},1512,[1513]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preventAutoHideAsync=async function(){return!1},e.setOptions=function(n){},e.hide=function(){},e.hideAsync=async function(){}},1513,[]); -__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.CarGate=function(){const e=(0,c.useSession)(e=>e.meId),[s,o]=(0,t.useState)(c.useSession.persist.hasHydrated());return(0,t.useEffect)(()=>{const e=c.useSession.persist.onFinishHydration(()=>o(!0));return c.useSession.persist.hasHydrated()&&o(!0),e},[]),s?e||h.PITCH?null:(0,j.jsx)(I,{}):(0,j.jsx)(n.default,{style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=e(_r(d[1])),n=e(_r(d[2])),s=e(_r(d[3])),o=_r(d[4]),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),f=_r(d[10]),p=_r(d[11]),y=_r(d[12]),j=_r(d[13]);let b=null,w=null;async function M(e){return!e&&w&&Date.now()-w.at<6e4&&new Date(w.r.expiresAt).getTime()-Date.now()>12e4?w.r:b||(b=(0,u.carPairStart)().then(e=>(e.ok&&(w={r:e,at:Date.now()}),e)).finally(()=>{b=null}),b)}function I(){const{width:e,height:c}=(0,s.default)(),[h,b]=(0,t.useState)(null),[w,I]=(0,t.useState)('starting'),[T,D]=(0,t.useState)(''),[k,C]=(0,t.useState)(0),z=(0,t.useRef)(!1),S=(0,t.useCallback)(async(e=!0)=>{if(z.current)return;z.current=!0,I('starting'),D('');const t=await M(e);if(z.current=!1,!t.ok)return I('error'),void D(t.error);b({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),I('waiting')},[]);(0,t.useEffect)(()=>{S(!1)},[]),(0,t.useEffect)(()=>{if(!h||'waiting'!==w)return;const e=setInterval(async()=>{C(Math.max(0,Math.round((h.until-Date.now())/1e3)));('expired'===await(0,u.carPairPoll)(h.id)||Date.now()>h.until)&&I('expired')},3e3);return()=>clearInterval(e)},[h,w]);const P=Math.min(120,Math.max(64,Math.round(Math.min(e/9,c/7)))),H=h?.code??'',v=H?`${H.slice(0,3)} ${H.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,j.jsx)(n.default,{testID:"car-pairing",style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:(0,j.jsxs)(n.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:c<820?10:16},children:[(0,j.jsx)(l.RestaurantLogo,{rid:x.VENUE_RID,size:c<820?64:88}),(0,j.jsx)(o.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,j.jsx)(y.ParkedOnly,{}),'waiting'===w||'starting'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,j.jsx)(n.default,{testID:"car-code",accessible:!0,accessibilityLabel:H?`Car code ${(0,p.spokenCode)(H)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,j.jsx)(o.T,{center:!0,size:P,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:P/8,lineHeight:1.2*P},children:v})}),H?(0,j.jsx)(o.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,j.jsxs)(n.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,j.jsx)(o.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,j.jsx)(n.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,j.jsx)(o.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{S()},style:{minHeight:64,minWidth:200}})})]}):'expired'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{S()},style:{minHeight:64,minWidth:280}})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,j.jsx)(o.Muted,{center:!0,children:T}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{S()},style:{minHeight:64,minWidth:240}})]}),T&&'error'!==w?(0,j.jsx)(o.T,{center:!0,colour:f.colours.amber,children:T}):null,(0,j.jsx)(o.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})})}},1514,[34,41,102,426,794,847,997,985,2,5,840,1474,1476,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.CarGate=function(){const e=(0,u.useSession)(e=>e.meId),[t,o]=(0,r.useState)(u.useSession.persist.hasHydrated());return(0,r.useEffect)(()=>{const e=u.useSession.persist.onFinishHydration(()=>o(!0));return u.useSession.persist.hasHydrated()&&o(!0),e},[]),t?e||x.PITCH?null:(0,b.jsx)(T,{}):(0,b.jsx)(s.default,{style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=_r(d[1]),n=e(_r(d[2])),s=e(_r(d[3])),o=e(_r(d[4])),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),f=_r(d[11]),y=_r(d[12]),j=_r(d[13]),b=_r(d[14]);let w=null,M=null;async function I(e){return!e&&M&&Date.now()-M.at<6e4&&new Date(M.r.expiresAt).getTime()-Date.now()>12e4?M.r:w||(w=(0,h.carPairStart)().then(e=>(e.ok&&(M={r:e,at:Date.now()}),e)).finally(()=>{w=null}),w)}function T(){const{width:e,height:u}=(0,o.default)(),[x,w]=(0,r.useState)(null),[M,T]=(0,r.useState)('starting'),[C,D]=(0,r.useState)(''),[k,z]=(0,r.useState)(0),S=(0,r.useRef)(!1),P=(0,r.useCallback)(async(e=!0)=>{if(S.current)return;S.current=!0,T('starting'),D('');const t=await I(e);if(S.current=!1,!t.ok)return T('error'),void D(t.error);w({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),T('waiting')},[]);(0,r.useEffect)(()=>{P(!1)},[]),(0,r.useEffect)(()=>{if(!x||'waiting'!==M)return;const e=setInterval(async()=>{z(Math.max(0,Math.round((x.until-Date.now())/1e3)));('expired'===await(0,h.carPairPoll)(x.id)||Date.now()>x.until)&&T('expired')},3e3);return()=>clearInterval(e)},[x,M]);const H=Math.min(120,Math.max(64,Math.round(Math.min(e/9,u/7)))),v=x?.code??'',F=v?`${v.slice(0,3)} ${v.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,b.jsxs)(s.default,{testID:"car-pairing",style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:[(0,b.jsx)(t.CarFullscreenButton,{place:"corner"}),(0,b.jsxs)(s.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:u<820?10:16},children:[(0,b.jsx)(c.RestaurantLogo,{rid:p.VENUE_RID,size:u<820?64:88}),(0,b.jsx)(l.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,b.jsx)(j.ParkedOnly,{}),'waiting'===M||'starting'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,b.jsx)(s.default,{testID:"car-code",accessible:!0,accessibilityLabel:v?`Car code ${(0,y.spokenCode)(v)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,b.jsx)(l.T,{center:!0,size:H,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:H/8,lineHeight:1.2*H},children:F})}),v?(0,b.jsx)(l.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,b.jsxs)(s.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,b.jsx)(l.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,b.jsx)(s.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,b.jsx)(l.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{P()},style:{minHeight:64,minWidth:200}})})]}):'expired'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{P()},style:{minHeight:64,minWidth:280}})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,b.jsx)(l.Muted,{center:!0,children:C}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{P()},style:{minHeight:64,minWidth:240}})]}),C&&'error'!==M?(0,b.jsx)(l.T,{center:!0,colour:f.colours.amber,children:C}):null,(0,b.jsx)(l.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})]})}},1514,[1478,34,41,102,426,794,847,997,985,2,5,840,1474,1476,25]); __d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1515,[986,857,856,985]); __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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1516,[798,796,34,1381,1015,402,102,846,985,1007,1014,5,840,794,1287,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1517,[796,34,236,402,102,840,985,1045,2,25]); diff --git a/owner-app/admin.html b/owner-app/admin.html index 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 77a1df008dad9b076ef55375bedcb1dd672430d0..c2fa6b2338de23a383638b76226a9ce0318d4fdd 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 951130b7abe79f8d2d59f80eb7c5c4b70e63f4cf..1ac6432ef1a9187d6ad562ab150b77a1699f2cde 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-f0b8800611"; +const V = "cc-owner-83292c17d8"; 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=f0b8800611a81f13214e6ec76361f3c2e60f682ffdb4184f7dc6ed3153f1c968"]; +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=83292c17d8bccea35cd10ec282df1d0faa679e8bb61699b3b54db50ce0805fe4"]; // 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 2162fcfda836a6ded4c66598f568eed6a514b797..2410909a8a7afd1ab4a33245f015c59871008f5e 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 cd07a2fcf982a432f7d26d9b1dbe03597a03e55a..8b8ddf48a1c227b2e116d83a878f40dfda11d224 100644 --- a/staff-app/_expo/static/js/web/bundle.js +++ b/staff-app/_expo/static/js/web/bundle.js @@ -23,11 +23,11 @@ __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,"PITCH_VENUE",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"PITCH_TEAM",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PITCH_TEXT",{enumerable:!0,get:function(){return o}}),e.pitchText=function(a){let n=a;for(const[a,t]of o)a.test(n)?(a.lastIndex=0,n=n.replace(a,t)):a.lastIndex=0;return n};const a={name:'The Harbour Kitchen',tagline:'Harbourside seafood & seasonal plates',location:'12 Quay Street, Portmorran',phone:'01632 960 123',website:'harbourkitchen.example'},n={'st-tracy':{name:'Morgan',job:'Owner',hourlyPence:null,salaried:!0},'st-gordon':{name:'Alex',job:'General Manager',dept:'Management',hourlyPence:null,salaried:!0},'st-bisto':{name:'Ravi',job:'Head Chef',hourlyPence:null,salaried:!0},'st-agate':{name:'Priya',job:'Front of house supervisor',hourlyPence:1450},'st-lenny':{name:'Tom',job:'Commis Chef',hourlyPence:1325},'st-finn':{name:'Lewis',job:'Bar staff',hourlyPence:1290},'st-eilidh':{name:'Chloe',job:'Front of house',hourlyPence:1271},'st-emily':{name:'Ellie',job:'Front of house',hourlyPence:1271},'st-lillie':{name:'Jordan',job:'Kitchen porter (KP)',hourlyPence:1271},'st-jack':{name:'Sam',job:'Kitchen porter (KP)',hourlyPence:1271}},o=[['Harbour View, Dunure, South Ayrshire',a.location],['Harbour View, Dunure',a.location],['Harbour View mug','Harbour Kitchen mug'],['Harbour View','Quay Street'],['anchoragedunure.com',a.website],['01292 502826',a.phone],['Mini Anchors','Little Crew'],['The Anchorage',a.name],['Anchorage','Harbour Kitchen'],['ANCHORAGE','HARBOUR KITCHEN'],['South Ayrshire','the Firth coast'],['Ayrshire','the Firth coast'],['Dunure','Portmorran'],['Kittyfisher boat (Big Sean)','Coastal Fish Co'],['Kittyfisher','Coastal Fish Co'],['Big Sean','Coastal Fish Co'],['Example Fish Co.','Coastal Fish Co'],['Sample Dairy Ltd','Hillside Dairy'],['Sample Fruit & Veg','Fieldfare Veg'],['Mills milk','Hillside Dairy milk'],['Mills','Hillside Dairy'],['J. Pieroni & Sons','Fieldfare Veg'],["Pieroni's",'Fieldfare Veg'],['Pieroni','Fieldfare Veg'],['Alsons (drinks)','Drinks wholesaler'],['Alsons','the drinks wholesaler'],['Spes Bona','the deli wholesaler'],['Tarelgin','the butcher'],['Reids','the bakery'],['Reeds','the bakery'],['Example Butchers Ltd','Quayside Butchers'],['Example Dry Goods Wholesale','Dry goods wholesaler'],['Sample Brewing Co.','Harbourside Brewing'],['Example Cleaning Supplies','Cleaning supplies'],['Sample Packaging Ltd','Packaging supplier'],['Example Kitchen Repairs','Kitchen repairs'],['Preston','Ravi'],['Bisto','Ravi'],['Tracy','Morgan'],['James','Morgan'],['Gordon','Alex'],['Agate','Priya'],['Lenny','Tom'],['Finn','Lewis'],['Eilidh','Chloe'],['Emily','Ellie'],['Gabrielle','Ellie'],['Cameron Mc','Sam'],['Cameron','Sam'],['Lillie','Jordan'],['Lily','Jordan'],['Mia','Jordan'],['Jack','Sam'],['Harvey','Jordan'],['Anna','the supplier'],['(preview)',''],[' (example)','']].map(([a,n])=>[new RegExp(`${/^[A-Za-z]/.test(a)?'(?g[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`](_),globalThis.__webpack_require__=o=>{const t=ErrorUtils.reportFatalError;_&&(ErrorUtils.reportFatalError=_=>{throw _});try{return g[`${__METRO_GLOBAL_PREFIX__}__r`](o)}finally{_&&(ErrorUtils.reportFatalError=t)}}},23,[]); -__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}function t(){const n=r(d[1]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"App",{enumerable:!0,get:function(){return c}}),r(d[2]);const o=r(d[3]),u=r(d[4]);function c(){return(0,n().jsx)(u.Head.Provider,{children:(0,n().jsx)(o.ExpoRoot,{context:t().ctx})})}r(d[5])},24,[25,27,34,709,1447,1450]); +__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}function t(){const n=r(d[1]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"App",{enumerable:!0,get:function(){return c}}),r(d[2]);const o=r(d[3]),u=r(d[4]);function c(){return(0,n().jsx)(u.Head.Provider,{children:(0,n().jsx)(o.ExpoRoot,{context:t().ctx})})}r(d[5])},24,[25,27,34,709,1448,1451]); __d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},25,[26]); __d(function(g,r,i,a,m,e,d){ /** @@ -41,7 +41,7 @@ __d(function(g,r,i,a,m,e,d){ */ "use strict";var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(t,o,f){var l=null;if(void 0!==f&&(l=""+f),void 0!==o.key&&(l=""+o.key),"key"in o)for(var y in f={},o)"key"!==y&&(f[y]=o[y]);else f=o;return o=f.ref,{$$typeof:n,type:t,key:l,ref:void 0!==o?o:null,props:f}}e.Fragment=t,e.jsx=o,e.jsxs=o},26,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ctx",{enumerable:!0,get:function(){return t}});const t=r(d[0])},27,[28]); -__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./(chef)/kitchen/[section].tsx":{enumerable:!0,get:()=>r(d[1])(d[0],d.paths)},"./(chef)/kitchen/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[2],d.paths)},"./(customer)/customer/[rid]/book.tsx":{enumerable:!0,get:()=>r(d[1])(d[3],d.paths)},"./(customer)/customer/[rid]/dish/[did].tsx":{enumerable:!0,get:()=>r(d[1])(d[4],d.paths)},"./(customer)/customer/[rid]/feedback.tsx":{enumerable:!0,get:()=>r(d[1])(d[5],d.paths)},"./(customer)/customer/[rid]/gift.tsx":{enumerable:!0,get:()=>r(d[1])(d[6],d.paths)},"./(customer)/customer/[rid]/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[7],d.paths)},"./(customer)/customer/[rid]/lost.tsx":{enumerable:!0,get:()=>r(d[1])(d[8],d.paths)},"./(customer)/customer/[rid]/loyalty.tsx":{enumerable:!0,get:()=>r(d[1])(d[9],d.paths)},"./(customer)/customer/[rid]/merch.tsx":{enumerable:!0,get:()=>r(d[1])(d[10],d.paths)},"./(customer)/customer/[rid]/offers.tsx":{enumerable:!0,get:()=>r(d[1])(d[11],d.paths)},"./(customer)/customer/[rid]/refer.tsx":{enumerable:!0,get:()=>r(d[1])(d[12],d.paths)},"./(customer)/customer/[rid]/waitlist.tsx":{enumerable:!0,get:()=>r(d[1])(d[13],d.paths)},"./(customer)/customer/[rid]/whatson.tsx":{enumerable:!0,get:()=>r(d[1])(d[14],d.paths)},"./(customer)/customer/basket.tsx":{enumerable:!0,get:()=>r(d[1])(d[15],d.paths)},"./(customer)/customer/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[16],d.paths)},"./(customer)/customer/order/[oid].tsx":{enumerable:!0,get:()=>r(d[1])(d[17],d.paths)},"./(customer)/customer/profile.tsx":{enumerable:!0,get:()=>r(d[1])(d[18],d.paths)},"./(customer)/demo.tsx":{enumerable:!0,get:()=>r(d[1])(d[19],d.paths)},"./(customer)/table/[n].tsx":{enumerable:!0,get:()=>r(d[1])(d[20],d.paths)},"./(customer)/table/live/[token].tsx":{enumerable:!0,get:()=>r(d[1])(d[21],d.paths)},"./(display)/display/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[22],d.paths)},"./(display)/staff/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[23],d.paths)},"./(owner)/admin/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[24],d.paths)},"./(owner)/owner/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[25],d.paths)},"./(staff)/team/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[26],d.paths)},"./+not-found.tsx":{enumerable:!0,get:()=>r(d[1])(d[27],d.paths)},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])(d[28],d.paths)},"./index.tsx":{enumerable:!0,get:()=>r(d[1])(d[29],d.paths)}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},28,[29,1038,1189,1190,1192,1196,1198,1205,1261,1262,1263,1264,1265,1266,1268,1269,1270,1271,1272,1273,1274,1275,1278,1336,1337,1338,1340,1382,1383,1446]); +__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./(chef)/kitchen/[section].tsx":{enumerable:!0,get:()=>r(d[1])(d[0],d.paths)},"./(chef)/kitchen/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[2],d.paths)},"./(customer)/customer/[rid]/book.tsx":{enumerable:!0,get:()=>r(d[1])(d[3],d.paths)},"./(customer)/customer/[rid]/dish/[did].tsx":{enumerable:!0,get:()=>r(d[1])(d[4],d.paths)},"./(customer)/customer/[rid]/feedback.tsx":{enumerable:!0,get:()=>r(d[1])(d[5],d.paths)},"./(customer)/customer/[rid]/gift.tsx":{enumerable:!0,get:()=>r(d[1])(d[6],d.paths)},"./(customer)/customer/[rid]/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[7],d.paths)},"./(customer)/customer/[rid]/lost.tsx":{enumerable:!0,get:()=>r(d[1])(d[8],d.paths)},"./(customer)/customer/[rid]/loyalty.tsx":{enumerable:!0,get:()=>r(d[1])(d[9],d.paths)},"./(customer)/customer/[rid]/merch.tsx":{enumerable:!0,get:()=>r(d[1])(d[10],d.paths)},"./(customer)/customer/[rid]/offers.tsx":{enumerable:!0,get:()=>r(d[1])(d[11],d.paths)},"./(customer)/customer/[rid]/refer.tsx":{enumerable:!0,get:()=>r(d[1])(d[12],d.paths)},"./(customer)/customer/[rid]/waitlist.tsx":{enumerable:!0,get:()=>r(d[1])(d[13],d.paths)},"./(customer)/customer/[rid]/whatson.tsx":{enumerable:!0,get:()=>r(d[1])(d[14],d.paths)},"./(customer)/customer/basket.tsx":{enumerable:!0,get:()=>r(d[1])(d[15],d.paths)},"./(customer)/customer/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[16],d.paths)},"./(customer)/customer/order/[oid].tsx":{enumerable:!0,get:()=>r(d[1])(d[17],d.paths)},"./(customer)/customer/profile.tsx":{enumerable:!0,get:()=>r(d[1])(d[18],d.paths)},"./(customer)/demo.tsx":{enumerable:!0,get:()=>r(d[1])(d[19],d.paths)},"./(customer)/table/[n].tsx":{enumerable:!0,get:()=>r(d[1])(d[20],d.paths)},"./(customer)/table/live/[token].tsx":{enumerable:!0,get:()=>r(d[1])(d[21],d.paths)},"./(display)/display/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[22],d.paths)},"./(display)/staff/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[23],d.paths)},"./(owner)/admin/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[24],d.paths)},"./(owner)/owner/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[25],d.paths)},"./(staff)/team/index.tsx":{enumerable:!0,get:()=>r(d[1])(d[26],d.paths)},"./+not-found.tsx":{enumerable:!0,get:()=>r(d[1])(d[27],d.paths)},"./_layout.tsx":{enumerable:!0,get:()=>r(d[1])(d[28],d.paths)},"./index.tsx":{enumerable:!0,get:()=>r(d[1])(d[29],d.paths)}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},28,[29,1038,1189,1190,1192,1196,1198,1205,1261,1262,1263,1264,1265,1266,1268,1269,1270,1271,1272,1273,1274,1275,1278,1336,1337,1338,1340,1382,1383,1447]); __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 s}});var t=r(d[0]);r(d[1]);var n=r(d[2]),c=r(d[3]),o=r(d[4]),f=r(d[5]);function s(){const{section:s}=(0,t.useLocalSearchParams)();return(0,c.canShow)('chef')?s&&(0,o.chefSectionAllowed)(String(s))?(0,f.jsx)(n.ChefApp,{section:String(s)},String(s)):(0,f.jsx)(t.Redirect,{href:"/kitchen"}):(0,f.jsx)(t.Redirect,{href:c.ENTRY[c.APP_VARIANT]})}},29,[30,34,792,846,988,25]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){return Object.keys(t).forEach(function(c){"default"===c||Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{enumerable:!0,get:function(){return t[c]}})}),t}Object.defineProperty(e,"__esModule",{value:!0}),r(d[0]),t(r(d[1]),e),t(r(d[2]),e),t(r(d[3]),e),t(r(d[4]),e)},30,[31,32,782,783,785]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},31,[]); @@ -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.122'},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.123'},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]); @@ -1195,7 +1195,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}),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: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";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)(!0);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]); @@ -1359,7 +1359,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}),_e.TableOrderLive=function({token:e}){const[s,m]=(0,l.useState)(null),[x,y]=(0,l.useState)(null),[j,f]=(0,l.useState)([]),[k,w]=(0,l.useState)(null),T=(0,h.useCustomer)(),[C,S]=(0,l.useState)(()=>(T?.allergies??[]).map(e=>e.allergen)),[v,O]=(0,l.useState)(''),[P,R]=(0,l.useState)(''),[I,M]=(0,l.useState)(''),[L,N]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),[B,D]=(0,l.useState)([]),q=(0,l.useCallback)(async()=>{try{m(await(0,c.tablePublic)(e)),y(null)}catch(e){y((0,d.tableOrderError)(e,'menu'))}},[e]),_=(0,l.useCallback)(async()=>{try{D(await(0,c.myTableOrders)(e))}catch{}},[e]);(0,l.useEffect)(()=>{q(),_();const e=setInterval(()=>{_(),q()},8e3);return()=>clearInterval(e)},[q,_]);const W=s?.menu??[];(0,l.useEffect)(()=>{f(e=>e.filter(e=>W.some(t=>t.id===e.id&&!t.soldOut)))},[s]);const E=(0,l.useMemo)(()=>{const e=new Map;for(const t of W)e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()]},[s]),Y=(0,d.cartTotal)(j,W),z='yes'===k?C.map(e=>({allergen:e,severity:T?.allergies?.find(t=>t.allergen===e)?.severity??'allergy'})):[],G=(0,d.allergyClashes)(j,W,z.map(e=>e.allergen)),V=e=>j.find(t=>t.id===e)?.qty??0,F=(e,t)=>f(n=>t<=0?n.filter(t=>t.id!==e):n.some(t=>t.id===e)?n.map(n=>n.id===e?{...n,qty:t}:n):[...n,{id:e,qty:t,note:''}]),H=(e,t)=>f(n=>n.map(n=>n.id===e?{...n,note:t}:n)),J=async()=>{N(!0),A(null);try{const t=await(0,c.sendTableOrder)(e,j,{note:I,name:v,phone:P,allergies:z});f([]),M(''),A({kind:'success',text:t.held?`Order ${t.ref} sent. A member of staff will check it, then it goes to the kitchen.`:`Order ${t.ref} sent to the kitchen.`}),_()}catch(e){A({kind:'warn',text:(0,d.tableOrderError)(e,'send')}),q()}finally{N(!1)}};if(x)return(0,p.jsxs)(o.Screen,{title:"Order at the table",children:[(0,p.jsx)(o.Banner,{kind:"warn",title:"Couldn't open the menu",children:x}),(0,p.jsx)(o.Button,{label:"Try again",onPress:()=>{q()}})]});if(!s)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Muted,{children:"Opening the menu\u2026"})});if(!s.ok)return(0,p.jsx)(o.Screen,{title:"Order at the table",children:(0,p.jsx)(o.Banner,{kind:"warn",title:"This code isn't working",children:s.reason??'Please ask a member of staff.'})});const K=s.open&&j.length>0&&null!==k&&('none'===k||C.length>0)&&(0,d.nameOk)(v)&&(0,d.phoneOk)(P)&&!L,Q=s.askServer??[],U=[...new Set(Q.map(e=>e.section))],X=L?'Sending\u2026':j.length?null===k?'Answer the allergy question':(0,d.nameOk)(v)?(0,d.phoneOk)(P)?`Send order to the kitchen (${(0,i.gbp)(Y)})`:'Check the phone number':'Add your name to send':'Add a dish to order';return(0,p.jsxs)(o.Screen,{title:`Table ${(0,n.tableNumbers)(s.table)}`,subtitle:s.venueName,footer:s.open?(0,p.jsx)(o.Button,{label:X,disabled:!K,onPress:()=>{J()},testID:"send-table-order-live"}):void 0,children:[(0,p.jsxs)(o.Muted,{center:!0,children:["Tip: add dishes, answer the allergy question, add your name, then send. Staff bring it to table ",(0,n.tableNumbers)(s.table),". ",d.PAY_WORDS]}),s.tip?(0,p.jsx)(o.Banner,{kind:"demo",children:s.tip}):null,s.open?null:(0,p.jsx)(o.Banner,{kind:"warn",title:"Not taking table orders right now",children:s.reason}),s.open&&s.staffAccept&&!B.some(e=>e.accepted)?(0,p.jsx)(o.Muted,{children:"The first order from your phone is checked by a member of staff before it goes to the kitchen."}):null,$?(0,p.jsx)(o.Banner,{kind:$.kind,children:$.text}):null,B.length?(0,p.jsx)(r.default,{testID:"my-table-orders",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Your orders at this table"}),B.map(e=>(0,p.jsxs)(r.default,{style:{gap:2,paddingVertical:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e.ref}),(0,p.jsx)(o.T,{size:13,colour:'cancelled'===e.status?u.colours.amber:u.colours.gold,children:(0,d.guestStatusWords)(e)})]}),(0,p.jsxs)(o.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,i.gbp)(e.totalPence)," to pay at the bar or with the server"]})]},e.id))]})}):null,s.open?E.map(([e,t])=>(0,p.jsxs)(r.default,{style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:e}),t.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,p.jsxs)(r.default,{style:{flex:1,gap:2},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),e.description?(0,p.jsx)(o.Muted,{children:e.description}):null,(0,p.jsxs)(o.T,{size:13,colour:u.colours.muted,children:[e.allergens.length?`Contains: ${e.allergens.map(a.allergenLabel).join(', ')}`:'No allergens listed: ask staff if unsure',e.mayContain.length?` \xb7 May contain: ${e.mayContain.map(a.allergenLabel).join(', ')}`:'']})]}),(0,p.jsx)(o.T,{weight:"semibold",colour:u.colours.gold,children:(0,i.gbp)(e.pricePence)})]}),e.soldOut?(0,p.jsx)(o.Badge,{kind:"amber",label:"Sold out today"}):V(e.id)?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:V(e.id),min:0,max:20,onChange:t=>F(e.id,t),label:e.name}),(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>F(e.id,0)})]}):(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"Add",accessibilityLabel:`Add ${e.name}`,onPress:()=>F(e.id,1)})]},e.id))]},e)):null,s.open&&!W.length?(0,p.jsx)(o.Banner,{kind:"demo",title:"No dishes to order from your phone yet",children:"The kitchen is still checking the allergens on the menu. Please order with your server or at the bar."}):null,s.open&&Q.length?(0,p.jsxs)(r.default,{testID:"table-ask-server",style:{gap:8},children:[(0,p.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:u.colours.gold,accessibilityRole:"header",children:W.length?'Also on the menu':'On the menu'}),(0,p.jsx)(o.Muted,{center:!0,children:"Ask your server for these. They can't be ordered from your phone yet, while the kitchen checks their allergens."}),U.map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:e}),Q.filter(t=>t.section===e).map((e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{style:{flex:1},children:e.name}),(0,p.jsx)(o.T,{colour:u.colours.muted,children:(0,i.gbp)(e.pricePence)})]},`${e.name}-${t}`))]},e))]}):null,s.open&&j.length?(0,p.jsx)(r.default,{testID:"table-cart",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:"Review your order"}),j.map(e=>{const n=W.find(t=>t.id===e.id);return(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{children:[e.qty,"\xd7 ",n?.name]}),(0,p.jsx)(o.T,{children:(0,i.gbp)(e.qty*(n?.pricePence??0))})]}),(0,p.jsx)(t.TextInput,{style:b,value:e.note,onChangeText:t=>H(e.id,t),placeholder:"Note for the kitchen (optional), e.g. no onions",placeholderTextColor:u.colours.muted,maxLength:140,accessibilityLabel:`Note for ${n?.name}`,testID:`table-note-${e.id}`})]},e.id)}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Total"}),(0,p.jsx)(o.T,{weight:"semibold",children:(0,i.gbp)(Y)})]})]})}):null,s.open?(0,p.jsx)(r.default,{testID:"table-allergy",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Does anyone at the table have a food allergy?"}),(0,p.jsx)(o.Muted,{center:!0,children:"We ask everyone, so the kitchen can keep you safe."}),(0,p.jsxs)(o.Row,{gap:8,style:{justifyContent:'center'},children:[(0,p.jsx)(o.Chip,{label:"No allergies",selected:'none'===k,onPress:()=>w('none')}),(0,p.jsx)(o.Chip,{label:"Yes, allergies",selected:'yes'===k,onPress:()=>w('yes')})]}),'yes'===k?(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:a.ALLERGENS.map(e=>(0,p.jsx)(o.Chip,{label:e.short,selected:C.includes(e.id),onPress:()=>S(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},e.id))}):null,G.length?(0,p.jsxs)(o.Banner,{kind:"warn",title:"Check with staff",children:[G.map(e=>e.name).join(', ')," ",G.length>1?'contain':'contains'," or may contain an allergy you picked. The kitchen will see your allergies on the ticket."]}):null]})}):null,s.open?(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Who's the order for?"}),(0,p.jsx)(t.TextInput,{style:b,value:v,onChangeText:O,placeholder:"Your name (needed)",placeholderTextColor:u.colours.muted,maxLength:40,accessibilityLabel:"Your name, needed",testID:"table-name",autoComplete:"name"}),(0,p.jsx)(t.TextInput,{style:b,value:P,onChangeText:R,placeholder:"Phone number (optional)",placeholderTextColor:u.colours.muted,maxLength:20,keyboardType:"phone-pad",accessibilityLabel:"Phone number, optional",testID:"table-phone",autoComplete:"tel"}),P&&!(0,d.phoneOk)(P)?(0,p.jsx)(o.Muted,{center:!0,children:"Please check the phone number, or leave it blank."}):null,(0,p.jsx)(o.Muted,{center:!0,children:"We only use these for this order."}),(0,p.jsx)(t.TextInput,{style:b,value:I,onChangeText:M,placeholder:"Note for the staff (optional)",placeholderTextColor:u.colours.muted,maxLength:300,accessibilityLabel:"Note for the staff (optional)"})]}):null,(0,p.jsx)(r.default,{testID:"pay-placeholder",children:(0,p.jsxs)(o.Card,{children:[(0,p.jsx)(o.T,{center:!0,weight:"semibold",children:"Paying"}),(0,p.jsx)(o.T,{center:!0,children:d.PAY_WORDS}),(0,p.jsx)(o.Muted,{center:!0,children:"No card details are asked for or kept in this app."})]})})]})};var e,t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),r=(e=s)&&e.__esModule?e:{default:e},o=_r(_d[4]),a=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]);const b={borderWidth:1,borderColor:u.colours.border,borderRadius:10,padding:10,color:u.colours.text,backgroundColor:u.colours.surface2}},1276,[796,829,34,102,794,830,836,1131,1277,848,840,25]); __d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tablePublic",{enumerable:!0,get:function(){return s}}),e.sendTableOrder=async function(t,r,a){if(!await(0,n.guestSession)())throw new Error('No connection. Try again when you are back online.');const o=await(0,n.rpc)('guest_table_order_v2',{p_phone:(a.phone??'').trim().slice(0,20)||null,p_token:t,p_lines:r.map(t=>({id:t.id,qty:t.qty,note:t.note.trim().slice(0,140)})),p_note:a.note.trim().slice(0,300)||null,p_allergies:a.allergies.map(t=>({allergen:t.allergen,severity:t.severity})),p_name:a.name.trim().slice(0,40)||null});if(!o||!1===o.ok||!o.id)throw new Error(o?.reason||'This table code isn\u2019t working any more. Please ask a member of staff.');return{id:o.id,ref:o.ref,held:!!o.held,totalPence:o.totalPence}},e.myTableOrders=async function(t){return await(0,n.guestSession)()?await(0,n.rpc)('guest_table_my_orders',{p_token:t})??[]:[]},e.loadTableSettings=async function(){const{data:t,error:n}=await a().from('table_order_settings').select('*').eq('venue_id',o()).maybeSingle();if(n)throw n;return(0,r.fromRow)(t)},e.saveTableSettings=async function(t,n){const{error:s}=await a().from('table_order_settings').upsert({venue_id:o(),...(0,r.toRow)(t),updated_at:(new Date).toISOString(),updated_by:n.slice(0,80)});if(s)throw s},e.listTableCodes=async function(){const{data:t,error:n}=await a().from('table_qr_codes').select('table_no, token, created_at').eq('venue_id',o()).eq('is_on',!0);if(n)throw n;return(t??[]).map(t=>({table:String(t.table_no),token:String(t.token),createdAt:String(t.created_at)})).sort((t,n)=>Number(t.table)-Number(n.table))},Object.defineProperty(e,"tableReadiness",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"makeTableCodes",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"renewTableCode",{enumerable:!0,get:function(){return u}}),e.watchTableSettings=function(t){const r=n.useSync.getState().venueId;if(!r)return()=>{};const o=a().channel(`tos-${r}-${Math.random().toString(36).slice(2,8)}`).on('postgres_changes',{event:'*',schema:'public',table:'table_order_settings',filter:`venue_id=eq.${r}`},()=>t()).subscribe();return()=>{a().removeChannel(o)}};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const a=()=>(0,t.getSupabase)(),o=()=>{const t=n.useSync.getState().venueId;if(!t)throw new Error('Not connected to the venue yet.');return t},s=t=>(0,n.rpc)('table_public',{p_token:t});const l=()=>(0,n.rpc)('table_order_readiness',{p_venue:o()}),c=t=>(0,n.rpc)('table_qr_make',{p_venue:o(),p_tables:t}),u=t=>(0,n.rpc)('table_qr_renew',{p_venue:o(),p_table:t})},1277,[931,985,1131]); __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 l}});var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]);function l(){return(0,t.canShow)('display')?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.DisplayBoard,{}),(0,c.jsx)(u.DisplayPairing,{})]}):(0,c.jsx)(n.Redirect,{href:t.ENTRY[t.APP_VARIANT]})}},1278,[30,34,846,1279,1334,25]); -__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Pe}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:G,subHeader:Le,noVoice:We=!1}={}){const Oe=(0,P.default)(),Ve=g??Oe.width,Ue=Oe.height,Ke=Ve<700,qe=Ve>=Ue,Ye=!Ke&&qe&&Ve>=600,Qe=Ye,Je=Math.round(Math.min(520,Math.max(Ve>=1e3?448:280,.3*Ve))),Xe=S.default.useRef(null),Ze=S.default.useRef(0),[et,tt]=(0,v.useState)({w:0,h:0}),lt=(0,q.useOwner)(e=>e.site),st=(0,V.useRestaurant)(lt);(0,me.useAlertWatcher)(lt,{enabled:!e});const it=(0,V.useOrders)(lt),ot=(0,V.useBookings)(lt),nt=(0,V.useEvents)(lt),at=(0,V.useStore)(e=>e.skipMinutes),rt=(0,V.useStore)(e=>e.clock.mode),dt=(0,V.useNow)(5e3),ct=(0,q.useOwner)(e=>e.staff),ut=(0,q.useOwner)(e=>e.attendance),ht=(0,q.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,Q.ensureAttendance)((0,F.ymd)(dt),dt)},[(0,F.ymd)(dt)]);const gt=ut.filter(e=>e.in&&!e.out&&dt.getTime()-new Date(e.in).getTime()<72e6&&dt.getTime()>=new Date(e.in).getTime()),bt=Ee(ct.find(e=>e.id===gt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,bt,!e);const yt=(0,F.ymd)(dt),pt=(0,T.useTravelDay)('display',yt),xt=(0,Y.useFrontDoor)(yt,qe),ft=(0,J.useDisplaySettings)(lt),mt=ft.privacy,jt=(0,ne.useSaverSync)(),wt=(0,J.usePlan)(lt),kt=(0,J.useFloor)(e=>e.live[lt]),It=(0,je.useBlocks)(e=>e.blocks),[Dt,vt]=(0,v.useState)('plan'),[St,Ct]=(0,v.useState)('all'),[Tt,$t]=(0,v.useState)(null),[Bt,Rt]=(0,v.useState)(null),[Lt,Wt]=(0,v.useState)(null),[zt,Mt]=(0,v.useState)(!1),[Ht,Pt]=(0,v.useState)(!1),[Et,At]=(0,v.useState)(null),[Ot,Nt]=(0,v.useState)(!1),[_t,Gt]=(0,v.useState)(!1),[Ft,Vt]=(0,v.useState)(null),[Ut,Kt]=(0,v.useState)(null),[qt,Yt]=(0,v.useState)(null),Qt=S.default.useRef(0),Jt=e=>{Qt.current=Date.now(),Yt(e)};S.default.useEffect(()=>{if(!qt)return;const e=setInterval(()=>{Date.now()-Qt.current>=De.DAY_IDLE_MS&&Yt(null)},5e3);return()=>clearInterval(e)},[qt]);const Xt=(0,V.useWaitlist)(lt),Zt=(0,V.useStore)(e=>e.walkIns[lt]??0),[el,tl]=(0,v.useState)(!1),[ll,sl]=(0,v.useState)(!1),[il,ol]=(0,v.useState)(!1);(0,N.useReviewAlerts)(lt);const[nl,al]=(0,v.useState)({view:0,content:0}),[rl,dl]=(0,v.useState)(null);S.default.useEffect(()=>{rl&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:rl,timeoutMs:4500,big:!0,testID:'floor-toast'}),dl(null))},[rl]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[cl,ul]=(0,v.useState)(null),hl=S.default.useRef(0),[gl,bl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!cl)return;hl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-hl.current;if(e>=Pe)return ul(null),void dl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');bl(e>=105e3?Math.ceil((Pe-e)/1e3):null)},1e3);return()=>clearInterval(e)},[cl]);const yl=e=>e.date!==yt?Wt({title:`Guest details \xb7 ${(0,De.dayWord)(e.date,yt)} ${e.time}`,body:(0,He.jsx)(He.Fragment,{children:(0,ye.bookingDetails)(e)})}):Wt({title:`Guest details \xb7 ${e.time}`,body:(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Fe,{rid:lt,id:e.id,turnBase:st.settings.turnMins}),e.walkIn?null:(0,He.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Wt(null),At(e.id)},style:{minHeight:56}}),e.walkIn?(0,He.jsx)(ue.CancelWalkInButton,{rid:lt,b:e,big:!0,onDone:e=>{Wt(null),dl(e)}}):null,e.walkIn?(0,He.jsx)(ue.ReinstateWalkInButton,{rid:lt,b:e,today:yt,onDone:e=>{Wt(null),dl(e)}}):null,(0,ye.bookingDetails)(e)]})}),pl=ot.filter(e=>e.date===yt).sort((e,t)=>e.time.localeCompare(t.time)),xl=pl.filter(e=>!['cancelled','noshow'].includes(e.status)),fl=it.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),ml=(0,v.useMemo)(()=>(0,d.forecastToday)(st,ot,it,nt,dt),[st,ot,it,nt,dt.getTime()/6e4|0]),jl=(0,je.closedAreasAt)(It,lt,yt,(0,F.hm)(dt)),wl=[...jl].join(','),kl=(0,v.useMemo)(()=>(0,X.floorView)(wt,ot,it,kt??{},dt,st.settings.turnMins,jl),[wt,ot,it,kt,dt.getTime(),wl]),Il=(0,be.hoursFor)(st,dt),Dl=Il?.open??new Date(`${yt}T12:00:00`),vl=Il?.close??new Date(`${yt}T21:00:00`),Sl=(0,F.addMins)(Dl,-Dl.getMinutes()),Cl=(0,F.addMins)(vl,90),Tl=e=>new Date(`${yt}T${e}:00`),$l=(0,je.blocksOn)(It,lt,yt).map(e=>({from:Tl(e.from),to:Tl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(st,dt,yt)),Bl=Object.keys(kl).filter(e=>'blocked'===kl[e]?.status),Rl=qt&&qt!==yt?qt:yt,Ll=Rl!==yt,Wl=(0,De.dayWord)(Rl,yt),zl=/^(Today|Yesterday|Tomorrow)$/.test(Wl),Ml=Ll?(0,De.bookingsForDay)(ot,Rl,yt).sort((e,t)=>e.time.localeCompare(t.time)):pl,Hl=(0,F.parseYmd)(Rl);Hl.setHours(12);const Pl=Ll?(0,be.hoursFor)(st,Hl):Il,El=Pl?.open??new Date(`${Rl}T12:00:00`),Al=Pl?.close??new Date(`${Rl}T21:00:00`),Ol=e=>new Date(`${Rl}T${e}:00`),Nl=[...Ll?(0,je.blocksOn)(It,lt,Rl).map(e=>({from:Ol(e.from),to:Ol(e.to),label:e.reason??'Paused'})):$l,...Ll?(0,i.queuedServicePauses)(st,Hl,Rl):[]],_l=(0,i.queuedServiceSessions)(st,Hl),Gl=l.IS_QUEUED_VENUE&&(void 0===_l||!_l.length),Fl=(0,He.jsxs)(H.default,{testID:"queued-hours-gate",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:void 0===_l?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,He.jsx)(A.Muted,{children:s.queuedVenues[lt]?.hours.note})]}),Vl=Ll?Pl||Ml.length?RlLl?(0,X.dayFloorView)(wt,Ml,Rl):kl,[Ll,wt,Ml,Rl,kl]),[Kl,ql]=(0,v.useState)(null),Yl=Ll?Ml.filter(e=>!['cancelled','noshow'].includes(e.status)):xl,Ql=Yl.reduce((e,t)=>e+t.partySize,0),Jl=(0,c.coversSplit)(Yl,Rl),Xl=(0,ve.cancelledDayTally)(ot,Rl),Zl=(0,Se.cancellationsFor)(ot,Rl,e=>e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)','')),es=(0,ve.cancelledTallyWords)(Xl,zl?Wl.toLowerCase():Ll?`on ${Wl}`:'today'),ts=It.filter(e=>e.rid===lt&&e.date===Rl&&!e.removedAt),ls=(0,Ie.chartBands)(ts,60*El.getHours()+El.getMinutes(),60*Al.getHours()+Al.getMinutes()),ss=new Set((0,Ie.blockedHours)(ls)),is=dt.getHours()+(dt.getMinutes()>=30?1:0),os=ml.hours.filter(e=>e.hour>=is&&!ss.has(e.hour)),ns=os.reduce((e,t)=>e+t.coversHigh,0),as=os.reduce((e,t)=>e+t.coversLow,0),rs=Math.round((as+ns)/2),ds=!ml.example&&ml.open&&ml.enough&&ns>0?`Usually ${(0,d.coversRange)(rs,rs)} more`:void 0,cs=async(e,t)=>{const l=kl[e]?.booking;if(!l||e===t)return;const s=kl[t]?.status;if(s&&!['free','soon'].includes(s))return void dl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${X.STATUS[s].label.toLowerCase()}. Pick a free table.`);await V.repo.bookings.update(l.id,{table:t});const i=kt?.[e]?.stage;J.useFloor.getState().setLive(lt,t,{stage:i??'seated',dirty:!1}),J.useFloor.getState().setLive(lt,e,{stage:void 0,dirty:!0}),dl(`${(0,ae.privName)(l,mt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},us=Ut?ot.find(e=>e.id===Ut.id):void 0,hs=Ut&&us?(()=>{const e=us.walkIn?(0,ae.privName)(us,mt):Ee(us.name),t=(0,ge.seatsOf)(wt,Ut.tables).total,l=(0,ge.seatLine)(t,us.partySize),s=(0,ge.pickClashes)(us,Ut.tables,ot.filter(e=>e.date===us.date),st.settings.turnMins),i=(0,ge.tableKey)(Ut.tables)!==(0,ge.tableKey)((0,J.tablesOf)(us.table));return(0,He.jsxs)(H.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:U.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,padding:10},children:[(0,He.jsxs)(H.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,De.dayWord)(us.date,yt)} ${us.time}. Tap tables on the plan to add or take them off. ${(0,ge.tablesWords)(Ut.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,De.dayWord)(us.date,yt)," ",us.time]}),(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[(0,ge.tablesWords)(Ut.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,He.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,He.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,ge.tablesWords)(Ut.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(us){try{await(0,he.saveBookingTables)(lt,us,Ut.tables),dl((0,ge.savedWords)(e,us.partySize,Ut.tables,t))}catch(t){dl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Kt(null)}else Kt(null)}}),(0,He.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Kt(null)})]})]})})():null,gs=wt.areas.filter(e=>wt.tables.some(t=>t.areaId===e.id)),bs=e=>{const t=wt.tables.filter(t=>t.areaId===e);return Ll?`${t.filter(e=>!Ul[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(kl[e.name]?.status??'free')).length}/${t.length} free`},ys='all'===St||gs.some(e=>e.id===St)?St:'all',ps=e=>(0,He.jsx)(Z.FloorCanvas,{plan:wt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Ye,big:!0,view:Ul,privacy:mt,turnBase:st.settings.turnMins,highlight:Ut?Ut.tables:Bt?[Bt]:void 0,onTap:e=>{return t=e.name,void(Ut?Kt(e=>e?{...e,tables:(0,ge.toggleTable)(e.tables,t)}:e):Ll?ql(t):Bt?(t!==Bt&&cs(Bt,t),Rt(null)):$t(t));var t},onDrop:(e,t)=>Ut||Ll?void 0:cs(e.name,t.name)}),xs=Ke?1:qe||gs.length>2?2:1,fs=e=>{const t=wt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ms=[];for(let e=0;e{const t=(0,Z.areaBounds)(wt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,Z.minReadableScale)(wt,e.id)}}),et.w,et.h):null,ws=e=>(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',height:ee.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:bs(e.id)})]}),ks=(0,He.jsx)(H.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-et.w)>1||Math.abs(l-et.h)>1)&&tt({w:t,h:l})},children:js?(0,He.jsx)(M.default,{style:{flex:1},scrollEnabled:js.scroll,showsVerticalScrollIndicator:js.scroll,contentContainerStyle:{gap:ee.GRID_GAP},children:js.rows.map((e,t)=>(0,He.jsx)(H.default,{style:{height:js.rowHeights[t],flexDirection:'row',gap:ee.GRID_GAP},children:e.map(e=>{const t=gs.find(t=>t.id===e);return(0,He.jsxs)(H.default,{testID:`area-cell-${e}`,style:{width:js.cellW,gap:2},children:[ws(t),(0,He.jsx)(H.default,{style:{flex:1},children:ps(e)})]},e)})},t))}):null}),Is=(0,He.jsxs)(H.default,{testID:"venue-plan",style:{flex:Ke?void 0:1,gap:10,minWidth:0},children:[(0,He.jsx)(a.TableNumberWarning,{plan:wt}),wt.tables.length?null:(0,He.jsxs)(H.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,He.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,He.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,He.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,He.jsx)(_e,{chipId:"all",compact:!Ke,label:"Whole venue",selected:'all'===ys,onPress:()=>Ct('all')},"__all"),...gs.map(e=>(0,He.jsx)(_e,{chipId:e.id,compact:!Ke,label:`${e.name}${(0,te.areaMarks)(e)}`,colour:(0,U.brandColour)(e.colour),sub:Ke?jl.has(e.id)?'closed':ys===e.id?bs(e.id):void 0:void 0,selected:ys===e.id,onPress:()=>Ct(e.id)},e.id))];return Ke?(0,He.jsx)(H.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,He.jsx)(M.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;al(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>al(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:nl.view>0&&nl.content>0&&nl.content<=nl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:nl.view>0&&nl.content<=nl.view+1?'100%':void 0},children:e})})(),(0,He.jsx)(h.FloorLegend,{}),hs,Bt?(0,He.jsxs)(A.Row,{gap:8,style:{backgroundColor:U.colours.goldTint,borderRadius:10,padding:8},children:[(0,He.jsxs)(A.T,{weight:"semibold",colour:U.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Bt),": tap the new table."]}),(0,He.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Rt(null)})]}):null,'all'===ys&&Ye?ks:'all'===ys?(0,He.jsx)(H.default,{style:{flex:Ke?void 0:1,gap:12,minHeight:Qe?void 0:360},children:ms.map((e,t)=>(0,He.jsxs)(H.default,{style:{flex:Ke?void 0:Math.max(.3,...e.map(e=>fs(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,He.jsxs)(H.default,{style:{flex:1,gap:2},children:[Ke?(0,He.jsxs)(H.default,{style:{alignItems:'center',gap:4},children:[(0,He.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{center:!0,children:bs(e.id)})]}):(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,U.brandColour)(e.colour),children:[e.name,(0,te.areaMarks)(e)]}),jl.has(e.id)?(0,He.jsx)(A.T,{size:13,weight:"semibold",colour:U.colours.blue,children:"Closed for weather"}):(0,He.jsx)(A.Muted,{children:bs(e.id)})]}),(0,He.jsx)(H.default,{style:Ke?{height:Math.max(280,Math.round((Ve-40)*fs(e.id)))}:{flex:1},children:ps(e.id)})]},e.id)),e.length{if(Ll)return void Vt(e.id);const t=(0,J.tablesOf)(e.table)[0];t&&kl[t]?$t(t):yl(e)}},Rl)}),vs='timeline'===Dt,Ss=Ll?(0,He.jsxs)(H.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:U.colours.gold,backgroundColor:U.colours.goldTint},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:zl?`Showing ${Wl} \xb7 ${(0,F.niceDate)((0,F.parseYmd)(Rl))}`:`Showing ${(0,De.dayWord)(Rl,yt)}`}),(0,He.jsx)(H.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${es}. Showing ${(0,De.dayLong)(Rl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,He.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Kt(null),Jt(null)},style:{minHeight:44}})]}):null,Cs=(0,He.jsx)(H.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:Ke?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===vs;return(0,He.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},onPress:()=>vt(e),style:{flex:Ke?1:void 0,minHeight:Ke?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?U.colours.gold:'transparent',...$e.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,He.jsx)(A.T,{size:Ke?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ts=(0,u.useBookingWrite)(),$s=e=>(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(Be.BigAction,{premium:!0,label:"Walk-in",onPress:xt.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"New booking",onPress:xt.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint}),(0,He.jsx)(Be.BigAction,{premium:!0,label:"Edit booking",onPress:()=>Pt(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ts.ok,accessibilityHint:Ts.hint})]});(0,Me.useDisplayNotices)(lt,!e);const Bs=Ke?180:168,[Rs,Ls]=(0,v.useState)(Bs),Ws=S.default.useRef(Bs),zs=S.default.useRef(null),Ms=S.default.useRef(null),Hs=()=>{const e=zs.current,t=Ms.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ue<820?8:12,o=44+(Ue<820?4:8),n=i>Ws.current?Math.ceil(i-Ws.current):ke.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Bs,Math.floor(t-s-l)-n-o));Math.abs(Ws.current-a)>=2&&(Ws.current=a,Ls(a))})})};S.default.useEffect(()=>{const e=setTimeout(Hs,60);return()=>clearTimeout(e)},[Ve,Ue]);const Ps=(0,He.jsxs)(H.default,{ref:Ms,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),Hs()},style:{flexDirection:'row',flexWrap:Ve>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:Ke?12:6,justifyContent:Ke?'center':void 0,borderTopWidth:1,borderTopColor:U.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,He.jsx)(ze.DisplayClockButton,{}),(0,He.jsx)(se.HoldToEdit,{quiet:!0,onUnlock:()=>{bl(null),ul({at:Date.now()})},onHint:()=>dl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,He.jsx)(we.BlockBookingsButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,display:!0,day:Rl}),wt.areas.some(e=>e.outdoor)?(0,He.jsx)(we.CloseGardenButton,{rid:lt,r:st,now:dt,by:bt,quiet:!0,short:!0}):null,(0,He.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>ol(!0),style:({pressed:e})=>({...$e.look.quiet(e),flexGrow:1}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,He.jsx)(p.GiftQrButton,{rid:lt,venue:st.name})]}),Es=fl.length?(0,He.jsxs)(H.default,{testID:"takeaway-panel",style:[$e.look.panel,{overflow:'hidden'}],children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,He.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,He.jsxs)(A.T,{size:12,colour:U.colours.muted,children:[fl.length," live"]})]}),(0,He.jsx)(H.default,{style:{padding:10},children:(0,He.jsx)(Ge,{list:fl,me:bt,compact:!0,bookings:ot})})]}):null,As=(Te.DueToday,Ll?Ml:pl.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Os=Ll?zl?`${Wl}\u2019s guests`:`Guests ${Wl}`:'Today\u2019s guests',Ns=(0,He.jsxs)(He.Fragment,{children:[0===As.length?(0,He.jsx)(A.Muted,{children:Ll?Rl{const t=(0,K.isSeatedHighlight)(e.status,{otherDay:Ll}),l=(0,re.guestRowText)(e,{name:e.walkIn?(0,ae.privName)(e,mt):(e.name??'').replace(' (example)',''),seated:t}),s=t?K.SEATED_FG:U.colours.text,i=t?K.SEATED_MUTED:U.colours.muted,o=t?K.SEATED_FG:U.colours.gold,n=l.depositWarn?U.colours.amber:t?K.SEATED_FG:U.colours.goldLight;return(0,He.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:Ll?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Gt(!1),Vt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,K.seatedHighlightStyle)({backgroundColor:e?U.colours.goldLight:U.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:U.colours.hairline,backgroundColor:e?U.colours.tilePressed:'transparent'},children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,He.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,He.jsx)(H.default,{style:{paddingTop:2},children:(0,He.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':U.colours.amber,ink:t?U.colours.gold:U.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,He.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,He.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,He.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,He.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,He.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,He.jsx)(H.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,He.jsx)(de.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,He.jsx)(Ce.CancellationsSection,{items:Zl,dayWord:Ll?zl?Wl.toLowerCase():`on ${Wl}`:'today'})]}),_s=(0,He.jsx)(M.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Ns}),Gs=W.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Gt(!1)}}),Fs=(0,He.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Os}, ${As.length}`,accessibilityState:{expanded:_t},'aria-expanded':_t,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Gt(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:_t?U.colours.gold:U.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?U.colours.tilePressed:_t?U.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,He.jsx)(A.T,{size:16,weight:"bold",colour:U.colours.gold,children:As.length}),(0,He.jsx)(H.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(H.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,He.jsxs)(A.T,{size:13,weight:"semibold",colour:U.colours.goldLight,numberOfLines:1,children:[Os," ",_t?'\u2039':'\u203a']})})})]}),Vs=_t?(0,He.jsxs)(H.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,He.jsxs)(H.default,{testID:"guests-drawer",...Gs.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ve)),backgroundColor:U.colours.surface,borderRightWidth:1,borderColor:U.colours.gold,borderRadius:14,...$e.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,He.jsxs)(A.T,{size:17,weight:"semibold",colour:U.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Os.toUpperCase()," (",As.length,")"]}),Xl.count?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:es}):null,(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Os}`,onPress:()=>Gt(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:18,colour:U.colours.muted,children:"\u2715"})})]}),_s]}),(0,He.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Os}`,accessibilityRole:"button",onPress:()=>Gt(!1),style:{flex:1}})]}):null,Us=Gl?Fl:l.IS_KIRKTON&&!Object.values(st.kitchenHours??{}).some(Boolean)?(0,He.jsxs)(H.default,{testID:"kirkton-hours-to-confirm",style:[$e.look.panel,{padding:14,gap:8}],children:[(0,He.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,He.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,He.jsx)(ke.DayGraph,{busyThreshold:(0,t.venueBusy)(st,ot,dt).busy,todays:Ml,open:El,close:Al,now:dt,turnBase:st.settings.turnMins,blocks:ts,pauses:Nl,compact:Ke,dense:!Ke,height:Ye?Rs:Bs,forecastNote:Ll?void 0:ds,emptyText:Vl,past:Rl{Ll?Gt(!0):vt('timeline')},Qs=(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',padding:Ue<820?8:12,paddingTop:Ue<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[pt?null:Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[pt?null:Ss,pt?(0,He.jsx)(M.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"})}):vs?Ds:Is,Vs]}),(0,He.jsxs)(H.default,{testID:"display-side",style:{width:Je,gap:Ue<820?4:8,minHeight:0},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:$s(!1)}),(0,He.jsx)(H.default,{style:{flexShrink:0},children:Cs}),pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:Ue<820,snug:Ue<820,tight:Ue<700,aside:`${Yl.length} ${1===Yl.length?'table':'tables'} booked${fl.length?` \xb7 ${fl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{ref:zs,testID:"day-graph-slot",onLayout:Hs,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Ks}),(0,He.jsxs)(M.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,He.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,He.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),Es,(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt})]})]})]});return(0,He.jsxs)(E.SafeAreaView,{style:{flex:1,backgroundColor:U.colours.bg},onTouchStart:()=>{Qt.current=Date.now()},onMouseDown:()=>{Qt.current=Date.now()},children:[Ke?(0,He.jsxs)(H.default,{style:{flex:1},children:[(0,He.jsxs)(M.default,{ref:Xe,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,He.jsx)(H.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,He.jsx)(f.ExitButton,{})}),(0,He.jsx)(_.RestaurantLogo,{rid:lt,size:64}),(0,He.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:st.name}),(0,He.jsx)(_.PoweredBy,{}),(0,He.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,He.jsx)(H.default,{accessible:!0,accessibilityLabel:`Current time ${(0,F.hm)(dt)}`,children:(0,He.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:U.colours.goldLight,children:(0,F.hm)(dt)})}),(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:"m"}),(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:"m"}),G]}),Le,qs,(0,He.jsx)(H.default,{testID:"phone-glance",style:{width:'100%'},children:(0,He.jsx)(Ne,{phone:!0,split:Jl,items:[{label:`Tables \xb7 ${Wl}`,value:Yl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Wl}`,value:Ql,testID:'badge-covers'},{label:'Takeaway',value:fl.length,alert:fl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Mt(!0)}]})}),(0,He.jsx)(H.default,{testID:"primary-actions",style:{gap:8},children:$s(!0)}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),Cs,(0,He.jsx)(H.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:vs?Ds:Is}),(0,He.jsxs)(H.default,{onLayout:e=>{Ze.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[$e.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,He.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:U.colours.goldLight,accessibilityRole:"header",children:[Os," (",As.length,")"]}),(0,He.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Os,style:{gap:4},children:Ns})]}),Es,Ks,(0,He.jsx)(H.default,{testID:"covers-dock",children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Xe.current?.scrollTo({y:Ze.current,animated:!0})})}),(0,He.jsxs)(H.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,He.jsx)(A.T,{center:!0,size:14,colour:mt?U.colours.muted:U.colours.amber,children:mt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,He.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,He.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>sl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ps]}),e?null:(0,He.jsx)(H.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:U.colours.hairline},children:(0,He.jsx)(R.VoiceSlot,{size:56})})]}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ve>=1e3?18:14,paddingVertical:Ue<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...$e.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,He.jsx)(H.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,He.jsx)(_.RestaurantBrand,{rid:st.id,size:Ve<900?32:40,beside:!0})}),(0,He.jsxs)(H.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,He.jsx)(A.T,{size:Ve<900?18:21,weight:"semibold",colour:U.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,F.hm)(dt)}),Ve>=900?(0,He.jsx)(A.T,{size:13,colour:U.colours.muted,children:(0,F.niceDate)(dt)}):null]})]}),pt?(0,He.jsx)(H.default,{style:{width:220}}):(0,He.jsx)(H.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:qs}),(0,He.jsxs)(H.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,He.jsx)(Re.ShellfishChip,{rid:lt,by:bt,app:"display",size:Ve<900?'xs':Ve<1100||Ue<700?'s':'m'}),(0,He.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>tl(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,He.jsx)(A.T,{size:15,weight:"semibold",colour:U.colours.muted,children:"?"})}),'simulated'===rt?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>at(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,He.jsx)(A.T,{size:11,colour:U.colours.muted,children:"+15"})}):null,e?null:(0,He.jsx)(f.ExitButton,{}),G,We?null:(0,He.jsx)(R.VoiceSlot,{size:44})]})]}),Le,pt?null:(0,He.jsxs)(H.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,He.jsx)(Ne,{splitOnly:!0,split:Jl,items:[]}),(0,He.jsx)(H.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ve>=1e3?18:14)+(e?0:52)+('simulated'===rt?52:0),zIndex:4},children:(0,He.jsx)(Re.SundayRoastChip,{rid:lt,by:bt,app:"display",size:Ve<1100||Ue<700?'s':'m'})})]}),Ye?Qs:(Js=(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{testID:"front-door-bar",style:{gap:10},children:[(0,He.jsx)(H.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:$s(!1)}),Cs]}),(0,He.jsx)(we.BlocksBanner,{rid:lt,now:dt,big:!0,by:bt}),pt?(0,He.jsx)(T.DayView,{rid:lt,day:pt,today:yt,app:"display"}):(0,He.jsx)(He.Fragment,{children:(0,He.jsxs)(H.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[Fs,(0,He.jsxs)(H.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Ss,vs?Ds:Is,Vs]})]})}),Es,pt?null:(0,He.jsx)(H.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,He.jsx)(C.CoversToday,{rid:lt,day:Rl,sound:(0,$.flapSoundOn)(),onPress:Ys})}),pt?null:(0,He.jsx)(H.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Bs+ke.DAY_GRAPH_CHROME},children:Ks})]}),(0,He.jsx)(M.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:Js})),Ps]}),(0,He.jsx)(j.SoldOutStrip,{rid:lt,by:bt,onOpen:()=>ol(!0)}),(0,He.jsx)(w.SoldOutSheet,{visible:il,onClose:()=>ol(!1),rid:lt,by:bt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,He.jsx)(y.TableOrderCue,{rid:lt}),xt.elements,Ht?(0,He.jsx)(b.EditBookingPicker,{rid:lt,today:yt,who:bt,hidePrivate:!0,onClose:()=>Pt(!1)}):null,Et?(0,He.jsx)(b.EditBookingSheet,{rid:lt,id:Et,who:bt,hidePrivate:!0,onClose:()=>At(null)}):null,Tt?(0,He.jsx)(ye.TableSheet,{rid:lt,name:Tt,view:kl,plan:wt,todays:pl,now:dt,privacy:mt,turnBase:st.settings.turnMins,onClose:()=>$t(null),onWalkIn:e=>xt.openWalkInAt(e),onMove:e=>Rt(e),onDetails:yl}):null,Kl?(()=>{const e=Ul[Kl],t=e?.dayBookings??[];return(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>ql(null),title:`${(0,r.tableNumbers)(Kl)} \xb7 ${zl?Wl:(0,De.dayLong)(Rl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,He.jsxs)(A.T,{size:16,colour:U.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${zl?Wl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${zl?Wl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,ae.privName)(e,mt):Ee(e.name);return(0,He.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,ge.tablesWords)((0,J.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{ql(null),Vt(e.id)},style:{minHeight:56}},e.id)}),(0,He.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>ql(null),style:{minHeight:56}})]})})():null,Ft?(()=>{const e=ot.find(e=>e.id===Ft);return e?(0,He.jsx)(ce.GuestActionsSheet,{rid:lt,b:e,name:e.walkIn?(0,ae.privName)(e,mt):Ee(e.name),view:kl,now:dt,otherDay:e.date!==yt,turnBase:st.settings.turnMins,onClose:()=>Vt(null),onDetails:yl,onDone:dl,onPickOnPlan:(e,t)=>{Gt(!1),vt('plan'),Ct('all'),Kt({id:e.id,tables:t})}}):null})():null,Lt?(0,He.jsx)(ye.DetailsPanel,{title:Lt.title,onClose:()=>Wt(null),children:Lt.body}):null,Ot?(0,He.jsx)(ye.ServiceSummary,{r:st,todays:pl,orders:it,waitlistAll:Xt,walkInCount:Zt,onClose:()=>Nt(!1)}):null,el?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>tl(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,He.jsx)(h.FloorLegend,{}),(0,He.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>tl(!1)})]}):null,ll?(0,He.jsxs)(A.Sheet,{visible:!0,onClose:()=>sl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,He.jsx)(O.ReviewsSection,{rid:lt,mode:"read",venueName:st.name}),(0,He.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>sl(!1)})]}):null,zt?(0,He.jsxs)(ye.DetailsPanel,{title:"Takeaway",onClose:()=>Mt(!1),children:[(0,He.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,He.jsx)(Ge,{list:fl,me:bt,bookings:ot})]}):null,cl?(0,He.jsx)(H.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:U.colours.bg},children:(0,He.jsx)(le.PlanDesigner,{initial:wt,venue:st.name,mode:"display",startStep:"arrange",onActivity:()=>{hl.current=Date.now(),null!==gl&&bl(null)},notice:null!==gl?`Locking again in ${gl} s \xb7 touch to keep editing`:null,onSave:e=>{J.useFloor.getState().setPlan(lt,e),ul(null),dl('Table plan saved. Editing is locked again.')},onCancel:()=>{ul(null),dl('No changes kept. Editing is locked again.')}},cl.at)}):null,e?null:(0,He.jsx)(oe.Screensaver,{rid:lt,idleMins:ft.idleMins,pinOn:ft.pinOn,wake:ft,tonightCards:ft.tonightCards,cfg:jt}),e?null:(0,He.jsx)(xe.PrintHost,{rid:lt}),e?null:(0,He.jsx)(pe.AlertHost,{variant:"display",rid:lt,skipTakeaway:!0}),e?null:(0,He.jsx)(B.SeatAllergenReminder,{rid:lt}),e?null:(0,He.jsx)(fe.TakeawayTakeover,{rid:lt,me:bt})]});var Js};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),z=e(_r(_d[31])),M=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=_r(_d[35]),A=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),ze=_r(_d[85]),Me=_r(_d[86]),He=_r(_d[87]);const Pe=12e4,Ee=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Oe=e=>e.slotTime?(0,F.hm)(new Date(e.slotTime)):'ASAP';function Ne({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,He.jsxs)(H.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,He.jsx)(H.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,He.jsxs)(H.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,He.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?U.colours.amber:U.colours.text,children:e.value}),(0,He.jsx)(A.T,{size:l?14:12,colour:U.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,He.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,He.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,He.jsx)(H.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,He.jsx)(A.T,{size:14,colour:U.colours.muted,children:"No Covers yet"}):(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(H.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:U.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,He.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,He.jsxs)(H.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:U.colours.gold},children:[(0,He.jsx)(H.default,{style:{width:`${s.walkInPct}%`,backgroundColor:U.colours.gold}}),(0,He.jsx)(H.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function _e({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,He.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,He.jsx)(H.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,He.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?U.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,He.jsx)(A.T,{size:12,colour:U.colours.muted,children:l}):null]})}function Ge({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,We.statusBlock)(e,t,(0,We.linkedBooking)(e,s));return e.length?(0,He.jsx)(H.default,{style:{gap:8},children:e.map(e=>(0,He.jsxs)(H.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:U.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?U.colours.ok:e.allergies.length?U.colours.red:U.colours.gold},children:[(0,He.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,He.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Oe(e)," \xb7 ",Ee(e.customerName)]}),(0,He.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,He.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,He.jsxs)(A.T,{size:14,weight:"semibold",colour:U.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,G.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,He.jsx)(Le.AllergyChain,{o:e,me:t,compact:!0}):null,(0,He.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,He.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>V.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,He.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,He.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>V.repo.orders.setStatus(e.id,'collected',t)}):null,(0,He.jsx)(xe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,He.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Fe({rid:e,id:t,turnBase:l}){const s=(0,V.useBookings)(e).find(e=>e.id===t);return s?(0,He.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1279,[1121,5,6,1280,798,822,1094,829,1120,1281,1282,1283,1091,1115,1284,1285,1287,1288,1289,1130,977,1099,1290,34,1073,1148,1033,1087,1116,1291,380,402,295,102,426,36,794,1182,1186,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1292,1107,1293,1296,1298,1301,1304,1300,1305,1307,1308,1112,1093,1095,852,1310,1171,1311,1181,1173,1011,1316,1324,1326,1076,1114,1328,1329,1330,1143,1331,1142,1136,838,1332,1333,25]); +__d(function(_g,_r,_i,_a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),Object.defineProperty(_e2,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return Ee}}),_e2.DisplayBoard=function({embedded:e=!1,boardW:g,headerExtra:F,subHeader:We,noVoice:Me=!1}={}){const Ne=(0,E.default)(),Ue=g??Ne.width,Ke=Ne.height,qe=Ue<700,Ye=Ue>=Ke,Qe=!qe&&Ye&&Ue>=600,Je=Qe,Xe=Math.round(Math.min(520,Math.max(Ue>=1e3?448:280,.3*Ue))),Ze=S.default.useRef(null),et=S.default.useRef(0),[tt,lt]=(0,v.useState)({w:0,h:0}),st=(0,Y.useOwner)(e=>e.site),it=(0,U.useRestaurant)(st);(0,je.useAlertWatcher)(st,{enabled:!e});const ot=(0,U.useOrders)(st),nt=(0,U.useBookings)(st),at=(0,U.useEvents)(st),rt=(0,U.useStore)(e=>e.skipMinutes),dt=(0,U.useStore)(e=>e.clock.mode),ct=(0,U.useNow)(5e3),ut=(0,Y.useOwner)(e=>e.staff),ht=(0,Y.useOwner)(e=>e.attendance),gt=(0,Y.useOwner)(e=>e.shifts);S.default.useEffect(()=>{(0,J.ensureAttendance)((0,V.ymd)(ct),ct)},[(0,V.ymd)(ct)]);const bt=ht.filter(e=>e.in&&!e.out&&ct.getTime()-new Date(e.in).getTime()<72e6&&ct.getTime()>=new Date(e.in).getTime()),yt=Oe(ut.find(e=>e.id===bt[0]?.staffId)?.name)||'Duty Manager';(0,k.useSoldOutLink)(!1,yt,!e);const pt=(0,V.ymd)(ct),xt=(0,T.useTravelDay)('display',pt),ft=(0,Q.useFrontDoor)(pt,Ye),mt=(0,X.useDisplaySettings)(st),jt=mt.privacy,wt=(0,ae.useSaverSync)(),kt=(0,X.usePlan)(st),It=(0,X.useFloor)(e=>e.live[st]),Dt=(0,we.useBlocks)(e=>e.blocks),[vt,St]=(0,v.useState)('plan'),[Ct,Tt]=(0,v.useState)(!1),[$t,Bt]=(0,v.useState)('all'),[Rt,Lt]=(0,v.useState)(null),[Wt,Mt]=(0,v.useState)(null),[zt,Ht]=(0,v.useState)(null),[Pt,Et]=(0,v.useState)(!1),[Ot,At]=(0,v.useState)(!1),[Nt,_t]=(0,v.useState)(null),[Gt,Ft]=(0,v.useState)(!1),[Vt,Ut]=(0,v.useState)(!1),[Kt,qt]=(0,v.useState)(null),[Yt,Qt]=(0,v.useState)(null),[Jt,Xt]=(0,v.useState)(null),Zt=S.default.useRef(0),el=e=>{Zt.current=Date.now(),Xt(e)};S.default.useEffect(()=>{if(!Jt)return;const e=setInterval(()=>{Date.now()-Zt.current>=ve.DAY_IDLE_MS&&Xt(null)},5e3);return()=>clearInterval(e)},[Jt]);const tl=(0,U.useWaitlist)(st),ll=(0,U.useStore)(e=>e.walkIns[st]??0),[sl,il]=(0,v.useState)(!1),[ol,nl]=(0,v.useState)(!1),[al,rl]=(0,v.useState)(!1);(0,_.useReviewAlerts)(st);const[dl,cl]=(0,v.useState)({view:0,content:0}),[ul,hl]=(0,v.useState)(null);S.default.useEffect(()=>{ul&&((0,I.notify)({id:`floor-note:${Date.now()}`,title:ul,timeoutMs:4500,big:!0,testID:'floor-toast'}),hl(null))},[ul]),S.default.useEffect(()=>{if(!e)return(0,$.setDisplaySilent)(!0),()=>(0,$.setDisplaySilent)(!1)},[e]);const[gl,bl]=(0,v.useState)(null),yl=S.default.useRef(0),[pl,xl]=(0,v.useState)(null);S.default.useEffect(()=>{if(!gl)return;yl.current=Date.now();const e=setInterval(()=>{const e=Date.now()-yl.current;if(e>=Ee)return bl(null),void hl('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');xl(e>=105e3?Math.ceil((Ee-e)/1e3):null)},1e3);return()=>clearInterval(e)},[gl]);const fl=e=>e.date!==pt?Ht({title:`Guest details \xb7 ${(0,ve.dayWord)(e.date,pt)} ${e.time}`,body:(0,Pe.jsx)(Pe.Fragment,{children:(0,pe.bookingDetails)(e)})}):Ht({title:`Guest details \xb7 ${e.time}`,body:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ve,{rid:st,id:e.id,turnBase:it.settings.turnMins}),e.walkIn?null:(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Ht(null),_t(e.id)},style:{minHeight:56}}),e.walkIn?(0,Pe.jsx)(he.CancelWalkInButton,{rid:st,b:e,big:!0,onDone:e=>{Ht(null),hl(e)}}):null,e.walkIn?(0,Pe.jsx)(he.ReinstateWalkInButton,{rid:st,b:e,today:pt,onDone:e=>{Ht(null),hl(e)}}):null,(0,pe.bookingDetails)(e)]})}),ml=nt.filter(e=>e.date===pt).sort((e,t)=>e.time.localeCompare(t.time)),jl=ml.filter(e=>!['cancelled','noshow'].includes(e.status)),wl=ot.filter(Ae).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),kl=(0,v.useMemo)(()=>(0,d.forecastToday)(it,nt,ot,at,ct),[it,nt,ot,at,ct.getTime()/6e4|0]),Il=(0,we.closedAreasAt)(Dt,st,pt,(0,V.hm)(ct)),Dl=[...Il].join(','),vl=(0,v.useMemo)(()=>(0,Z.floorView)(kt,nt,ot,It??{},ct,it.settings.turnMins,Il),[kt,nt,ot,It,ct.getTime(),Dl]),Sl=(0,ye.hoursFor)(it,ct),Cl=Sl?.open??new Date(`${pt}T12:00:00`),Tl=Sl?.close??new Date(`${pt}T21:00:00`),$l=(0,V.addMins)(Cl,-Cl.getMinutes()),Bl=(0,V.addMins)(Tl,90),Rl=e=>new Date(`${pt}T${e}:00`),Ll=(0,we.blocksOn)(Dt,st,pt).map(e=>({from:Rl(e.from),to:Rl(e.to),label:e.reason??'Paused'})).concat((0,i.queuedServicePauses)(it,ct,pt)),Wl=Object.keys(vl).filter(e=>'blocked'===vl[e]?.status),Ml=Jt&&Jt!==pt?Jt:pt,zl=Ml!==pt,Hl=(0,ve.dayWord)(Ml,pt),Pl=/^(Today|Yesterday|Tomorrow)$/.test(Hl),El=zl?(0,ve.bookingsForDay)(nt,Ml,pt).sort((e,t)=>e.time.localeCompare(t.time)):ml,Ol=(0,V.parseYmd)(Ml);Ol.setHours(12);const Al=zl?(0,ye.hoursFor)(it,Ol):Sl,Nl=Al?.open??new Date(`${Ml}T12:00:00`),_l=Al?.close??new Date(`${Ml}T21:00:00`),Gl=e=>new Date(`${Ml}T${e}:00`),Fl=[...zl?(0,we.blocksOn)(Dt,st,Ml).map(e=>({from:Gl(e.from),to:Gl(e.to),label:e.reason??'Paused'})):Ll,...zl?(0,i.queuedServicePauses)(it,Ol,Ml):[]],Vl=(0,i.queuedServiceSessions)(it,Ol),Ul=l.IS_QUEUED_VENUE&&(void 0===Vl||!Vl.length),Kl=(0,Pe.jsxs)(P.default,{testID:"queued-hours-gate",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:void 0===Vl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Pe.jsx)(A.Muted,{children:s.queuedVenues[st]?.hours.note})]}),ql=zl?Al||El.length?Mlzl?(0,Z.dayFloorView)(kt,El,Ml):vl,[zl,kt,El,Ml,vl]),[Ql,Jl]=(0,v.useState)(null),Xl=zl?El.filter(e=>!['cancelled','noshow'].includes(e.status)):jl,Zl=Xl.reduce((e,t)=>e+t.partySize,0),es=(0,c.coversSplit)(Xl,Ml),ts=(0,Se.cancelledDayTally)(nt,Ml),ls=(0,Ce.cancellationsFor)(nt,Ml,e=>e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)','')),ss=(0,Se.cancelledTallyWords)(ts,Pl?Hl.toLowerCase():zl?`on ${Hl}`:'today'),is=Dt.filter(e=>e.rid===st&&e.date===Ml&&!e.removedAt),os=(0,De.chartBands)(is,60*Nl.getHours()+Nl.getMinutes(),60*_l.getHours()+_l.getMinutes()),ns=new Set((0,De.blockedHours)(os)),as=ct.getHours()+(ct.getMinutes()>=30?1:0),rs=kl.hours.filter(e=>e.hour>=as&&!ns.has(e.hour)),ds=rs.reduce((e,t)=>e+t.coversHigh,0),cs=rs.reduce((e,t)=>e+t.coversLow,0),us=Math.round((cs+ds)/2),hs=!kl.example&&kl.open&&kl.enough&&ds>0?`Usually ${(0,d.coversRange)(us,us)} more`:void 0,gs=async(e,t)=>{const l=vl[e]?.booking;if(!l||e===t)return;const s=vl[t]?.status;if(s&&!['free','soon'].includes(s))return void hl('dirty'===s?`${(0,r.tableNumbers)(t)} needs clearing first.`:`${(0,r.tableNumbers)(t)} is ${Z.STATUS[s].label.toLowerCase()}. Pick a free table.`);await U.repo.bookings.update(l.id,{table:t});const i=It?.[e]?.stage;X.useFloor.getState().setLive(st,t,{stage:i??'seated',dirty:!1}),X.useFloor.getState().setLive(st,e,{stage:void 0,dirty:!0}),hl(`${(0,re.privName)(l,jt)} moved ${(0,r.tableNumbers)(e)} \u2192 ${t}. ${(0,r.tableNumbers)(e)} needs clearing.`)},bs=Yt?nt.find(e=>e.id===Yt.id):void 0,ys=Yt&&bs?(()=>{const e=bs.walkIn?(0,re.privName)(bs,jt):Oe(bs.name),t=(0,be.seatsOf)(kt,Yt.tables).total,l=(0,be.seatLine)(t,bs.partySize),s=(0,be.pickClashes)(bs,Yt.tables,nt.filter(e=>e.date===bs.date),it.settings.turnMins),i=(0,be.tableKey)(Yt.tables)!==(0,be.tableKey)((0,X.tablesOf)(bs.table));return(0,Pe.jsxs)(P.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:K.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,padding:10},children:[(0,Pe.jsxs)(P.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,ve.dayWord)(bs.date,pt)} ${bs.time}. Tap tables on the plan to add or take them off. ${(0,be.tablesWords)(Yt.tables)}. ${l.text}.${s.length?` ${s.length} clash${1===s.length?'':'es'} with other bookings.`:''}`,children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,ve.dayWord)(bs.date,pt)," ",bs.time]}),(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[(0,be.tablesWords)(Yt.tables)," \xb7 ",l.text,s.length?` \xb7 ${[...new Set(s.map(e=>(0,r.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),(0,Pe.jsxs)(A.Row,{gap:8,wrap:!0,children:[(0,Pe.jsx)(A.Button,{testID:"plan-pick-save",label:s.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${s.length?'Save anyway':'Save'}, ${(0,be.tablesWords)(Yt.tables)} for ${e}. ${l.text}.`,onPress:async()=>{if(bs){try{await(0,ge.saveBookingTables)(st,bs,Yt.tables),hl((0,be.savedWords)(e,bs.partySize,Yt.tables,t))}catch(t){hl(`Couldn\u2019t save tables for ${e}: ${String(t?.message??t).slice(0,120)}`)}Qt(null)}else Qt(null)}}),(0,Pe.jsx)(A.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>Qt(null)})]})]})})():null,ps=kt.areas.filter(e=>kt.tables.some(t=>t.areaId===e.id)),xs=e=>{const t=kt.tables.filter(t=>t.areaId===e);return zl?`${t.filter(e=>!Yl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(vl[e.name]?.status??'free')).length}/${t.length} free`},fs='all'===$t||ps.some(e=>e.id===$t)?$t:'all',ms=e=>(0,Pe.jsx)(ee.FloorCanvas,{plan:kt,areaId:e,mode:"live",fit:"contain",crop:!0,fill:Qe,big:!0,view:Yl,privacy:jt,turnBase:it.settings.turnMins,highlight:Yt?Yt.tables:Wt?[Wt]:void 0,onTap:e=>{return t=e.name,void(Yt?Qt(e=>e?{...e,tables:(0,be.toggleTable)(e.tables,t)}:e):zl?Jl(t):Wt?(t!==Wt&&gs(Wt,t),Mt(null)):Lt(t));var t},onDrop:(e,t)=>Yt||zl?void 0:gs(e.name,t.name)}),js=qe?1:Ye||ps.length>2?2:1,ws=e=>{const t=kt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},ks=[];for(let e=0;e{const t=(0,ee.areaBounds)(kt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ee.minReadableScale)(kt,e.id)}}),tt.w,tt.h):null,Ds=e=>(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',height:te.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:xs(e.id)})]}),vs=(0,Pe.jsx)(P.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-tt.w)>1||Math.abs(l-tt.h)>1)&<({w:t,h:l})},children:Is?(0,Pe.jsx)(H.default,{style:{flex:1},scrollEnabled:Is.scroll,showsVerticalScrollIndicator:Is.scroll,contentContainerStyle:{gap:te.GRID_GAP},children:Is.rows.map((e,t)=>(0,Pe.jsx)(P.default,{style:{height:Is.rowHeights[t],flexDirection:'row',gap:te.GRID_GAP},children:e.map(e=>{const t=ps.find(t=>t.id===e);return(0,Pe.jsxs)(P.default,{testID:`area-cell-${e}`,style:{width:Is.cellW,gap:2},children:[Ds(t),(0,Pe.jsx)(P.default,{style:{flex:1},children:ms(e)})]},e)})},t))}):null}),Ss=(0,Pe.jsxs)(P.default,{testID:"venue-plan",style:{flex:qe?void 0:1,gap:10,minWidth:0},children:[(0,Pe.jsx)(a.TableNumberWarning,{plan:kt}),kt.tables.length?null:(0,Pe.jsxs)(P.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Pe.jsx)(A.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Pe.jsx)(A.Muted,{center:!0,children:"Waiting for the venue\u2019s real table plan. No sample tables have been added."}),l.IS_WILDINGS||l.IS_KIRKMICHAEL||l.IS_SOUTERS?(0,Pe.jsx)(A.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?n.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?n.KIRKMICHAEL_GUIDE:n.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Pe.jsx)(Ge,{chipId:"all",compact:!qe,label:"Whole venue",selected:'all'===fs,onPress:()=>Bt('all')},"__all"),...ps.map(e=>(0,Pe.jsx)(Ge,{chipId:e.id,compact:!qe,label:`${e.name}${(0,le.areaMarks)(e)}`,colour:(0,K.brandColour)(e.colour),sub:qe?Il.has(e.id)?'closed':fs===e.id?xs(e.id):void 0:void 0,selected:fs===e.id,onPress:()=>Bt(e.id)},e.id))];return qe?(0,Pe.jsx)(P.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Pe.jsx)(H.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;cl(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>cl(t=>t.content===e?t:{...t,content:e}),style:{flexGrow:0,flexShrink:0,maxHeight:48,alignSelf:'stretch'},contentContainerStyle:{flexDirection:'row',flexWrap:'nowrap',alignItems:'center',justifyContent:dl.view>0&&dl.content>0&&dl.content<=dl.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:dl.view>0&&dl.content<=dl.view+1?'100%':void 0},children:e})})(),(0,Pe.jsx)(h.FloorLegend,{}),ys,Wt?(0,Pe.jsxs)(A.Row,{gap:8,style:{backgroundColor:K.colours.goldTint,borderRadius:10,padding:8},children:[(0,Pe.jsxs)(A.T,{weight:"semibold",colour:K.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,r.tableNumbers)(Wt),": tap the new table."]}),(0,Pe.jsx)(A.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Mt(null)})]}):null,'all'===fs&&Qe?vs:'all'===fs?(0,Pe.jsx)(P.default,{style:{flex:qe?void 0:1,gap:12,minHeight:Je?void 0:360},children:ks.map((e,t)=>(0,Pe.jsxs)(P.default,{style:{flex:qe?void 0:Math.max(.3,...e.map(e=>ws(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Pe.jsxs)(P.default,{style:{flex:1,gap:2},children:[qe?(0,Pe.jsxs)(P.default,{style:{alignItems:'center',gap:4},children:[(0,Pe.jsxs)(A.T,{center:!0,size:18,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{center:!0,size:14,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{center:!0,children:xs(e.id)})]}):(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:(0,K.brandColour)(e.colour),children:[e.name,(0,le.areaMarks)(e)]}),Il.has(e.id)?(0,Pe.jsx)(A.T,{size:13,weight:"semibold",colour:K.colours.blue,children:"Closed for weather"}):(0,Pe.jsx)(A.Muted,{children:xs(e.id)})]}),(0,Pe.jsx)(P.default,{style:qe?{height:Math.max(280,Math.round((Ue-40)*ws(e.id)))}:{flex:1},children:ms(e.id)})]},e.id)),e.length{if(zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},Ml)}),Ts='timeline'===vt,$s=Ct?(0,Pe.jsx)(W.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Tt(!1),supportedOrientations:['landscape','portrait'],children:(0,Pe.jsxs)(P.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:K.colours.bg,padding:10,gap:8},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Pe.jsx)(z.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Tt(!1),style:{minHeight:64,minWidth:180,paddingHorizontal:22,borderRadius:16,borderWidth:2,borderColor:K.colours.goldLight,backgroundColor:K.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Pe.jsx)(P.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Pe.jsx)(A.T,{size:22,weight:"semibold",colour:K.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${zl?(0,ve.dayLong)(Ml):'Today'}`})}),(0,Pe.jsx)(P.default,{style:{minWidth:180}})]}),Ul?Kl:(0,Pe.jsx)(P.default,{style:{flex:1,minHeight:0},children:(0,Pe.jsx)(oe.Timeline,{hideNow:!0,plan:kt,bookings:zl?El:ml,now:zl?Nl:ct,privacy:jt,turnBase:it.settings.turnMins,t0:zl?(0,V.addMins)(Nl,-Nl.getMinutes()):$l,t1:zl?(0,V.addMins)(_l,90):Bl,pauses:zl?Fl:Ll,blockedTables:zl?[]:Wl,onOpen:e=>{if(Tt(!1),zl)return void qt(e.id);const t=(0,X.tablesOf)(e.table)[0];t&&vl[t]?Lt(t):fl(e)}},`full-${Ml}`)})]})}):null,Bs=zl?(0,Pe.jsxs)(P.default,{testID:"display-day-bar",style:{flexDirection:'row',alignItems:'center',gap:8,marginBottom:4,paddingVertical:2,paddingHorizontal:8,minHeight:44,borderRadius:12,borderWidth:1,borderColor:K.colours.gold,backgroundColor:K.colours.goldTint},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:Pl?`Showing ${Hl} \xb7 ${(0,V.niceDate)((0,V.parseYmd)(Ml))}`:`Showing ${(0,ve.dayWord)(Ml,pt)}`}),(0,Pe.jsx)(P.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${ss}. Showing ${(0,ve.dayLong)(Ml)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Pe.jsx)(A.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{Qt(null),el(null)},style:{minHeight:44}})]}):null,Rs=(0,Pe.jsx)(P.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',alignSelf:qe?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(Ts||Ct);return(0,Pe.jsx)(z.default,{testID:s,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:i},accessibilityHint:'timeline'===e?'Opens the timeline over the whole screen':void 0,onPress:()=>{'timeline'===e?(St('plan'),Tt(!0)):(Tt(!1),St('plan'))},style:{flex:qe?1:void 0,minHeight:qe?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?K.colours.gold:'transparent',...Be.look.web(i?{backgroundImage:l.IS_ISOLATED_VENUE?'none':'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:l.IS_ISOLATED_VENUE?'0 4px 12px rgba(0,0,0,0.3)':'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,Pe.jsx)(A.T,{size:qe?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),Ls=(0,u.useBookingWrite)(),Ws=e=>(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Walk-in",onPress:ft.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"New booking",onPress:ft.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint}),(0,Pe.jsx)(Re.BigAction,{premium:!0,label:"Edit booking",onPress:()=>At(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ls.ok,accessibilityHint:Ls.hint})]});(0,He.useDisplayNotices)(st,!e);const Ms=qe?180:168,[zs,Hs]=(0,v.useState)(Ms),Ps=S.default.useRef(Ms),Es=S.default.useRef(null),Os=S.default.useRef(null),As=()=>{const e=Es.current,t=Os.current;e?.measureInWindow&&t?.measureInWindow&&e.measureInWindow((e,l,s,i)=>{t.measureInWindow((e,t)=>{const s=Ke<820?8:12,o=44+(Ke<820?4:8),n=i>Ps.current?Math.ceil(i-Ps.current):Ie.DAY_GRAPH_CHROME,a=Math.max(70,Math.min(Ms,Math.floor(t-s-l)-n-o));Math.abs(Ps.current-a)>=2&&(Ps.current=a,Hs(a))})})};S.default.useEffect(()=>{const e=setTimeout(As,60);return()=>clearTimeout(e)},[Ue,Ke]);const Ns=(0,Pe.jsxs)(P.default,{ref:Os,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),As()},style:{flexDirection:'row',flexWrap:Ue>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:qe?12:6,justifyContent:qe?'center':void 0,borderTopWidth:1,borderTopColor:K.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Pe.jsx)(ze.DisplayClockButton,{}),(0,Pe.jsx)(ie.HoldToEdit,{quiet:!0,onUnlock:()=>{xl(null),bl({at:Date.now()})},onHint:()=>hl('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Pe.jsx)(ke.BlockBookingsButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,display:!0,day:Ml}),kt.areas.some(e=>e.outdoor)?(0,Pe.jsx)(ke.CloseGardenButton,{rid:st,r:it,now:ct,by:yt,quiet:!0,short:!0}):null,(0,Pe.jsx)(z.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>rl(!0),style:({pressed:e})=>({...Be.look.quiet(e),flexGrow:1}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),(0,Pe.jsx)(p.GiftQrButton,{rid:st,venue:it.name})]}),_s=wl.length?(0,Pe.jsxs)(P.default,{testID:"takeaway-panel",style:[Be.look.panel,{overflow:'hidden'}],children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Pe.jsx)(A.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Pe.jsxs)(A.T,{size:12,colour:K.colours.muted,children:[wl.length," live"]})]}),(0,Pe.jsx)(P.default,{style:{padding:10},children:(0,Pe.jsx)(Fe,{list:wl,me:yt,compact:!0,bookings:nt})})]}):null,Gs=($e.DueToday,zl?El:ml.filter(e=>'confirmed'===e.status||'seated'===e.status).sort((e,t)=>e.time.localeCompare(t.time))),Fs=zl?Pl?`${Hl}\u2019s guests`:`Guests ${Hl}`:'Today\u2019s guests',Vs=(0,Pe.jsxs)(Pe.Fragment,{children:[0===Gs.length?(0,Pe.jsx)(A.Muted,{children:zl?Ml{const t=(0,q.isSeatedHighlight)(e.status,{otherDay:zl}),l=(0,de.guestRowText)(e,{name:e.walkIn?(0,re.privName)(e,jt):(e.name??'').replace(' (example)',''),seated:t}),s=t?q.SEATED_FG:K.colours.text,i=t?q.SEATED_MUTED:K.colours.muted,o=t?q.SEATED_FG:K.colours.gold,n=l.depositWarn?K.colours.amber:t?q.SEATED_FG:K.colours.goldLight;return(0,Pe.jsxs)(z.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:zl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{Ut(!1),qt(e.id)},style:({pressed:e})=>t?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,q.seatedHighlightStyle)({backgroundColor:e?K.colours.goldLight:K.colours.gold,borderBottomWidth:1})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:K.colours.hairline,backgroundColor:e?K.colours.tilePressed:'transparent'},children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Pe.jsx)(A.T,{size:18,weight:"semibold",colour:s,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Pe.jsx)(P.default,{style:{paddingTop:2},children:(0,Pe.jsx)(L.AllergyIcon,{text:l.allergy,size:22,colour:t?'#7A4A00':K.colours.amber,ink:t?K.colours.gold:K.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Pe.jsxs)(A.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:16,colour:s,children:l.people}),l.deposit?(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}):null,l.deposit?(0,Pe.jsx)(A.T,{size:16,weight:"semibold",colour:n,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Pe.jsx)(A.T,{size:16,colour:i,children:" \xb7 "}),(0,Pe.jsx)(A.T,{size:16,weight:t?'semibold':'regular',colour:'No table yet'===l.table?i:s,children:l.table}),l.dog?(0,Pe.jsx)(A.T,{size:16,children:" "}):null,l.dog?(0,Pe.jsx)(P.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Pe.jsx)(ce.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]})]},e.id)}),(0,Pe.jsx)(Te.CancellationsSection,{items:ls,dayWord:zl?Pl?Hl.toLowerCase():`on ${Hl}`:'today'})]}),Us=(0,Pe.jsx)(H.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:Vs}),Ks=M.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&Ut(!1)}}),qs=(0,Pe.jsxs)(z.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${Fs}, ${Gs.length}`,accessibilityState:{expanded:Vt},'aria-expanded':Vt,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>Ut(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:Vt?K.colours.gold:K.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?K.colours.tilePressed:Vt?K.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Pe.jsx)(A.T,{size:16,weight:"bold",colour:K.colours.gold,children:Gs.length}),(0,Pe.jsx)(P.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(P.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Pe.jsxs)(A.T,{size:13,weight:"semibold",colour:K.colours.goldLight,numberOfLines:1,children:[Fs," ",Vt?'\u2039':'\u203a']})})})]}),Ys=Vt?(0,Pe.jsxs)(P.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Pe.jsxs)(P.default,{testID:"guests-drawer",...Ks.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*Ue)),backgroundColor:K.colours.surface,borderRightWidth:1,borderColor:K.colours.gold,borderRadius:14,...Be.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingTop:10},children:[(0,Pe.jsxs)(A.T,{size:17,weight:"semibold",colour:K.colours.gold,style:{flex:1,flexWrap:'wrap'},children:[Fs.toUpperCase()," (",Gs.length,")"]}),ts.count?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,style:{width:'100%'},testID:"cancelled-day-tally-guests",children:ss}):null,(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`Close ${Fs}`,onPress:()=>Ut(!1),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:18,colour:K.colours.muted,children:"\u2715"})})]}),Us]}),(0,Pe.jsx)(z.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${Fs}`,accessibilityRole:"button",onPress:()=>Ut(!1),style:{flex:1}})]}):null,Qs=Ul?Kl:l.IS_KIRKTON&&!Object.values(it.kitchenHours??{}).some(Boolean)?(0,Pe.jsxs)(P.default,{testID:"kirkton-hours-to-confirm",style:[Be.look.panel,{padding:14,gap:8}],children:[(0,Pe.jsx)(A.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Pe.jsx)(A.Muted,{children:"No service hours have been set for this venue."})]}):(0,Pe.jsx)(Ie.DayGraph,{busyThreshold:(0,t.venueBusy)(it,nt,ct).busy,todays:El,open:Nl,close:_l,now:ct,turnBase:it.settings.turnMins,blocks:is,pauses:Fl,compact:qe,dense:!qe,height:Qe?zs:Ms,forecastNote:zl?void 0:hs,emptyText:ql,past:Ml{zl?Ut(!0):Tt(!0)},ei=(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',padding:Ke<820?8:12,paddingTop:Ke<820?6:10,gap:12,minHeight:0,overflow:'hidden'},children:[xt?null:qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[xt?null:Bs,xt?(0,Pe.jsx)(H.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"})}):Ts?Cs:Ss,$s,Ys]}),(0,Pe.jsxs)(P.default,{testID:"display-side",style:{width:Xe,gap:Ke<820?4:8,minHeight:0},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Ws(!1)}),(0,Pe.jsx)(P.default,{style:{flexShrink:0},children:Rs}),xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:Ke<820,snug:Ke<820,tight:Ke<700,aside:`${Xl.length} ${1===Xl.length?'table':'tables'} booked${wl.length?` \xb7 ${wl.length} takeaway`:''}`,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{ref:Es,testID:"day-graph-slot",onLayout:As,style:{flexGrow:0,flexShrink:0,overflow:'visible'},children:Js}),(0,Pe.jsxs)(H.default,{testID:"display-side-scroll",style:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},children:[(0,Pe.jsx)(z.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Pe.jsx)(A.T,{center:!0,weight:"semibold",children:"Reviews"})}),_s,(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt})]})]})]});return(0,Pe.jsxs)(O.SafeAreaView,{style:{flex:1,backgroundColor:K.colours.bg},onTouchStart:()=>{Zt.current=Date.now()},onMouseDown:()=>{Zt.current=Date.now()},children:[qe?(0,Pe.jsxs)(P.default,{style:{flex:1},children:[(0,Pe.jsxs)(H.default,{ref:Ze,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Pe.jsx)(P.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Pe.jsx)(f.ExitButton,{})}),(0,Pe.jsx)(G.RestaurantLogo,{rid:st,size:64}),(0,Pe.jsx)(A.T,{center:!0,size:24,weight:"semibold",accessibilityRole:"header",children:it.name}),(0,Pe.jsx)(G.PoweredBy,{}),(0,Pe.jsx)(D.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Pe.jsx)(P.default,{accessible:!0,accessibilityLabel:`Current time ${(0,V.hm)(ct)}`,children:(0,Pe.jsx)(A.T,{center:!0,size:30,weight:"semibold",colour:K.colours.goldLight,children:(0,V.hm)(ct)})}),(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:"m"}),(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:"m"}),F]}),We,Xs,(0,Pe.jsx)(P.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Pe.jsx)(_e,{phone:!0,split:es,items:[{label:`Tables \xb7 ${Hl}`,value:Xl.length,testID:'badge-tables'},{label:`Covers \xb7 ${Hl}`,value:Zl,testID:'badge-covers'},{label:'Takeaway',value:wl.length,alert:wl.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Et(!0)}]})}),(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{gap:8},children:Ws(!0)}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),Rs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[Ts?Cs:Ss,$s]}),(0,Pe.jsxs)(P.default,{onLayout:e=>{et.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Be.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Pe.jsxs)(A.T,{center:!0,size:20,weight:"semibold",colour:K.colours.goldLight,accessibilityRole:"header",children:[Fs," (",Gs.length,")"]}),(0,Pe.jsx)(P.default,{testID:"display-guest-list",accessibilityLabel:Fs,style:{gap:4},children:Vs})]}),_s,Js,(0,Pe.jsx)(P.default,{testID:"covers-dock",children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,compact:!0,sound:(0,$.flapSoundOn)(),onPress:()=>Ze.current?.scrollTo({y:et.current,animated:!0})})}),(0,Pe.jsxs)(P.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Pe.jsx)(A.T,{center:!0,size:14,colour:jt?K.colours.muted:K.colours.amber,children:jt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Pe.jsx)(A.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:{minHeight:48,alignSelf:'stretch'}}),(0,Pe.jsx)(A.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>nl(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Ns]}),e?null:(0,Pe.jsx)(P.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:K.colours.hairline},children:(0,Pe.jsx)(R.VoiceSlot,{size:56})})]}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:Ue>=1e3?18:14,paddingVertical:Ke<820?4:8,gap:8,minHeight:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Be.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',gap:8,minWidth:0,overflow:'hidden'},children:[(0,Pe.jsx)(P.default,{style:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Pe.jsx)(G.RestaurantBrand,{rid:it.id,size:Ue<900?32:40,beside:!0})}),(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Pe.jsx)(A.T,{size:Ue<900?18:21,weight:"semibold",colour:K.colours.goldLight,style:{letterSpacing:.4,lineHeight:26},children:(0,V.hm)(ct)}),Ue>=900?(0,Pe.jsx)(A.T,{size:13,colour:K.colours.muted,children:(0,V.niceDate)(ct)}):null]})]}),xt?(0,Pe.jsx)(P.default,{style:{width:220}}):(0,Pe.jsx)(P.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:Xs}),(0,Pe.jsxs)(P.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Pe.jsx)(Le.ShellfishChip,{rid:st,by:yt,app:"display",size:Ue<900?'xs':Ue<1100||Ke<700?'s':'m'}),(0,Pe.jsx)(z.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>il(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,Pe.jsx)(A.T,{size:15,weight:"semibold",colour:K.colours.muted,children:"?"})}),'simulated'===dt?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>rt(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Pe.jsx)(A.T,{size:11,colour:K.colours.muted,children:"+15"})}):null,e?null:(0,Pe.jsx)(f.ExitButton,{}),F,Me?null:(0,Pe.jsx)(R.VoiceSlot,{size:44})]})]}),We,xt?null:(0,Pe.jsxs)(P.default,{testID:"display-day-stats",style:{paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},children:[(0,Pe.jsx)(_e,{splitOnly:!0,split:es,items:[]}),(0,Pe.jsx)(P.default,{testID:"roast-under-shellfish",style:{position:'absolute',top:2,right:104+(Ue>=1e3?18:14)+(e?0:52)+('simulated'===dt?52:0),zIndex:4},children:(0,Pe.jsx)(Le.SundayRoastChip,{rid:st,by:yt,app:"display",size:Ue<1100||Ke<700?'s':'m'})})]}),Qe?ei:(ti=(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Pe.jsx)(P.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Ws(!1)}),Rs]}),(0,Pe.jsx)(ke.BlocksBanner,{rid:st,now:ct,big:!0,by:yt}),xt?(0,Pe.jsx)(T.DayView,{rid:st,day:xt,today:pt,app:"display"}):(0,Pe.jsx)(Pe.Fragment,{children:(0,Pe.jsxs)(P.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[qs,(0,Pe.jsxs)(P.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[Bs,Ts?Cs:Ss,$s,Ys]})]})}),_s,xt?null:(0,Pe.jsx)(P.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Pe.jsx)(C.CoversToday,{rid:st,day:Ml,sound:(0,$.flapSoundOn)(),onPress:Zs})}),xt?null:(0,Pe.jsx)(P.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Ms+Ie.DAY_GRAPH_CHROME},children:Js})]}),(0,Pe.jsx)(H.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:ti})),Ns]}),(0,Pe.jsx)(j.SoldOutStrip,{rid:st,by:yt,onOpen:()=>rl(!0)}),(0,Pe.jsx)(w.SoldOutSheet,{visible:al,onClose:()=>rl(!1),rid:st,by:yt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Pe.jsx)(y.TableOrderCue,{rid:st}),ft.elements,Ot?(0,Pe.jsx)(b.EditBookingPicker,{rid:st,today:pt,who:yt,hidePrivate:!0,onClose:()=>At(!1)}):null,Nt?(0,Pe.jsx)(b.EditBookingSheet,{rid:st,id:Nt,who:yt,hidePrivate:!0,onClose:()=>_t(null)}):null,Rt?(0,Pe.jsx)(pe.TableSheet,{rid:st,name:Rt,view:vl,plan:kt,todays:ml,now:ct,privacy:jt,turnBase:it.settings.turnMins,onClose:()=>Lt(null),onWalkIn:e=>ft.openWalkInAt(e),onMove:e=>Mt(e),onDetails:fl}):null,Ql?(()=>{const e=Yl[Ql],t=e?.dayBookings??[];return(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>Jl(null),title:`${(0,r.tableNumbers)(Ql)} \xb7 ${Pl?Hl:(0,ve.dayLong)(Ml)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Pe.jsxs)(A.T,{size:16,colour:K.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${Pl?Hl.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${Pl?Hl.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,re.privName)(e,jt):Oe(e.name);return(0,Pe.jsx)(A.Button,{kind:"secondary",label:`${e.time} \xb7 ${t} \xb7 ${e.partySize} Covers`,testID:`day-table-booking-${e.id}`,accessibilityLabel:`${e.time}, ${t}, ${e.partySize} Covers, ${(0,be.tablesWords)((0,X.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Jl(null),qt(e.id)},style:{minHeight:56}},e.id)}),(0,Pe.jsx)(A.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>Jl(null),style:{minHeight:56}})]})})():null,Kt?(()=>{const e=nt.find(e=>e.id===Kt);return e?(0,Pe.jsx)(ue.GuestActionsSheet,{rid:st,b:e,name:e.walkIn?(0,re.privName)(e,jt):Oe(e.name),view:vl,now:ct,otherDay:e.date!==pt,turnBase:it.settings.turnMins,onClose:()=>qt(null),onDetails:fl,onDone:hl,onPickOnPlan:(e,t)=>{Ut(!1),St('plan'),Bt('all'),Qt({id:e.id,tables:t})}}):null})():null,zt?(0,Pe.jsx)(pe.DetailsPanel,{title:zt.title,onClose:()=>Ht(null),children:zt.body}):null,Gt?(0,Pe.jsx)(pe.ServiceSummary,{r:it,todays:ml,orders:ot,waitlistAll:tl,walkInCount:ll,onClose:()=>Ft(!1)}):null,sl?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>il(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Pe.jsx)(h.FloorLegend,{}),(0,Pe.jsx)(A.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>il(!1)})]}):null,ol?(0,Pe.jsxs)(A.Sheet,{visible:!0,onClose:()=>nl(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Pe.jsx)(N.ReviewsSection,{rid:st,mode:"read",venueName:it.name}),(0,Pe.jsx)(A.Button,{kind:"secondary",label:"Close",onPress:()=>nl(!1)})]}):null,Pt?(0,Pe.jsxs)(pe.DetailsPanel,{title:"Takeaway",onClose:()=>Et(!1),children:[(0,Pe.jsx)(A.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Pe.jsx)(Fe,{list:wl,me:yt,bookings:nt})]}):null,gl?(0,Pe.jsx)(P.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:K.colours.bg},children:(0,Pe.jsx)(se.PlanDesigner,{initial:kt,venue:it.name,mode:"display",startStep:"arrange",onActivity:()=>{yl.current=Date.now(),null!==pl&&xl(null)},notice:null!==pl?`Locking again in ${pl} s \xb7 touch to keep editing`:null,onSave:e=>{X.useFloor.getState().setPlan(st,e),bl(null),hl('Table plan saved. Editing is locked again.')},onCancel:()=>{bl(null),hl('No changes kept. Editing is locked again.')}},gl.at)}):null,e?null:(0,Pe.jsx)(ne.Screensaver,{rid:st,idleMins:mt.idleMins,pinOn:mt.pinOn,wake:mt,tonightCards:mt.tonightCards,cfg:wt}),e?null:(0,Pe.jsx)(fe.PrintHost,{rid:st}),e?null:(0,Pe.jsx)(xe.AlertHost,{variant:"display",rid:st,skipTakeaway:!0}),e?null:(0,Pe.jsx)(B.SeatAllergenReminder,{rid:st}),e?null:(0,Pe.jsx)(me.TakeawayTakeover,{rid:st,me:yt})]});var ti};var t=_r(_d[0]),l=_r(_d[1]),s=_r(_d[2]),i=_r(_d[3]),o=_r(_d[4]),n=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),b=_r(_d[13]),y=_r(_d[14]),p=_r(_d[15]),x=_r(_d[16]),f=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),I=_r(_d[21]),D=_r(_d[22]),v=_r(_d[23]),S=e(v),C=_r(_d[24]),T=_r(_d[25]),$=_r(_d[26]),B=_r(_d[27]),R=_r(_d[28]),L=_r(_d[29]),W=e(_r(_d[30])),M=e(_r(_d[31])),z=e(_r(_d[32])),H=e(_r(_d[33])),P=e(_r(_d[34])),E=e(_r(_d[35])),O=_r(_d[36]),A=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=_r(_d[41]),V=_r(_d[42]),U=_r(_d[43]),K=_r(_d[44]),q=_r(_d[45]),Y=_r(_d[46]),Q=_r(_d[47]),J=_r(_d[48]),X=_r(_d[49]),Z=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),le=_r(_d[53]),se=_r(_d[54]),ie=_r(_d[55]),oe=_r(_d[56]),ne=_r(_d[57]),ae=_r(_d[58]),re=_r(_d[59]),de=_r(_d[60]),ce=_r(_d[61]),ue=_r(_d[62]),he=_r(_d[63]),ge=_r(_d[64]),be=_r(_d[65]),ye=_r(_d[66]),pe=_r(_d[67]),xe=_r(_d[68]),fe=_r(_d[69]),me=_r(_d[70]),je=_r(_d[71]),we=_r(_d[72]),ke=_r(_d[73]),Ie=_r(_d[74]),De=_r(_d[75]),ve=_r(_d[76]),Se=_r(_d[77]),Ce=_r(_d[78]),Te=_r(_d[79]),$e=_r(_d[80]),Be=_r(_d[81]),Re=_r(_d[82]),Le=_r(_d[83]),We=_r(_d[84]),Me=_r(_d[85]),ze=_r(_d[86]),He=_r(_d[87]),Pe=_r(_d[88]);const Ee=12e4,Oe=e=>(e??'').replace(' (example)',''),Ae=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),Ne=e=>e.slotTime?(0,V.hm)(new Date(e.slotTime)):'ASAP';function _e({items:e,tight:t,phone:l,split:s,inline:i,splitOnly:o}){return(0,Pe.jsxs)(P.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:o?'center':'stretch',maxWidth:o?560:void 0,width:o?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[o?null:(0,Pe.jsx)(P.default,{style:{flexDirection:'row',flexWrap:l?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,s)=>{const i=(0,Pe.jsxs)(P.default,{testID:e.testID,style:{flex:l?1:void 0,minWidth:l?148:void 0,flexBasis:l?148:void 0,flexDirection:l?'column':'row',alignItems:l?'center':'baseline',justifyContent:l?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:s?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...l?{minHeight:76}:{}},children:[(0,Pe.jsx)(A.T,{size:l?24:19,weight:"semibold",colour:e.alert?K.colours.amber:K.colours.text,children:e.value}),(0,Pe.jsx)(A.T,{size:l?14:12,colour:K.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Pe.jsx)(z.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:l?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Pe.jsx)(S.default.Fragment,{children:i},e.testID)})}),s?(0,Pe.jsx)(P.default,{testID:"covers-split",accessible:!0,accessibilityLabel:s.a11y,style:{width:i?void 0:'100%',flex:i?1:void 0,minWidth:i?180:void 0,paddingHorizontal:12,paddingBottom:i?6:8,paddingTop:i?6:8,gap:4,alignItems:'center',justifyContent:'center',borderTopWidth:i||o?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:s.empty?(0,Pe.jsx)(A.T,{size:14,colour:K.colours.muted,children:"No Covers yet"}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsxs)(P.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",colour:K.colours.gold,children:`Walk-ins ${s.walkIns} \xb7 ${s.walkInPct}%`}),(0,Pe.jsx)(A.T,{size:i?13:14,weight:"semibold",children:`Bookings ${s.bookings} \xb7 ${s.bookingPct}%`})]}),(0,Pe.jsxs)(P.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:K.colours.gold},children:[(0,Pe.jsx)(P.default,{style:{width:`${s.walkInPct}%`,backgroundColor:K.colours.gold}}),(0,Pe.jsx)(P.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function Ge({chipId:e,label:t,sub:l,selected:s,onPress:i,colour:o,compact:n}){return(0,Pe.jsxs)(z.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:s},accessibilityLabel:`${t}${l?`, ${l}`:''}${s?', selected':''}`,'aria-pressed':s,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:n?4:7,minHeight:44,paddingHorizontal:n?6:14,borderRadius:999,borderWidth:1,borderColor:s?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:s?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[o?(0,Pe.jsx)(P.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:o}}):null,(0,Pe.jsx)(A.T,{size:n?12:14,weight:s?'semibold':'medium',colour:s?K.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),l?(0,Pe.jsx)(A.T,{size:12,colour:K.colours.muted,children:l}):null]})}function Fe({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,Me.statusBlock)(e,t,(0,Me.linkedBooking)(e,s));return e.length?(0,Pe.jsx)(P.default,{style:{gap:8},children:e.map(e=>(0,Pe.jsxs)(P.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:K.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?K.colours.ok:e.allergies.length?K.colours.red:K.colours.gold},children:[(0,Pe.jsxs)(A.Row,{style:{justifyContent:'space-between'},children:[(0,Pe.jsxs)(A.T,{size:l?16:18,weight:"bold",children:[Ne(e)," \xb7 ",Oe(e.customerName)]}),(0,Pe.jsx)(A.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,Pe.jsxs)(A.Muted,{children:[e.ref," \xb7 ",e.lines.reduce((e,t)=>e+t.qty,0)," items",'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':e.customerSignal?' \xb7 on the way':'']}),e.allergies.length?(0,Pe.jsxs)(A.T,{size:14,weight:"semibold",colour:K.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,F.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Pe.jsx)(We.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Pe.jsxs)(A.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Pe.jsx)(A.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>U.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Pe.jsx)(A.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Pe.jsx)(A.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>U.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Pe.jsx)(fe.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Pe.jsx)(A.Muted,{children:"No takeaway orders right now."})}function Ve({rid:e,id:t,turnBase:l}){const s=(0,U.useBookings)(e).find(e=>e.id===t);return s?(0,Pe.jsx)(g.BookingTableButton,{rid:e,booking:s,turnBase:l}):null}},1279,[1121,5,6,1280,798,822,1094,829,1120,1281,1282,1283,1091,1115,1284,1285,1287,1288,1289,1130,977,1099,1290,34,1073,1148,1033,1087,1116,1291,395,380,402,295,102,426,36,794,1182,1186,847,830,827,848,840,1090,865,1096,1100,1014,1079,1108,1292,1107,1293,1296,1298,1301,1304,1300,1305,1307,1308,1112,1093,1095,852,1310,1171,1311,1181,1173,1011,1316,1324,1326,1076,1114,1328,1329,1330,1143,1331,1142,1136,838,1332,1333,25]); __d(function(g,_r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.queuedServiceSessions=u,e.queuedServicePauses=function(n,t,s){const i=u(n,t);return i?i.slice(1).flatMap((n,t)=>{const u=i[t][1],r=n[0];return u!!t.walkIn||'walk-in'===t.source},1281,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useBookingWrite=function(){const t=(0,s.useSignedIn)(),c=(0,n.canChangeBookings)(t);return{ok:c,hint:c?void 0:n.BOOKING_VIEW_ONLY,lock:s=>c?{disabled:!1,accessibilityLabel:s}:{disabled:!0,accessibilityLabel:s,accessibilityHint:n.BOOKING_VIEW_ONLY}}};var n=r(d[0]),s=r(d[1])},1282,[1012,1100]); @@ -1463,7 +1463,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";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LaunchWelcome=function({p:e,onDone:t}){(0,r.useEffect)(()=>{if(!z||document.getElementById('cc-launch-css'))return;const e=document.createElement('style');e.id='cc-launch-css',e.textContent=I,document.head.appendChild(e)},[]),(0,r.useEffect)(()=>{if(z)return document.documentElement.classList.add('cc-welcome'),()=>document.documentElement.classList.remove('cc-welcome')},[]);const[o,k]=(0,r.useState)(P()?0:3),[O,N]=(0,r.useState)('main'),[W,H]=(0,r.useState)(''),[M,_]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(o<=0)return;const e=setTimeout(()=>k(e=>e-1),300);return()=>clearTimeout(e)},[o]);const B=(0,f.useAvatars)(t=>!!t.photos[e.id]),V=(0,b.useStore)(e=>e.restaurants[0]?.name??'Your venue').toUpperCase(),G=(0,x.useOwner)(t=>t.hourly[e.id]),K=(0,x.useOwner)(t=>t.staff.find(t=>t.id===e.id)),$=(0,y.useSync)(e=>e.mode),q='live'===$||'offline'===$,J=K?.salaried||e.salaried?'Salaried':null!=G?`\xa3${(G/100).toFixed(2)} an hour${K?.noTax?' \xb7 no-tax code':''}`:'connecting'===$?'Loading\u2026':'Ask your manager',Q='staff'!==e.app&&'staff'!==p.APP_VARIANT?(0,j.appUrl)('staff'):null,X=`AN-${String(v.ROSTER.findIndex(t=>t.id===e.id)+1).padStart(2,'0')}`,Z=j.APP_NAME['staff'===p.APP_VARIANT?'staff':e.app],ee=L['staff'===p.APP_VARIANT&&'staff'!==e.app?'Staff':e.level]??L.Staff;return(0,C.jsxs)(h.default,{testID:"invite-welcome",style:[u.default.absoluteFill,{backgroundColor:(0,n.soutersSurface)('#000'),zIndex:1e3}],children:[(0,C.jsxs)(h.default,{...R('space'),pointerEvents:"none",children:[(0,C.jsx)(h.default,{...R('stars1')}),(0,C.jsx)(h.default,{...R('stars2')})]}),o>0?(0,C.jsxs)(l.default,{testID:"invite-countdown",accessibilityLabel:"Skip intro",onPress:()=>k(0),style:{flex:1,alignItems:'center',justifyContent:'center',gap:10},children:[(0,C.jsxs)(E,{colour:w.colours.muted,children:[V," \xb7 COVER CHARGE"]}),(0,C.jsx)(h.default,{...R('count'),children:(0,C.jsx)(T.T,{size:120,weight:"bold",colour:A,children:o})},o),(0,C.jsx)(E,{children:"GETTING YOU ON BOARD"})]}):'selfie'===O?(0,C.jsx)(F,{p:e,onClose:e=>{N('main'),e?(H('Avatar saved. Looking good!'),_(e=>e+1)):H('')}}):(0,C.jsxs)(c.default,{contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsxs)(h.default,{...R('rise1'),style:{alignItems:'center',gap:2},children:[(0,C.jsxs)(E,{children:[V," \xb7 ",Z.toUpperCase()]}),(0,C.jsx)(T.T,{size:20,colour:w.colours.muted,center:!0,style:{marginTop:10},children:"Welcome aboard,"}),(0,C.jsx)(T.T,{size:42,weight:"bold",center:!0,style:{lineHeight:50},children:e.name})]}),(0,C.jsxs)(h.default,{...R('reveal'),style:{marginVertical:8},children:[(0,C.jsx)(h.default,{...R('orbit'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:156})})]},M),W?(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:w.colours.ok,center:!0,children:W}):null,(0,C.jsx)(h.default,{...R('rise2'),style:{alignSelf:'stretch'},children:(0,C.jsxs)(h.default,{testID:"invite-crew-card",...R('card'),style:{borderRadius:20,borderWidth:1,borderColor:'rgba(207,164,95,0.55)',overflow:'hidden',padding:18,gap:12},children:[(0,C.jsx)(h.default,{...R('sheen'),pointerEvents:"none"}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},children:[(0,C.jsx)(E,{children:"CREW ID"}),(0,C.jsx)(T.T,{size:15,weight:"semibold",colour:w.colours.muted,style:{letterSpacing:1.5},children:X})]}),(0,C.jsx)(h.default,{style:{height:2,backgroundColor:A,opacity:.7,borderRadius:1}}),(0,C.jsx)(Y,{k:"NAME",v:e.name}),(0,C.jsx)(Y,{k:"ROLE",v:(0,j.levelJob)(e.level,e.job)}),(0,C.jsx)(Y,{k:"APP",v:Z}),'owner'!==e.role?(0,C.jsx)(h.default,{testID:"invite-pay",children:(0,C.jsx)(Y,{k:"PAY",v:J})}):null,(0,C.jsx)(Y,{k:"ACCESS",v:'Owner'===e.level?'Everything':'Manager'===e.level?'Manager':'Supervisor'===e.level?'Supervisor':'Head Chef'===e.level?'Kitchen lead':'Team member'}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,C.jsx)(h.default,{...R('blink'),style:{width:10,height:10,borderRadius:5,backgroundColor:w.colours.ok}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.ok,children:"Signed in on this phone"})]})]})}),(0,C.jsxs)(h.default,{...R('rise3'),style:{alignSelf:'stretch',gap:10},children:[(0,C.jsx)(E,{children:"WHAT YOU CAN DO"}),ee.map(e=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'flex-start'},children:[(0,C.jsx)(T.T,{size:16,colour:A,children:"\u25c6"}),(0,C.jsx)(T.T,{size:16,style:{flex:1},children:e})]},e))]}),z?(0,C.jsxs)(h.default,{testID:"invite-avatar-offer",...R('rise4'),style:{alignSelf:'stretch',gap:12,borderRadius:20,padding:18,borderWidth:1,borderColor:'rgba(255,255,255,0.14)',backgroundColor:'rgba(255,255,255,0.03)'},children:[(0,C.jsx)(E,{children:"YOUR AVATAR \xb7 OPTIONAL"}),(0,C.jsx)(T.T,{size:16,children:B?'You made your own avatar from a photo.':'Keep this one, choose an original icon, or make your own from a photo.'}),(0,C.jsx)(D,{kind:"ghost",label:B?'Choose another avatar':'Choose my avatar',testID:"invite-avatar-make",onPress:()=>{H(''),N('selfie')}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.muted,children:"Your photo stays on this phone. It\u2019s turned into your avatar here; only the finished avatar is shared with your team."})]}):null,(0,C.jsx)(h.default,{style:{alignSelf:'stretch',gap:10,marginTop:4},children:(0,C.jsx)(D,{label:B?'Get started':'Skip, keep this one and get started',testID:"invite-get-started",onPress:t})}),(0,s.inPhoneApp)()?null:(0,C.jsxs)(h.default,{style:{alignSelf:'stretch',gap:6,borderRadius:16,padding:16,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:[(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:A,children:"Tip: add it to your Home screen"}),(0,C.jsxs)(T.T,{size:15,children:[U()," It then opens like a normal app and remembers you."]})]}),Q?(0,C.jsx)(l.default,{accessibilityRole:"link",onPress:()=>{z&&window.location.assign(Q)},children:(0,C.jsx)(T.T,{size:15,colour:A,center:!0,children:"Also open CoverCharge for Staff (your clock-in, rota and pay) \u203a"})}):null,(0,C.jsx)(T.T,{size:14,colour:w.colours.muted,center:!0,children:q?'Connected: bookings, orders and stock are shared live with the rest of the team. Your pay is only visible to you and your managers.':'Connecting\u2026 if there\u2019s no signal, what you enter is kept on this phone and shared once you\u2019re back online.'})]})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]),s=_r(d[3]),o=e(_r(d[4]));_r(d[5]);var l=e(_r(d[6])),c=e(_r(d[7])),u=e(_r(d[8])),h=e(_r(d[9])),p=_r(d[10]),f=_r(d[11]),x=_r(d[12]),b=_r(d[13]),y=_r(d[14]),j=_r(d[15]),v=_r(d[16]),k=_r(d[17]),w=_r(d[18]),S=_r(d[19]),T=_r(d[20]),C=_r(d[21]);const A=w.colours.gold,I="\n[data-cc=\"space\"]{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;background:radial-gradient(ellipse at 50% 115%,#2a1f0c 0%,#0a0805 38%,#000 70%)}\n[data-cc=\"stars1\"],[data-cc=\"stars2\"]{position:absolute;top:-50%;left:-50%;width:200%;height:200%;will-change:transform}\n[data-cc=\"stars1\"]{background-image:radial-gradient(1.2px 1.2px at 23px 41px,#fff,transparent),radial-gradient(1px 1px at 97px 13px,#fff9,transparent),radial-gradient(1.4px 1.4px at 151px 120px,#f5e6c8,transparent),radial-gradient(1px 1px at 61px 163px,#fffa,transparent),radial-gradient(1.2px 1.2px at 183px 77px,#fff8,transparent);background-size:211px 199px;animation:cc-drift 90s linear infinite;opacity:.75}\n[data-cc=\"stars2\"]{background-image:radial-gradient(2px 2px at 40px 60px,#CFA45F,transparent),radial-gradient(1.6px 1.6px at 250px 210px,#fff,transparent),radial-gradient(1.8px 1.8px at 330px 40px,#fffc,transparent);background-size:397px 367px;animation:cc-drift2 60s linear infinite,cc-twinkle 3.2s ease-in-out infinite alternate;opacity:.8}\n@keyframes cc-drift{to{transform:translate3d(-211px,199px,0)}}\n@keyframes cc-drift2{to{transform:translate3d(-397px,367px,0)}}\n@keyframes cc-twinkle{from{opacity:.45}to{opacity:.95}}\n[data-cc=\"count\"]{animation:cc-count .32s cubic-bezier(.2,.8,.2,1) both}\n@keyframes cc-count{from{opacity:0;transform:scale(1.9)}to{opacity:1;transform:scale(1)}}\n[data-cc=\"reveal\"]{animation:cc-reveal .75s cubic-bezier(.2,.9,.25,1.25) both}\n@keyframes cc-reveal{0%{opacity:0;transform:scale(.35) rotate(-12deg)}100%{opacity:1;transform:scale(1) rotate(0)}}\n[data-cc=\"halo\"]{border-radius:999px;box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 38px 6px rgba(207,164,95,.35);animation:cc-glow 2.6s ease-in-out infinite}\n@keyframes cc-glow{0%,100%{box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 30px 4px rgba(207,164,95,.28)}50%{box-shadow:0 0 0 2px rgba(207,164,95,1),0 0 52px 10px rgba(207,164,95,.5)}}\n[data-cc=\"orbit\"]{position:absolute;top:-14px;left:-14px;right:-14px;bottom:-14px;border-radius:999px;border:1px dashed rgba(207,164,95,.45);animation:cc-spin 14s linear infinite}\n@keyframes cc-spin{to{transform:rotate(360deg)}}\n[data-cc=\"rise1\"],[data-cc=\"rise2\"],[data-cc=\"rise3\"],[data-cc=\"rise4\"]{animation:cc-rise .5s cubic-bezier(.2,.8,.2,1) both}\n[data-cc=\"rise2\"]{animation-delay:.12s}[data-cc=\"rise3\"]{animation-delay:.24s}[data-cc=\"rise4\"]{animation-delay:.36s}\n@keyframes cc-rise{from{opacity:0;transform:translate3d(0,18px,0)}to{opacity:1;transform:none}}\n[data-cc=\"btn\"]{transition:transform .12s ease,box-shadow .2s ease,filter .2s ease;cursor:pointer}\n[data-cc=\"btn\"]:hover{filter:brightness(1.08)}\n[data-cc=\"btnp\"]{transition:transform .12s ease,box-shadow .2s ease;cursor:pointer;box-shadow:0 0 0 1px rgba(207,164,95,.9),0 8px 30px rgba(207,164,95,.35)}\n[data-cc=\"btnp\"]:hover{box-shadow:0 0 0 1px #CFA45F,0 8px 44px rgba(207,164,95,.6)}\n[data-cc=\"card\"]{background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.02));backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}\n[data-cc=\"sheen\"]{position:absolute;top:0;bottom:0;width:40%;left:-60%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.10),transparent);animation:cc-sheen 3.8s ease-in-out 1s infinite}\n@keyframes cc-sheen{0%{left:-60%}35%,100%{left:130%}}\n[data-cc=\"scan\"]{position:absolute;left:0;right:0;height:4px;background:linear-gradient(90deg,transparent,#CFA45F,#fff,#CFA45F,transparent);box-shadow:0 0 18px 4px rgba(207,164,95,.75);animation:cc-scan .9s ease-in-out infinite alternate}\n@keyframes cc-scan{from{top:2%}to{top:96%}}\n[data-cc=\"grid\"]{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(rgba(207,164,95,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(207,164,95,.18) 1px,transparent 1px);background-size:22px 22px}\n[data-cc=\"blink\"]{animation:cc-blink 1s steps(2,start) infinite}\n@keyframes cc-blink{to{visibility:hidden}}\nhtml.cc-welcome #cc-install-hint{display:none !important}\n@media (prefers-reduced-motion: reduce){[data-cc]{animation:none !important;transition:none !important}}\n",R=e=>({dataSet:{cc:e}}),z='undefined'!=typeof document,P=()=>z&&'function'==typeof window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches,O=()=>{try{z&&navigator.vibrate?.(12)}catch{}};function D({label:e,onPress:t,kind:n="primary",testID:r,disabled:s}){const o='primary'===n;return(0,C.jsx)(l.default,{testID:r,accessibilityRole:"button",accessibilityLabel:e,disabled:s,onPress:()=>{O(),t()},...R(o&&!s?'btnp':'btn'),style:({pressed:e})=>[{alignSelf:'stretch',minHeight:56,borderRadius:28,alignItems:'center',justifyContent:'center',paddingHorizontal:20,backgroundColor:o?A:'rgba(255,255,255,0.04)',borderWidth:o?0:1.5,borderColor:A,opacity:s?.45:1,transform:[{scale:e?.96:1}]}],children:(0,C.jsx)(T.T,{size:18,weight:"semibold",colour:o?'#0B0B0B':A,center:!0,children:e})})}const E=({children:e,colour:t=A})=>(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:t,style:{letterSpacing:2.2},children:e}),L={Owner:['Takings, sales, labour cost and payroll','Bookings (Tables and Covers), orders, the rota and team chat','Every setting, plus the Assistant for quick answers'],Manager:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],Supervisor:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],'Head Chef':['Stock, costings, prep, ordering and the specials board','Food safety checks, allergens and live tickets','Your own clock-in, rota and pay in the Staff app'],Staff:['Clock in and out, see your rota, swap shifts, ask for time off','Team chat, food safety checks and the accident book','Your own hours, pay and tips (only yours)']};function U(){const e=z?navigator.userAgent:'';return/iPhone|iPad|iPod/.test(e)?'In Safari, tap Share (the square with an arrow), then Add to Home Screen.':/SamsungBrowser/.test(e)?'Tap the menu, then Add page to, then Home screen.':'In Chrome, tap \u22ee then Add to Home screen (or Install app).'}const Y=({k:e,v:t})=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'baseline'},children:[(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:w.colours.muted,numberOfLines:1,style:{width:74,letterSpacing:1.2},children:e}),(0,C.jsx)(T.T,{size:18,weight:"semibold",style:{flex:1},children:t})]});function F({p:e,onClose:s}){const[u,p]=(0,r.useState)('choose'),[x,b]=(0,r.useState)(null),[y,j]=(0,r.useState)(null),[v,I]=(0,r.useState)(!1),[z,L]=(0,r.useState)(''),U=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{U.current&&URL.revokeObjectURL(U.current)},[]);const Y=async e=>{L('');const t=await(0,k.pickPhoto)(e);if(!t)return;U.current&&URL.revokeObjectURL(U.current);const n=URL.createObjectURL(t);U.current=n,b(n),I(!1),p('scan');const r=Date.now();try{const e=await(0,k.styliseOnDevice)(t),n=P()?0:Math.max(0,1300-(Date.now()-r));setTimeout(()=>{j(e),p('reveal'),O()},n)}catch{L("That photo couldn't be opened. Try another one (JPEG or PNG)."),p('choose')}},F=({children:e})=>(0,C.jsx)(h.default,{style:{width:236,height:236,borderRadius:118,overflow:'hidden',borderWidth:2,borderColor:A,alignItems:'center',justifyContent:'center',backgroundColor:(0,n.soutersSurface)('#050505')},children:e});return(0,C.jsxs)(c.default,{testID:"invite-avatar-step",contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsx)(E,{children:"MAKE YOUR AVATAR"}),(0,C.jsx)(T.T,{size:28,weight:"bold",center:!0,children:'choose'===u?'Choose your look':'scan'===u?'Scanning\u2026':`Looking good, ${e.name}`}),'choose'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(F,{children:[(0,C.jsx)(h.default,{style:{opacity:.55},children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:200,ring:!1})}),(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"})]})})}),(0,C.jsx)(T.T,{size:16,center:!0,colour:w.colours.muted,children:"Take a selfie or pick a photo. Your phone turns it into a space-age avatar. The photo never leaves this phone and isn\u2019t kept."}),(0,C.jsx)(D,{label:"Take a selfie",testID:"avatar-selfie",onPress:()=>Y(!0)}),(0,C.jsx)(D,{kind:"ghost",label:"Upload a photo",testID:"avatar-upload",onPress:()=>Y(!1)}),(0,C.jsx)(h.default,{style:{width:'100%',minWidth:0},children:(0,C.jsx)(t.AvatarOptions,{onSelect:t=>{f.useAvatars.getState().setOwn(e.id,e.id,t.dataUrl,e.name)?s(!0):L('Could not save your avatar. Try again.')}})})]}):'scan'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(F,{children:[x?(0,C.jsx)(o.default,{source:{uri:x},style:{width:236,height:236},accessibilityLabel:"Your photo"}):null,(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('scan'),pointerEvents:"none"})]})}),(0,C.jsx)(E,{colour:w.colours.muted,children:"MAKING YOUR AVATAR ON THIS PHONE"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:y?(0,C.jsx)(o.default,{testID:"avatar-result",source:{uri:y},style:{width:220,height:220,borderRadius:110},accessibilityLabel:"Your new avatar"}):null})}),(0,C.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityState:{checked:v},accessibilityLabel:"I agree to use this avatar",testID:"avatar-consent",onPress:()=>{O(),I(!v)},style:{alignSelf:'stretch',flexDirection:'row',gap:12,alignItems:'flex-start',padding:14,borderRadius:16,borderWidth:1.5,borderColor:v?A:'rgba(255,255,255,0.2)'},children:[(0,C.jsx)(h.default,{style:{width:28,height:28,borderRadius:8,borderWidth:2,borderColor:A,backgroundColor:v?A:'transparent',alignItems:'center',justifyContent:'center'},children:v?(0,C.jsx)(T.T,{size:17,weight:"bold",colour:"#111",children:"\u2713"}):null}),(0,C.jsx)(T.T,{size:15,style:{flex:1},children:"I\u2019m happy for this avatar, made from my photo, to be shown to my team in CoverCharge. Only the finished avatar is shared; my photo isn\u2019t uploaded or kept, and a manager can reset my avatar."})]}),(0,C.jsx)(D,{label:"Use this avatar",testID:"avatar-save",disabled:!v,onPress:()=>{if(!y)return;f.useAvatars.getState().setOwn(e.id,e.id,y,e.name)?(U.current&&URL.revokeObjectURL(U.current),U.current=null,s(!0)):L("Couldn't save the avatar. Please try again.")}}),(0,C.jsx)(D,{kind:"ghost",label:"Try another photo",onPress:()=>{j(null),p('choose')}})]}),z?(0,C.jsx)(T.T,{size:15,colour:w.colours.red,center:!0,children:z}):null,'scan'!==u?(0,C.jsx)(l.default,{testID:"invite-avatar-done",accessibilityRole:"button",onPress:()=>{O(),s(!1)},style:({pressed:e})=>({padding:12,transform:[{scale:e?.96:1}]}),children:(0,C.jsx)(T.T,{size:17,weight:"semibold",colour:w.colours.text,children:"Skip, keep this one"})}):null]})}},1380,[927,798,34,1072,336,236,402,295,41,102,846,924,865,800,985,997,15,793,840,899,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}),_e.StaffHome=function({go:e}){const L=(0,m.useInStaffApp)(),{now:N,meId:A,me:O,r:R,today:z}=(0,m.useCtx)(3e4),H=(0,s.useTravelDay)('staff',z),P=(0,h.useOwner)(e=>e.shifts),F=(0,h.useOwner)(e=>e.attendance),_=(0,h.useOwner)(e=>e.staffCanViewSuppliers),E=(0,h.useOwner)(e=>e.quickLinks),W=(0,h.useOwner)(e=>e.chat),q=(0,h.useOwner)(e=>e.swaps),V=(0,h.useOwner)(e=>e.leave),G=P.filter(e=>e.staffId===A&&e.published&&e.date>=z).sort((e,s)=>e.date.localeCompare(s.date)||e.start-s.start),U=G.find(e=>e.date===z),Y=F.filter(e=>e.staffId===A&&e.in&&!e.out&&N.getTime()-new Date(e.in).getTime()<72e6).sort((e,s)=>s.in.localeCompare(e.in))[0],Q=(0,x.usePay)(A,0),K=(0,b.useOrders)(R.id),J=(0,b.useBookings)(R.id),X=K.filter(e=>(0,T.LIVE)(e)&&e.allergies.length&&(0,k.nextStep)(e,(0,k.linkedBooking)(e,J))),Z=J.filter(e=>e.date===z&&['confirmed','seated'].includes(e.status)&&(0,k.bookingNeedsAction)(e,K.filter(T.LIVE))),ee=J.filter(e=>(0,S.undoKind)(e,z)||e.walkIn&&'cancelled'===e.status&&e.date===z).sort((e,s)=>e.time.localeCompare(s.time)).slice(0,12),se=W.filter(e=>'all'===e.ch&&e.pinned&&!e.removed).slice(-1)[0],te=q.filter(e=>e.fromId===A&&'open'===e.status).length+V.filter(e=>e.staffId===A&&'pending'===e.status).length,ie=[['Clock in / out',()=>e('more','clock')],['My rota, swaps & time off',()=>e('more','rota')],['Staff chat',()=>e('chat')],['Recipe cards',()=>e('more','recipecards')],['My hours & pay',()=>e('more','mypay')],['My tips',()=>e('more','mytips')],['Post to social (draft)',()=>e('more','social')],..._?[['Suppliers',()=>e('more','suppliers')]]:[]];return!L&&H?(0,v.jsxs)(o.default,{style:{gap:10},children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(s.DayView,{rid:R.id,day:H,today:z,app:"staff"})]}):(0,v.jsxs)(o.default,{style:{gap:10},children:[L?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s.DayBar,{app:"staff",today:z}),(0,v.jsx)(t.CoversToday,{rid:R.id})]}),(0,v.jsxs)(r.Card,{highlight:u.colours.accentBorder,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.Row,{gap:10,style:{flex:1},children:[(0,v.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"My avatar",onPress:()=>e('more','avatar'),children:(0,v.jsx)(C.StaffAvatar,{id:A,size:52})}),(0,v.jsxs)(r.T,{size:18,weight:"bold",children:["Hi ",O.replace(' (example)','').split(' ')[0]]})]}),(0,v.jsx)(r.Badge,{kind:"gold",label:L?R.name:'Staff app preview'})]}),(0,v.jsx)(r.Muted,{children:L?`${N.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})}`:'This is what staff will see in the separate Staff app.'})]}),(0,v.jsx)(M.StaffTipsTile,{rid:R.id,today:z,onPress:()=>e('more','mytips')}),(0,v.jsxs)(r.Card,{highlight:Y?u.colours.ok:void 0,children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{weight:"semibold",children:Y?`On shift since ${(0,c.hm)(new Date(Y.in))}`:'Not clocked in'}),Y?(0,v.jsx)(r.Badge,{kind:"ok",label:(0,m.hmDur)(Math.max(0,Math.round((N.getTime()-new Date(Y.in).getTime())/6e4)))}):null]}),U?(0,v.jsxs)(r.Muted,{children:["Today on the rota: ",(0,m.fmtH)(U.start),"\u2013",(0,m.fmtH)(U.end)]}):G[0]?(0,v.jsxs)(r.Muted,{children:["Next on the rota: ",m.DAY3[G[0].day]," ",Number(G[0].date.slice(8))," ",(0,m.fmtH)(G[0].start),"\u2013",(0,m.fmtH)(G[0].end)]}):(0,v.jsx)(r.Muted,{children:"No shifts on the rota this week."}),(0,v.jsx)(r.Button,{small:!0,kind:Y?'secondary':'success',label:Y?'Clock out':'Clock in',onPress:()=>e('more','clock')})]}),A?(0,v.jsx)($.RequestTimeOff,{meId:A,me:O,testID:"staff-home-time-off"}):null,(0,v.jsx)(p.ShellfishTile,{rid:R.id,by:O.replace(' (example)',''),app:"staff"}),ee.length?(0,v.jsx)(r.Card,{children:(0,v.jsxs)(o.default,{testID:"staff-seated-today",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Seated and finished today (",ee.length,")"]}),(0,v.jsx)(r.Muted,{children:"Seated someone by mistake? Tap Unseat: they go back to Booked and their tables are freed. Finished or No-show by mistake? Tap Undo."}),ee.map(e=>{const s=e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;return(0,v.jsxs)(o.default,{testID:(0,f.isSeatedHighlight)(e.status)?`staff-seated-row-${e.id}`:`staff-done-row-${e.id}`,style:(0,f.isSeatedHighlight)(e.status)?{gap:6,padding:10,borderRadius:12,marginTop:4,...(0,f.seatedHighlightStyle)()}:{gap:6,borderTopWidth:1,borderTopColor:u.colours.hairline,paddingTop:8,opacity:'finished'===e.status||'noshow'===e.status?.7:1},children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsxs)(r.T,{size:17,weight:"semibold",colour:(0,f.isSeatedHighlight)(e.status)?f.SEATED_FG:u.colours.text,children:[e.time," \xb7 ",s]}),(0,v.jsx)(r.Badge,{kind:'noshow'===e.status?'red':'seated'===e.status?'ok':'neutral',label:'noshow'===e.status?'No-show':'seated'===e.status?'Seated':'Finished'})]}),(0,v.jsxs)(r.Muted,{children:[e.table?(0,I.tableCardLabel)(e.table):'No table'," \xb7 ",e.ref]}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsxs)(r.Row,{wrap:!0,gap:6,children:['seated'===e.status?(0,v.jsx)(r.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${s}`,onPress:()=>(0,B.finishBookingNow)(R.id,e)}):null,e.walkIn?(0,v.jsx)(a.CancelWalkInButton,{rid:R.id,b:e,small:!0}):null,e.walkIn?(0,v.jsx)(a.ReinstateWalkInButton,{rid:R.id,b:e,today:z,small:!0}):null,(0,v.jsx)(S.BookingUndo,{b:e,rid:R.id,today:z,who:s})]})]},e.id)})]})}):null,X.length+Z.length?(0,v.jsxs)(o.default,{testID:"staff-allergy-signoffs",style:{gap:8},children:[(0,v.jsxs)(r.T,{weight:"semibold",children:["Allergy sign-offs (",X.length+Z.length,")"]}),(0,v.jsx)(r.Muted,{children:"Tap Sign off for your step. Your name and the time are recorded."}),X.map(e=>(0,v.jsx)(j.AllergyChain,{o:e,me:O},e.id)),Z.map(e=>(0,v.jsxs)(o.default,{accessible:!0,accessibilityLabel:`Booking ${e.time}, ${e.name}, ${e.partySize}${e.table?`, ${(0,D.tableNumbersA11y)(e.table)}`:''}`,style:{gap:4},children:[(0,v.jsxs)(r.Muted,{children:["Booking ",e.time," \xb7 ",e.name," (",e.partySize,")",e.table?` \xb7 ${(0,I.tablesLabel)(e.table)}`:'']}),(0,v.jsx)(l.DepositChip,{b:e,money:!0,testID:`staff-deposit-${e.id}`}),(0,v.jsx)(j.BookingAllergyChain,{b:e,me:O}),(0,v.jsx)(o.default,{style:{flexDirection:'row'},children:(0,v.jsx)(w.WhatsAppGuest,{b:e,rid:R.id,kind:"auto"})})]},e.id))]}):null,se?(0,v.jsxs)(r.Card,{onPress:()=>e('chat'),children:[(0,v.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,v.jsx)(r.T,{size:12,weight:"semibold",colour:u.colours.gold,children:"\ud83d\udccc PINNED IN ALL STAFF"}),(0,v.jsx)(r.Muted,{children:"Open chat \u203a"})]}),(0,v.jsx)(r.T,{size:14,children:se.text})]}):null,(0,v.jsxs)(r.Card,{children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Hours this pay period"}),(0,v.jsxs)(r.T,{size:18,weight:"semibold",colour:u.colours.goldLight,children:[(0,m.hmDur)(Q.paid)," paid hours"]})]}),te?(0,v.jsx)(r.Card,{onPress:()=>e('more','rota'),children:(0,v.jsxs)(r.T,{size:14,children:["You have ",te," request",te>1?'s':''," waiting for a manager \u203a"]})}):null,(0,y.visibleLinks)(E,'staff').length?(0,v.jsxs)(o.default,{testID:"quick-links",style:{gap:6},children:[(0,v.jsx)(r.T,{weight:"semibold",children:"Quick links"}),(0,v.jsx)(y.QuickLinksRow,{compact:!0})]}):null,L?null:(0,v.jsx)(o.default,{style:{gap:6},children:ie.map(([e,s])=>(0,v.jsx)(r.Button,{kind:"secondary",label:e,onPress:s},e))})]})};var s=_r(d[0]),t=_r(d[1]),a=_r(d[2]),l=_r(d[3]);_r(d[4]);var n=e(_r(d[5])),o=e(_r(d[6])),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),f=_r(d[11]),p=_r(d[12]),m=_r(d[13]),x=_r(d[14]),y=_r(d[15]),j=_r(d[16]),b=_r(d[17]),w=_r(d[18]),k=_r(d[19]),T=_r(d[20]),C=_r(d[21]),S=_r(d[22]),I=_r(d[23]),D=_r(d[24]),B=_r(d[25]),M=_r(d[26]),$=_r(d[27]),v=_r(d[28])},1381,[1148,1073,1112,1089,34,402,102,794,865,827,840,1090,1142,1100,1145,1367,1136,850,1149,838,1147,899,1360,1014,829,1096,1154,1159,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1382,[30,34,846,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,"default",{enumerable:!0,get:function(){return q}});var t=r(_d[0]),s=r(_d[1]);r(_d[2]),r(_d[3]);var n=r(_d[4]),o=r(_d[5]),u=r(_d[6]),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=e(r(_d[10])),p=e(r(_d[11]));r(_d[12]);var y=e(r(_d[13])),h=e(r(_d[14])),S=r(_d[15]),_=r(_d[16]),O=r(_d[17]),P=r(_d[18]),j=r(_d[19]),v=r(_d[20]),b=r(_d[21]),x=r(_d[22]),A=r(_d[23]),w=r(_d[24]),E=r(_d[25]),C=r(_d[26]);r(_d[27]);var I=r(_d[28]),k=r(_d[29]),R=r(_d[30]),H=r(_d[31]),T=r(_d[32]),F=r(_d[33]),B=r(_d[34]),V=r(_d[35]),N=r(_d[36]);const G=r(_d[37]),L=r(_d[38]),M=r(_d[39]),U=r(_d[40]);function q(){const[e]=(0,n.useFonts)({Poppins_400Regular:G,Poppins_500Medium:L,Poppins_600SemiBold:M,Poppins_700Bold:U}),[t,E]=(0,d.useState)(v.useStore.persist.hasHydrated()),[T,F]=(0,d.useState)(x.useOwner.persist.hasHydrated()),B=t&&T;(0,d.useEffect)(()=>{const e=v.useStore.persist.onFinishHydration(()=>E(!0)),t=x.useOwner.persist.onFinishHydration(()=>F(!0));return v.useStore.persist.hasHydrated()&&E(!0),x.useOwner.persist.hasHydrated()&&F(!0),()=>{e(),t()}},[]),(0,d.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===(0,S.venueKey)(v.useStore.persist.getOptions().name??'')&&(0,C.quietly)(()=>v.useStore.persist.rehydrate()),e.key===(0,S.venueKey)(b.useFloor.persist.getOptions().name??'')&&(0,C.quietly)(()=>b.useFloor.persist.rehydrate()),e.key===(0,S.venueKey)(o.useBlocks.persist.getOptions().name??'')&&(0,C.quietly)(()=>o.useBlocks.persist.rehydrate())};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,d.useEffect)(()=>{B&&x.useOwner.getState().syncRoster()},[B]),(0,d.useEffect)(()=>{B&&(0,s.startAppSync)()},[B]);const V=e&&B,q=(0,w.useSignedOutGate)(),D=(0,u.usePathname)(),K=V&&!(0,O.isAllowedPath)(D||'/');return(0,d.useEffect)(()=>{if(!K)return;const e=setTimeout(()=>u.router.replace(O.ENTRY[O.APP_VARIANT]),0);return()=>clearTimeout(e)},[K,D]),(0,d.useEffect)(()=>{V&&l.hideAsync().catch(()=>{})},[V]),V?(0,N.jsxs)(j.SafeAreaProvider,{children:[(0,N.jsx)(c.StatusBar,{style:"light"}),q?(0,N.jsx)(h.default,{style:{flex:1,backgroundColor:A.colours.bg}}):(0,N.jsx)(h.default,{style:{flex:1},children:(0,N.jsx)(u.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:A.colours.bg}}})}),K&&!q?(0,N.jsx)(h.default,{style:[y.default.absoluteFill,{backgroundColor:A.colours.bg}]}):null,K||q||O.IS_CAR?null:(0,N.jsx)(R.VoiceHost,{}),q?null:(0,N.jsx)(I.SyncBadge,{}),K||q||O.IS_CAR?null:(0,N.jsx)(k.PushPrompt,{}),O.IS_CAR?(0,N.jsx)(P.CarGate,{}):(0,N.jsx)(w.InviteGate,{}),K||q?null:(0,N.jsx)(H.SliderHost,{})]}):(0,N.jsxs)(h.default,{style:{flex:1,backgroundColor:A.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[_.HERO_LOGOS[S.VENUE_RID]?(0,N.jsx)(p.default,{source:_.HERO_LOGOS[S.VENUE_RID],accessibilityLabel:"Venue logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,N.jsx)(f.default,{color:A.colours.gold})]})}T.PITCH&&(globalThis.__pitch={useSaverCfg:V.useSaverCfg,useSync:s.useSync,seedInvitePairsForQA:t.seedInvitePairsForQA,appVariant:O.APP_VARIANT,useStore:v.useStore,useOwner:x.useOwner,useFloor:b.useFloor,useBlocks:o.useBlocks,useSession:E.useSession,useCashUp:F.useCashUp,seedPitch:B.seedPitch},setTimeout(()=>{try{(0,B.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),E.START_INVITE,l.preventAutoHideAsync().catch(()=>{})},1383,[1384,985,795,1335,1386,1011,30,1413,496,34,385,336,236,41,102,5,847,846,1415,36,848,1014,865,840,1374,997,1010,1418,1419,1420,1421,1099,2,1024,1441,1304,25,1442,1443,1444,1445]); +__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,"default",{enumerable:!0,get:function(){return q}});var t=r(_d[0]),s=r(_d[1]);r(_d[2]),r(_d[3]);var n=r(_d[4]),o=r(_d[5]),u=r(_d[6]),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=e(r(_d[10])),p=e(r(_d[11]));r(_d[12]);var y=e(r(_d[13])),h=e(r(_d[14])),S=r(_d[15]),_=r(_d[16]),O=r(_d[17]),P=r(_d[18]),j=r(_d[19]),v=r(_d[20]),b=r(_d[21]),x=r(_d[22]),A=r(_d[23]),w=r(_d[24]),E=r(_d[25]),C=r(_d[26]);r(_d[27]);var I=r(_d[28]),k=r(_d[29]),R=r(_d[30]),H=r(_d[31]),T=r(_d[32]),F=r(_d[33]),B=r(_d[34]),V=r(_d[35]),N=r(_d[36]);const G=r(_d[37]),L=r(_d[38]),M=r(_d[39]),U=r(_d[40]);function q(){const[e]=(0,n.useFonts)({Poppins_400Regular:G,Poppins_500Medium:L,Poppins_600SemiBold:M,Poppins_700Bold:U}),[t,E]=(0,d.useState)(v.useStore.persist.hasHydrated()),[T,F]=(0,d.useState)(x.useOwner.persist.hasHydrated()),B=t&&T;(0,d.useEffect)(()=>{const e=v.useStore.persist.onFinishHydration(()=>E(!0)),t=x.useOwner.persist.onFinishHydration(()=>F(!0));return v.useStore.persist.hasHydrated()&&E(!0),x.useOwner.persist.hasHydrated()&&F(!0),()=>{e(),t()}},[]),(0,d.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===(0,S.venueKey)(v.useStore.persist.getOptions().name??'')&&(0,C.quietly)(()=>v.useStore.persist.rehydrate()),e.key===(0,S.venueKey)(b.useFloor.persist.getOptions().name??'')&&(0,C.quietly)(()=>b.useFloor.persist.rehydrate()),e.key===(0,S.venueKey)(o.useBlocks.persist.getOptions().name??'')&&(0,C.quietly)(()=>o.useBlocks.persist.rehydrate())};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,d.useEffect)(()=>{B&&x.useOwner.getState().syncRoster()},[B]),(0,d.useEffect)(()=>{B&&(0,s.startAppSync)()},[B]);const V=e&&B,q=(0,w.useSignedOutGate)(),D=(0,u.usePathname)(),K=V&&!(0,O.isAllowedPath)(D||'/');return(0,d.useEffect)(()=>{if(!K)return;const e=setTimeout(()=>u.router.replace(O.ENTRY[O.APP_VARIANT]),0);return()=>clearTimeout(e)},[K,D]),(0,d.useEffect)(()=>{V&&l.hideAsync().catch(()=>{})},[V]),V?(0,N.jsxs)(j.SafeAreaProvider,{children:[(0,N.jsx)(c.StatusBar,{style:"light"}),q?(0,N.jsx)(h.default,{style:{flex:1,backgroundColor:A.colours.bg}}):(0,N.jsx)(h.default,{style:{flex:1},children:(0,N.jsx)(u.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:A.colours.bg}}})}),K&&!q?(0,N.jsx)(h.default,{style:[y.default.absoluteFill,{backgroundColor:A.colours.bg}]}):null,K||q||O.IS_CAR?null:(0,N.jsx)(R.VoiceHost,{}),q?null:(0,N.jsx)(I.SyncBadge,{}),K||q||O.IS_CAR?null:(0,N.jsx)(k.PushPrompt,{}),O.IS_CAR?(0,N.jsx)(P.CarGate,{}):(0,N.jsx)(w.InviteGate,{}),K||q?null:(0,N.jsx)(H.SliderHost,{})]}):(0,N.jsxs)(h.default,{style:{flex:1,backgroundColor:A.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[_.HERO_LOGOS[S.VENUE_RID]?(0,N.jsx)(p.default,{source:_.HERO_LOGOS[S.VENUE_RID],accessibilityLabel:"Venue logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,N.jsx)(f.default,{color:A.colours.gold})]})}T.PITCH&&(globalThis.__pitch={useSaverCfg:V.useSaverCfg,useSync:s.useSync,seedInvitePairsForQA:t.seedInvitePairsForQA,appVariant:O.APP_VARIANT,useStore:v.useStore,useOwner:x.useOwner,useFloor:b.useFloor,useBlocks:o.useBlocks,useSession:E.useSession,useCashUp:F.useCashUp,seedPitch:B.seedPitch},setTimeout(()=>{try{(0,B.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),E.START_INVITE,l.preventAutoHideAsync().catch(()=>{})},1383,[1384,985,795,1335,1386,1011,30,1413,496,34,385,336,236,41,102,5,847,846,1415,36,848,1014,865,840,1374,997,1010,1419,1420,1421,1422,1099,2,1024,1442,1304,25,1443,1444,1445,1446]); __d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"inviteCache",{enumerable:!0,get:function(){return j}}),_e.refreshLinkPhones=P,_e.linkedSinceText=I,_e.refreshInvites=A,_e.useInviteStatus=function(){const[,e]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const n=()=>e(e=>e+1);return v.add(n),A(),()=>{v.delete(n)}},[]),x},Object.defineProperty(_e,"when",{enumerable:!0,get:function(){return C}}),_e.inviteStateText=function(e,n=Date.now()){return'used'===e?.state?'Previous link used. Current app links are prepared automatically.':e?.devices?`Signed in on ${e.devices} device${1===e.devices?'':'s'}`:'Personal Android and iPhone links'},_e.seedInvitePairsForQA=function(n,t,s){if(!e.PITCH)throw new Error('QA only');w.set(`${n}:${t}`,s),S()},Object.defineProperty(_e,"installSteps",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"installMessage",{enumerable:!0,get:function(){return D}}),_e.InviteLinkControls=function({m:e,actorRole:s}){const o=(0,u.useSync)(e=>e.venueId),b=(0,u.useSync)(e=>'staff'===e.kind&&!!e.venueId),x=(0,u.useSync)(e=>e.perms.includes('*')||e.perms.includes('roles.manage')),j=b&&e.active&&!e.name.includes('(example)')&&('owner'===s||x||'manager'===s&&'owner'!==e.role&&!e.ownerAccess),A=`${o}:${e.id}`,B=(0,f.useSession)(e=>e.meId),T=(0,y.useOwner)(e=>B?e.staff.find(e=>e.id===B):void 0),E=!B||!!T&&(0,k.ownJobManagesLinks)(T),[,z]=(0,t.useState)(0),[O,_]=(0,t.useState)(''),[W,U]=(0,t.useState)(!1),[Z,F]=(0,t.useState)(null),[G,N]=(0,t.useState)(null),[Q,Y]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{if(!j)return;const n=()=>z(e=>e+1);v.add(n),P(),M(A,e.id);const t=setInterval(()=>{M(A,e.id)},3e4),s=()=>{M(A,e.id)};return'undefined'!=typeof window&&window.addEventListener('focus',s),()=>{v.delete(n),clearInterval(t),'undefined'!=typeof window&&window.removeEventListener('focus',s)}},[j,A,e.id]),!j)return null;const J=w.get(A),q=async n=>{try{await(0,u.revokeStaffAppLink)(n),w.delete(A),N(null),_('Link revoked. Existing signed-in sessions are unchanged.'),await M(A,e.id),Z&&F(await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}};return(0,m.jsxs)(l.default,{testID:`invite-${e.id}`,style:{gap:10},children:[(()=>{const n=I(L[e.id]);return n?(0,m.jsxs)(l.default,{testID:`invite-phone-${e.id}`,style:{gap:8,padding:12,borderRadius:10,borderWidth:1,borderColor:h.colours.gold,backgroundColor:h.colours.bg,alignItems:'center'},children:[(0,m.jsx)(d.T,{center:!0,weight:"semibold",colour:h.colours.goldLight,testID:`invite-phone-since-${e.id}`,children:n}),(0,m.jsxs)(d.Muted,{center:!0,size:13,children:["Another phone that opens ",e.name,"\u2019s link is asked to see a manager."]}),E?Q?(0,m.jsxs)(l.default,{style:{gap:8,alignItems:'center',width:'100%'},children:[(0,m.jsxs)(d.T,{center:!0,size:15,children:["Reset ",e.name,"\u2019s phone? Their link will link to the next phone that opens it. Phones already signed in stay signed in."]}),(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Yes, reset phone",testID:`invite-reset-yes-${e.id}`,style:{minHeight:44},accessibilityLabel:`Yes, reset ${e.name}'s phone`,onPress:async()=>{try{await(0,u.resetStaffLinkPhone)(e.id),await P(),_(`Phone reset. ${e.name}\u2019s link will link to the next phone that opens it.`)}catch(e){_(String(e.message))}finally{Y(!1)}}}),(0,m.jsx)(d.Button,{label:"Cancel",kind:"ghost",style:{minHeight:44},testID:`invite-reset-no-${e.id}`,onPress:()=>Y(!1)})]})]}):(0,m.jsx)(d.Button,{label:"Reset phone",kind:"secondary",testID:`invite-reset-${e.id}`,style:{minHeight:44},accessibilityLabel:`Reset phone for ${e.name}. Asks to confirm.`,onPress:()=>Y(!0)}):(0,m.jsx)(d.Muted,{center:!0,size:13,testID:`invite-reset-managers-only-${e.id}`,children:"Only a manager or owner can reset a phone or switch a link off."})]}):null})(),['android','iphone'].map(t=>{const s='android'===t?'Android app':'iPhone web app',o=J?.[t],u=(0,c.currentAppLink)(o)&&o?(0,c.personalAppUrl)(t,o):null;return(0,m.jsxs)(l.default,{testID:`invite-${t}-${e.id}`,style:{gap:6,padding:10,borderRadius:10,borderWidth:1,borderColor:h.colours.gold,backgroundColor:h.colours.bg},children:[(0,m.jsx)(d.T,{center:!0,weight:"semibold",children:s}),u&&o?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n.Text,{selectable:!0,accessibilityLabel:`${e.name}, ${s} personal link`,testID:`invite-link-${t}-${e.id}`,style:{color:h.colours.goldLight,fontSize:14,textAlign:'center',width:'100%'},children:o.shortCode?`Short link: ${o.shortCode}`:"Secure personal link \u2014 Copy or Share"}),(0,m.jsx)(d.Muted,{center:!0,size:13,children:H(t)}),(0,m.jsx)(d.Muted,{center:!0,size:13,children:"Works for good on the first phone that opens it."}),(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Copy",kind:"secondary",style:{minHeight:44,minWidth:44},accessibilityLabel:`Copy ${e.name}'s ${s} link`,testID:`invite-copy-${t}-${e.id}`,onPress:async()=>_(await(0,p.copyText)(D(u,e.name,t))?'Link and install steps copied':'Select and copy the link.')}),(0,m.jsx)(d.Button,{label:"Share",style:{minHeight:44,minWidth:44},accessibilityLabel:`Share ${e.name}'s ${s} link`,testID:`invite-share-${t}-${e.id}`,onPress:async()=>_(await R(u,e.name,t))}),E?(0,m.jsx)(d.Button,{label:"Revoke link",kind:"ghost",style:{minHeight:44},accessibilityLabel:`Revoke ${e.name}'s ${s} link`,onPress:()=>N(o.id)}):null]})]}):(0,m.jsx)(d.Muted,{children:$.has(A)?'Cannot load the current link. Reconnecting automatically.':'Preparing current link\u2026'})]},t)}),G&&E?(0,m.jsxs)(d.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,m.jsx)(d.Button,{label:"Confirm revoke link",accessibilityLabel:`Confirm revoke link for ${e.name}`,style:{minHeight:44},onPress:()=>{q(G)}}),(0,m.jsx)(d.Button,{label:"Cancel",kind:"ghost",style:{minHeight:44},onPress:()=>N(null)})]}):null,O?(0,m.jsx)(d.T,{center:!0,size:14,children:O}):null,(0,m.jsx)(d.Button,{label:W?"Making new links\u2026":"Make new app links",testID:`invite-new-${e.id}`,accessibilityLabel:`Make new Android and iPhone app links for ${e.name}`,disabled:W,onPress:async()=>{if(!W){U(!0);try{const n=await(0,u.refreshStaffAppLinks)(e.id);w.set(A,n),$.delete(A),S(),_('New links ready. Links already sent keep working. Signed-in phones stay signed in.'),Z&&F(await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}finally{U(!1)}}}}),(0,m.jsxs)(d.Muted,{center:!0,size:13,children:["Share privately with ",e.name,". Links never expire. Each link works on the first phone that opens it; Reset phone lets it link to a new one."]}),(0,m.jsx)(d.Button,{label:Z?'Hide previous links':'Manage previous links',kind:"ghost",style:{minHeight:44},accessibilityLabel:`Manage all previous app links for ${e.name}`,onPress:async()=>{try{F(Z?null:await(0,u.staffAppLinkHistory)(e.id))}catch(e){_(String(e.message))}}}),Z?.map(n=>(0,m.jsxs)(l.default,{style:{gap:4},children:[(0,m.jsxs)(d.Muted,{center:!0,size:13,children:['legacy'===n.platform?'Previous app link':'android'===n.platform?'Android app':'iPhone'," \xb7 ",C(n.createdAt)," \xb7 ",n.revokedAt?'Revoked':n.usedAt?'Used for sign-in':'Unused']}),!n.revokedAt&&E?(0,m.jsx)(d.Button,{label:"Revoke this link",kind:"ghost",style:{minHeight:44},accessibilityLabel:`Revoke ${e.name}'s ${n.platform} link from ${C(n.createdAt)}`,onPress:()=>N(n.id)}):null]},n.id))]})};var e=r(_d[0]),n=r(_d[1]),t=r(_d[2]);r(_d[3]),r(_d[4]);var s,o=r(_d[5]),l=(s=o)&&s.__esModule?s:{default:s},d=r(_d[6]),c=r(_d[7]),u=r(_d[8]),h=r(_d[9]),p=r(_d[10]),f=r(_d[11]),y=r(_d[12]),k=r(_d[13]),m=r(_d[14]);const w=new Map,b=new Map,v=new Set,$=new Map,S=()=>v.forEach(e=>e());let x=null;const j=()=>x;let L={};async function P(){return L=await(0,u.staffLinkPhones)(),S(),L}function I(e){if(!e||!e.phones)return null;const n=new Date(e.since).toLocaleDateString('en-GB',{timeZone:'Europe/London',day:'numeric',month:'short',year:'numeric'});return e.phones>1?`Linked to ${e.phones} phones, the first since ${n}`:`Linked to a phone since ${n}`}async function A(){return x=await(0,u.readInviteStatus)(),S(),x}const C=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZoneName:'short'}):'';async function M(n,t){if(e.PITCH&&w.has(n))return;if(b.has(n))return b.get(n);const s=(async()=>{try{w.set(n,await(0,u.ensureStaffAppLinks)(t)),$.delete(n)}catch(e){w.delete(n),$.set(n,String(e.message||e))}finally{b.delete(n),S()}})();return b.set(n,s),s}const H=e=>'android'===e?'Tap the link, download the app, allow installation, then open it. It signs you in.':'Open in Safari and tap Open app. In the app, tap Share, Add to Home Screen, then open it from your Home Screen.',D=(e,n,t)=>`${n} \u2014 ${'android'===t?'Android app':'iPhone web app'}\n${e}\n${H(t)}`;async function R(e,n,t){const s=D(e,n,t);try{if('undefined'!=typeof navigator&&navigator.share)return await navigator.share({title:`CoverCharge for ${n}`,text:s,url:e}),'Share opened'}catch(e){if('AbortError'===e.name)return'Share cancelled'}return await(0,p.copyText)(s)?'Link and install steps copied. Paste them into a private message.':'Select and copy the link.'}},1384,[2,796,34,236,383,102,794,1385,985,840,1151,997,865,988,25]); __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IOS_WEB",{enumerable:!0,get:function(){return t}}),e.getPageSlug=n,e.personalGetUrl=o,e.siteRootFromLocation=s,e.mintPersonalUrl=function(t,c,h){const p=s();if(p)return o({origin:p.origin,basePath:p.basePath,staffId:t,name:c,token:h});return`get/${n(c)||n(t)}.html?v=2#i=${encodeURIComponent(h)}`},e.currentAppLink=function(t,n=Date.now()){return!!t&&/^[A-Za-z0-9_-]{16,64}$/.test(t.token)&&Date.parse(t.expiresAt)>n},e.personalAppUrl=function(t,n){if(n.shortCode&&/^[A-Za-z0-9_-]{10}$/.test(n.shortCode)){const t=s()??{origin:'https://covercharge-apps.static.hf.space',basePath:'/'};return`${t.origin}${t.basePath}s.html#${n.shortCode}`}if(n.url)try{const t=new URL(n.url);if('https:'===t.protocol&&'covercharge-apps.static.hf.space'===t.hostname&&/^\/(?:(?:kirkmichael|wildings)\/)?get\/[a-z0-9-]+\.html$/.test(t.pathname))return t.href}catch{}const o=s()??{origin:'https://covercharge-apps.static.hf.space',basePath:'/'},c=['owner','chef'].includes(n.app)?n.app:'staff',h=`i=${encodeURIComponent(n.token)}${'iphone'===t?`&d=${encodeURIComponent(n.device||'')}`:''}`;return`${o.origin}${o.basePath}get/${t}.html?a=${c}${'android'===t?'&v=2':'&v=61'}#${h}`};const t=new Set(['st-jack','st-agate','st-lenny','st-james','st-lillie','st-bisto','st-gordon','st-cameron','st-mia','st-emily','st-gabrielle','st-harvey','st-tracy','st-eilidh','st-finn']);function n(t){return(t.startsWith('st-')||t.startsWith('ow-')||t.startsWith('ch-')?t.replace(/^(st|ow|ch)-/,''):t.replace(/\s*\(.*?\)\s*/g,' ').trim().split(/\s+/)[0]||t).toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'staff'}function o(t){const o=t.origin.replace(/\/$/,'');let s=(t.basePath||'/').replace(/\/?$/,'/');s.startsWith('/')||(s='/'+s);return`${o}${s}get/${n(t.name)||n(t.staffId)}.html?v=2#i=${encodeURIComponent(t.token)}`}function s(t){try{if(!(t||'undefined'!=typeof window&&window.location))return null;const n=new URL(t||window.location.href),o=n.pathname.match(/^(.*?\/)(?:owner|staff|chef|display|customer)-app(?:\/|$)/);return{origin:n.origin,basePath:o?o[1]:'/'}}catch{return null}}},1385,[]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return o.useFonts}});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var o=r(d[2])},1386,[1387,1410,1412]); @@ -1495,43 +1495,44 @@ __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,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},1412,[34,1387]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},1413,[1414]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preventAutoHideAsync=async function(){return!1},e.setOptions=function(n){},e.hide=function(){},e.hideAsync=async function(){}},1414,[]); -__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.CarGate=function(){const e=(0,c.useSession)(e=>e.meId),[s,o]=(0,t.useState)(c.useSession.persist.hasHydrated());return(0,t.useEffect)(()=>{const e=c.useSession.persist.onFinishHydration(()=>o(!0));return c.useSession.persist.hasHydrated()&&o(!0),e},[]),s?e||h.PITCH?null:(0,j.jsx)(I,{}):(0,j.jsx)(n.default,{style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=e(_r(d[1])),n=e(_r(d[2])),s=e(_r(d[3])),o=_r(d[4]),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),f=_r(d[10]),p=_r(d[11]),y=_r(d[12]),j=_r(d[13]);let b=null,w=null;async function M(e){return!e&&w&&Date.now()-w.at<6e4&&new Date(w.r.expiresAt).getTime()-Date.now()>12e4?w.r:b||(b=(0,u.carPairStart)().then(e=>(e.ok&&(w={r:e,at:Date.now()}),e)).finally(()=>{b=null}),b)}function I(){const{width:e,height:c}=(0,s.default)(),[h,b]=(0,t.useState)(null),[w,I]=(0,t.useState)('starting'),[T,D]=(0,t.useState)(''),[k,C]=(0,t.useState)(0),z=(0,t.useRef)(!1),S=(0,t.useCallback)(async(e=!0)=>{if(z.current)return;z.current=!0,I('starting'),D('');const t=await M(e);if(z.current=!1,!t.ok)return I('error'),void D(t.error);b({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),I('waiting')},[]);(0,t.useEffect)(()=>{S(!1)},[]),(0,t.useEffect)(()=>{if(!h||'waiting'!==w)return;const e=setInterval(async()=>{C(Math.max(0,Math.round((h.until-Date.now())/1e3)));('expired'===await(0,u.carPairPoll)(h.id)||Date.now()>h.until)&&I('expired')},3e3);return()=>clearInterval(e)},[h,w]);const P=Math.min(120,Math.max(64,Math.round(Math.min(e/9,c/7)))),H=h?.code??'',v=H?`${H.slice(0,3)} ${H.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,j.jsx)(n.default,{testID:"car-pairing",style:[r.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:(0,j.jsxs)(n.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:c<820?10:16},children:[(0,j.jsx)(l.RestaurantLogo,{rid:x.VENUE_RID,size:c<820?64:88}),(0,j.jsx)(o.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,j.jsx)(y.ParkedOnly,{}),'waiting'===w||'starting'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,j.jsx)(n.default,{testID:"car-code",accessible:!0,accessibilityLabel:H?`Car code ${(0,p.spokenCode)(H)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,j.jsx)(o.T,{center:!0,size:P,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:P/8,lineHeight:1.2*P},children:v})}),H?(0,j.jsx)(o.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,j.jsxs)(n.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,j.jsx)(o.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,j.jsx)(o.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,j.jsx)(n.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,j.jsx)(o.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{S()},style:{minHeight:64,minWidth:200}})})]}):'expired'===w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{S()},style:{minHeight:64,minWidth:280}})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,j.jsx)(o.Muted,{center:!0,children:T}),(0,j.jsx)(o.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{S()},style:{minHeight:64,minWidth:240}})]}),T&&'error'!==w?(0,j.jsx)(o.T,{center:!0,colour:f.colours.amber,children:T}):null,(0,j.jsx)(o.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})})}},1415,[34,41,102,426,794,847,997,985,2,5,840,1416,1417,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=32;const l=s=>s.split('').join(' ')},1416,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1417,[34,102,794,840,25]); -__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1418,[986,857,856,985]); -__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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1419,[798,796,34,1343,1015,402,102,846,985,1007,1014,5,840,794,1287,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1420,[796,34,236,402,102,840,985,1045,2,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.VoiceHost=function(){const e=(0,f.useVoiceTarget)(),t=(0,f.useVoiceSlot)(e=>e.rect);g.PITCH&&(globalThis.__voiceExpect={app:e?.app??null,on:!!e?.on,slot:!!t});if(!e?.on||!t)return null;const n=(0,P.jsx)(X,{app:e.actions,ui:e.app},e.actions);if('undefined'!=typeof document){const{createPortal:e}=_r(d[33]);return e(n,document.body)}return n};var t=_r(d[0]),n=_r(d[1]),o=_r(d[2]),r=e(_r(d[3])),s=e(_r(d[4])),i=e(_r(d[5])),a=e(_r(d[6]));_r(d[7]);var l=e(_r(d[8])),c=e(_r(d[9])),u=e(_r(d[10])),h=e(_r(d[11])),p=_r(d[12]),f=_r(d[13]),g=_r(d[14]),y=_r(d[15]),m=e(y),w=_r(d[16]),x=_r(d[17]),b=_r(d[18]),v=_r(d[19]),k=_r(d[20]),j=_r(d[21]),T=_r(d[22]),R=_r(d[23]),C=_r(d[24]),S=_r(d[25]),I=_r(d[26]),M=_r(d[27]),E=_r(d[28]),H=_r(d[29]),z=_r(d[30]),D=_r(d[31]),P=_r(d[32]);const A='How many people?',$=['covers','partySize'],W=200,_=16e3,B=31e3,O='That took too long, so I stopped waiting. Hold the button and try again, or tap Type instead.',V='Something went wrong there. Hold the button and try again, or tap Type instead.',F='The microphone is blocked. Allow it in the browser\u2019s site settings, or tap the button to type instead.';function L(e,t){return'cap'===e?t?.message||E.REACHED_TEXT:'identity'===e||'app'===e?'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.':'not-allowed'===e?F:'audio-capture'===e?'I couldn\u2019t use the microphone on this device. Check nothing else is using it, then hold the button again, or tap Type instead.':'busy'===e?'Speech to text is busy just now. Hold the button and try again in a moment, or tap Type instead.':'soon'===e?'Speech to text is switching on soon. For now, tap the button to type instead.':'long'===e?'That was longer than 30 seconds. Hold the button and say it more briefly, or tap Type instead.':'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.'}function N({colour:e,size:t=34}){return(0,P.jsxs)(m.default,{width:t,height:t,viewBox:"0 0 24 24",children:[(0,P.jsx)(y.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:e}),(0,P.jsx)(y.Path,{d:"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7",stroke:e,strokeWidth:2,strokeLinecap:"round",fill:"none"})]})}const G={owner:['\u201cWalk-in fridge 3 degrees\u201d','\u201cMark the lobster sold out\u201d','\u201cHow many Covers tonight?\u201d','\u201cAdd blue roll to the Booker list\u201d'],staff:['\u201cMessage the team: running 10 minutes late\u201d','\u201cRead my messages\u201d','\u201cWhen\u2019s my next shift?\u201d','\u201cWhat are today\u2019s specials?\u201d','\u201cDoes the fish supper contain gluten?\u201d'],chef:['\u201cFreezer minus 19\u201d','\u201cMark the soup sold out\u201d','\u201cRead the orders\u201d','\u201cAdd onions to the Bidfood list\u201d'],display:['\u201cWalk-in fridge 3 degrees\u201d','\u201cRead the orders\u201d','\u201cAny room for 6 at 8?\u201d','\u201cRead the shift notes\u201d']};function X({app:e,ui:g}){const y=(0,w.useCtx)(6e4),m=(0,b.useOwner)(e=>e.staff),X=(0,I.useVoiceNav)(e=>e.go),{height:U}=(0,u.default)(),q=(0,f.useVoiceSlot)(e=>e.rect),K=q.size,Y=x.ROSTER.find(e=>'chef'===e.app),J='display'===e?'Main Display':'chef'===e?m.find(e=>e.id===Y?.id)?.name??'Head Chef':y.me,Q='display'===e?'display':'chef'===e?Y?.id??'chef':y.meId,Z={rid:y.rid,today:y.today,go:(e,t)=>X?.(e,t),app:e,who:J.replace(' (example)',''),whoId:Q,role:'owner'===g?y.role:e};(0,o.useEffect)(()=>{try{(0,T.setVenueWords)((0,R.venueKeyterms)(y.rid))}catch{}},[y.rid,m]);const[ee,te]=(0,o.useState)('idle'),[ne,oe]=(0,o.useState)(''),[re,se]=(0,o.useState)(0),[ie,ae]=(0,o.useState)(null),[le,de]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(''),[he,pe]=(0,o.useState)(!1),fe=(0,o.useRef)(null),ge=(0,o.useRef)(0),ye=(0,o.useRef)(null),me=(0,o.useRef)(Z);me.current=Z;const we=(0,o.useRef)(ie);we.current=ie;const xe=(0,o.useRef)(y.now);xe.current=y.now;const be=e=>{ae(e),te('answer')},ve=be,ke=async e=>{const t=++ge.current;let n;te('working');try{n=await(0,j.runAction)(e.id,e.params,me.current,!0)}catch{n={status:'error',message:V}}t===ge.current&&((0,H.buzz)([20,40,20]),ve({text:'needs_confirmation'===n.status?n.preview:n.message,tone:'error'===n.status?'warn':'ok'}))},je=()=>ve({text:'Cancelled. Nothing was changed.',tone:'info'}),Te=async(e,t,n)=>{const o=++ge.current,r={...e.params,[e.field]:t};let s;te('working');try{s=await(0,j.runAction)(e.id,r,me.current,!1)}catch{s={status:'error',message:V}}o===ge.current&&('needs_confirmation'===s.status?ve({heard:n,text:s.preview,pending:{id:e.id,params:r,preview:s.preview}}):ve({heard:n,text:s.message,tone:'error'===s.status?'warn':'ok'}))},Re=async(e,t)=>{const n=ge.current,o=e=>{n===ge.current&&be(e)};try{await Ce(e,o,t)}catch{o({heard:e.trim()||void 0,text:V,tone:'warn'})}},Ce=async(t,n,o)=>{const r=t.trim(),s=me.current;if(!r)return void n({text:'I didn\u2019t catch that. Hold the button while you speak, then let go.',tone:'info'});const i=we.current?.pending;if(i){const e=(0,H.yesNo)(r);if('yes'===e)return void await ke(i);if('no'===e)return void je()}const a=we.current?.ask;if(a){const e=(0,D.coversAnswer)(r);if(e&&e<=30)return void await Te(a,e,r)}te('working');const l=(0,j.matchIntent)(r,s.today,{app:e,rid:s.rid,whoId:s.whoId}),c=xe.current;if(!E.voiceUsage.allowed(s.rid,'action'===l.kind?l.action.id:null,c))return void n({heard:r,text:E.REACHED_TEXT,tone:'info'});E.voiceUsage.record(s.rid,c);const u=E.voiceUsage.get(s.rid,c),h=u.reached?E.REACHED_TEXT:u.warn?(0,E.WARN_TEXT)(u):void 0,p=e=>n({...e,note:h});if('action'===l.kind){const e=l.action,t=e.params.filter(e=>e.required&&(void 0===l.params[e.name]||''===l.params[e.name]||'[]'===l.params[e.name]));if(1===t.length&&$.includes(t[0].name))return void p({heard:r,text:A,ask:{id:e.id,params:l.params,field:t[0].name},tone:'info'});if(t.length)return void p({heard:r,text:e.preview(l.params,s)+(/\?$/.test(e.preview(l.params,s))||/couldn|didn/.test(e.preview(l.params,s))?'':` I still need: ${t.map(e=>e.description.toLowerCase()).join('; ')}.`)+' Hold the button and try again.',tone:'warn'});const n=await(0,j.runAction)(e.id,l.params,s,!1);return void('needs_confirmation'===n.status?p({heard:r,text:n.preview,pending:{id:e.id,params:l.params,preview:n.preview}}):p({heard:r,text:n.message,tone:'error'===n.status?'warn':'ok'}))}const f=` ${r.toLowerCase()} `,g=e=>{const t=(0,j.actionById)(e);if(!t)return 0;try{return t.match?t.match(f):t.keywords.filter(e=>f.includes(e)).length}catch{return 0}},y=()=>(0,j.toolSpecs)().filter(t=>{const n=(0,j.actionById)(t.function.name);return!!n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))}).map((e,t)=>({t:e,i:t,s:g(e.function.name)})).sort((e,t)=>t.s-e.s||e.i-t.i).slice(0,60).map(e=>e.t),m=async t=>{if('call'===t.kind){const n=(0,j.actionById)(t.name);if(n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))){const e=n.params.filter(e=>e.required&&(void 0===t.args[e.name]||''===t.args[e.name]));if(1===e.length&&$.includes(e[0].name))return p({heard:r,text:A,ask:{id:n.id,params:t.args,field:e[0].name},tone:'info'}),!0;const o=await(0,j.runAction)(n.id,t.args,s,!1);return'needs_confirmation'===o.status?p({heard:r,text:o.preview,pending:{id:n.id,params:t.args,preview:o.preview}}):p({heard:r,text:o.message,tone:'error'===o.status?'warn':'ok'}),!0}}return'text'===t.kind&&(p({heard:r,text:(0,j.moneySafe)(e,s.role)?(0,j.noMoney)(t.text):t.text,tone:'info'}),!0)};if('help'===l.kind){const t=l.ids.map(C.helpById).filter(Boolean)[0];if(!(((0,S.searchHelp)(C.HELP,r,1)[0]?.score??0)>=2.5)){const n=await(0,T.askServer)(e,r,y(),o);if(await m(n))return;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(`${t.title}. ${t.body}`)?void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}.`,tone:'info'}):void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}. This guide might help: ${t.title}.`,help:l.ids,tone:'info'})}const n=`${t.title}. ${t.body}`;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(n)?void p({heard:r,text:'That isn\u2019t shown here. Ask a manager in the Managers app.',tone:'info'}):void p({heard:r,text:n,help:l.ids,tone:'info'})}await m(await(0,T.askServer)(e,r,y(),o))||p({heard:r,text:T.SOON_TEXT+' '+G[e].slice(0,2).join(' or ')+'.',tone:'info'})},Se=()=>{fe.current?.abort(),fe.current=null,ye.current?.(),ye.current=null,se(0)};(0,o.useEffect)(()=>()=>{fe.current?.abort(),ye.current?.()},[]);const Ie=async()=>{if(!(0,H.canListen)())return de(!0),void ve({text:(0,H.tabletWithoutMic)()?'This Display tablet app needs an update before it can use the microphone. For now, type below.':'This browser can\u2019t record speech. Type instead below.',tone:'info'});if((0,H.desktopStt)()){if(!(0,M.micExplainedFor)(g))return void pe(!0)}else{const e=await(0,H.micPermission)();if('granted'===e)(0,M.setMicExplainedFor)(g);else{if('denied'===e)return de(!0),void ve({text:F,tone:'warn'});if(!(0,M.micExplainedFor)(g))return void pe(!0)}}if(!He.current.holding&&!Ee.current)return;const t=++ge.current;(0,H.buzz)(35),oe(''),ae(null),de(!1),te('listening');if(fe.current=(0,H.listen)(oe,(e,n,o)=>{if(ye.current?.(),ye.current=null,se(0),fe.current=null,t===ge.current){if('not-allowed'!==n&&'service-not-allowed'!==n)return'stt-failed'===n?(ve({text:'Speech to text didn\u2019t start on this Mac. Type instead below; restarting the app usually fixes it.',tone:'warn'}),void de(!0)):void(n?ve({text:L(n,o),tone:'cap'===n?'info':'warn'}):Re(e,o?.receipt));ve({text:(0,H.desktopStt)()?'The microphone is blocked for CoverCharge. Open System Settings \u203a Privacy & Security \u203a Microphone, switch on CoverCharge for Mac, then try again. Or type instead.':F,tone:'warn'})}},e,se),!fe.current)return te('idle'),void de(!0);if((0,H.desktopStt)()){const e=await(0,H.levelMeter)(se);fe.current?ye.current=e:e()}},Me=()=>{fe.current&&(te('working'),fe.current.stop(),ye.current?.(),ye.current=null,se(0))},Ee=(0,o.useRef)(!1),He=(0,o.useRef)({timer:0,holding:!1}),ze=(0,o.useRef)(Ie);ze.current=Ie;const De=(0,o.useRef)(Me);De.current=Me;const Pe=(0,o.useMemo)(()=>a.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>{const e=He.current;e.holding=!1,(0,M.micExplainedFor)(g)&&(0,H.warmMic)(),e.timer=setTimeout(()=>{e.holding=!0,ze.current()},W)},onPanResponderRelease:()=>{const e=He.current;if(clearTimeout(e.timer),e.holding)return e.holding=!1,void De.current();(0,H.disarmMic)(),de(!0),te(e=>'idle'===e?'answer':e)},onPanResponderTerminate:()=>{const e=He.current;clearTimeout(e.timer),e.holding&&(e.holding=!1,De.current())}}),[e]);(0,o.useRef)(ee).current=ee,(0,o.useEffect)(()=>z.useVoiceKeys.subscribe((e,t)=>{const n=e.last;if(!n||n.n===t.last?.n)return;const o=!!fe.current;'start'!==n.cmd||o?'stop'===n.cmd?(Ee.current=!1,o&&De.current()):'toggle'===n.cmd?o?(Ee.current=!1,De.current()):(Ee.current=!0,ze.current()):'type'===n.cmd&&(de(!0),te(e=>'idle'===e?'answer':e)):(Ee.current=!0,ze.current())}),[]);const Ae=K>=64,$e=(0,o.useRef)(new s.default.Value(0)).current;(0,o.useEffect)(()=>{if('listening'!==ee)return $e.stopAnimation(),void $e.setValue(0);const e=s.default.loop(s.default.timing($e,{toValue:1,duration:1100,easing:i.default.out(i.default.quad),useNativeDriver:!1}));return e.start(),()=>e.stop()},[ee]);const We='listening'===ee,Be='answer'===ee&&(ie||le)||'working'===ee||We,Oe=()=>{ge.current++,Se(),ae(null),de(!1),ue(''),te('idle')};(0,o.useEffect)(()=>{if('working'!==ee&&'listening'!==ee)return;const e=ge.current,t=setTimeout(()=>{e===ge.current&&('listening'!==ee?(ge.current++,Se(),de(!0),be({heard:ne&&!/\u2026$/.test(ne)?ne:void 0,text:O,tone:'warn'})):De.current())},'working'===ee?_:B);return()=>clearTimeout(t)},[ee]);const Ve=()=>{const e=ce.trim();e&&(ue(''),oe(e),ge.current++,Re(e))},Fe='fixed',Le={top:q.y+K+8},Ne=$e.interpolate({inputRange:[0,1],outputRange:[1,1.7]}),Ge=$e.interpolate({inputRange:[0,1],outputRange:[.6,0]}),Xe='warn'===ie?.tone?k.colours.amber:ie?.pending?k.colours.gold:k.colours.border;return(0,P.jsxs)(P.Fragment,{children:[Be?(0,P.jsx)(h.default,{testID:"voice-panel",style:[{position:Fe,left:12,right:12,alignItems:'flex-end',zIndex:60},Le],pointerEvents:"box-none",children:(0,P.jsxs)(h.default,{style:{width:'100%',maxWidth:Ae?720:520,backgroundColor:k.colours.surface,borderRadius:16,borderWidth:2,borderColor:Xe,padding:Ae?20:14,gap:10,maxHeight:U*(Ae?.78:.6)},children:[(0,P.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.gold,accessibilityRole:"header",children:We?Ae?'Listening\u2026 let go (or press \u2318\u21e7G) to send':'Listening\u2026 let go to send':'working'===ee?'Working on it\u2026':ie?.pending?'Please confirm':'Voice assistant'}),(0,P.jsx)(l.default,{testID:"voice-close",accessibilityRole:"button",accessibilityLabel:"Close voice assistant",hitSlop:12,onPress:Oe,style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:20,colour:k.colours.muted,children:"\u2715"})})]}),(0,P.jsx)(v.T,{testID:"voice-reply-mode",size:14,colour:k.colours.muted,children:"Text replies only"}),We?(0,P.jsxs)(h.default,{style:{gap:8},children:[(0,P.jsx)(h.default,{style:{height:10,borderRadius:5,backgroundColor:k.colours.surface2,overflow:'hidden'},children:(0,P.jsx)(h.default,{testID:"voice-level",style:{width:`${Math.round(8+92*re)}%`,height:10,backgroundColor:k.colours.ok}})}),(0,P.jsx)(v.T,{size:16,children:ne||'Say it now\u2026'})]}):null,'working'===ee?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(r.default,{color:k.colours.gold}),(0,P.jsx)(v.T,{size:15,colour:k.colours.muted,children:ne?/\u2026$/.test(ne)?ne:`\u201c${ne}\u201d`:''})]}):null,'working'===ee||We?(0,P.jsx)(v.Button,{testID:"voice-stop",kind:"secondary",label:"Cancel",onPress:()=>{ge.current++,Se(),de(!1),be({text:'Stopped. Nothing was changed.',tone:'info'})},style:{minHeight:48}}):null,'answer'===ee&&ie?(0,P.jsxs)(c.default,{style:{maxHeight:U*(Ae?.55:.36)},contentContainerStyle:{gap:8},children:[ie.heard?(0,P.jsx)(h.default,{testID:"voice-heard",accessible:!0,accessibilityLabel:`I heard: ${ie.heard}`,children:(0,P.jsxs)(v.T,{size:Ae?16:14,colour:k.colours.muted,children:["I heard: \u201c",ie.heard,"\u201d"]})}):null,ie.note?(0,P.jsx)(h.default,{testID:"voice-usage-note",children:(0,P.jsx)(v.T,{size:13,colour:k.colours.amber,children:ie.note})}):null,(0,P.jsx)(h.default,{testID:"voice-answer",children:(0,P.jsx)(v.T,{size:Ae?24:18,weight:ie.pending?'semibold':'regular',children:ie.text})}),ie.help&&'owner'===e&&X?ie.help.slice(0,3).map(e=>{const t=(0,C.helpById)(e);return t?(0,P.jsx)(v.Button,{small:!0,kind:"secondary",label:`Open help: ${t.title}`,onPress:()=>{X('more','help'),Oe()}},e):null}):null]}):null,'answer'===ee&&ie?.ask?(0,P.jsx)(h.default,{testID:"voice-how-many",style:{flexDirection:'row',flexWrap:'wrap',gap:10},children:[1,2,3,4,5,6,7,8].map(e=>(0,P.jsx)(l.default,{testID:`voice-covers-${e}`,accessibilityRole:"button",accessibilityLabel:1===e?'1 person':`${e} people`,onPress:()=>{Te(ie.ask,e)},style:{width:Ae?96:72,height:Ae?96:72,borderRadius:14,backgroundColor:k.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:Ae?40:32,weight:"semibold",colour:k.colours.onGold,children:e})},e))}):null,'answer'===ee&&ie?.pending?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(v.Button,{testID:"voice-confirm",kind:"success",label:"Confirm",onPress:()=>{ke(ie.pending)},style:{flex:1,minHeight:56}}),(0,P.jsx)(v.Button,{testID:"voice-cancel",kind:"secondary",label:"Cancel",onPress:je,style:{flex:1,minHeight:56}})]}):null,'answer'!==ee||ie?.pending?null:(0,P.jsxs)(h.default,{style:{gap:6},children:[le||!(0,H.canListen)()?(0,P.jsxs)(v.Row,{gap:8,children:[(0,P.jsx)(n.TextInput,{testID:"voice-type",value:ce,onChangeText:ue,onSubmitEditing:Ve,placeholder:"Type instead\u2026",placeholderTextColor:k.colours.muted,autoFocus:!0,returnKeyType:"send",style:{flex:1,minWidth:0,width:0,minHeight:48,borderRadius:10,borderWidth:1,borderColor:k.colours.border,backgroundColor:k.colours.surface2,color:k.colours.text,paddingHorizontal:12,fontFamily:k.fonts.regular,fontSize:16}}),(0,P.jsx)(v.Button,{testID:"voice-send",kind:"success",label:"Ask",onPress:Ve,disabled:!ce.trim()})]}):(0,P.jsx)(l.default,{accessibilityRole:"button",onPress:()=>de(!0),children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"Type instead"})}),ie?null:(0,P.jsxs)(v.T,{size:Ae?15:13,colour:k.colours.muted,children:[Ae?'Hold Space (or the gold button) and speak, or press \u2318\u21e7G to start and again to send. ':'Hold the gold button and speak, for example ',Ae?`For example ${G[e].join(', ')}.`:`${G[e].join(', ')}.`]}),'owner'===g&&'owner'===e?(0,P.jsx)(l.default,{testID:"voice-open-assistant",accessibilityRole:"button",onPress:()=>{Oe(),p.useAssistantUi.getState().setOpen(!0)},style:{minHeight:44,justifyContent:'center'},children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"\u2726 Open the Assistant (ideas, history and longer requests) \u203a"})}):null]})]})}):null,(0,P.jsxs)(h.default,{style:{position:Fe,left:`clamp(0px, ${q.x}px, calc(100vw - ${K}px))`,top:q.y,width:K,height:K,zIndex:61},pointerEvents:"box-none",children:[We?(0,P.jsx)(s.default.View,{pointerEvents:"none",style:{position:'absolute',left:0,top:0,width:K,height:K,borderRadius:K/2,borderWidth:4,borderColor:k.colours.ok,opacity:Ge,transform:[{scale:Ne}]}}):null,We?(0,P.jsx)(h.default,{pointerEvents:"none",style:{position:'absolute',left:-6,top:-6,width:K+12,height:K+12,borderRadius:(K+12)/2,borderWidth:3+Math.round(7*re),borderColor:k.colours.ok}}):null,(0,P.jsx)(h.default,{testID:"voice-button",accessible:!0,accessibilityRole:"button",accessibilityLabel:'owner'===g&&'owner'===e?'Voice assistant and Assistant. Hold to talk, let go to send. Tap to type or open the Assistant.':'Voice assistant. Hold to talk, let go to send. Tap to type instead.',...Pe.panHandlers,style:[{width:K,height:K,borderRadius:K/2,alignItems:'center',justifyContent:'center',backgroundColor:We?k.colours.ok:k.colours.gold,borderWidth:2,borderColor:k.colours.bg},{userSelect:'none',WebkitUserSelect:'none',WebkitTouchCallout:'none',touchAction:'none',cursor:'pointer'}],children:['kirkton','abbotsford'].includes(t.VENUE_RID)?(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.onGold,children:'working'===ee?'Wait':'Talk'}):'working'===ee?(0,P.jsx)(r.default,{color:k.colours.onGold,size:"large"}):(0,P.jsx)(N,{colour:k.colours.onGold,size:Math.round(.5*K)})})]}),(0,P.jsx)(v.Sheet,{visible:he,onClose:()=>{(0,M.setMicExplainedFor)(g),pe(!1)},title:"Talk to CoverCharge",testID:"voice-explain",children:(0,P.jsxs)(h.default,{style:{gap:10},children:[(0,P.jsxs)(v.T,{children:["Hold the gold button, say what you need, then let go. For example ",G[e].slice(0,3).join(', '),"."]}),(0,P.jsx)(v.T,{children:(0,H.desktopStt)()?'Your Mac will now ask once to let CoverCharge use the microphone. It only listens while you hold the button.':'Your device will now ask once to use the microphone. It only listens while you hold the button, for up to 30 seconds.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:(0,H.desktopStt)()?'On this Mac, speech is turned into text on the Mac itself, so what you say isn\u2019t sent anywhere. CoverCharge doesn\u2019t keep the audio.':'What you say while holding is sent to Grok (xAI) to be turned into text. CoverCharge doesn\u2019t keep the audio.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:"The helper replies in text only, never aloud. Any change is shown in text first, with Confirm and Cancel buttons; you can also say \u201cyes\u201d. Orders to suppliers, messages and payments are only ever saved as drafts for the owner."}),(0,P.jsx)(v.Button,{testID:"voice-allow",kind:"success",label:"Allow microphone",onPress:async()=>{(0,M.setMicExplainedFor)(g),pe(!1);const e=!!(0,H.desktopStt)()||await(0,H.askMic)();if((0,H.desktopStt)()){(await(0,H.levelMeter)(()=>{}))()}ve(e?{text:'Ready. Now hold the button and speak.',tone:'ok'}:{text:F,tone:'warn'})}}),(0,P.jsx)(v.Button,{kind:"secondary",label:"Type instead",onPress:()=>{(0,M.setMicExplainedFor)(g),pe(!1),de(!0),te('answer')}})]})})]})}},1421,[5,796,34,385,283,364,380,236,402,295,426,102,1422,1116,2,900,1100,15,865,794,840,1423,930,1437,1433,1434,1438,1117,1439,929,1440,1436,25,277]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ASSISTANT_AVAILABLE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"useAssistantUi",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"AssistantFab",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"AssistantSheet",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"AssistantPage",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"AssistantSettings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"AssistantPlanCard",{enumerable:!0,get:function(){return c}});const t=!1,n={getState:()=>({open:!1,setOpen:t=>{}})},u=()=>null,s=()=>null,l=()=>null,o=()=>null,c=()=>null},1422,[]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1423,[1424,1098,829,1427,1428,865,848,1014,1432,1433,1434,1430,1429,1435,1436,1012,1013]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1424,[1425,1426,1038]); -__d(function(g,r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_LABEL",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HISTORY_NOTE",{enumerable:!0,get:function(){return o}}),e.validPastDate=n,Object.defineProperty(e,"ukHistoryDate",{enumerable:!0,get:function(){return s}}),e.parseHistoryInput=function(t){const o=t.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(o))return o;const n=/^(\d{1,2})[\s/.-]+(\d{1,2})[\s/.-]+(\d{4})$/.exec(o);if(!n)return;const s=`${n[3]}-${n[2].padStart(2,'0')}-${n[1].padStart(2,'0')}`,d=new Date(s+'T12:00:00Z');return Number.isNaN(d.getTime())||d.toISOString().slice(0,10)!==s?void 0:s},e.exactHistoryDate=function(t,o){if(1!==(t.match(/\b(?:\d{4}-\d{2}-\d{2}|\d{1,2}\/\d{1,2}\/\d{4}|\d{1,2}(?:st|nd|rd|th)?\s+[a-z]+\s+\d{4})\b/gi)??[]).length)return;const s=t.match(/\b(\d{4}-\d{2}-\d{2})\b/);let d=s?.[1];if(!d){const o=t.match(/\b(\d{1,2})\/(\d{1,2})\/(\d{4})\b/);o&&(d=`${o[3]}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`)}if(!d){const o=t.toLowerCase().match(/\b(\d{1,2})(?:st|nd|rd|th)?\s+(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)\s+(\d{4})\b/),n=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'];o&&(d=`${o[3]}-${String(n.indexOf(o[2].slice(0,3))+1).padStart(2,'0')}-${o[1].padStart(2,'0')}`)}return d&&n(d,o)?d:void 0},Object.defineProperty(e,"historyDateLabel",{enumerable:!0,get:function(){return d}}),e.bookingDayText=function(t){const n=`Booked covers on ${d(t.date)}: ${null===t.booked_covers?'not recorded':t.booked_covers}.`,s=t.bookings.map(t=>`${t.time??'Time not recorded'}: party size ${null===t.covers?'not recorded':`${t.covers} Covers`}; ${t.table?`table ${t.table}`:'table not recorded'}; ${t.status??'status not recorded'}${t.counted?'':', excluded from Booked covers'}.`);return[n,...s,t.historical_records?"Includes previous booking system history (incomplete).":'',o,t.bookings.length?'':'No booking records found; incomplete history does not prove there were no bookings.',t.missing_covers?`${t.missing_covers} booking records have no party size; left blank.`:''].filter(Boolean).join(' ')};const t='Includes previous booking system history (incomplete)',o='Recovered booking records, not confirmed attendance. Cancelled bookings are shown but excluded from Booked covers.';function n(t,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;const n=new Date(t+'T12:00:00Z');return!Number.isNaN(n.getTime())&&n.toISOString().slice(0,10)===t&&t{const[o,n,s]=t.split('-');return`${s} ${n} ${o}`};const d=t=>new Date(t+'T12:00:00Z').toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'Europe/London'})},1425,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.historyAccess=c,_e.lookupBookingDay=l,_e.useHistoricalBookingDay=function(t,o,u,y=0){const k=(0,s.useSync)(e=>[e.kind,e.venueId,e.venueSlug,e.perms.join(',')].join(':')),f=c(t),h=f&&(0,n.validPastDate)(o,u)?`${k}:${o}:${y}`:'',[w,p]=(0,e.useState)({key:'',data:null,error:''});return(0,e.useEffect)(()=>{if(!h)return void p({key:'',data:null,error:''});let e=!0;return l(t,o).then(t=>{e&&p({key:h,data:t,error:''})}).catch(t=>{e&&p({key:h,data:null,error:t.message})}),()=>{e=!1}},[h,t,o]),{allowed:f,data:h&&w.key===h?w.data:null,error:h&&w.key===h?w.error:''}};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]);function c(e){const n=s.useSync.getState();return'owner'===t.APP_VARIANT&&'staff'===n.kind&&n.venueSlug===e&&!!n.venueId&&(n.perms.includes('*')||n.perms.includes('staff.manage'))}async function l(e,t){if(!c(e))throw new Error('Sign in to the Managers app with manager or owner access to Look back.');if(!(0,n.validPastDate)(t,(0,o.venueYmd)(new Date)))throw new Error('Choose an exact past date, with day, month and year.');const l=(0,u.getSupabase)(),{data:y,error:k}=await l.rpc('historical_booking_day',{p_venue:s.useSync.getState().venueId,p_date:t});if(k||!y||!Array.isArray(y.bookings))throw new Error('Booking history could not be loaded. Reconnect and try again.');return y}},1426,[34,846,1425,827,985,931]); -__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"niceDay",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"appNow",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"num",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"tableIn",{enumerable:!0,get:function(){return L}}),e.resolveTable=q,Object.defineProperty(e,"tokensOf",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"hm",{enumerable:!0,get:function(){return x}}),e.findBooking=A,Object.defineProperty(e,"staffOf",{enumerable:!0,get:function(){return me}}),Object.defineProperty(e,"findCard",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(e,"allergenList",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(e,"OPS_VOICE_ACTIONS",{enumerable:!0,get:function(){return ye}});var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),o=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),d=_r(_d[7]),l=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),b=_r(_d[11]),p=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]);const f=t=>{const[n,r,a]=t.split('-').map(Number);return new Date(n,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},y=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},k=(t,n)=>n.test(t),w=t=>t.who??('display'===t.app?'Main Display':'Assistant'),v={a:1,an:1,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,fifteen:15,twenty:20,half:.5},S=t=>null==t||''===t?void 0:'number'==typeof t?t:v[String(t).toLowerCase()]??(Number.isFinite(Number(t))?Number(t):void 0),$=['owner','staff','display'],C=['owner','staff','chef','display'],I=['staff'],N=/\btables?\s+([a-z]?\d{1,3}[a-z]?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/i,L=t=>{const n=t.match(N);return n?String(S(n[1])??n[1]).toUpperCase():void 0};function q(t,n){const r=String(n??'').replace(/^tables?\s+/i,'').trim();if(!r)return;const a=String(S(r)??r).toLowerCase(),o=(0,s.planOf)(t),i=[...new Set([...(o?.tables??[]).map(t=>t.name),...Object.keys(s.useFloor.getState().live[t]??{})])];return i.find(t=>t.toLowerCase()===a)??(o?.tables??[]).find(t=>(t.label??'').toLowerCase()===a)?.name??i.find(t=>t.toLowerCase().replace(/[^0-9a-z]/g,'').replace(/^t(?=\d)/,'')===a.replace(/[^0-9a-z]/g,''))}const O=(t,n)=>s.useFloor.getState().live[t]?.[n]??{},_=new Set(['the','and','for','table','booking','party','seat','seated','cancel','move','mark','finished','show','arrived','here','has','have','they','them','who','with','from','tonight','today','please','change','confirm','decline','request','people','covers','guests','their','into','onto','done','left','gone']),D=t=>t.toLowerCase().replace(/[^a-z0-9: ]/g,' ').split(/\s+/).filter(t=>t.length>2&&!_.has(t)),x=t=>{const n=t.match(/\b(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/i);if(!n)return null;let r=Number(n[1]);return'pm'===n[3]?.toLowerCase()&&r<12&&(r+=12),!n[3]&&r>=1&&r<=11&&(r+=12),`${String(r).padStart(2,'0')}:${n[2]??'00'}`};function A(t,n,r,a,o){const d=String(r??'').toLowerCase(),l=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status)&&!/walk-?in/i.test(r.name??'')),c=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status));if(!d&&!o)return;const u=c.find(t=>t.ref&&d.includes(t.ref.toLowerCase()));if(u)return u;const b=D(d),p=l.filter(t=>D(t.name).some(t=>b.includes(t)));if(1===p.length)return p[0];if(o){const t=c.filter(t=>(0,s.tablesOf)(t.table).some(t=>t.toLowerCase()===o.toLowerCase())),n=p.length?t.filter(t=>p.includes(t)):t;if(n.length)return n.sort((t,n)=>('seated'===t.status?-1:1)-('seated'===n.status?-1:1))[0]}const h=/\d/.test(d.replace(N,''))?x(d.replace(N,'')):null;if(h){const t=(p.length?p:l).filter(t=>t.time===h);if(1===t.length)return t[0]}return p.length?p.sort((t,n)=>t.time.localeCompare(n.time))[0]:void 0}const j=t=>`${t.name}, ${t.partySize} at ${t.time}${t.table?`, table ${t.table}`:''}`,M=[{name:'booking',type:'string',required:!0,description:'Guest name, booking reference or time, as said'},{name:'table',type:'string',description:'Table, if said'}],T=t=>({booking:t,table:L(t)}),P='I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.';function z(t,n,r,a,i,s,d,l=""){return{id:t,apps:$,title:n,risk:'change',params:M,keywords:[],description:`${n}: today\u2019s booking by guest name, reference, table or time.${l}`,match:t=>k(t,i)?7:0,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return r?`${s}: ${j(r)}?${l}`:P},run:async(t,n)=>{const i=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return i?(await o.repo.bookings.setStatus(i.id,r),d&&await d(i,n,t),`Done: ${i.name} ${'noshow'===r?'marked as a no-show':'cancelled'===r?'cancelled':'finished'===r?'finished':r}.`):"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d."}}}const F=(t,n)=>(0,s.tablesOf)(n).forEach(n=>s.useFloor.getState().setLive(t,n,{stage:'seated',dirty:!1})),B={id:'seat_booking',apps:$,title:'Seat a booking',risk:'change',params:M,keywords:[],description:'Seat a guest with a booking today (at their booked table, or the table said). Walk-ins use add_walkin.',match:t=>!k(t,/\b(seat|sit)\b/)||k(t,/\b(walk.?in|walkin|no booking)\b/)||k(t,/\b(\d+|one|two|three|four|five|six|seven|eight|nine|ten) (people|covers|guests)\b/)?k(t,/\b(have|has|are|is) (arrived|here)\b/)?7:0:7,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']),o=q(n.rid,t.table)??r?.table;if(!r)return P;const i=o?O(n.rid,(0,s.tablesOf)(o)[0]):{};return`Seat ${r.name}, ${r.partySize} at ${r.time}${o?`, at table ${o}`:' (no table yet)'}?${i.blocked?` ${(0,a.tableNumbers)(o)} is marked blocked.`:i.dirty?` ${(0,a.tableNumbers)(o)} still needs clearing.`:i.stage?` ${(0,a.tableNumbers)(o)} already has people seated.`:''}`},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const a=q(n.rid,t.table);return t.table&&!a?`Nothing changed: there\u2019s no table ${t.table} on the plan.`:(a&&a!==r.table&&await o.repo.bookings.update(r.id,{table:a}),await o.repo.bookings.setStatus(r.id,'seated'),F(n.rid,a??r.table),`Done: ${r.name} seated${a??r.table?` at table ${a??r.table}`:''}.`)}},E=z('finish_booking','Finish a table (party left)','finished',['seated'],/\b(finished|have left|has left|left|gone|paid and gone|party left|they'?re done)\b/,'Mark finished',(t,n)=>{(0,s.tablesOf)(t.table).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0}))},' The table is then marked as needing clearing.'),R=z('no_show','Mark a no-show','noshow',['confirmed','pending'],/\b(no.?show|didn'?t (turn up|show|come)|not (turned|turning) up)\b/,'Mark as a no-show'),H=z('cancel_booking','Cancel a booking','cancelled',['confirmed','pending'],/^(?!.*\b(shifts?|orders?|rota)\b).*(\bcancel+(ed)?\b.*\b(booking|reservation|table for|party)\b|\bcancel\s+(?!that\b|it\b|this\b|now\b|please\b)[a-z]{3,})/,'Cancel the booking',void 0,' The guest is not messaged from here.'),W={id:'move_booking',apps:$,title:'Move a booking to another table',risk:'change',params:[M[0],{name:'table',type:'string',required:!0,description:'New table'}],keywords:[],description:'Give a booking today a different table (seated parties move too).',match:t=>k(t,/\b(move|put|switch|change)\b/)&&k(t,/\btables?\b/)&&!k(t,/\b(shift|rota)\b/)?7:0,parse:t=>{const n=[...t.matchAll(new RegExp(N.source,'gi'))],r=n[n.length-1];return{booking:t,table:r?String(S(r[1])??r[1]).toUpperCase():void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),o=q(n.rid,t.table);return r?o?`Move ${j(r)} to table ${o}?${O(n.rid,o).stage||O(n.rid,o).blocked?` ${(0,a.tableNumbers)(o)} is not free.`:''}`:`There\u2019s no table ${t.table??''} on the plan.`:P},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),a=q(n.rid,t.table);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";if(!a)return'Nothing changed: I couldn\u2019t find that table on the plan.';const i=r.table;return await o.repo.bookings.update(r.id,{table:a,tableSetHere:!0}),'seated'===r.status&&((0,s.tablesOf)(i).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0})),F(n.rid,a)),`Done: ${r.name} moved to table ${a}.`}},G={id:'change_booking',apps:['owner','staff'],title:'Change a booking\u2019s time or party size',risk:'change',params:[M[0],{name:'time',type:'time',description:'New time HH:mm'},{name:'covers',type:'integer',description:'New party size'}],keywords:[],description:'Change the time or the number of people on a booking today. The guest is not messaged from here.',match:t=>k(t,/\b(change|make it|now|instead|update|actually)\b/)&&k(t,/\b(booking|reservation|party)\b/)&&k(t,/\b(\d|one|two|three|four|five|six|seven|eight|nine|ten)\b/)?6:0,parse:t=>{const n=t.toLowerCase(),r=n.match(/\b(?:to|for|now|of)\s+(\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\s*(?:people|covers|guests|pax)?\b(?!\s*[:.]\d)(?!\s*(?:am|pm|o'?clock))/),a=n.match(/\b(?:to|at)\s+(\d{1,2}(?::\d{2})?\s*(?:am|pm)|\d{1,2}:\d{2}|\d{1,2}\s*o'?clock)/);return{booking:t,covers:r&&/people|covers|guests|pax|party|for/.test(n)&&!a?.[1]?.startsWith(r[1])?S(r[1]):void 0,time:a?x(a[1].replace(/o'?clock/,''))??void 0:void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);return r?t.time||t.covers?`Change ${j(r)} to ${[t.covers?`${t.covers} people`:'',t.time?`${t.time}`:''].filter(Boolean).join(' at ')}? The guest is not messaged from here.`:`What should change on ${r.name}\u2019s booking? Say the new time or number of people.`:P},run:async(t,r)=>{const a=A(r.rid,r.today,t.booking,['confirmed','pending']);if(!a)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const i=S(t.covers);if(!(null==t.covers||i&&(0,n.validParty)(i)))return`Nothing changed: ${n.PARTY_RULE}`;const s=t.time?x(String(t.time)):null;return i||s?(await o.repo.bookings.update(a.id,{...i?{partySize:i}:{},...s?{time:s}:{}}),`Done: ${a.name} is now ${i??a.partySize} at ${s??a.time}.`):'Nothing changed.'}},U={id:'decide_booking',apps:['owner'],title:'Accept or decline a booking request',risk:'change',params:[M[0],{name:'outcome',type:'string',required:!0,description:'confirmed or declined',enum:['confirmed','declined']}],keywords:[],description:'Accept or decline a booking request that is waiting (the same as the Accept / Decline buttons).',match:t=>k(t,/\b(accept|approve|confirm|decline|reject|turn down)\b/)&&k(t,/\b(booking|request|reservation)\b/)?7:0,parse:t=>({booking:t,outcome:/\b(decline|reject|turn down)\b/i.test(t)?'declined':'confirmed'}),preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?`${'declined'===t.outcome?'Decline':'Accept'} the request from ${r.name}, ${r.partySize} on ${f(r.date)} at ${r.time}?`:'I couldn\u2019t find a waiting request with that name.'},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?(await o.repo.bookings.decide(r.id,'declined'===t.outcome?'declined':'confirmed',w(n)),`Done: ${r.name}\u2019s request ${'declined'===t.outcome?'declined':'accepted'}.`):'Nothing changed: I couldn\u2019t find a waiting request with that name.'}},V=[{name:'table',type:'string',required:!0,description:'Table name or number'}],Y={id:'table_cleared',apps:$,title:'Mark a table cleared',risk:'change',params:V,keywords:[],description:'Mark a table cleared and free (after clearing it down).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(cleared|clear(ed)? down|is clean|wiped|reset|is free|is ready|ready again)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} cleared and free?${O(n.rid,r).stage?' People are still marked as seated there.':''}`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!1,stage:void 0}),`Done: table ${r} is free.`):'Nothing changed: I couldn\u2019t find that table.'}},J={id:'table_needs_clearing',apps:$,title:'Mark a table as needing clearing',risk:'change',params:V,keywords:[],description:'Mark a table as needing clearing (dirty).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(needs? (clearing|clearing down|a clean|wiping)|dirty|to be cleared)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} as needing clearing?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!0,stage:void 0}),`Done: table ${r} needs clearing.`):'Nothing changed: I couldn\u2019t find that table.'}},K={id:'block_table',apps:$,title:'Block or unblock a table',risk:'change',params:[...V,{name:'blocked',type:'string',required:!0,description:'yes to block, no to unblock',enum:['yes','no']}],keywords:[],description:'Block a table (not used tonight) or unblock it.',match:t=>k(t,/\b(un.?block|block|out of use|not in use|close)\b/)&&k(t,/\btables?\b/)&&!k(t,/\barea\b/)?8:0,parse:t=>({table:L(t),blocked:/\b(un.?block|back in use|open)\b/i.test(t)?'no':'yes'}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`${'no'===t.blocked?'Unblock':'Block'} table ${r}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{blocked:'no'!==t.blocked}),`Done: table ${r} ${'no'===t.blocked?'unblocked':'blocked'}.`):'Nothing changed: I couldn\u2019t find that table.'}},Q={mains:'mains',main:'mains',dessert:'dessert',desserts:'dessert',pudding:'dessert',bill:'bill',check:'bill',seated:'seated',starters:'seated'},X={id:'table_stage',apps:$,title:'Set a table\u2019s course',risk:'change',params:[...V,{name:'stage',type:'string',required:!0,description:'seated, mains, dessert or bill',enum:['seated','mains','dessert','bill']}],keywords:[],description:'Set where a seated table is: seated (starters), mains, dessert or bill.',match:t=>k(t,/\btables?\b/)&&k(t,/\b(on|at|having|wants?|asked for|ready for|onto)\b.*\b(mains?|desserts?|pudding|bill|check)\b/)?8:0,parse:t=>{const n=t.toLowerCase().match(/\b(mains?|desserts?|pudding|bill|check|starters)\b/);return{table:L(t),stage:n?Q[n[1]]:void 0}},preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Set table ${r} to ${t.stage}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table),a=Q[String(t.stage??'').toLowerCase()];return r&&a?(s.useFloor.getState().setLive(n.rid,r,{stage:a,dirty:!1}),`Done: table ${r} is on ${a}.`):'Nothing changed: say the table and mains, dessert or bill.'}},Z=t=>/\b(how many|how much|what'?s|what is|what are|any|have we got|do we have|are there|is there)\b|\?\s*$/.test(t),ee=t=>/\b(roast|chickens?|beef)\b/.test(t)&&!/\b(sold out|86|off the menu|menu|dish|special|allerg)/.test(t)&&Object.values(d.useShellStore.getState().items).some(t=>t.some(t=>t.active&&(0,l.isRoastItem)(t))),te=t=>(d.useShellStore.getState().items[t]??[]).filter(t=>t.active),ne=(t,n)=>{const r=String(n??'').toLowerCase();return te(t).find(t=>[t.name,t.plural,t.key].some(t=>t&&new RegExp(`\\b${t.toLowerCase().replace(/[^a-z0-9 ]/g,'')}`).test(r)))},re={id:'shellfish_count',apps:C,title:'Shellfish count: sold, delivery or recount',risk:'change',params:[{name:'item',type:'string',required:!0,description:'Item, e.g. lobster'},{name:'qty',type:'string',required:!0,description:'How many (\xbd allowed for half items)'},{name:'mode',type:'string',required:!0,description:'sold, delivery or count',enum:['sold','delivery','count']}],keywords:[],description:'Record shellfish (or other counted stock) sold, a delivery in, or a recount (sets the count).',match:t=>!k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)&&!ee(t)||k(t,/\b(allerg|contain|chat|message|tell|text|post)/)||Z(t)||!k(t,/\b(\d+|\xbd|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|sold|deliver(ed|y)?|came in|arrived|got in|count(ed)?|recount)\b/)?0:7,parse:(n,r)=>{const a=n.toLowerCase(),o=a.match(/\b(\d+(?:\.5)?|\xbd|a half|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|fifteen|twenty)\b/),i=/\b(deliver(ed|y)?|came in|arrived|got in|received)\b/.test(a)?'delivery':/\b(count|we have|we'?ve got|there are|recount|left in)\b/.test(a)?'count':'sold',s=ne(r.rid,a);return s&&(0,t.fishInStone)(r.rid,s)?{item:s.name,qty:(0,t.parseStoneAmount)(n),mode:i}:{item:s?.name??n,qty:o?'\xbd'===o[1]||/half/.test(o[1])?.5:S(o[1]):1,mode:i}},preview:(n,a)=>{const o=ne(a.rid,n.item);if(!o||'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'I couldn\u2019t find that item in the shellfish counts.';if((0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||!Number.isInteger(2*r))return'Use stone in half-stone steps, for example one and a half stone.';const i=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,s=(0,t.fromStone)(r,o.unit),l='count'===n.mode?s:'delivery'===n.mode?i+s:i-s;return`${o.name}: ${n.mode} ${(0,t.stoneSpeech)(r)}, after ${(0,t.stoneSpeech)((0,t.toStone)(Math.max(0,l),o.unit))}?`}const i=S(n.qty)??0,s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c='count'===n.mode?i:'delivery'===n.mode?s+i:s-i;return`${'count'===n.mode?`Set ${o.plural||o.name} to ${(0,l.fmtCount)(i)}`:'delivery'===n.mode?`Add a delivery of ${(0,l.fmtCount)(i)} ${o.plural||o.name}`:`Record ${(0,l.fmtCount)(i)} ${1===i?o.name:o.plural||o.name} sold`} (now ${(0,l.fmtCount)(s)}, after ${(0,l.fmtCount)(Math.max(0,c))})?`},run:(n,a)=>{const o=ne(a.rid,n.item);if(o&&'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'Nothing changed: that item is not in Head Chef stock.';if(o&&(0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||r>500||!Number.isInteger(2*r))return'Nothing changed: use stone in half-stone steps.';const i=(0,t.fromStone)(r,o.unit),s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,l='count'===n.mode?i-s:'delivery'===n.mode?i:-i;return s+l<0?`Nothing changed: only ${(0,t.stoneSpeech)((0,t.toStone)(s,o.unit))} left.`:(l&&d.shellfish.append({rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner',delta:l,reason:'count'===n.mode?'count':'delivery'===n.mode?'delivery':'sold'}),`Done: ${o.name}, ${(0,t.stoneSpeech)((0,t.toStone)(s+l,o.unit))} left.`)}const i=S(n.qty);if(!o||null==i||!(i>=0)||i>500)return'Nothing changed: say the item and how many.';if('half'!==o.unit&&i%1)return`Nothing changed: ${o.plural||o.name} are counted whole.`;const s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c={rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner'};return'count'===n.mode?(i!==s&&d.shellfish.append({...c,delta:i-s,reason:'count'}),`Done: ${o.plural||o.name} counted at ${(0,l.fmtCount)(i)}.`):'delivery'===n.mode?i<=0?'Nothing changed.':(d.shellfish.append({...c,delta:i,reason:'delivery'}),`Done: ${(0,l.fmtCount)(i)} in. ${(0,l.fmtCount)(s+i)} now.`):s(k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)||ee(t))&&Z(t)&&!k(t,/\b(allerg|contain)/)?8:0,parse:(t,n)=>({item:ne(n.rid,t)?.name}),preview:()=>'Shellfish left',run:(n,a)=>{const o=(0,d.venueCounts)(d.useShellStore.getState(),a.rid),i=ne(a.rid,n.item),s=(i?[i]:te(a.rid).filter(t=>!(0,l.isRoastItem)(t)||(0,l.isSundayIn)(new Date))).filter(t=>'chef'!==a.app||(0,r.chefCanSee)(a.rid,t));return s.length?s.map(n=>`${n.plural||n.name}: ${(0,t.fishInStone)(a.rid,n)?(0,t.stoneSpeech)((0,t.toStone)(o[n.key]??0,n.unit)):(0,l.fmtCount)(o[n.key]??0)} left`).join('. ')+'.':'No shellfish counts are set up here.'}},oe={accept:'acknowledged',preparing:'preparing',ready:'ready',collected:'collected'},ie=(t,n)=>{const r=String(n??'').toLowerCase(),a=i.useStore.getState().orders.filter(n=>n.restaurantId===t&&!['closed','cancelled','collected','served'].includes(n.status));return a.find(t=>t.ref&&r.includes(t.ref.toLowerCase()))??a.find(t=>{const n=r.match(/\b(?:number|no\.?|order)\s*(\d{1,4})\b/);return!!n&&t.ref.replace(/\D/g,'').endsWith(n[1])})??(()=>{const t=a.filter(t=>D(t.customerName??'').some(t=>D(r).includes(t)));return 1===t.length?t[0]:void 0})()},se={id:'order_status',apps:C,title:'Move an order on: accept, preparing, ready or collected',risk:'change',params:[{name:'order',type:'string',required:!0,description:'Order reference, number or customer name'},{name:'status',type:'string',required:!0,description:'accept, preparing, ready or collected',enum:['accept','preparing','ready','collected']}],keywords:[],description:'Accept a takeaway or table order, or mark it preparing, ready or collected (the same as the order buttons).',match:t=>k(t,/\b(orders?|takeaways?|collection|ticket)\b/)&&k(t,/\b(accept|ready|collected|picked up|preparing|start(ed)?|on it)\b/)&&!k(t,/\b(read|any|list|what)\b/)?7:0,parse:t=>{const n=t.toLowerCase();return{order:t,status:/\baccept/.test(n)?'accept':/\b(collected|picked up)\b/.test(n)?'collected':/\bready\b/.test(n)?'ready':'preparing'}},preview:(t,n)=>{const r=ie(n.rid,t.order);return r?`Mark order ${r.ref} for ${r.customerName} as ${'accept'===t.status?'accepted':t.status}?`:'I couldn\u2019t find that order. Say the order number or the name.'},run:async(t,n)=>{const r=ie(n.rid,t.order),a=oe[String(t.status)];if(!r||!a)return'Nothing changed: I couldn\u2019t find that order.';if('acknowledged'===a){return await o.repo.orders.accept(r.id,w(n))?`Done: order ${r.ref} accepted.`:`Order ${r.ref} was already accepted.`}return await o.repo.orders.setStatus(r.id,a,w(n)),`Done: order ${r.ref} is ${a}.`}},de={id:'order_list_add',apps:C,title:'Add to an order list',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What we need'},{name:'qty',type:'integer',description:'How many (default 1)'},{name:'list',type:'string',description:'Which list (supplier), if said'}],keywords:[],description:'Add an item to an order list (or add to the quantity if it is already on it). Nothing is ordered from the supplier.',match:t=>k(t,/\b(add|put)\b.*\b(to|on)\b.*\b(order|shopping|cash and carry|list)\b|\bwe need (more )?\w+/)&&!k(t,/\b(chat|message|tell|text|post|shift|rota)\b/)?6:0,parse:t=>{const n=t.toLowerCase().replace(/[.?!]+$/,'').match(/\b(?:add|put|need(?: more)?)\s+(?:(\d+|an?|one|two|three|four|five|six|seven|eight|nine|ten|twelve|twenty)\s+)?(.+?)(?:\s+(?:to|on)\s+(?:the\s+)?(.+?)(?:\s+(?:order|list|order list))*)?$/);return n?{qty:S(n[1])??1,item:n[2].replace(/^(?:some|more)\s+/,'').trim(),list:n[3]?.replace(/\b(order|list|shopping)\b/g,'').trim()||void 0}:{item:t}},preview:(t,n)=>{const r=c.useOrderLists.getState().lists.filter(t=>t.rid===n.rid),a=String(t.list??'').toLowerCase(),o=a&&r.find(t=>t.name.toLowerCase().includes(a))||r[0];return o?`Add ${t.qty??1} ${t.item} to ${o.name}? Nothing is ordered from the supplier.`:'There are no order lists yet. Set one up in Order lists.'},run:(t,n)=>{const r=c.useOrderLists.getState(),a=r.lists.filter(t=>t.rid===n.rid),o=String(t.list??'').toLowerCase(),i=o&&a.find(t=>t.name.toLowerCase().includes(o))||a[0],s=String(t.item??'').trim().slice(0,60),d=Math.max(1,Math.min(99,Math.round(S(t.qty)??1)));if(!i||s.length<2)return'Nothing changed: say what we need.';const l={id:n.whoId??'assistant',name:w(n)},u=r.items.find(t=>t.rid===n.rid&&t.listId===i.id&&'open'===t.status&&t.name.toLowerCase()===s.toLowerCase());return u?(r.bump(u.id,d,l),`Done: added ${d} more ${s} on ${i.name}.`):(r.addItem(n.rid,{listId:i.id,name:s,qty:d,unit:'',addedBy:l.id,addedByName:l.name}),`Done: ${d} ${s} added to ${i.name}.`)}},le={in:'Clock you in',out:'Clock you out',break_start:'Start your break',break_end:'End your break'};function ce(t,n,r){return{id:t,apps:I,title:le[n].replace('you','me').replace('your','my'),risk:'change',params:[],keywords:[],description:`${le[n]} now (only for the person signed in; the same location check as the Clock tab).`,match:t=>k(t,r)?8:0,preview:()=>`${le[n]} now?`,run:async(t,r)=>{if(!r.whoId)return'Sign in to the Staff app first.';const a=y().toISOString(),o=await(0,b.clockAction)(n,{rid:r.rid,staffId:r.whoId,date:r.today,at:a});return o.ok?'Done: '+{in:'clocked in',out:'clocked out',break_start:'break started',break_end:'break ended'}[n]+` at ${new Date(a).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}.`+(o.warn?' '+o.warn:''):'Nothing changed: '+o.message}}}const ue=ce('clock_in','in',/\bclock (me )?in\b|\bclocking in\b|\bstart(ing)? my shift\b/),be=ce('clock_out','out',/\bclock (me )?out\b|\bclocking out\b|\b(finish|end)(ing)? my shift\b/),pe=ce('break_start','break_start',/\b(start|starting|taking|take|going on|begin)( my| a)? break\b|\bon (my )?break now\b/),he=ce('break_end','break_end',/\b(end|ending|finish|finished|back from)( my| a| the)? break\b|\bback from break\b/),me=t=>{const n=u.useOwner.getState().staff,r=String(t??'').toLowerCase();return n.find(n=>n.id===t)?.id??n.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>D(r).includes(t)))?.id},ge=(t,n)=>{if(!(0,p.hasRecipeCards)())return;const r=D(String(n??''));let a;for(const n of(0,p.recipeCards)().list(t)){const t=D(n.dish).filter(t=>r.includes(t)).length;t&&t>(a?.s??0)&&(a={c:n,s:t})}return a?.c},fe=t=>{const n=m.ALLERGENS.filter(n=>t[n.id]).map(n=>('may'===t[n.id]?'may contain ':'')+n.label.toLowerCase());return n.length?n.join(', '):'none of the 14 allergens'},ye=[B,E,R,H,W,G,U,Y,J,K,X,re,ae,se,de,ue,be,pe,he,{id:'decide_leave',apps:['owner'],title:'Approve or decline a holiday request',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff member id or first name'},{name:'outcome',type:'string',required:!0,description:'approved or declined',enum:['approved','declined']}],keywords:[],description:'Approve or decline someone\u2019s waiting holiday (leave) request.',match:t=>k(t,/\b(approve|accept|decline|reject|ok|okay)\b/)&&k(t,/\b(holiday|leave|time off|day off|days off)\b/)?7:0,parse:t=>{const n=t.toLowerCase(),r=u.useOwner.getState().staff.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>new RegExp(`\\b${t}\\b`).test(n)));return{staffId:r?.id,outcome:/\b(decline|reject|refuse)\b/.test(n)?'declined':'approved'}},preview:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status),o=n.staff.find(t=>t.id===r)?.name.replace(' (example)','');return a?`${'declined'===t.outcome?'Decline':'Approve'} ${o}\u2019s holiday, ${f(a.from)}${a.to!==a.from?` to ${f(a.to)}`:''}?`:`There\u2019s no waiting holiday request${o?` from ${o}`:''}.`},run:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status);return a?(n.setLeave(a.id,'declined'===t.outcome?'declined':'approved'),`Done: holiday ${'declined'===t.outcome?'declined':'approved'}.`):'Nothing changed: no waiting request found.'}},{id:'allergen_signoff',apps:['chef'],title:'Sign off a dish\u2019s allergens',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'}],keywords:[],description:'Head chef signs off a recipe card (its allergens). The allergens are read back first.',match:t=>k(t,/\bsign(ed)?.?off\b|\bapprove\b.*\b(card|recipe|allergens?)\b/)?8:0,parse:t=>({dish:t}),preview:(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?`${r.dish} can\u2019t be signed off yet: ${a}`:`Sign off ${r.dish}? Allergens: ${fe(r.allergens)}.`},run:async(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'Nothing changed: I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?'Nothing changed: '+a:(await(0,p.recipeCards)().signOff(r.id,{name:w(n),role:'head-chef'}),`Done: ${r.dish} signed off.`)}}]},1427,[982,1098,804,829,848,800,1014,981,983,1025,865,1071,856,832,830]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.spokenDate=j,Object.defineProperty(_e,"GAP_VOICE_ACTIONS",{enumerable:!0,get:function(){return be}});var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),l=_r(_d[12]),f=_r(_d[13]),u=_r(_d[14]),m=_r(_d[15]),g=_r(_d[16]),y=_r(_d[17]),b=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),S=_r(_d[21]),$=_r(_d[22]);const v=(e,t)=>t.test(e),I=e=>e.who??('display'===e.app?'Main Display':'Assistant'),N=e=>(e??'').replace(' (example)',''),A=e=>String(e).padStart(2,'0'),D=()=>{const e=(0,$.appNow)();return`${A(e.getHours())}:${A(e.getMinutes())}`},C=['owner','staff','display'],T=['owner'],q=['staff','owner'],O=['owner','chef'],_=e=>`\u201c${e}\u201d`,x=(e,t)=>n.useOwner.getState().sys(e,t,(0,$.appNow)().toISOString()),M=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],R=e=>`${A(Math.floor(e))}:${A(Math.round(e%1*60))}`,L=['january','february','march','april','may','june','july','august','september','october','november','december'];function j(e,t){const a=e.toLowerCase(),r=a.match(new RegExp(`\\b(\\d{1,2})(?:st|nd|rd|th)?(?:\\s+of)?\\s+(${L.join('|')})\\b`))??a.match(new RegExp(`\\b(${L.join('|')})\\s+(\\d{1,2})(?:st|nd|rd|th)?\\b`));if(r){const e=Number(/\d/.test(r[1])?r[1]:r[2]),a=L.indexOf(/\d/.test(r[1])?r[2]:r[1]);let n=Number(t.slice(0,4));return`${n}-${A(a+1)}-${A(e)}`e.active)){const r=[N(e.name).split(' ')[0],e.nickname].filter(Boolean).map(e=>e.toLowerCase()),n=Math.min(...r.map(e=>{const a=t.match(new RegExp(`\\b${e.replace(/[^a-z']/g,'')}\\b`));return a?.index??1/0}));n<1/0&&a.push({s:e,at:n})}return a.sort((e,t)=>e.at-t.at).map(e=>e.s)}const F=e=>n.useOwner.getState().staff.find(t=>t.id===e),E=e=>F(e)??W(String(e??''))[0],U=e=>a.useStore.getState().waitlist.filter(t=>t.restaurantId===e&&('waiting'===t.status||'notified'===t.status)).sort((e,t)=>e.number-t.number);function z(e,t){const a=String(t??'').toLowerCase(),r=U(e);if(!r.length)return;const n=a.match(/(?:#|number|no\.?)\s*(\d{1,3})\b/);if(n)return r.find(e=>e.number===Number(n[1]));const i=(0,$.tokensOf)(a).filter(e=>!['waitlist','wait','list','off','remove','told','ready','next'].includes(e)),s=r.filter(e=>(0,$.tokensOf)(e.name).some(e=>i.includes(e)));return s.length?s[0]:/\b(next|first)\b/.test(a)||1===r.length?r[0]:void 0}const Y=e=>`waitlist number ${e.number}, ${e.name}, party of ${e.partySize}`;function B(e,t){const n=a.useStore.getState(),i=n.restaurants.find(t=>t.id===e);if(!i)return;const s=(0,$.appNow)(),o=(0,l.ymdOf)(s),d=r.useFloor.getState(),c=d.plans[e]??(0,r.seedPlan)(e),h=n.bookings.filter(t=>t.restaurantId===e),p=(0,w.closedAreasAt)(w.useBlocks.getState().blocks,e,o,D()),f=(0,b.floorView)(c,h,n.orders.filter(t=>t.restaurantId===e),d.live[e]??{},s,i.settings.turnMins,p);return(0,b.suggestTable)(c,h.filter(e=>e.date===o),f,t,s,(0,b.turnFor)(t,i.settings.turnMins))?.table}const P=/\bwait ?(ing )?list\b|\bwaiting\b/,H=[{name:'who',type:'string',required:!0,description:'Waitlist number or name, as said (or "next")'}],K={id:'waitlist_seat',apps:C,title:'Seat someone from the waitlist',risk:'change',params:[...H,{name:'table',type:'string',required:!1,description:'Table (else the best free table)'}],keywords:[],description:'Seat a waiting party from the waitlist at a table (the suggested table unless one is said), like the Seat button.',match:e=>v(e,P)&&v(e,/\bseat\b|\bsit\b/)?9:0,parse:e=>({who:e,table:(0,$.tableIn)(e)}),preview:(e,t)=>{const a=z(t.rid,e.who);if(!a)return'I couldn\u2019t find that party on the waitlist. Say their number or name.';const r=(0,$.resolveTable)(t.rid,e.table)??B(t.rid,a.partySize);return r?`Seat ${Y(a)}, at table ${r}?`:`There\u2019s no free table for ${a.partySize} right now. Say a table to seat them anyway.`},run:async(e,a)=>{const n=z(a.rid,e.who);if(!n)return'Nothing changed: I couldn\u2019t find that party on the waitlist.';const i=(0,$.resolveTable)(a.rid,e.table)??B(a.rid,n.partySize);return i?(await t.repo.waitlist.setStatus(n.id,'seated'),await t.repo.bookings.seatWalkIn(a.rid,n.partySize,i,`From waitlist #${n.number}`),(0,r.tablesOf)(i).forEach(e=>r.useFloor.getState().setLive(a.rid,e,{stage:'seated',dirty:!1})),`Done: waitlist number ${n.number} seated at table ${i}.`):'Nothing changed: there\u2019s no free table for them. Say a table.'}};function V(e,t){if(!e.whoId)return;const a=n.useOwner.getState().shifts.filter(t=>t.staffId===e.whoId&&!1!==t.published&&t.date>=e.today).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start),r=j(String(t??''),e.today);return r?a.find(e=>e.date===r):a[0]}const G=e=>`${(0,$.niceDay)(e.date)}, ${R(e.start)} to ${R(e.end)}`,Q=/\b(approve|accept|decline|reject|okay|ok)\b/,Z='I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d.';function J(e,t){const a=e.toLowerCase(),r=a.match(/\bfrom\s+(.+?)\s+(?:to|until|till)\s+(.+)$/);if(r){const e=j(r[1],t),a=j(r[2],t)??e;return{from:e,to:a&&e&&a'open'===e.status&&(!r||e.kind===r)),s=W(String(e??'')).map(e=>e.id);return s.length?i.find(e=>s.includes(e.fromId)&&(!e.toId||1===s.length||s.includes(e.toId)))??i.find(e=>s.includes(e.fromId)||e.toId&&s.includes(e.toId)):1===i.length?i[0]:void 0}const ee=(t,a)=>'chef'!==a?.app||(0,e.chefCanSee)(a.rid,t)&&(0,e.chefCanSee)(a.rid,i.useSafety.getState().points.find(e=>e.id===t.pointId)),te=(e,t)=>{const a=i.useSafety.getState().entries.filter(a=>(0,l.ymdOf)(new Date(a.at))===e&&ee(a,t));return{n:a.length,bad:a.filter(e=>!e.ok).length,fixed:a.filter(e=>!e.ok&&e.corrective).length}},ae=/\b(food safety|safety diary|diary|haccp|safe methods|sfbb)\b/;function re(e,t){const a=(0,m.weekStart)(new Date(e+'T12:00:00')),r=new Date(a+'T00:00:00').getTime(),n=r+6048e5,s=i.useSafety.getState().entries.filter(e=>{const a=new Date(e.at).getTime();return a>=r&&a!e.ok).length,actions:s.filter(e=>!e.ok&&e.corrective).length,daysSigned:o.filter(e=>{const t=new Date(e.date+'T00:00:00').getTime();return t>=r&&te.test(t))?.[1]??'Other',location:s?s[1].replace(/^the /,''):'Not said',firstAid:o?o[1]:'',what:e.trim().replace(/^(?:please\s+)?(?:record|log|report|add|write up|put in the accident book)\s+(?:an?\s+)?(?:accident|near miss|injury)?\s*(?:in the accident book)?\s*[:,-]?\s*/i,'').replace(/^\w/,e=>e.toUpperCase())||e.trim()}}function se(e,t){const a=(0,d.ukClock)((0,$.appNow)()),r=new Date(`${a.ymd}T12:00:00Z`).getUTCDay(),n=(0,$.tokensOf)(String(t??'')).filter(e=>!['tick','ticked','task','off','mark','done','did','finished','completed','ive','i\u2019ve','list'].includes(e)),i=e=>(0,$.tokensOf)(e).filter(e=>n.some(t=>t===e||t.length>3&&e.startsWith(t.slice(0,4)))).length,h=e.whoId?(0,o.tasksFor)((0,s.tasksOf)(e.rid,e.whoId),r):[];let p=h.map(e=>({t:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.t;const l='chef'===e.app?['all','kitchen']:'staff'===e.app?['all','foh']:['all','foh','kitchen'],f=p?void 0:c.useReminders.getState().reminders.filter(t=>t.rid===e.rid&&!t.removed&&!t.paused&&t.days.includes(a.dow)&&l.includes(t.audience)).map(e=>({r:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.r;return{ymd:a.ymd,task:p,rem:f}}const oe=e=>a.useStore.getState().menu.filter(t=>t.restaurantId===e);function de(e,t){const a=(0,$.tokensOf)(String(t??''));let r;for(const t of oe(e)){const e=(0,$.tokensOf)(t.name).filter(e=>a.includes(e)).length;e&&e>(r?.s??0)&&(r={m:t,s:e})}return r?.m}const ce=e=>{const t=e.match(/\xa3\s?(\d+(?:\.\d{1,2})?)|\b(\d+(?:\.\d{2}))\b|\b(\d+)\s*(?:pounds|quid)(?:\s*(\d{1,2}))?/i);if(t)return t[1]?Number(t[1]):t[2]?Number(t[2]):Number(t[3])+(t[4]?Number(t[4])/100:0)},he={gram:'g',grams:'g',g:'g',kilo:'kg',kilos:'kg',kg:'kg',ml:'ml',millilitres:'ml',litre:'l',litres:'l',l:'l',tablespoon:'tbsp',tablespoons:'tbsp',tbsp:'tbsp',teaspoon:'tsp',teaspoons:'tsp',tsp:'tsp',pinch:'pinch',slice:'slice',slices:'slices',whole:'whole'};function pe(e){const t=e.match(/\badd\s+(\d+(?:\.\d+)?|a|an|one|two|three|four|five|six|half)\s*(grams?|g|kilos?|kg|ml|millilitres|litres?|l|tablespoons?|tbsp|teaspoons?|tsp|pinch|slices?|whole)?\s+(?:of\s+)?(.+?)\s+(?:to|into|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*$/i);if(t)return{qty:String((0,$.num)(t[1])??t[1]),unit:t[2]?he[t[2].toLowerCase()]??t[2]:'',name:t[3].trim(),dish:t[4]}}const le={in:'Clock {n} in',out:'Clock {n} out',break_start:'Start a break for {n}',break_end:'End {n}\u2019s break'},fe=e=>null==e?'not entered':`\xa3${e.toLocaleString('en-GB',{minimumFractionDigits:2,maximumFractionDigits:2})}`,ue=e=>'owner'===e.app&&'staff'!==e.role,me=['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];function ge(e){if(/\bweekdays?\b/.test(e))return[1,2,3,4,5];if(/\bweekends?\b/.test(e))return[0,6];const t=me.map((t,a)=>new RegExp(`\\b${t}s?\\b`).test(e)?a:-1).filter(e=>e>=0);return t.length?t:[0,1,2,3,4,5,6]}const ye={all:'everyone on shift',foh:'front of house',kitchen:'the kitchen'},be=[K,{id:'waitlist_remove',apps:C,title:'Take someone off the waitlist',risk:'change',params:H,keywords:[],description:'Take a party off the waitlist (they left or no longer need a table), like the Remove button. It stays in the records.',match:e=>v(e,P)&&v(e,/\b(remove|take .*off|cross .*off|strike .*off|gave up|have left|has left|left|gone)\b/)&&!v(e,/\b(seat|told|ready)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Take ${Y(a)}, off the waitlist?`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,a)=>{const r=z(a.rid,e.who);return r?(await t.repo.waitlist.setStatus(r.id,'removed'),`Done: number ${r.number} is off the waitlist.`):'Nothing changed: I couldn\u2019t find that party.'}},{id:'waitlist_told',apps:C,title:'Mark a waiting party as told their table is ready',risk:'change',params:H,keywords:[],description:'Record that a waiting party has been told their table is ready, like the Mark as told button. No text is sent.',match:e=>v(e,P)&&v(e,/\b(told|tell|let .* know|notif|ready|called)\b/)&&!v(e,/\b(seat|remove)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Mark ${Y(a)}, as told their table is ready? No text is sent from here.`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,n)=>{const i=z(n.rid,e.who);if(!i)return'Nothing changed: I couldn\u2019t find that party.';const s=a.useStore.getState().restaurants.find(e=>e.id===n.rid);return r.useFloor.getState().logSms(n.rid,(0,$.appNow)().toISOString(),`#${i.number} ${i.partySize}: Your table at ${s?.name??'the restaurant'} is ready.`),await t.repo.waitlist.setStatus(i.id,'notified'),`Done: number ${i.number} marked as told. No text was sent.`}},{id:'request_cover',apps:q,title:'Ask for cover for my shift',risk:'change',params:[{name:'day',type:'string',required:!1,description:'Day or date of your shift (else your next shift)'}],keywords:[],description:'Ask the team to cover one of your own shifts, like the Ask for cover button. A \u201cCover needed\u201d note goes in the team chat.',match:e=>v(e,/\bcover\b/)&&v(e,/\b(my|me)\b/)&&v(e,/\b(shift|ask|need|someone|anyone|can)\b/)&&!v(e,Q)?9:0,parse:e=>({day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day);return a?`Ask for cover for your shift on ${G(a)}? A \u201cCover needed\u201d note goes in the team chat.`:Z},run:(e,t)=>{const a=V(t,e.day);return a&&t.whoId?n.useOwner.getState().swaps.some(e=>e.shiftId===a.id&&'open'===e.status)?'There\u2019s already an open request for that shift.':(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,kind:'cover',note:'Can anyone cover?'}),x('all',`Cover needed: ${M[a.day]} ${R(a.start)}\u2013${R(a.end)} (${N(F(t.whoId)?.name??t.who)})`),`Done: cover asked for ${G(a)}. A manager approves it once someone takes it.`):"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_swap',apps:q,title:'Ask to swap my shift with someone',risk:'change',params:[{name:'with',type:'string',required:!0,description:'Who you agreed to swap with (first name)'},{name:'day',type:'string',required:!1,description:'Day or date of your shift'}],keywords:[],description:'Ask a manager to approve swapping one of your shifts with a colleague you agreed it with, like the Swap with button.',match:e=>v(e,/\bswap\b/)&&!v(e,Q)?9:0,parse:(e,t)=>({with:W(e).find(e=>e.id!==t?.whoId)?.id,day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day),r=E(e.with);return r&&r.id!==t.whoId?a?`Ask to swap your shift on ${G(a)} with ${N(r.name)}? A manager still approves it.`:Z:'Who are you swapping with? Say their first name.'},run:(e,t)=>{const a=V(t,e.day),r=E(e.with);return a&&t.whoId?r&&r.id!==t.whoId?(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,toId:r.id,kind:'swap',note:'Agreed between us'}),`Done: swap with ${N(r.name)} asked for. A manager approves it.`):'Nothing changed: say who you\u2019re swapping with.':"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_holiday',apps:q,title:'Ask for holiday',risk:'change',params:[{name:'from',type:'string',required:!0,description:'First day off, YYYY-MM-DD'},{name:'to',type:'string',required:!0,description:'Last day off, YYYY-MM-DD'},{name:'reason',type:'string',required:!1,description:'Reason (default Holiday)'}],keywords:[],description:'Send your own holiday (time off) request to a manager, like the Send request button.',match:e=>v(e,/\b(holiday|time off|day off|days off|annual leave|leave)\b/)&&v(e,/\b(request|book|ask|want|need|like|have|put in|take|off)\b/)&&!v(e,Q)&&!v(e,/\b(who|how many|when is)\b/)?8:0,parse:(e,t)=>{const a=J(e,t?.today??(0,l.ymdOf)((0,$.appNow)())),r=e.match(/\b(?:for|because)\s+(?:a |an |my )?([a-z][a-z ]{2,40}?)\s*$/i);return{...a,reason:r&&!/\b(from|to|monday|tuesday|wednesday|thursday|friday|saturday|sunday|tomorrow|\d)/i.test(r[1])?r[1]:void 0}},preview:(e,t)=>t.whoId?`Ask for ${e.reason??'holiday'} from ${(0,$.niceDay)(String(e.from))}${e.to!==e.from?` to ${(0,$.niceDay)(String(e.to))}`:''}? A manager approves it.`:'Sign in first so I know who\u2019s asking.',run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const a=e=>/^\d{4}-\d{2}-\d{2}$/.test(String(e));return!a(e.from)||!a(e.to)||String(e.to)v(e,Q)&&v(e,/\b(swap|cover|swaps)\b/)?9:0,parse:e=>({who:e,outcome:/\b(decline|reject|refuse|no)\b/i.test(e)?'declined':'approved'}),preview:e=>{const t=X(e.who);if(!t)return'I couldn\u2019t find that open swap or cover request. Say the name on it.';const a=n.useOwner.getState().shifts.find(e=>e.id===t.shiftId),r=N(F(t.fromId)?.name),i=N(F(t.toId)?.name),s='swap'===t.kind?`${r}\u2019s swap with ${i}`:t.toId?`${i} covering ${r}`:`${r}\u2019s cover request`;return'declined'===e.outcome||t.toId?`${'declined'===e.outcome?'Decline':'Approve'} ${s}${a?` for ${G(a)}`:''}?${'declined'===e.outcome?'':' The shift moves and a note goes in the team chat.'}`:`Nobody has taken ${r}\u2019s cover yet, so it can\u2019t be approved. You can decline it.`},run:e=>{const t=X(e.who);if(!t)return'Nothing changed: no open request found.';if('declined'!==e.outcome&&!t.toId)return'Nothing changed: nobody has taken that cover yet.';const a=n.useOwner.getState(),r=a.shifts.find(e=>e.id===t.shiftId);if(a.setSwap(t.id,'declined'===e.outcome?'declined':'approved'),'declined'===e.outcome)return'Done: request declined.';const i=e=>N(F(e)?.name);return x('all','swap'===t.kind?`Shift swap: ${i(t.fromId)} \u2194 ${i(t.toId)} approved`:`Cover approved: ${i(t.toId)} covers ${i(t.fromId)}${r?` (${M[r.day]} ${R(r.start)}\u2013${R(r.end)})`:''}`),'Done: approved and posted in the team chat.'}},{id:'sign_safety_day',apps:O,title:'Sign today\u2019s food safety diary',risk:'change',params:[],keywords:[],description:'Sign today\u2019s food safety diary: the opening and closing checks were done and the safe methods were followed, like the diary Sign button. Today only.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,ae)&&!v(e,/\bweek(ly)?\b/)?9:0,preview:(e,t)=>{const a=(i.useSafety.getState().daySigns??[]).find(e=>e.date===t.today);if(a)return`Today\u2019s diary is already signed by ${a.by}.`;const r=te(t.today,t);return`Sign today\u2019s food safety diary as ${I(t)}: the opening and closing checks were done and the safe methods were followed today? Today: ${r.n} checks, ${r.bad} out of range${r.bad?`, ${r.fixed} with an action`:''}.`},run:(e,t)=>'staff'===t.role?'Nothing changed: only a manager or the head chef signs the diary.':(i.useSafety.getState().daySigns??[]).some(e=>e.date===t.today)?'It\u2019s already signed today.':(i.useSafety.getState().signDay({date:t.today,by:N(I(t)),byId:t.whoId??'',at:(0,$.appNow)().toISOString()}),'Done: today\u2019s diary signed.')},{id:'sign_safety_week',apps:O,title:'Sign off this week\u2019s food safety review',risk:'change',params:[],keywords:[],description:'Weekly food safety review: reads the six statements back; Confirm means yes to all six. If any reading is out of range without an action, it must be done on screen with a note.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,/\bweek(ly)?\b/)&&(v(e,ae)||v(e,/\b(review|safety|checks)\b/))?9:0,preview:(e,t)=>{const{week:a,summary:r}=re(t.today,t),n=(i.useSafety.getState().weekly??[]).find(e=>e.week===a);if(n)return`This week is already signed off by ${n.by}.`;const s=`Week of ${(0,$.niceDay)(a)}: ${r.entries} checks, ${r.outOfRange} out of range, ${r.actions} with an action, diary signed ${r.daysSigned} of 7 days.`;return r.actions`${t+1}. ${e}.`).join(' ')} Sign off the week?`},run:(e,t)=>{if('staff'===t.role)return'Nothing changed: only a manager or the head chef signs off the week.';const{week:a,summary:r}=re(t.today,t);return(i.useSafety.getState().weekly??[]).some(e=>e.week===a)?'This week is already signed off.':r.actions!0),note:'Signed by voice: yes to all.',summary:r}),'Done: week signed off.')}},{id:'record_accident',title:'Record an accident or near miss',risk:'change',params:[{name:'what',type:'string',required:!0,description:'What happened, in the speaker\u2019s words'},{name:'person',type:'string',required:!1,description:'Who was hurt'},{name:'location',type:'string',required:!1,description:'Where'},{name:'injury',type:'string',required:!1,description:'The injury'},{name:'firstAid',type:'string',required:!1,description:'First aid given'}],keywords:[],description:'Add an entry to the accident book (accident or near miss) with what was said; every field is read back first.',match:e=>v(e,/\baccident book\b/)?10:v(e,/\b(accident|injur(y|ed)|near miss|hurt|cut (him|her|them|my)self|burn(ed|t)? (him|her|them|my)self|slipped|tripped|fell over|scalded)\b/)&&v(e,/\b(record|log|report|write|add|book|had|there was|has|have|just)\b/)&&!v(e,/\b(how many|show|read)\b/)?8:0,parse:e=>{const t=ie(e);return{what:t.what,person:t.person,location:t.location,firstAid:t.firstAid}},preview:e=>{const t=ie(String(e.what)),a=String(e.person??t.person),r=String(e.location??t.location);return`Add to the accident book: when, today at ${D()}; who, ${a} (${t.personType}); where, ${r}; type, ${t.category}; what happened, ${_(t.what)}; injury, ${e.injury?String(e.injury):'Near miss'===t.category?'none (near miss)':'not recorded'}; first aid, ${e.firstAid||t.firstAid||'none recorded'}; reported by you. Check it before you confirm; you can add more in the Accident book.`},run:(e,t)=>{const a=ie(String(e.what)),r='Near miss'===a.category,n=(0,$.appNow)();return i.useSafety.getState().addAccident({when:`${(0,l.ymdOf)(n)}T${D()}`,location:String(e.location??a.location),person:String(e.person??a.person),personType:a.personType,category:a.category,what:a.what,injury:String(e.injury??'')||(r?'None (near miss)':'Not recorded'),firstAid:String(e.firstAid||a.firstAid||'')||'None recorded',witnesses:'None',reportedBy:N(I(t)),reportedById:t.whoId??'',app:'staff'===t.app?'staff':'chef'===t.app?'chef':'managers'}),'Done: added to the accident book.'+(/(hospital|fracture|broke|unconscious|ambulance)/i.test(a.what)?' This may need reporting under RIDDOR; check the Accident book.':'')}},{id:'tick_task',apps:['staff','chef','owner'],title:'Tick off one of my tasks',risk:'change',params:[{name:'task',type:'string',required:!0,description:'The task or reminder, as said'}],keywords:[],description:'Tick off one of today\u2019s daily tasks (yours), or mark a venue reminder like \u201cchairs up\u201d as done, like the tick and Done buttons.',match:e=>v(e,/\btick(ed)?( off)?\b|\bmark .* (as )?done\b|\b(i'?ve|i have|we'?ve) (done|finished|completed)\b|\b(task|reminder) (is )?done\b|\bdone the\b/)&&!v(e,/\b(shift|break|order|table|booking|clock)\b/)?7:0,parse:e=>({task:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I tick your tasks.';const{ymd:a,task:r,rem:n}=se(t,e.task);return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?`${_(r.text)} is already ticked today.`:`Tick off today\u2019s task ${_(r.text)}?`:n?`Mark the reminder ${_(n.text)} as done for today?`:'I couldn\u2019t find that in today\u2019s tasks. Say a word from the task.'},run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const{ymd:a,task:r,rem:n}=se(t,e.task),i={id:t.whoId,name:N(I(t))};return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?'Already ticked today.':(s.useDailyTasks.getState().toggleTick(t.rid,t.whoId,r.id,a,i),`Done: ${_(r.text)} ticked.`):n?(c.useReminders.getState().markDone({rid:t.rid,reminderId:n.id,forDate:a,at:(0,$.appNow)().toISOString(),staffRef:t.whoId,staffName:i.name}),`Done: ${_(n.text)} marked done.`):'Nothing changed: I couldn\u2019t find that task.'}},{id:'add_dish',apps:T,title:'Add a dish to the menu',risk:'change',params:[{name:'name',type:'string',required:!0,description:'Dish name'},{name:'section',type:'string',required:!1,description:'Menu section'},{name:'price',type:'string',required:!0,description:'Price in pounds'},{name:'description',type:'string',required:!1,description:'Short description'}],keywords:[],description:'Add a new dish to the menu, like Manage \u203a Add dish. It stays off the menu until the head chef signs off its recipe card.',match:e=>v(e,/\b(add|new|put)\b/)&&v(e,/\b(dish|menu item|to the menu|on the menu|onto the menu)\b/)&&!v(e,/\b(special|specials|sold out|order list)\b/)?8:0,parse:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t?.rid),n=e.toLowerCase(),i=e.match(/\b(?:called|named)\s+(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i)??e.match(/\b(?:add|put)\s+(?:a |an |the )?(?:new )?(?:dish\s+)?(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i),s=r?.sections.find(e=>n.includes(e.toLowerCase())||n.includes(e.toLowerCase().replace(/s$/,''))),o=ce(e);return{name:i?.[1]?.replace(/^(?:a |an )?(?:new )?dish\s*/i,'').trim(),section:s,price:null!=o?String(o):void 0}},preview:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=String(e.section??r?.sections[0]??'Mains');return`Add ${_(String(e.name))} to ${n} at \xa3${Number(e.price).toFixed(2)}${e.description?`, described as ${_(String(e.description))}`:''}? It stays off the menu until the head chef signs off its recipe card.`},run:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=Number(e.price),i=String(e.name??'').trim();return i.length<2||!Number.isFinite(n)||n<=0?'Nothing changed: I need a dish name and a price.':de(t.rid,i)?.name.toLowerCase()===i.toLowerCase()?'That dish is already on the menu.':(a.useStore.getState().addMenuItem({restaurantId:t.rid,section:String(e.section??r?.sections[0]??'Mains'),name:i,description:String(e.description??''),price:n,dietary:[],allergens:{},prepMins:10,soldOut:!1,signOff:null}),`Done: ${i} added. The head chef needs to add its recipe card and sign off the allergens before it shows.`)}},{id:'edit_dish',apps:T,title:'Rename a dish or change its description',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name now'},{name:'field',type:'string',required:!0,description:'name or description',enum:['name','description']},{name:'value',type:'string',required:!0,description:'The new name or description'}],keywords:[],description:'Rename a dish or change its menu description, like Manage \u203a Save dish. Renaming changes its recipe card, so the head chef signs it off again.',match:e=>v(e,/\brename\b|\b(change|update|set|edit)\b.*\b(description|name)\b|\bdescri(be|ption)\b.*\bas\b/)&&!v(e,/\b(price|booking|special|my name)\b/)?8:0,parse:e=>{const t=e.match(/\brename\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i);if(t)return{dish:t[1],field:'name',value:t[2].trim()};const a=e.match(/\bname of\s+(?:the\s+)?(.+?)\s+to\s+(.+)$/i);if(a)return{dish:a[1],field:'name',value:a[2].trim()};const r=e.match(/\bdescription (?:of|for)\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i)??e.match(/\b(?:describe|change|update|set)\s+(?:the\s+)?(.+?)(?:'s|\u2019s)?\s+(?:description\s+)?(?:to|as)\s+(.+)$/i);return r?{dish:r[1],field:'description',value:r[2].trim()}:{dish:e}},preview:(e,t)=>{const a=de(t.rid,e.dish);return a?'name'===e.field?`Rename ${_(a.name)} to ${_(String(e.value))}? Its recipe card changes too, so the head chef signs it off again.`:`Change the description of ${a.name} to ${_(String(e.value))}?`:'I couldn\u2019t find that dish on the menu.'},run:(e,t)=>{const r=de(t.rid,e.dish),n=String(e.value??'').trim();return r?n.length<2?'Nothing changed: say the new wording.':(a.useStore.getState().updateMenuItem(r.id,'name'===e.field?{name:n}:{description:n}),'name'===e.field?`Done: renamed to ${n}.`:`Done: description of ${r.name} changed.`):'Nothing changed: I couldn\u2019t find that dish.'}},{id:'add_recipe_ingredient',apps:['chef'],title:'Add an ingredient to a recipe card',risk:'change',params:[{name:'text',type:'string',required:!0,description:'e.g. add 50 grams of butter to the haggis'}],keywords:[],description:'Add an ingredient line to a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\badd\b/)&&v(e,/\b(ingredient|recipe|card)\b|\badd\s+\d+\s*(g|grams?|kg|ml|tbsp|tsp)\b/)&&!v(e,/\b(step|method|order list|special)\b/)?8:0,parse:e=>({text:e}),preview:(e,t)=>{const a=pe(String(e.text));if(!a)return'Say it like \u201cadd 50 grams of butter to the haggis\u201d.';const r=(0,$.findCard)(t.rid,a.dish);return r?`Add ${[a.qty,a.unit].filter(Boolean).join(' ')} ${a.name} to ${r.dish}\u2019s recipe card?${r.signOff?' It\u2019s signed off now, so it will need signing off again.':''} Check its allergens on the card.`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=pe(String(e.text)),r=a&&(0,$.findCard)(t.rid,a.dish);return a&&r?(await(0,y.recipeCards)().update(r.id,{ingredients:[...r.ingredients,{id:(0,k.uuid)(),name:a.name,qty:a.qty,unit:a.unit}]},{name:N(I(t)),role:'head-chef'}),`Done: ${a.name} added to ${r.dish}.${r.signOff?' It needs signing off again.':''}`):'Nothing changed: I couldn\u2019t find that recipe card.'}},{id:'add_recipe_step',apps:['chef'],title:'Add a method step to a recipe card',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'},{name:'step',type:'string',required:!0,description:'The step wording'}],keywords:[],description:'Add a method step to the end of a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\b(add|new)\b/)&&v(e,/\b(step|method)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:to|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*[:,]\s*(.+)$/i)??e.match(/\bstep\s+(?:to|for)\s+(?:the\s+)?(.+?)\s+(?:saying|that says|reading)\s+(.+)$/i);return t?{dish:t[1],step:t[2].trim()}:{dish:e}},preview:(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0;return a?`Add step ${a.steps.length+1} to ${a.dish}: ${_(String(e.step))}?${a.signOff?' It will need signing off again.':''}`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0,r=String(e.step??'').trim();return!a||r.length<3?'Nothing changed: I need the dish and the step.':(await(0,y.recipeCards)().update(a.id,{steps:[...a.steps,r]},{name:N(I(t)),role:'head-chef'}),`Done: step added to ${a.dish}.`)}},{id:'manager_clock',apps:T,title:'Clock someone in or out (manager correction)',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff first name or id'},{name:'action',type:'string',required:!0,description:'in, out, break_start or break_end',enum:['in','out','break_start','break_end']},{name:'reason',type:'string',required:!0,description:'Why (at least 3 letters)'}],keywords:[],description:'A manager clocks a member of staff in or out, or starts or ends their break, now, with a reason, like the Clock tab\u2019s manager buttons. It is marked as a manager correction.',match:e=>v(e,/\bclock\s+\w+\s+(in|out)\b|\bclock (in|out)\s+[a-z]+\b|\b(start|end)\s+(a |the )?break for\b|\b(end|finish)\s+\w+'?s break\b/)&&!v(e,/\b(me|myself|my|who|is|are|has)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=W(e)[0],r=e.match(/\b(?:reason|because|as)\b[:,]?\s*(.+)$/i),n=/\bbreak\b/.test(t)?/\b(end|finish|back)\b/.test(t)?'break_end':'break_start':/\bout\b/.test(t)?'out':'in';return{staffId:a?.id,action:n,reason:r?.[1]?.trim()}},preview:e=>{const t=E(e.staffId);return t?`${le[e.action??'in'].replace('{n}',N(t.name))} now, at ${D()}? Reason: ${_(String(e.reason))}. It\u2019s marked as a manager correction.`:'Who? Say their first name.'},run:(e,t)=>{const a=E(e.staffId);if(!a)return'Nothing changed: I couldn\u2019t tell who.';const r=e.action??'in',n=(0,g.managerClockAction)(r,{rid:t.rid,staffId:a.id,date:t.today,at:(0,$.appNow)().toISOString()},{id:t.whoId??'manager',name:N(I(t))},String(e.reason??''));return n.ok?`Done: ${N(a.name)} ${{in:'clocked in',out:'clocked out',break_start:'on a break',break_end:'back from break'}[r]} at ${D()}.${n.warn?' '+n.warn:''}`:'Nothing changed: '+n.message}},{id:'tips_pot',apps:T,title:'What\u2019s in the tips pot',risk:'look',params:[],keywords:[],description:'Managers only: the confirmed tips held for the team since the last payout (the Tips pot card).',match:e=>v(e,/\btips? (pot|jar|so far|held|this (period|fortnight|month|week))\b|\bin the tips\b|\bhow much (have we got |is there )?in tips\b|\bwhat are the tips\b|\bhow much (are|is) (the )?tips\b/)&&!v(e,/\b(pay|payout|split|share out)\b/)?8:0,preview:()=>'Tips pot',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const r=h.useCashUp.getState(),n=a.useStore.getState().restaurants.find(e=>e.id===t.rid),i=(0,f.payFor)(t.rid,n?.settings.pay,u.useOnboard.getState().answers).pay,s=(0,p.tipsPot)(r.tips.filter(e=>e.rid===t.rid),r.pot.filter(e=>e.rid===t.rid),(0,l.tipsPeriod)(i,t.today).start,t.today);return`The tips pot holds ${fe(s.total)} from ${(0,$.niceDay)(s.from)} to today, from ${s.days.length} confirmed cash-up${1===s.days.length?'':'s'}.${s.lastPayout?` Last paid out through ${(0,$.niceDay)(s.lastPayout.throughDate)}.`:''}`}},{id:'cash_up_summary',apps:T,title:'Read the latest cash-up',risk:'look',params:[{name:'day',type:'string',required:!1,description:'Day (else the latest)'}],keywords:[],description:'Managers only: the latest (or a named day\u2019s) cash-up: gross takings, tips and who confirmed it.',match:e=>v(e,/\bcash.?up\b|\btakings\b|\bhow much did we take\b/)&&!v(e,/\b(add|enter|start|do the|unlock|edit)\b/)?8:0,parse:(e,t)=>({day:j(e.replace(/\btonight\b/i,'today'),t?.today??(0,l.ymdOf)((0,$.appNow)()))??(/\b(last night|yesterday)\b/i.test(e)?'yesterday':void 0)}),preview:()=>'Cash-up read-out',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const a=new Date(t.today+'T12:00:00');a.setDate(a.getDate()-1);const r='yesterday'===e.day?(0,l.ymdOf)(a):e.day,n=h.useCashUp.getState().cashUps.filter(e=>e.rid===t.rid&&(!r||e.date===r)).sort((e,t)=>t.date.localeCompare(e.date)),i=n[0];return i?`Cash-up for ${(0,$.niceDay)(i.date)}: gross takings ${fe((0,p.grossOf)(i.vals))}, tips ${fe((0,p.combinedTips)(i.vals))} (cash and card). ${i.confirmedAt?`Confirmed${i.confirmedBy?` by ${i.confirmedBy}`:''}.`:'Not confirmed yet.'}`:r?`There\u2019s no cash-up for ${(0,$.niceDay)(r)}.`:'There\u2019s no cash-up yet.'}},{id:'table_note',apps:C,title:'Add a note to a table',risk:'change',params:[{name:'table',type:'string',required:!0,description:'Table'},{name:'note',type:'string',required:!0,description:'The note (say \u201cclear\u201d to remove it)'}],keywords:[],description:'Put a short note on a table on the floor plan (e.g. \u201chigh chair\u201d, \u201cbirthday\u201d), like the table sheet\u2019s Note.',match:e=>v(e,/\btables?\s+\w+/)&&v(e,/\bnote\b/)&&!v(e,/\bshift note\b/)?9:0,parse:e=>{const t=e.match(/\bnote\b(?:\s+(?:on|for|to)\s+tables?\s+\w+)?\s*(?:[:,-]|saying|that says|that|says|reading)?\s*(.+)$/i),a=/\b(clear|remove|delete) (the )?note\b/i.test(e);return{table:(0,$.tableIn)(e),note:a?'clear':t?.[1]?.replace(/^(?:on|for|to)?\s*tables?\s+\w+\s*[:,-]?\s*/i,'').trim()}},preview:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);return a?'clear'===e.note?`Clear the note on table ${a}?`:`Note on table ${a}: ${_(String(e.note))}?`:'Which table?'},run:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);if(!a)return'Nothing changed: I couldn\u2019t find that table.';const n='clear'===e.note?'':String(e.note??'').trim().slice(0,80);return(0,r.tablesOf)(a).forEach(e=>r.useFloor.getState().setLive(t.rid,e,{note:n||void 0})),n?`Done: note on table ${a}.`:`Done: note cleared on table ${a}.`}},{id:'log_lost_property',apps:T,title:'Log lost property',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What was found'},{name:'where',type:'string',required:!1,description:'Where it was found'}],keywords:[],description:'Add an item to the lost property log (held), like Extras \u203a Lost property \u203a Add.',match:e=>v(e,/\blost property\b|\b(found|someone left|left behind|handed in)\b\s+(a|an|some|their|his|her)\b|\b(a|an)\s+\w+(\s+\w+)?\s+(was )?(left behind|handed in)\b/)&&!v(e,/\b(how many|what'?s in|list|read|returned)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:found|left(?: behind)?|handed in|log|add)\s+(?:a |an |some |their |his |her )?(.+?)(?=\s+(?:at|on|in|under|by|near|from)\s|[,.]|$)/i)??e.match(/\b(?:a|an)\s+(.+?)\s+(?:was )?(?:left behind|handed in)/i),a=e.match(/\s(?:at|on|in|under|by|near)\s+(?:the\s+)?(table\s+\w+|bar|toilets?|coat ?rack|cloakroom|door|entrance|terrace|garden|car park|dining room|booth\s+\w+|[a-z]+ table)\b/i);return{item:t?.[1]?.replace(/^(?:lost property|to lost property)\s*:?\s*/i,'').trim(),where:a?.[1]}},preview:e=>`Log lost property: ${_(String(e.item))}, found ${e.where?`at ${e.where}`:'(place not noted)'}, today at ${D()}? It\u2019s marked as held.`,run:(e,t)=>{const a=String(e.item??'').trim();if(a.length<2)return'Nothing changed: say what was found.';const r=(0,$.appNow)();return n.useOwner.getState().addLost({item:a,where:String(e.where??'').trim()||'Not noted',foundAt:`${(0,l.ymdOf)(r)} ${D()}`,foundBy:N(I(t))}),`Done: ${a} logged as held.`}},{id:'add_reminder',apps:T,title:'Add a venue reminder for staff',risk:'change',params:[{name:'text',type:'string',required:!0,description:'What it says'},{name:'time',type:'string',required:!0,description:'HH:MM, UK time'},{name:'days',type:'string',required:!1,description:'Days (default every day)'},{name:'audience',type:'string',required:!1,description:'all, foh or kitchen',enum:['all','foh','kitchen']}],keywords:[],description:'Add a venue reminder shown to staff on shift at a time on chosen days, like Settings \u203a Advanced \u203a Reminders \u203a Add.',match:e=>v(e,/\b(remind|reminder)\b/)&&v(e,/\b(add|set|new|create|every|daily|weekdays?|weekends?|at \d)\b/)&&!v(e,/\b(me|my)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=/\b(kitchen|chefs?)\b/.test(t)?'kitchen':/\b(front of house|foh|floor|waiters?|servers?)\b/.test(t)?'foh':'all',r=e.match(/\bremind(?:er)?\s+(?:for\s+)?(?:everyone|all staff|staff|the team|the kitchen|kitchen|front of house|foh|the floor|chefs?)?\s*(?:to|that|:)\s+(.+?)(?=\s+(?:at\s+\d|every\b|on\s+(?:mon|tue|wed|thu|fri|sat|sun)|daily|weekdays?|weekends?)|$)/i)??e.match(/\breminder\s*(?:saying|that says|:)\s*(.+?)(?=\s+(?:at\s+\d|every\b|daily)|$)/i),n=e.match(/\bat\s+(\d{1,2}(?:[:.]\d{2})?\s*(?:am|pm)?)/i);return{text:r?.[1]?.trim(),time:n?(0,$.hm)(n[1])??void 0:void 0,days:ge(t).join(','),audience:a}},preview:e=>{const t=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number),a=String(e.text??''),r=a.charAt(0).toUpperCase()+a.slice(1);return`Add a reminder for ${ye[e.audience??'all']}: ${_(r)}, ${7===t.length?'every day':'every '+t.map(e=>me[e].replace(/^\w/,e=>e.toUpperCase())).join(', ')} at ${e.time} (UK time)?`},run:(e,t)=>{const a=String(e.text??'').trim(),r=String(e.time??'');if(a.length<2||!/^\d{2}:\d{2}$/.test(r))return'Nothing changed: I need the wording and a time like 21:00.';const n=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number).filter(e=>e>=0&&e<=6).sort();return c.useReminders.getState().ensure(t.rid),c.useReminders.getState().add(t.rid,{text:a.charAt(0).toUpperCase()+a.slice(1),days:n,time:r,audience:e.audience??'all'}),'Done: reminder added.'}}]},1428,[804,848,800,1014,865,1019,1029,1030,1002,1001,1024,13,1049,1050,1051,1020,1071,856,1079,1011,839,1429,1427]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.dishesFor=R,_e.findDish=E,_e.allergensSaid=M,_e.timeFrom=Y,_e.coversFrom=G,_e.dateFrom=Z,_e.nameFrom=$,Object.defineProperty(_e,"VOICE_ACTIONS",{enumerable:!0,get:function(){return X}});var e=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),s=_r(_d[7]),d=_r(_d[8]),l=_r(_d[9]),c=_r(_d[10]),p=_r(_d[11]),u=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]),f=_r(_d[15]),g=_r(_d[16]),b=_r(_d[17]),y=_r(_d[18]);const w=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},v=e=>String(e).padStart(2,'0'),k=e=>e.getFullYear()+'-'+v(e.getMonth()+1)+'-'+v(e.getDate()),S=e=>{const[t,r,a]=e.split('-').map(Number);return new Date(t,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},N=(e,t)=>t.test(e),I=(e,t)=>e+' '+t+(1===e?'':'s'),A={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},T=e=>null==e?void 0:A[e.toLowerCase()]??(Number.isFinite(Number(e))?Number(e):void 0),x=e=>e.who??('display'===e.app?'Main Display':'Assistant'),D={owner:'Managers',staff:'Staff',chef:'Head Chef',display:'Main Display'},C=e=>D[e.app??'owner'],O=new Set(['the','and','with','our','for']),L=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').split(/\s+/).filter(e=>e.length>2&&!O.has(e));function R(e){const t=i.useStore.getState(),r=(0,c.resolveMenu)(t.menu.filter(t=>t.restaurantId===e&&!t.hidden)).map(e=>({kind:'menu',id:e.id,name:e.name,allergens:e.allergens,soldOut:e.soldOut,price:e.price,signedOff:!!e.signOff})),a=l.useSpecials.getState().current[e];return[...r,...(a?.items??[]).map(e=>({kind:'special',id:e.id,name:e.name,allergens:e.allergens,price:e.price,signedOff:!!a?.allergenCheck}))]}const _=e=>e.replace(/s$/,'');function E(e,t){const r=new Set(L(e).map(_)),a=e.toLowerCase();let n;for(const e of R(t)){const t=L(e.name);if(!t.length)continue;const o=t.filter(e=>r.has(_(e))).length;if(!o)continue;const i=o/t.length+.25*o+(a.includes(e.name.toLowerCase())?2:0);(o>=Math.min(2,t.length)||t.length<=3)&&(!n||i>n.s)&&(n={d:e,s:i})}return n?.d}const F=[[/\b(gluten|wheat|coeliac|celiac|barley|rye)\b/,['gluten']],[/\bpeanuts?\b/,['peanuts']],[/\b(tree ?nuts?|almonds?|walnuts?|hazelnuts?|cashews?|pecans?|pistachios?)\b/,['treenuts']],[/\bnuts?\b/,['peanuts','treenuts']],[/\b(dairy|milk|lactose|cheese|cream|butter)\b/,['milk']],[/\beggs?\b/,['eggs']],[/\b(shellfish|crustaceans?|prawns?|crab|langoustines?)\b/,['crustaceans']],[/\b(molluscs?|mussels?|oysters?|squid|scallops?|clams?)\b/,['molluscs']],[/\bfish\b/,['fish']],[/\b(soya|soy)\b/,['soya']],[/\bcelery\b/,['celery']],[/\bmustard\b/,['mustard']],[/\bsesame\b/,['sesame']],[/\b(sulphites?|sulfites?|sulphur)\b/,['sulphites']],[/\blupin\b/,['lupin']]];function M(e){const t=new Set;for(const[r,a]of F)r.test(e)&&a.forEach(e=>t.add(e));return[...t]}const q=e=>p.ALLERGENS.find(t=>t.id===e)?.short??e,z='Always check the signed-off recipe card and tell the kitchen about any allergy.';function B(t,r){if('chef'===r?.app&&(0,e.isAnchorage)(r.rid)&&(0,e.isBarFridge)(t))return[];const a=d.useSafety.getState().points.filter(t=>'chef'!==r?.app||(0,e.chefCanSee)(r.rid,t)),n=/\b(done|complete|completed|finished|ok|okay|checked)\b/i.test(t);return(0,f.parseQuick)(t,a).filter(e=>e.point).map(e=>{const t=(0,f.isTempKind)(e.point.kind);return{pointId:e.point.id,value:t?e.value:null,done:t?void 0:n}})}const j=e=>{try{return JSON.parse(String(e.readings??'[]'))}catch{return[]}};function H(e){const t=d.useSafety.getState().points.find(t=>t.id===e.pointId);return t?(0,f.isTempKind)(t.kind)?null==e.value?t.name+': no temperature heard':t.name+': '+e.value+'\xb0C '+((0,f.inRange)(t,e.value)?'(safe)':'OUT OF RANGE (safe: '+(0,f.limitText)(t)+')'):t.name+': '+(e.done?'done':'NOT done'):'?'}function Y(e){const t=e.match(/\b(?:at|around|about)\s+(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})[:.](\d{2})\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})()\s*(am|pm)\b/);if(!t){const t=e.match(new RegExp("\\bhalf (?:past )?(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b"));if(!t)return;let r=T(t[1])??0;return r>=1&&r<=10&&(r+=12),v(r)+':30'}let r=Number(t[1]);const a=Number(t[2]||0),n=t[3];return'pm'===n&&r<12&&(r+=12),'am'===n&&12===r&&(r=0),!n&&r>=1&&r<=10&&(r+=12),r>23||a>59?void 0:v(r)+':'+v(a)}function G(e){const r=e.match(new RegExp("\\b(?:table for|party of|for|of)\\s+(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))"))??e.match(new RegExp("\\b(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\s*(?:covers|people|guests|adults|of us)\\b")),a=T(r?.[1]);return a&&(0,t.validParty)(a)?a:void 0}const P=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function Z(e,t){const r=new Date(t+'T12:00:00');if(/\btomorrow\b/.test(e))return r.setDate(r.getDate()+1),k(r);const a=P.findIndex(t=>e.includes(t));if(a>=0){const t=(r.getDay()+6)%7;return r.setDate(r.getDate()+((a-t+7)%7||(/\bnext\b/.test(e)?7:0))),k(r)}return t}function U(e,t,r,a){const n=i.useStore.getState(),o=n.restaurants.find(t=>t.id===e),d=s.useFloor.getState().plans[e]??(0,s.seedPlan)(e),l=o?.settings.turnMins??90,c=n.bookings.filter(r=>r.restaurantId===e&&r.date===t);return(0,u.freeTablesAt)(d,c,a,new Date(t+'T'+r+':00'),(0,u.turnFor)(a,l),l)}const K=(e,t)=>{const[r,a]=e.split(':').map(Number),n=60*r+a+t;return v(Math.floor(n/60))+':'+v(n%60)},W=e=>e.replace(/^\w/,e=>e.toUpperCase());function $(e){const t=e.match(/\b(?:under|name of|named|called)\s+([A-Za-z][A-Za-z'\u2019-]+(?:\s+[A-Z][A-Za-z'\u2019-]+)?)/i)??e.match(/\bname(?:'s| is)?\s+([A-Za-z][A-Za-z'\u2019-]+)/i);return t?W(t[1]):void 0}const J=e=>!/\b(how do i|how do you|where do i|how to)\b/.test(e),V=e=>!['collected','served','closed','cancelled'].includes(e.status),Q=e=>e.toUpperCase().replace(/[\s-]/g,''),X=[{id:'next_table_free',title:'When is the next table free?',risk:'look',description:'Estimate when the next table frees up, and how long a walk-in for 2 or 4 would wait.',params:[],keywords:['next table','table free'],match:e=>N(e,/\b(next|soonest|first)\b.*\btables?\b.*\b(free|ready|available|clear)\b|\bhow long\b.*\b(wait|walk)|\bwait(ing)? (time|for a table)\b|\bwhen\b.*\btable\b.*\b(free|ready)\b/)?4:0,preview:()=>'Next table free',run:(e,t)=>{const r=i.useStore.getState(),a=w(),n=k(a),o=r.restaurants.find(e=>e.id===t.rid);if(!o)return'I can\u2019t see this venue\u2019s tables yet.';const d=s.useFloor.getState(),l=d.plans[t.rid]??(0,s.seedPlan)(t.rid),c=r.bookings.filter(e=>e.restaurantId===t.rid),p=(0,m.closedAreasAt)(m.useBlocks.getState().blocks,t.rid,n,v(a.getHours())+':'+v(a.getMinutes())),f=(0,u.floorView)(l,c,r.orders.filter(e=>e.restaurantId===t.rid),d.live[t.rid]??{},a,o.settings.turnMins,p);return(0,h.nextFreeSentence)((0,h.nextTablesFree)(o,f,c.filter(e=>e.date===n),a,c),a)+' It\u2019s an estimate.'}},{id:'log_check',title:'Log a temperature or kitchen check',risk:'change',description:'Record fridge, freezer, cooking, cooling, hot-hold or delivery temperatures, or a cleaning or kitchen check, in the food safety log. Out-of-range readings are flagged.',params:[{name:'readings',type:'string',required:!0,description:'JSON list of {pointId, value in \xb0C or null, done for non-temperature checks}'}],keywords:['fridge','freezer','temperature','probe'],match:e=>J(e)&&N(e,/\b(fridges?|freezers?|walk.?in|cold room|temps?|temperatures?|degrees|probe|core temp|hot hold|cooling|cleaning|clean down|deep clean)\b/)&&(!N(e,/\b(seat|seated|party|covers?|people|guests?|table \w+|walk.?ins? (of|for)|just arrived)\b/)||N(e,/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus)\b/))?3:0,parse:(e,t)=>({readings:JSON.stringify(B(e,t))}),preview:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));return n.length?'Log in the food safety log: '+n.map(H).join('; ')+'?':'I didn\u2019t catch which fridge, freezer or check. Try \u201cwalk-in fridge 3 degrees\u201d.'},run:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));if(!n.length)return'Nothing logged: I didn\u2019t catch which unit or check.';if(n.some(e=>{const t=a.find(t=>t.id===e.pointId);return!!t&&(0,f.isTempKind)(t.kind)&&null==e.value}))return'Nothing logged: a temperature was missing. Say the number, for example \u201cfreezer minus 19\u201d.';const o=w().toISOString(),i='chef'===r.app?'chef':'owner'===r.app?'managers':'staff',s=n.filter(e=>a.some(t=>t.id===e.pointId)).map(e=>{const t=a.find(t=>t.id===e.pointId),n=(0,f.isTempKind)(t.kind),s=n?(0,f.inRange)(t,e.value):!!e.done,d=['display'===r.app?'Logged on the Main Display.':'',s?'':'Out of range: add the corrective action.'].filter(Boolean).join(' ');return{pointId:t.id,name:t.name,kind:t.kind,at:o,by:x(r),byId:r.whoId??'voice-'+(r.app??'owner'),app:i,value:n?e.value:void 0,done:n?void 0:!!e.done,ok:s,source:'voice',note:d||void 0}});d.useSafety.getState().addEntries(s);const l=s.filter(e=>!e.ok);return l.length?'Logged. '+l.map(e=>e.name+' is OUT OF RANGE').join(', ')+'. Check it now and add what you did in the food safety log.':'Logged: '+s.map(e=>e.name+' '+(null!=e.value?e.value+'\xb0C':'done')).join(', ')+'. All fine.'}},{id:'allergen_info',title:'Allergen question',risk:'look',description:'Answer allergen questions from the recipe cards and the menu: what a dish contains or may contain, or which dishes are free of an allergen.',params:[{name:'dish',type:'string',description:'Dish name'},{name:'allergens',type:'string',description:'Comma-separated allergen ids'}],keywords:['allergen','allergy','contain'],match:e=>!N(e,/(allergens?|allerg(y|ic|ies)|contains?|coeliac|celiac|safe for|free from|.free\b|intoleran)/)||N(e,/\b(sold out|price|draft)\b/)||N(e,/\btables?\b.*\bfree\b|\bfree\b.*\btables?\b/)?0:3,parse:(e,t)=>{const r=E(e,t.rid);let a=e.toLowerCase();if(r)for(const e of L(r.name))a=a.replace(new RegExp('\\b'+e+'\\b','g'),' ');return{dish:r?.name,allergens:M(a).join(',')}},preview:e=>'Allergens'+(e.dish?' in '+e.dish:''),run:(e,t)=>{const r=R(t.rid),a=e.dish?r.find(t=>t.name===e.dish):void 0,n=String(e.allergens??'').split(',').filter(Boolean);if(a){const e=p.ALLERGENS.filter(e=>'contains'===a.allergens[e.id]).map(e=>e.short),t=p.ALLERGENS.filter(e=>'may'===a.allergens[e.id]).map(e=>e.short);return(n.length?n.map(e=>'contains'===a.allergens[e]?a.name+' CONTAINS '+q(e)+'.':'may'===a.allergens[e]?a.name+' MAY CONTAIN '+q(e)+'.':'No '+q(e)+' is listed for '+a.name+'.').join(' '):a.name+' contains '+(e.length?e.join(', '):'none of the 14 allergens')+(t.length?', and may contain '+t.join(', '):'')+'.')+(a.signedOff?'':' Its allergens are NOT signed off yet.')+' '+z}if(n.length){const e=r.filter(e=>!e.soldOut&&n.every(t=>!e.allergens[t])),t=r.filter(e=>n.some(t=>'contains'===e.allergens[t]));return e.length+(1===e.length?' dish has':' dishes have')+' no '+n.map(q).join(' or ')+' listed'+(e.length?', for example '+e.slice(0,5).map(e=>e.name).join(', '):'')+'. '+t.length+' contain it. '+z}return'Which dish, or which allergen? For example \u201cdoes the fish supper contain gluten?\u201d.'}},{id:'set_sold_out',title:'Mark a dish sold out or back on',risk:'change',description:'Mark a menu dish sold out or back on. A reminder for staff: it shows on the Display and in the Sold out list.',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'soldOut',type:'string',required:!0,description:'yes = sold out, no = back on',enum:['yes','no']}],keywords:['sold out','back on','86'],match:e=>N(e,/\b(sold out|run out|ran out|out of stock|86|eighty.?six|back on|available again|back in stock|un.?86|none left)\b/)?4:0,parse:(e,t)=>{const r=E(e,t.rid),a=/\b(back on|available again|back in stock|un.?86)\b/i.test(e);return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,soldOut:a?'no':'yes'}},preview:e=>e.itemId?'Mark '+e.name+' '+('no'===e.soldOut?'back on':'sold out')+'?':e.name?e.name+' is on the Specials board; change it there.':'I couldn\u2019t find that dish on the menu.',run:async e=>e.itemId?(await o.repo.menu.updateItem(String(e.itemId),{soldOut:'no'!==e.soldOut}),'Done: '+e.name+' is '+('no'===e.soldOut?'back on':'sold out')+'.'):'Nothing changed: I couldn\u2019t find that dish on the menu.'},{id:'change_price',apps:['owner'],title:'Change a menu price',risk:'change',description:'Change the price of a menu dish (managers only).',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'pence',type:'integer',required:!0,description:'New price in pence'}],keywords:['price'],match:e=>N(e,/\b(price|charge|cost)\b/)&&N(e,/(\xa3|\d|pound)/)&&!N(e,/\b(special|offer)\b/)?3:0,parse:(e,t)=>{const r=E(e,t.rid),a=e.match(/\b(?:to|at)\s*\xa3?\s*(\d{1,3})(?:[.:](\d{1,2}))?/i)??e.match(/\xa3\s*(\d{1,3})(?:\.(\d{1,2}))?/)??e.match(/(\d{1,3})\s*pounds?(?:\s*(\d{1,2}))?/i),n=a?100*Number(a[1])+Number((a[2]??'0').padEnd(2,'0')):void 0;return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,pence:n,old:r?.price??void 0}},preview:e=>e.itemId?'Change '+e.name+' from '+(null!=e.old?(0,g.gbp)(Number(e.old)):'its current price')+' to '+(null!=e.pence?(0,g.gbp)(Number(e.pence)):'?')+'?':'I couldn\u2019t find that dish on the menu.',run:async(e,t)=>{if(t.role&&!['owner','manager'].includes(t.role))return'Only managers can change prices.';const r=Number(e.pence);return e.itemId&&r>0&&r<1e5?(await o.repo.menu.updateItem(String(e.itemId),{price:r}),'Done: '+e.name+' is now '+(0,g.gbp)(r)+'.'):'Nothing changed: I need the dish and a price.'}},{id:'draft_special',apps:['owner','chef'],title:'Draft a special',risk:'draft',description:'Save a special as a draft for the owner to approve. It goes on the Specials board only after its allergens are checked.',params:[{name:'text',type:'string',required:!0,description:'The special, e.g. \u201cHake with mussels, \xa318\u201d'}],keywords:['special'],match:e=>N(e,/\bspecials?\b/)&&N(e,/\b(add|new|put|draft|today'?s|tonight'?s|change|set)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\bspecials?\b(?:\s*(?:board|is|are|to|:))?\s*/i,'').trim()||e}),preview:e=>'Save a draft special: \u201c'+e.text+'\u201d. Its allergens get checked before it goes on the board.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'special',title:'New special',lines:[String(e.text),'Add its allergens and post it on the Specials board when approved.'],by:x(t),app:C(t)}),'Saved as a draft special for the owner to approve. It isn\u2019t on the board yet.')},{id:'check_availability',title:'Check table availability',risk:'look',description:'Check whether a table is free for a party at a date and time, and suggest nearby times if not.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'}],keywords:['availability','table for','free table'],match:e=>N(e,/\b(availability|available|space|room for|any room|got room|any tables?|got a table|free table|have we got|is there a table|can we fit|fit in)\b/)&&!N(e,/\b(sold|back on|allerg)/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r)}},preview:e=>'Check a table for '+(e.covers??'?')+' at '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'today'),run:(e,t)=>{const r=Number(e.covers),a=String(e.time),n=String(e.date??t.today),o=U(t.rid,n,a,r);if(o.length)return'Yes, there\u2019s room for '+r+' at '+a+' on '+S(n)+'. Best fit: table '+o[0].table+(o[0].area?' ('+o[0].area+')':'')+'.';const i=[];for(const e of[-30,30,-60,60,-90,90]){const o=K(a,e);if(U(t.rid,n,o,r).length&&i.push(o),i.length>=3)break}return'No table for '+r+' at '+a+' on '+S(n)+'.'+(i.length?' Free nearby: '+i.sort().join(', ')+'.':' Nothing free within 90 minutes either.')}},{id:'draft_booking',title:'Take a booking (draft)',risk:'draft',description:'Take a booking as a DRAFT for the owner to confirm in Bookings. The guest confirmation is only sent from there.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'},{name:'name',type:'string',description:'Guest name'}],keywords:['book','booking','reserve'],match:e=>N(e,/\b(book|booking|reserve|reservation)\b/)&&!N(e,/\b(availability|any tables?|have we got|is there|how many|move|cancel|booker)\b/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r),name:$(e)}},preview:(e,t)=>{const r=e.covers&&e.time?U(t.rid,String(e.date??t.today),String(e.time),Number(e.covers)):[],a=e.covers&&e.time?r.length?' Table '+r[0].table+' is free.':' NO table is free then.':'';return'Draft booking: '+(e.name??'guest')+', '+(e.covers??'?')+' covers, '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'?')+'.'+a+' The owner confirms it in Bookings; nothing is sent to the guest now.'},run:(e,r)=>(0,t.validParty)(Number(e.covers))?(b.useDrafts.getState().add({rid:r.rid,kind:'booking',title:'Booking: '+(e.name??'guest')+', '+e.covers+' covers',lines:[S(String(e.date))+' at '+e.time,'Take their phone number when you confirm it in Bookings.'],data:{covers:e.covers,date:e.date,time:e.time,name:e.name},by:x(r),app:C(r)}),'Saved as a draft booking for the owner to confirm. No confirmation has been sent.'):`Nothing saved. ${t.PARTY_RULE} How many people?`},{id:'add_waitlist',title:'Add to the waitlist',risk:'change',description:'Add a party to the waitlist. Nobody is messaged.',params:[{name:'name',type:'string',description:'Name'},{name:'covers',type:'integer',required:!0,description:'Party size'}],keywords:['waitlist','waiting list'],match:e=>N(e,/\b(wait ?list|waiting list|queue)\b/)?4:0,parse:e=>({name:$(e)??e.match(/\badd\s+([A-Z][a-z'\u2019-]+)\b/)?.[1],covers:G(e.toLowerCase())}),preview:e=>'Add '+(e.name??'a guest')+', '+(e.covers??'?')+' covers, to the waitlist?',run:async(e,r)=>{const a=Number(e.covers);if(!(0,t.validParty)(a))return`Nothing added: how many people? ${t.PARTY_RULE}`;return'Done: '+(await o.repo.waitlist.join(r.rid,String(e.name??'Guest'),a)).name+' is on the waitlist. Nobody has been messaged.'}},{id:'read_orders',title:'Read out orders',risk:'look',description:'Read out the live orders and takeaways.',params:[],keywords:['orders'],match:e=>N(e,/\b(orders?|takeaways?|tickets?|collections?)\b/)&&N(e,/\b(read|what|any|list|how many|open|live|waiting|outstanding|pending|due|next)\b/)&&!N(e,/\b(shopping|booker|bidfood|supplier)\b/)?3:0,preview:()=>'Read out the live orders',run:(e,t)=>{const a=i.useStore.getState().orders.filter(e=>e.restaurantId===t.rid&&V(e)).sort((e,t)=>(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt));if(!a.length)return'No live orders right now.';const n=a.filter(e=>'takeaway'===e.type).length;return I(a.length,'live order')+' ('+n+' takeaway). '+a.slice(0,6).map(e=>{return('takeaway'===e.type?'Takeaway ':(0,r.tableNumbers)(e.tableNo)+' ')+e.ref+' for '+e.customerName+', '+I(e.lines.reduce((e,t)=>e+t.qty,0),'item')+', '+e.status+(e.slotTime?', due '+(t=e.slotTime,new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})):'')+(e.allergies.length?', HAS ALLERGIES':'');var t}).join('. ')+(a.length>6?'. And '+(a.length-6)+' more.':'.')}},{id:'day_numbers',title:'Covers, sales and forecast',risk:'look',description:'How many covers are booked today and tomorrow, sales through CoverCharge so far today, and the forecast for the rest of today.',params:[],keywords:['covers','sales','forecast'],match:e=>N(e,/\b(covers|sales|takings|revenue|forecast|how busy|busy tonight|expected|how many (people|guests|bookings))\b/)&&!N(e,/\b(walk|seat|wait ?list|add|book (a|for|in))\b/)?3:0,preview:()=>'Today\u2019s covers, sales and forecast',run:(e,t)=>{const r=i.useStore.getState(),n=w(),o=k(n),s=r.restaurants.find(e=>e.id===t.rid),d=r.bookings.filter(e=>e.restaurantId===t.rid),l=d.filter(e=>e.date===o&&['confirmed','seated','finished'].includes(e.status)),c=l.reduce((e,t)=>e+t.partySize,0),p=l.filter(e=>e.walkIn).reduce((e,t)=>e+t.partySize,0),u=new Date(n);u.setDate(u.getDate()+1);const h=k(u),m=d.filter(e=>e.date===h&&['confirmed','pending'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),f=r.orders.filter(e=>e.restaurantId===t.rid),b=f.filter(e=>e.createdAt.slice(0,10)===o&&'cancelled'!==e.status),y=b.reduce((e,t)=>e+t.subtotal,0);let v='';if(s){const e=(0,a.forecastToday)(s,d,f,r.events,n);v=e.open?e.enough?' Forecast for the rest of today: about '+e.restOfDay.covers+' covers ('+(0,a.coversRange)(e.restOfDay.low,e.restOfDay.high,!1)+')'+(e.example?', example figures.':'.'):' No forecast yet: not enough history ('+e.restOfDay.booked+' covers booked for the rest of today).':''}return'Today: '+c+' covers booked or seated'+(p?', including '+p+' walk-in':'')+'. '+I(b.length,'order')+' through CoverCharge so far'+('display'===t.app||'staff'===t.app||'staff'===t.role?'.':', '+(0,g.gbp)(y)+' before tips (till sales aren\u2019t included).')+v+' Tomorrow: '+m+' covers booked so far.'}},{id:'supplier_list',title:'Add to a Booker or Bidfood shopping list',risk:'draft',description:'Add items to a DRAFT shopping list for Booker or Bidfood for the owner to check and order on the supplier\u2019s site. Never places an order.',params:[{name:'supplier',type:'string',required:!0,description:'Supplier',enum:['booker','bidfood']},{name:'items',type:'string',required:!0,description:'Items separated by semicolons'}],keywords:['booker','bidfood','shopping list'],match:e=>N(e,/\b(booker|bidfood|bid food)\b/)?4:N(e,/\b(shopping list|order list|we need more|we'?re low on|running low)\b/)?3:0,parse:e=>({supplier:/\bbid ?food\b/i.test(e)?'bidfood':'booker',items:e.replace(/\b(to|on|onto)\s+(the\s+)?(booker|bidfood|bid food)?\s*(shopping\s+|order\s+)?list\b.*$/i,'').replace(/\b(from|at)\s+(booker|bidfood|bid food)\b/i,'').replace(/[,.]?\s*\b(put|add|stick)\s+(it|them|that|those)\b.*$/i,'').replace(/^.*?\b(add|need|order|get|put|low on)\b\s*/i,'').trim().split(/\s*(?:,|\band\b)\s*/i).map(e=>e.trim()).filter(Boolean).join('; ')}),preview:e=>'Add to the draft '+('bidfood'===e.supplier?'Bidfood':'Booker')+' list: '+String(e.items??'').split('; ').join(', ')+'. Nothing is ordered; the owner checks it and orders on the supplier\u2019s site.',run:(e,t)=>{const r=String(e.items??'').split('; ').filter(Boolean);if(!r.length)return'Nothing added: which items?';const a=b.useDrafts.getState().addToList(t.rid,'bidfood'===e.supplier?'bidfood':'booker',r,x(t),C(t));return'Added to the draft '+a.title+' ('+I(a.lines.length,'item')+'). Nothing has been ordered.'}},{id:'draft_offer',title:'Draft an offer',risk:'draft',description:'Save an offer or promotion as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The offer'}],keywords:['offer','promotion'],match:e=>N(e,/\b(offer|promotion|promo|deal|discount|happy hour|two for one|2 for 1)\b/)&&N(e,/\b(draft|create|make|set up|new|add|run|do)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\b(?:offer|promotion|promo|deal)\b\s*(?:for|of|:)?\s*/i,'').trim()||e}),preview:e=>'Save a draft offer for the owner to approve: \u201c'+e.text+'\u201d. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'offer',title:'New offer',lines:[String(e.text)],by:x(t),app:C(t)}),'Saved as a draft offer for the owner to approve. Nothing was published or sent.')},{id:'draft_event',title:'Draft an event',risk:'draft',description:'Save an event (quiz, live music, tasting night) as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The event'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['event'],match:e=>N(e,/\b(event|quiz|live music|tasting|gig|party night|music night|open mic|ceilidh)\b/)&&N(e,/\b(draft|create|make|plan|set up|new|add|put on|run)\b/)?3:0,parse:(e,t)=>({text:e.replace(/^.*?\b(?:draft|create|make|plan|set up|add|put on|run)\b\s*(?:an?|the)?\s*(?:new\s+)?(?:event)?\s*(?:for|:)?\s*/i,'').trim()||e,date:/\b(tomorrow|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i.test(e)?Z(e.toLowerCase(),t.today):void 0}),preview:e=>'Save a draft event for the owner to approve: \u201c'+e.text+'\u201d'+(e.date?' on '+S(String(e.date)):'')+'. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'event',title:'New event',lines:[String(e.text),...e.date?[S(String(e.date))]:[]],data:{date:e.date},by:x(t),app:C(t)}),'Saved as a draft event for the owner to approve. Nothing was published or sent.')},{id:'card_balance',apps:['owner','chef'],title:'Gift card or stamp card balance',risk:'look',description:'Look up a gift card balance by its code, or a summary of stamp cards.',params:[{name:'code',type:'string',description:'Gift card code'},{name:'kind',type:'string',description:'gift or stamp',enum:['gift','stamp']}],keywords:['gift card','voucher','stamp card'],match:e=>N(e,/\b(gift ?cards?|gift vouchers?|vouchers?|stamp ?cards?|stamps|loyalty)\b/)?3:0,parse:e=>{const t=e.toUpperCase().replace(/\b(GIFT|CARDS?|VOUCHERS?|BALANCE|CHECK|WHAT'?S|WHAT|THE|ON|IS|CODE|FOR|OF|HOW|MUCH|LEFT|STAMPS?|A)\b/g,' ').match(/[A-Z0-9][A-Z0-9 -]{3,}[A-Z0-9]/);return{kind:/stamp|loyalty/i.test(e)?'stamp':'gift',code:t?Q(t[0]):void 0}},preview:e=>'stamp'===e.kind?'Stamp cards':'Gift card '+(e.code??''),run:(e,t)=>{const r=i.useStore.getState();if('stamp'===e.kind&&(0,n.staffServer)())return(0,n.loyaltySummary)().then(e=>I(e.members,'guest')+' have stamp cards here; '+I(e.rewardsReady,'reward')+' ready to use. To check one guest, open Stamp card and find or scan them.',()=>'I couldn\u2019t reach the stamp cards just now. Try again in a moment.');if('stamp'===e.kind){const e=r.stampCards.filter(e=>e.restaurantId===t.rid),a=e.reduce((e,t)=>e+t.rewardsAvailable,0);return I(e.length,'guest')+' have stamp cards here; '+I(a,'reward')+' ready to claim. To check one guest, scan their card in Stamp cards.'}if(!e.code)return'Read me the code on the gift card, letter by letter.';const a=String(e.code),o=r.giftCards.filter(e=>e.restaurantId===t.rid).find(e=>Q(e.code)===a||a.length>=4&&Q(e.code).includes(a));return o?'Gift card '+o.code+': '+(0,g.gbp)(o.balance)+' left of '+(0,g.gbp)(o.initial)+'.':'I couldn\u2019t find a gift card with that code. Check it and try again.'}},{id:'feedback_summary',title:'Summarise feedback',risk:'look',description:'Summarise the last 7 days of guest ratings and comments.',params:[],keywords:['feedback','reviews'],match:e=>N(e,/\b(feedback|reviews?|ratings?|complaints?|comments?|what are (guests|people) saying)\b/)?3:0,preview:()=>'Summarise this week\u2019s feedback',run:(e,t)=>{const r=w().getTime()-6048e5,a=i.useStore.getState().ratings.filter(e=>e.restaurantId===t.rid&&new Date(e.createdAt).getTime()>=r);if(!a.length)return'No guest feedback in the last 7 days.';const n=a.reduce((e,t)=>e+t.stars,0)/a.length,o=a.filter(e=>e.stars<=3&&e.comment).slice(0,2),s=a.filter(e=>e.stars>=5&&e.comment).slice(0,1);return I(a.length,'rating')+' in the last 7 days, averaging '+n.toFixed(1)+' stars.'+(s.length?' Best: \u201c'+s[0].comment+'\u201d.':'')+(o.length?' To look at: '+o.map(e=>'\u201c'+e.comment+'\u201d ('+e.stars+' stars)').join('; ')+'.':' No low scores.')}},{id:'shift_note',title:'Leave a shift note',risk:'change',description:'Leave a note for the next shift.',params:[{name:'text',type:'string',required:!0,description:'The note'}],keywords:['shift note','handover'],match:e=>N(e,/\b(shift note|leave a note|note for|handover|tell the next shift|let the next shift know|note that)\b/)&&!N(e,/\b(read|any notes|what notes)\b/)?4:0,parse:e=>({text:e.replace(/^.*?\b(?:shift note|leave a note|note for (?:the )?(?:next shift|tomorrow|tonight|morning|evening)|handover note|handover|tell the next shift|let the next shift know|note that)\b\s*(?:that|:|,|for the next shift)?\s*/i,'').trim()||e}),preview:e=>'Leave a shift note: \u201c'+e.text+'\u201d?',run:(e,t)=>(y.useShiftNotes.getState().add({rid:t.rid,text:String(e.text),by:x(t),app:C(t)}),'Shift note saved. It shows on the Shift notes screen.')},{id:'read_shift_notes',title:'Read shift notes',risk:'look',description:'Read out the latest open shift notes.',params:[],keywords:['notes'],match:e=>N(e,/\b(read|any|what|latest)\b.*\b(shift notes?|notes|handover)\b/)?5:0,preview:()=>'Read the latest shift notes',run:(e,t)=>{const r=y.useShiftNotes.getState().notes.filter(e=>e.rid===t.rid&&!e.done).slice(0,5);return r.length?r.map(e=>e.by+', '+new Date(e.at).toLocaleString('en-GB',{weekday:'short',hour:'2-digit',minute:'2-digit'})+': '+e.text).join('. '):'No open shift notes.'}}]},1429,[804,1098,829,1120,1204,848,800,1014,1019,989,831,830,1079,1080,1011,1020,836,1430,1431]); -__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return f}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},d=r(_d[1]),n=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},f=(0,d.create)()((0,n.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,d,n,o,f)=>{const p=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===d&&'draft'===e.status);if(p){const t={...p,lines:[...p.lines,...n]};return e(e=>({drafts:e.drafts.map(e=>e.id===p.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:d,title:('bidfood'===d?'Bidfood':'Booker')+" shopping list",lines:n,by:o,app:f})},decide:(t,s,d)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:d,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,n.createJSONStorage)(()=>s.default)}))},1430,[808,815,818]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1431,[808,815,818]); -__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,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1432,[798,34,283,364,236,402,102,815,794,840,25]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return a}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],o=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from Bidfood or Booker',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add Bidfood or Booker for this venue, with your account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add Bidfood or Add Booker (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and Booker or Bidfood lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cwalk-in fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, Booker and Bidfood shopping lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cwalk-in fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Take a picture of the taking sheet, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Take a picture of the taking sheet, or upload a spreadsheet',keywords:['cash up','photo','spreadsheet','csv','excel','xlsx','camera','sheet','gross','card','cash','tips','takings'],body:'In Cash up & sales tap Take a picture of the taking sheet: the camera opens and the figures are filled in from the photo. Check every figure beside the photo (gross, card, cash, tips, food and drink), change anything that is wrong, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. If the photo can\u2019t be read, type the figures in.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'The taking sheet buttons are here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display then shows a Buy a gift card button with a large QR code. Guests buy on your website; the Display shows no prices or balances.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per person, the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Upload cash up sheet. Your phone camera opens; take a photo of the paper sheet (you can add several). The review screen shows the photo beside the figures. Automatic reading isn\u2019t switched on yet, so type each figure from the photo; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],a=t=>o.find(o=>o.id===t)},1433,[]); -__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1434,[]); -__d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return x}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]);const i=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},h=e=>String(e).padStart(2,'0'),c=e=>e.getFullYear()+'-'+h(e.getMonth()+1)+'-'+h(e.getDate()),d=e=>{const t=new Date(e);return h(t.getHours())+':'+h(t.getMinutes())},l=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return h(Math.floor(t/60))+':'+h(t%60)},u=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),h=new Date(i());return h.setDate(h.getDate()+1),e===c(h)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},m=(e,t)=>t.test(e),p=e=>(e??'').replace(' (example)',''),f=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),b=['staff'],k=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],w={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function y(e,t){return'all'===e||(0,n.inChannel)(e,t)}function S(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:p(e.name),nickname:e.nickname},o))}const v=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>m(e,/\bkitchen (chat|group|channel)\b/)&&!m(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:b,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>m(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&m(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!m(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=S(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:p(o.name)};const h=k.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(w[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=f(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||y(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(w[s]??'the team chat')+'.'):'You can\u2019t post in '+(w[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:b,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>m(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=f(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||y(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),l=e=>'system'===e.from?'CoverCharge':p(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return l(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(w[t]??t))+' at ')+d(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:b,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>m(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&m(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!m(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=i(),h=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>h)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+u(c.date,s)+', '+l(c.start)+' to '+l(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>u(e.date,s)+' '+l(e.start)+'\u2013'+l(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:b,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>m(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),h=a.today,c=o.getHours()+o.getMinutes()/60,u=s.shifts.find(e=>e.staffId===a.whoId&&e.published&&e.date===h);return n?'You\u2019re clocked in since '+d(n.in)+'.'+(u?' Your shift ends at '+l(u.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':u&&u.end>c?'You\u2019re not clocked in. Your shift today is '+l(u.start)+' to '+l(u.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(u?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:b,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>m(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const h=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+d(e.start)+'. Breaks today: '+h+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return h?'You\u2019ve had '+h+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:b,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>m(e,/\bspecials?\b/)&&!m(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:b,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>m(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],x=new Set(['log_check','allergen_info','next_table_free',...v.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1435,[800,865,989,836,1429,1032]); -__d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1436,[]); -__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_KEYTERMS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"MAX_APP_KEYTERMS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"VENUE_WORDS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"cleanTerm",{enumerable:!0,get:function(){return u}}),e.venueKeyterms=function(l){const b=[],f=new Set,h=t=>{const a=u(t??''),n=a.toLowerCase();a.length>=2&&!f.has(n)&&b.lengtht.active).forEach(t=>h(String(t.name).split(/\s+/)[0]))}catch{}try{(n.useFloor.getState().plans[l]??(0,n.seedPlan)(l)).areas.forEach(t=>h(t.name))}catch{}try{s.forEach(h)}catch{}try{a.useStore.getState().menu.filter(t=>!t.restaurantId||t.restaurantId===l).forEach(t=>h(t.name))}catch{}return b};var t=r(d[0]),a=r(d[1]),n=r(d[2]);const l=100,c=80,o=['walk-in','covers','table','seat','seated','clear','cleared','needs clearing','block','unblock','waitlist','lobster','crab','langoustines','scallops','sold out','no-show','Sitooterie','Beer Garden','Main Restaurant','party of','people'],s=['table one','table two','table three','table four','table five','table six','table seven','table eight','table nine','table ten','table eleven','table twelve'],u=t=>t.replace(/\([^)]*\)/g,' ').replace(/[^\p{L}\p{N} '&.-]/gu,' ').replace(/\s+/g,' ').trim().slice(0,50).trim()},1437,[865,800,1014]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useVoiceNav",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(()=>({go:null}))},1438,[815]); -__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_TASKS_PER_MONTH",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"VOICE_WARN_AT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"VOICE_FAIR_USAGE",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"monthKey",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"voiceUsage",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"REACHED_TEXT",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"WARN_TEXT",{enumerable:!0,get:function(){return v}}),_e.useVoiceUsage=function(e,t=new Date){const n=h(n=>n.used[e]?.[f(t)]??0);return _(n)};var e,t=r(_d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(_d[1]),s=r(_d[2]);const u=1e3,c=.8,d='Fair usage: 1,000 voice tasks a month per venue',l=new Set(['log_check']),f=(e=new Date)=>e.getFullYear()+'-'+String(e.getMonth()+1).padStart(2,'0'),h=(0,o.create)()((0,s.persist)(e=>({used:{},add:(t,n)=>e(e=>({used:{...e.used,[t]:{[n]:(e.used[t]?.[n]??0)+1}}}))}),{name:'covercharge-voice-usage-v1',version:1,storage:(0,s.createJSONStorage)(()=>n.default)})),_=e=>{const t=e/u;return{used:e,limit:u,pct:t,warn:t>=c,reached:e>=u,line:'Voice assistant: '+e.toLocaleString('en-GB')+' of 1,000 tasks used this month, resets on the 1st'}},b={get:(e,t=new Date)=>_(h.getState().used[e]?.[f(t)]??0),allowed:(e,t,n=new Date)=>null!=t&&l.has(t)||!b.get(e,n).reached,record:(e,t=new Date)=>h.getState().add(e,f(t))},p='This venue has used its fair-usage allowance of 1,000 voice tasks for this month. It starts again on the 1st. Food safety logging still works, and the owner can contact CoverCharge if you need more.',v=e=>e.line+'. That\u2019s '+Math.round(100*e.pct)+'% of this venue\u2019s fair-usage allowance.'},1439,[808,815,818]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useVoiceKeys",{enumerable:!0,get:function(){return e}}),_e.installVoiceKeys=function(){if('undefined'==typeof window||!window.addEventListener)return()=>{};let n=!1;const o=o=>(o.metaKey||o.ctrlKey)&&o.shiftKey&&'g'===o.key.toLowerCase()?(o.preventDefault(),void(o.repeat||e.getState().send('toggle'))):!o.metaKey&&!o.ctrlKey||o.shiftKey||'/'!==o.key?void('Space'!==o.code||o.metaKey||o.ctrlKey||o.altKey||t(o.target)||(o.preventDefault(),o.repeat||n||(n=!0,e.getState().send('start')))):(o.preventDefault(),void e.getState().send('type')),s=t=>{'Space'===t.code&&n&&(t.preventDefault(),n=!1,e.getState().send('stop'))},l=()=>{n&&(n=!1,e.getState().send('stop'))};return window.addEventListener('keydown',o,!0),window.addEventListener('keyup',s,!0),window.addEventListener('blur',l),()=>{window.removeEventListener('keydown',o,!0),window.removeEventListener('keyup',s,!0),window.removeEventListener('blur',l)}};const e=(0,r(d[0]).create)((e,t)=>({last:null,send:n=>e({last:{cmd:n,n:(t().last?.n??0)+1}})})),t=e=>{const t=e?.tagName;return'INPUT'===t||'TEXTAREA'===t||'SELECT'===t||!!e?.isContentEditable}},1440,[815]); -__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=u(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),k=[],A=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);if(i.includes(c))continue;k.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0});const u='st-jack'===t?{auto:'rota'}:{};d=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:f(d,23.5)}:void 0,...u}):d===y&&e<=m&&A.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:f(d,u.auto?e:e-.05),inSite:!0,...u})}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!k.some(e=>e.staffId===t.staffId&&e.date===t.date)),...k],attendance:[...S.attendance,...A]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:f(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:f((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',u=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,f=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1441,[848,800,865,1024,15,997,846]); -__d(function(e,s,o,p,t,a,f){"use strict";t.exports="/staff-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},1442,[]); -__d(function(s,o,e,p,t,c,d){"use strict";t.exports="/staff-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},1443,[]); -__d(function(o,s,e,f,p,t,d){"use strict";p.exports="/staff-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},1444,[]); -__d(function(o,s,p,t,d,e,n){"use strict";d.exports="/staff-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},1445,[]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1446,[30,34,846,25]); -__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 t.Head}});const t=(n=r(d[0]),c=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(c,t)||Object.defineProperty(c,t,{enumerable:!0,get:function(){return n[t]}})}),n);var n,c},1447,[1448]); -__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var c in n)Object.defineProperty(t,c,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,c).get})})(e,{get Head(){return u},get default(){return s}});const n=r(d[1]),c=r(d[2]);function o({children:c}){return(0,t().jsx)(n.Helmet,{children:c})}const u=({children:n})=>(0,c.useIsFocused)()?(0,t().jsx)(o,{children:n}):null;u.Provider=n.HelmetProvider;const s=u},1448,[25,1449,591]); -__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>fe,HelmetData:()=>se,HelmetProvider:()=>oe}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[0])),T=u(r(d[0])),A=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(A||{}),O={rel:["amphtml","canonical","alternate"]},C={type:["application/ld+json"]},w={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x=Object.values(A),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},$=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",k="defaultTitle",S="defer",E="encodeSpecialCharacters",M="onChangeClientState",P="titleTemplate",H="prioritizeSeoTags",D=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},L=t=>{let n=D(t,"title");const s=D(t,P);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=D(t,k);return n||i||void 0},I=t=>D(t,M)||(()=>{}),U=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),N=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;it.push(n));const l=Object.keys(o);for(let t=0;t{if(Array.isArray(t)&&t.length)for(let s=0;sArray.isArray(t)?t.join(""):t,z=(t,n)=>{const s=Object.keys(t);for(let i=0;iArray.isArray(t)?t.reduce((t,s)=>(z(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},F=(t,n)=>({...t,[n]:void 0}),Y=["noscript","script","style"],K=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),G=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${K(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),W=(t,n,s,i)=>{const o=G(s),l=R(n);return o?`<${t} ${j}="true" ${o}>${K(l,i)}`:`<${t} ${j}="true">${K(l,i)}`},J=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${K(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===Y.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}`}`},""),Q=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),V=(t,n,s)=>{const i=Q(s,{key:n,[j]:!0});return[T.default.createElement("title",i,n)]},X=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),T.default.createElement(t,i)}),Z=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>V(0,n.title,n.titleAttributes),toString:()=>W(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Q(n),toString:()=>G(n)};default:return{toComponent:()=>X(t,n),toString:()=>J(t,n,s)}}},ee=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=B(t,w),l=B(n,O),c=B(s,C);return{priorityMethods:{toComponent:()=>[...X("meta",o.priority),...X("link",l.priority),...X("script",c.priority)],toString:()=>`${Z("meta",o.priority,i)} ${Z("link",l.priority,i)} ${Z("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},te=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=ee(t)),{priority:T,base:Z("base",n,i),bodyAttributes:Z("bodyAttributes",s,i),htmlAttributes:Z("htmlAttributes",o,i),link:Z("link",y,i),meta:Z("meta",f,i),noscript:Z("noscript",l,i),script:Z("script",b,i),style:Z("style",c,i),title:Z("title",{title:p,titleAttributes:u},i)}},re=[],ne=!("undefined"==typeof window||!window.document||!window.document.createElement),se=class{instances=[];canUseDOM=ne;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?re:this.instances,add:t=>{(this.canUseDOM?re:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?re:this.instances).indexOf(t);(this.canUseDOM?re:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=te({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ie=b.default.createContext({}),oe=class t extends b.Component{static canUseDOM=ne;constructor(n){super(n),this.helmetData=new se(this.props.context||{},t.canUseDOM)}render(){return b.default.createElement(ie.Provider,{value:this.helmetData.value},this.props.children)}},ae=r(d[0]),le=(t,n)=>{if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;const s=Object.keys(t),i=Object.keys(n);return s.length===i.length&&s.every(s=>Object.prototype.hasOwnProperty.call(n,s)&&t[s]===n[s])},ce=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},pe=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},ue=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=R(t)),pe("title",n)},de=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;pe("body",i),pe("html",o),ue(f,b);const T={baseTag:ce("base",s),linkTags:ce("link",l),metaTags:ce("meta",c),noscriptTags:ce("noscript",p),scriptTags:ce("script",h),styleTags:ce("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},he=null,me=t=>{he&&cancelAnimationFrame(he),t.defer?he=requestAnimationFrame(()=>{de(t,()=>{he=null})}):(de(t),he=null)},ye=class extends ae.Component{rendered=!1;shouldComponentUpdate(t){return!le(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:N(["href"],o),bodyAttributes:U("bodyAttributes",o),defer:D(o,S),encode:D(o,E),htmlAttributes:U("htmlAttributes",o),linkTags:q("link",["rel","href"],o),metaTags:q("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:q("noscript",["innerHTML"],o),onChangeClientState:I(o),scriptTags:q("script",["src","innerHTML"],o),styleTags:q("style",["cssText"],o),title:L(o),titleAttributes:U("titleAttributes",o),prioritizeSeoTags:_(o,H)});var o;oe.canUseDOM?me(i):te&&(s=te(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},fe=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(F(this.props,"helmetData"),F(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){if(!x.some(n=>t.type===n))throw new Error("function"==typeof t.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`);if(n&&"string"!=typeof n&&(!Array.isArray(n)||n.some(t=>"string"!=typeof t)))throw new Error(`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`} ) Refer to our API for more information.`);return!0}mapChildrenToProps(t,n){let s={};return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[$[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof se)){i=new se(i.context,!0),delete s.helmetData}return i?y.default.createElement(ye,{...s,context:i.value}):y.default.createElement(ie.Consumer,null,t=>y.default.createElement(ye,{...s,context:t}))}}},1449,[34,172]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1450,[]); -__d(function(g,r,i,a,m,_e,d){"use strict";function t(){const e=r(d[0]);return t=function(){return e},e}function e(){const t=r(d[1]);return e=function(){return t},t}function n(){const t=f(r(d[2]));return n=function(){return t},t}function o(){const t=r(d[3]);return o=function(){return t},t}Object.defineProperty(_e,"__esModule",{value:!0}),Object.defineProperty(_e,"renderRootComponent",{enumerable:!0,get:function(){return y}});const u=f(r(d[4]));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}function f(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=c(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var s=u?Object.getOwnPropertyDescriptor(t,f):null;s&&(s.get||s.set)?Object.defineProperty(o,f,s):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o}function s(t){if('[object Object]'!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function p(t){return t&&'object'==typeof t&&'string'==typeof t.name&&'string'==typeof t.message}function l(t){return p(t)?t:s(t)?new Error(JSON.stringify(t)):new Error(String(t))}function y(c){try{setTimeout(()=>{u._internal_preventAutoHideAsync?.()}),n().startTransition(()=>{(0,e().registerRootComponent)(c)})}catch(n){u.hideAsync();const c=l(n);(0,e().registerRootComponent)(()=>(0,t().jsx)(o().View,{})),console.error(c),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw c})}}},1451,[25,499,34,270,651]); +__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.CarGate=function(){const e=(0,u.useSession)(e=>e.meId),[t,o]=(0,r.useState)(u.useSession.persist.hasHydrated());return(0,r.useEffect)(()=>{const e=u.useSession.persist.onFinishHydration(()=>o(!0));return u.useSession.persist.hasHydrated()&&o(!0),e},[]),t?e||x.PITCH?null:(0,b.jsx)(T,{}):(0,b.jsx)(s.default,{style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3}]})};var t=_r(d[0]),r=_r(d[1]),n=e(_r(d[2])),s=e(_r(d[3])),o=e(_r(d[4])),l=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),f=_r(d[11]),y=_r(d[12]),j=_r(d[13]),b=_r(d[14]);let w=null,M=null;async function I(e){return!e&&M&&Date.now()-M.at<6e4&&new Date(M.r.expiresAt).getTime()-Date.now()>12e4?M.r:w||(w=(0,h.carPairStart)().then(e=>(e.ok&&(M={r:e,at:Date.now()}),e)).finally(()=>{w=null}),w)}function T(){const{width:e,height:u}=(0,o.default)(),[x,w]=(0,r.useState)(null),[M,T]=(0,r.useState)('starting'),[C,D]=(0,r.useState)(''),[k,z]=(0,r.useState)(0),S=(0,r.useRef)(!1),P=(0,r.useCallback)(async(e=!0)=>{if(S.current)return;S.current=!0,T('starting'),D('');const t=await I(e);if(S.current=!1,!t.ok)return T('error'),void D(t.error);w({id:t.requestId,code:t.code,until:new Date(t.expiresAt).getTime()}),T('waiting')},[]);(0,r.useEffect)(()=>{P(!1)},[]),(0,r.useEffect)(()=>{if(!x||'waiting'!==M)return;const e=setInterval(async()=>{z(Math.max(0,Math.round((x.until-Date.now())/1e3)));('expired'===await(0,h.carPairPoll)(x.id)||Date.now()>x.until)&&T('expired')},3e3);return()=>clearInterval(e)},[x,M]);const H=Math.min(120,Math.max(64,Math.round(Math.min(e/9,u/7)))),v=x?.code??'',F=v?`${v.slice(0,3)} ${v.slice(3)}`:'\xb7\xb7\xb7 \xb7\xb7\xb7';return(0,b.jsxs)(s.default,{testID:"car-pairing",style:[n.default.absoluteFill,{backgroundColor:f.colours.bg,zIndex:1e3,alignItems:'center',justifyContent:'center',padding:24}],children:[(0,b.jsx)(t.CarFullscreenButton,{place:"corner"}),(0,b.jsxs)(s.default,{style:{width:'100%',maxWidth:880,alignItems:'center',gap:u<820?10:16},children:[(0,b.jsx)(c.RestaurantLogo,{rid:p.VENUE_RID,size:u<820?64:88}),(0,b.jsx)(l.T,{center:!0,size:28,weight:"semibold",accessibilityRole:"header",children:"The Anchorage \xb7 car screen"}),(0,b.jsx)(j.ParkedOnly,{}),'waiting'===M||'starting'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:18,colour:f.colours.muted,children:"Sign this car in from your phone"}),(0,b.jsx)(s.default,{testID:"car-code",accessible:!0,accessibilityLabel:v?`Car code ${(0,y.spokenCode)(v)}`:'Making a code',accessibilityLiveRegion:"polite",style:{paddingHorizontal:32,paddingVertical:10,borderRadius:20,borderWidth:1.5,borderColor:f.colours.gold,backgroundColor:'rgba(201,162,74,0.10)'},children:(0,b.jsx)(l.T,{center:!0,size:H,weight:"bold",colour:f.colours.goldLight,style:{letterSpacing:H/8,lineHeight:1.2*H},children:F})}),v?(0,b.jsx)(l.Muted,{center:!0,children:`This code works for ${Math.max(1,Math.ceil((k||600)/60))} more minute${1===Math.ceil((k||600)/60)?'':'s'}.`}):null,(0,b.jsxs)(s.default,{testID:"car-steps",style:{gap:4,alignItems:'center'},children:[(0,b.jsx)(l.T,{center:!0,size:18,children:"1. On your phone, open CoverCharge for Managers."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"2. Go to More, then Car screen."}),(0,b.jsx)(l.T,{center:!0,size:18,children:"3. Type these 6 numbers and tap Approve car."})]}),(0,b.jsx)(s.default,{style:{flexDirection:'row',gap:12,flexWrap:'wrap',justifyContent:'center'},children:(0,b.jsx)(l.Button,{testID:"car-new-code",kind:"secondary",label:"New code",onPress:()=>{P()},style:{minHeight:64,minWidth:200}})})]}):'expired'===M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:f.colours.goldLight,children:"That code has run out"}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Make a new code",onPress:()=>{P()},style:{minHeight:64,minWidth:280}})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:f.colours.amber,children:"Couldn\u2019t make a code"}),(0,b.jsx)(l.Muted,{center:!0,children:C}),(0,b.jsx)(l.Button,{testID:"car-new-code",label:"Try again",onPress:()=>{P()},style:{minHeight:64,minWidth:240}})]}),C&&'error'!==M?(0,b.jsx)(l.T,{center:!0,colour:f.colours.amber,children:C}):null,(0,b.jsx)(l.Muted,{center:!0,style:{maxWidth:640},children:"Don\u2019t open your personal app link in the car: it stays on your phone. Use this screen only when the car is in Park."})]})]})}},1415,[1416,34,41,102,426,794,847,997,985,2,5,840,1417,1418,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,"FS_KEY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"FS_BUTTON_H",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"NOT_ALLOWED",{enumerable:!0,get:function(){return b}}),_e.useCarViewport=function(){(0,t.useEffect)(()=>{if(!u)return;const e=document.documentElement,t=document.body,n=[e.style.cssText,t.style.cssText];for(const n of[e.style,t.style])n.height='100%',n.margin='0',n.overflow='hidden',n.overscrollBehavior='none',n.touchAction='manipulation';return()=>{e.style.cssText=n[0],t.style.cssText=n[1]}},[])},_e.CarFullscreenButton=function({place:e="rail",width:E}){const[x,p]=(0,t.useState)(y),[L,T]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!u)return;const e=()=>{const e=y();p(e),e||v.set(f,null)};document.addEventListener('fullscreenchange',e),document.addEventListener('webkitfullscreenchange',e);let t='1'===v.get(f)&&!y();const n=()=>{t&&(t=!1,w())};return t&&(document.addEventListener('click',n,!0),document.addEventListener('touchend',n,!0)),()=>{document.removeEventListener('fullscreenchange',e),document.removeEventListener('webkitfullscreenchange',e),document.removeEventListener('click',n,!0),document.removeEventListener('touchend',n,!0)}},[]),(0,t.useEffect)(()=>{if(!L)return;const e=setTimeout(()=>T(null),9e3);return()=>clearTimeout(e)},[L]);const F=(0,t.useCallback)(async()=>{if(T(null),y()){v.set(f,null);try{await((document.exitFullscreen??document.webkitExitFullscreen)?.call(document))}catch{}return}const e=window.innerHeight;await w()?(v.set(f,'1'),setTimeout(()=>{(!y()||window.innerHeight<=e+8)&&T(b)},900)):T(b)},[]);if(!u)return null;const k=x?'Exit full screen':'Full screen',j='corner'===e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{testID:"car-fullscreen",accessibilityRole:"button",accessibilityLabel:k,accessibilityHint:x?'Shows the browser bar again':'Hides the browser bar, if the car allows it',onPress:()=>{F()},style:[{minHeight:h,minWidth:j?220:void 0,width:j?void 0:E,alignSelf:j?void 0:'center',justifyContent:'center',alignItems:'center',paddingHorizontal:12,borderRadius:14,borderWidth:2,borderColor:o.colours.goldLight,backgroundColor:x?'#1d1708':o.colours.gold},j?{position:'fixed',top:12,right:12,zIndex:1200}:null],children:(0,s.jsx)(l.T,{size:j?20:17,weight:"bold",colour:x?o.colours.goldLight:'#1a1407',center:!0,numberOfLines:1,children:k})}),L?(0,s.jsx)(c.default,{testID:"car-fullscreen-msg",accessible:!0,accessibilityLiveRegion:"assertive",accessibilityLabel:L,style:{position:'fixed',top:j?76:12,right:j?12:220,maxWidth:420,zIndex:1300,padding:14,borderRadius:14,borderWidth:1.5,borderColor:o.colours.amber,backgroundColor:'#1d1708'},children:(0,s.jsx)(l.T,{size:17,center:!0,colour:"#FFE2A8",children:L})}):null]})};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),c=e(r(d[3])),l=r(d[4]),o=r(d[5]),s=r(d[6]);const u='undefined'!=typeof document,f='cc-car-fullscreen',h=56,b='The car\u2019s browser kept its address bar, so full screen isn\u2019t available here. The car screen already uses all the space it is given.',v={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}},y=()=>u&&!(!document.fullscreenElement&&!document.webkitFullscreenElement);async function w(){const e=document.documentElement,t=e.requestFullscreen??e.webkitRequestFullscreen;if(!t)return!1;try{return await t.call(e,{navigationUI:'hide'}),!0}catch{return!1}}},1416,[34,236,402,102,794,840,25]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAR_BUTTONS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"RAIL_TITLE",{enumerable:!0,get:function(){return o}}),e.railSizes=function(s,l){const t=l>=1e3?13:11,n=Math.round(1.45*t),c=48+n+8,b=Math.floor((l-o-12)/12)>=c?1:2,h=12/b,p=Math.floor((l-o-12)/h),u=1===b?s>=1600?168:s>=1200?136:120:s>=1600?128:s>=1100?100:88,f=Math.max(44,Math.min(1===b?72:64,p-n-12,u-24));return{railW:u*b,colW:u,cols:b,per:p,circle:f,label:t,lineH:n,icon:Math.round(.46*f)}},Object.defineProperty(e,"spokenCode",{enumerable:!0,get:function(){return l}});const s=[{id:'rota',label:'Rota',short:'Rota',icon:'rota',pages:[{id:'rota',label:'Rota'}]},{id:'signoff',label:'Sign off hours',short:'Sign off',icon:'signoff',pages:[{id:'signoff',label:'Sign off hours'},{id:'timesheets',label:'Timesheets'}]},{id:'menu',label:'Menu & sold out',short:'Menu',icon:'menu',pages:[{id:'soldout',label:'Sold out'},{id:'menu',label:'Menu & allergens'},{id:'tableqr',label:'Table QR codes'}]},{id:'bookings',label:'Bookings',short:'Bookings',icon:'bookings',pages:[{id:'@bookings',label:'Bookings'},{id:'lookback',label:'Look back'}]},{id:'noshows',label:'No-shows',short:'No-shows',icon:'noshow',pages:[{id:'@noshows',label:'No-shows'}]},{id:'chat',label:'Staff chat',short:'Chat',icon:'chat',pages:[{id:'@chat',label:'Staff chat'}]},{id:'stock',label:'Stock & suppliers',short:'Stock',icon:'stock',pages:[{id:'trackedstock',label:'Tracked stock'},{id:'orderlists',label:'Order lists'},{id:'suppliers',label:'Suppliers'}]},{id:'loyalty',label:'Loyalty',short:'Loyalty',icon:'loyalty',pages:[{id:'loyalty',label:'Stamp card'}]},{id:'takings',label:'Takings & tips',short:'Takings',icon:'takings',pages:[{id:'cashup',label:'Cash up & sales'},{id:'tips',label:'Tips'},{id:'spendhead',label:'Spend per head'}]},{id:'safety',label:'Food safety',short:'Safety',icon:'safety',pages:[{id:'haccp',label:'Food safety log'},{id:'compliance',label:'Daily checks'}]},{id:'reviews',label:'Reviews',short:'Reviews',icon:'reviews',pages:[{id:'reviews',label:'Reviews'}]},{id:'assistant',label:'Assistant',short:'Assistant',icon:'assistant',pages:[{id:'assistant',label:'Assistant'}]}],o=64;const l=s=>s.split('').join(' ')},1417,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ParkedOnly=function({small:e}){return(0,s.jsx)(n.default,{testID:"parked-only",accessible:!0,accessibilityLabel:"Parked only. Use this screen only when the car is in Park.",style:{minHeight:e?28:36,paddingHorizontal:e?8:12,borderRadius:999,borderWidth:1,borderColor:t.colours.amber,backgroundColor:'rgba(232,168,56,0.12)',alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,s.jsx)(o.T,{size:e?11:13,weight:"semibold",colour:t.colours.amber,center:!0,children:"PARKED ONLY"})})},r(d[0]);var e,l=r(d[1]),n=(e=l)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),s=r(d[4])},1418,[34,102,794,840,25]); +__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=_r(d[0]),r=_r(d[1]),s=_r(d[2]),n=_r(d[3]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the Head Chef, an owner or a manager can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:c=>r.localRecipeCards.list(c),get:c=>r.localRecipeCards.get(c),byMenuItem:c=>r.localRecipeCards.byMenuItem(c),subscribe:c=>r.localRecipeCards.subscribe(c),create:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.create(c,s,n)),update:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.update(c,s,n)),signOff:async(c,s)=>(t('recipes.signoff'),r.localRecipeCards.signOff(c,s)),remove:async(s,n)=>{t('recipes.edit');const o=await r.localRecipeCards.remove(s,n);return c.useGpCalc.getState().removeCardCost(s),o},savePhoto:async(c,s,n)=>(t('recipes.edit'),r.localRecipeCards.savePhoto(c,s,n)),photoSource:c=>r.localRecipeCards.photoSource(c)};function p(){const c=o()?l:r.localRecipeCards;(0,s.recipeCards)()!==c&&(0,s.setRecipeCardRepository)(c)}p(),n.useSync.subscribe((c,r)=>{c.mode===r.mode&&c.kind===r.kind&&c.venueId===r.venueId||p()})},1419,[986,857,856,985]); +__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,"STRIP",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"SYNC_CONNECTED_GREEN",{enumerable:!0,get:function(){return P}}),_e.syncTone=R,Object.defineProperty(_e,"syncToneColour",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"syncToneSpoken",{enumerable:!0,get:function(){return z}}),_e.SyncBadge=function(){const e=(0,y.useSync)(),[P,k]=(0,s.useState)(!1),[N,W]=(0,s.useState)(e.refused?.at??''),$=e.refused&&e.refused.at!==N?e.refused:void 0,[A,H]=(0,s.useState)(!1),[L,O]=(0,s.useState)(''),_=(0,p.useDisplaySettings)(f.VENUE_RID),E=(0,v.useScreensaverAsleep)(e=>e.asleep),V='off'===e.mode&&(C.PITCH||!(0,j.isSupabaseConfigured)());if('customer'===h.APP_VARIANT||'off'===e.mode&&!V)return null;if(E)return(0,I.jsx)(u.default,{testID:"sync-strip-asleep",accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{height:D,backgroundColor:x.colours.bg}});const M='live'===e.mode,Y='display'===h.APP_VARIANT,K=e.waiting??0,U=`${K} change${1===K?'':'s'} waiting to save`,B=V?C.PITCH?'Demo \xb7 this device only':'This device only':M?K?U:e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',F=R(e.mode,V,K),G=S(F),Q=V?C.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':M?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.default,{testID:"sync-strip",style:{height:D,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:x.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,I.jsxs)(c.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:K&&M?`${U}, ${z(F)}. Kept on this device and tried again by itself. Tap for details.`:`${B}, ${z(F)}. Tap for details.`,accessibilityLiveRegion:"polite",onPress:()=>k(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:(0,t.soutersSurface)('rgba(16,14,11,0.92)'),borderWidth:1,borderColor:`${G}80`,maxWidth:320},children:[(0,I.jsx)(u.default,{testID:"sync-dot",style:{width:10,height:10,borderRadius:5,backgroundColor:G}}),(0,I.jsx)(T.T,{size:12,weight:"semibold",children:B})]})}),P?(0,I.jsxs)(u.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:(0,t.soutersSurface)('#15120E'),borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,I.jsx)(T.T,{size:13,children:Q}),K?(0,I.jsxs)(u.default,{testID:"sync-waiting",style:{gap:4},children:[(0,I.jsxs)(T.T,{size:12,colour:x.colours.gold,children:[U,". ",1===K?'It is':'They are'," kept on this device and tried again by ",1===K?'itself':'themselves'," until the shared system takes ",1===K?'it':'them',".",e.waitingWhat?` Waiting: ${e.waitingWhat}.`:'']}),(0,I.jsx)(c.default,{testID:"sync-retry",accessibilityRole:"button",accessibilityLabel:"Try saving again now",onPress:()=>{b.mutationQueue.retryNow()},style:{minHeight:44,justifyContent:'center',alignSelf:'flex-start',paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:x.colours.gold},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:"Try again now"})})]}):null,e.refused?(0,I.jsxs)(T.T,{size:12,colour:x.colours.red,children:["Last change not saved: ",e.refused.what,". ",e.refused.why,"."]}):null,e.message?(0,I.jsx)(T.T,{size:12,colour:x.colours.muted,children:e.message}):null,e.venueId&&(M||'offline'===e.mode)?A?(0,I.jsxs)(u.default,{style:{gap:6,marginTop:6},children:[(0,I.jsx)(T.T,{size:12,children:Y?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),Y&&_.pinOn?(0,I.jsx)(n.TextInput,{testID:"unpair-pin",value:L,onChangeText:O,placeholder:"Display PIN",placeholderTextColor:x.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:x.colours.text}}):null,(0,I.jsxs)(u.default,{style:{flexDirection:'row',gap:8},children:[(0,I.jsx)(c.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:Y?'Yes, unpair':'Yes, disconnect',disabled:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L),onPress:()=>{H(!1),k(!1),O(''),Y?(0,y.unpairDisplay)():(0,y.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:Y&&_.pinOn&&!(0,l.wakePinMatches)(_,L)?'rgba(255,255,255,0.08)':x.colours.red},children:(0,I.jsx)(T.T,{size:12,weight:"semibold",children:Y?'Yes, unpair':'Yes, disconnect'})}),(0,I.jsx)(c.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{H(!1),O('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,I.jsx)(T.T,{size:12,children:"Keep"})})]})]}):(0,I.jsx)(c.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:Y?'Unpair this display':'Disconnect this device',onPress:()=>H(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,I.jsx)(T.T,{size:12,colour:x.colours.gold,children:Y?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,I.jsx)(o.WipeDevice,{compact:!0})]}):null,$?(0,I.jsx)(u.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:D+w+8,zIndex:950,alignItems:'center'},pointerEvents:"box-none",children:(0,I.jsxs)(u.default,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:x.colours.red,maxWidth:460,gap:8},children:[(0,I.jsx)(T.T,{size:13,children:`Not saved: ${$.what}. Why: ${$.why}. This device now shows what the shared system has, so please make the change again if it is still needed.`}),(0,I.jsx)(c.default,{testID:"sync-toast-ok",accessibilityRole:"button",accessibilityLabel:"OK, dismiss this message",onPress:()=>W($.at),style:{minHeight:44,minWidth:64,justifyContent:'center',alignItems:'center',alignSelf:'flex-end',paddingHorizontal:14,borderRadius:8,backgroundColor:x.colours.red},children:(0,I.jsx)(T.T,{size:13,weight:"semibold",children:"OK"})})]})}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=e(r(d[5])),u=e(r(d[6])),h=r(d[7]),y=r(d[8]),b=r(d[9]),p=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]),C=r(d[16]),I=r(d[17]);const D=48,w='display'===h.APP_VARIANT?0:57,P='#3DD68C';function R(e,t,n){return t?'disconnected':'live'===e?n?'pending':'connected':'connecting'===e?'pending':'disconnected'}const S=e=>'connected'===e?P:'pending'===e?x.colours.amber:x.colours.red,z=e=>'connected'===e?'connected':'pending'===e?'not connected yet':'not connected'},1420,[798,796,34,1343,1015,402,102,846,985,1007,1014,5,840,794,1287,974,2,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.PushPrompt=function(){const e=(0,l.useSync)(e=>e.kind),b=(0,l.useSync)(e=>e.staffRef),x=(0,l.useSync)(e=>e.venueId),[p,S]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(u.PITCH||y()||'staff'!==e||!b||!x)return;let t=!0;return(async()=>{const e=await(0,c.pushState)();if(!t)return;if('undefined'!=typeof Notification&&'granted'===Notification.permission&&('on'===e||'off'===e))return void(0,c.turnOnPush)();if('off'!==e)return;const o=Number(localStorage.getItem(h)||0);Date.now()-o>2592e5&&S(!0)})(),()=>{t=!1}},[e,b,x]),!p)return null;const w={minHeight:48,borderRadius:12,justifyContent:'center',paddingHorizontal:18};return(0,f.jsxs)(r.default,{accessibilityRole:"alert",style:{position:'absolute',left:12,right:12,bottom:72,backgroundColor:s.colours.surface2,borderColor:s.colours.gold,borderWidth:1,borderRadius:14,padding:16,zIndex:50},children:[(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:18,fontWeight:'700',marginBottom:6},children:"Get notifications on this phone"}),(0,f.jsx)(t.Text,{style:{color:'#F2E6C9',fontSize:16,marginBottom:12},children:j??'So you hear about rota changes, swaps and reminders even when the app is closed.'}),(0,f.jsxs)(r.default,{style:{flexDirection:'row',gap:12},children:[(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Turn on notifications",style:[w,{backgroundColor:s.colours.gold,flex:1}],onPress:async()=>{const e=await(0,c.turnOnPush)();e.ok?S(!1):v(e.message)},children:(0,f.jsx)(t.Text,{style:{color:'#0B0B0B',fontSize:17,fontWeight:'700',textAlign:'center'},children:"Turn on"})}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Not now",style:[w,{borderColor:s.colours.gold,borderWidth:1}],onPress:()=>{try{localStorage.setItem(h,String(Date.now()))}catch{}S(!1)},children:(0,f.jsx)(t.Text,{style:{color:s.colours.goldLight,fontSize:17,textAlign:'center'},children:"Not now"})})]})]})};var t=_r(d[0]),o=_r(d[1]);_r(d[2]);var n=e(_r(d[3])),r=e(_r(d[4])),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);const h='cc-push-later-v1',y=()=>'undefined'!=typeof navigator&&/CoverChargePhone\//.test(navigator.userAgent)},1421,[796,34,236,402,102,840,985,1045,2,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.VoiceHost=function(){const e=(0,f.useVoiceTarget)(),t=(0,f.useVoiceSlot)(e=>e.rect);g.PITCH&&(globalThis.__voiceExpect={app:e?.app??null,on:!!e?.on,slot:!!t});if(!e?.on||!t)return null;const n=(0,P.jsx)(X,{app:e.actions,ui:e.app},e.actions);if('undefined'!=typeof document){const{createPortal:e}=_r(d[33]);return e(n,document.body)}return n};var t=_r(d[0]),n=_r(d[1]),o=_r(d[2]),r=e(_r(d[3])),s=e(_r(d[4])),i=e(_r(d[5])),a=e(_r(d[6]));_r(d[7]);var l=e(_r(d[8])),c=e(_r(d[9])),u=e(_r(d[10])),h=e(_r(d[11])),p=_r(d[12]),f=_r(d[13]),g=_r(d[14]),y=_r(d[15]),m=e(y),w=_r(d[16]),x=_r(d[17]),b=_r(d[18]),v=_r(d[19]),k=_r(d[20]),j=_r(d[21]),T=_r(d[22]),R=_r(d[23]),C=_r(d[24]),S=_r(d[25]),I=_r(d[26]),M=_r(d[27]),E=_r(d[28]),H=_r(d[29]),z=_r(d[30]),D=_r(d[31]),P=_r(d[32]);const A='How many people?',$=['covers','partySize'],W=200,_=16e3,B=31e3,O='That took too long, so I stopped waiting. Hold the button and try again, or tap Type instead.',V='Something went wrong there. Hold the button and try again, or tap Type instead.',F='The microphone is blocked. Allow it in the browser\u2019s site settings, or tap the button to type instead.';function L(e,t){return'cap'===e?t?.message||E.REACHED_TEXT:'identity'===e||'app'===e?'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.':'not-allowed'===e?F:'audio-capture'===e?'I couldn\u2019t use the microphone on this device. Check nothing else is using it, then hold the button again, or tap Type instead.':'busy'===e?'Speech to text is busy just now. Hold the button and try again in a moment, or tap Type instead.':'soon'===e?'Speech to text is switching on soon. For now, tap the button to type instead.':'long'===e?'That was longer than 30 seconds. Hold the button and say it more briefly, or tap Type instead.':'I couldn\u2019t turn that into text just now. Hold the button and try again, or tap Type instead.'}function N({colour:e,size:t=34}){return(0,P.jsxs)(m.default,{width:t,height:t,viewBox:"0 0 24 24",children:[(0,P.jsx)(y.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:e}),(0,P.jsx)(y.Path,{d:"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7",stroke:e,strokeWidth:2,strokeLinecap:"round",fill:"none"})]})}const G={owner:['\u201cWalk-in fridge 3 degrees\u201d','\u201cMark the lobster sold out\u201d','\u201cHow many Covers tonight?\u201d','\u201cAdd blue roll to the Booker list\u201d'],staff:['\u201cMessage the team: running 10 minutes late\u201d','\u201cRead my messages\u201d','\u201cWhen\u2019s my next shift?\u201d','\u201cWhat are today\u2019s specials?\u201d','\u201cDoes the fish supper contain gluten?\u201d'],chef:['\u201cFreezer minus 19\u201d','\u201cMark the soup sold out\u201d','\u201cRead the orders\u201d','\u201cAdd onions to the Bidfood list\u201d'],display:['\u201cWalk-in fridge 3 degrees\u201d','\u201cRead the orders\u201d','\u201cAny room for 6 at 8?\u201d','\u201cRead the shift notes\u201d']};function X({app:e,ui:g}){const y=(0,w.useCtx)(6e4),m=(0,b.useOwner)(e=>e.staff),X=(0,I.useVoiceNav)(e=>e.go),{height:U}=(0,u.default)(),q=(0,f.useVoiceSlot)(e=>e.rect),K=q.size,Y=x.ROSTER.find(e=>'chef'===e.app),J='display'===e?'Main Display':'chef'===e?m.find(e=>e.id===Y?.id)?.name??'Head Chef':y.me,Q='display'===e?'display':'chef'===e?Y?.id??'chef':y.meId,Z={rid:y.rid,today:y.today,go:(e,t)=>X?.(e,t),app:e,who:J.replace(' (example)',''),whoId:Q,role:'owner'===g?y.role:e};(0,o.useEffect)(()=>{try{(0,T.setVenueWords)((0,R.venueKeyterms)(y.rid))}catch{}},[y.rid,m]);const[ee,te]=(0,o.useState)('idle'),[ne,oe]=(0,o.useState)(''),[re,se]=(0,o.useState)(0),[ie,ae]=(0,o.useState)(null),[le,de]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(''),[he,pe]=(0,o.useState)(!1),fe=(0,o.useRef)(null),ge=(0,o.useRef)(0),ye=(0,o.useRef)(null),me=(0,o.useRef)(Z);me.current=Z;const we=(0,o.useRef)(ie);we.current=ie;const xe=(0,o.useRef)(y.now);xe.current=y.now;const be=e=>{ae(e),te('answer')},ve=be,ke=async e=>{const t=++ge.current;let n;te('working');try{n=await(0,j.runAction)(e.id,e.params,me.current,!0)}catch{n={status:'error',message:V}}t===ge.current&&((0,H.buzz)([20,40,20]),ve({text:'needs_confirmation'===n.status?n.preview:n.message,tone:'error'===n.status?'warn':'ok'}))},je=()=>ve({text:'Cancelled. Nothing was changed.',tone:'info'}),Te=async(e,t,n)=>{const o=++ge.current,r={...e.params,[e.field]:t};let s;te('working');try{s=await(0,j.runAction)(e.id,r,me.current,!1)}catch{s={status:'error',message:V}}o===ge.current&&('needs_confirmation'===s.status?ve({heard:n,text:s.preview,pending:{id:e.id,params:r,preview:s.preview}}):ve({heard:n,text:s.message,tone:'error'===s.status?'warn':'ok'}))},Re=async(e,t)=>{const n=ge.current,o=e=>{n===ge.current&&be(e)};try{await Ce(e,o,t)}catch{o({heard:e.trim()||void 0,text:V,tone:'warn'})}},Ce=async(t,n,o)=>{const r=t.trim(),s=me.current;if(!r)return void n({text:'I didn\u2019t catch that. Hold the button while you speak, then let go.',tone:'info'});const i=we.current?.pending;if(i){const e=(0,H.yesNo)(r);if('yes'===e)return void await ke(i);if('no'===e)return void je()}const a=we.current?.ask;if(a){const e=(0,D.coversAnswer)(r);if(e&&e<=30)return void await Te(a,e,r)}te('working');const l=(0,j.matchIntent)(r,s.today,{app:e,rid:s.rid,whoId:s.whoId}),c=xe.current;if(!E.voiceUsage.allowed(s.rid,'action'===l.kind?l.action.id:null,c))return void n({heard:r,text:E.REACHED_TEXT,tone:'info'});E.voiceUsage.record(s.rid,c);const u=E.voiceUsage.get(s.rid,c),h=u.reached?E.REACHED_TEXT:u.warn?(0,E.WARN_TEXT)(u):void 0,p=e=>n({...e,note:h});if('action'===l.kind){const e=l.action,t=e.params.filter(e=>e.required&&(void 0===l.params[e.name]||''===l.params[e.name]||'[]'===l.params[e.name]));if(1===t.length&&$.includes(t[0].name))return void p({heard:r,text:A,ask:{id:e.id,params:l.params,field:t[0].name},tone:'info'});if(t.length)return void p({heard:r,text:e.preview(l.params,s)+(/\?$/.test(e.preview(l.params,s))||/couldn|didn/.test(e.preview(l.params,s))?'':` I still need: ${t.map(e=>e.description.toLowerCase()).join('; ')}.`)+' Hold the button and try again.',tone:'warn'});const n=await(0,j.runAction)(e.id,l.params,s,!1);return void('needs_confirmation'===n.status?p({heard:r,text:n.preview,pending:{id:e.id,params:l.params,preview:n.preview}}):p({heard:r,text:n.message,tone:'error'===n.status?'warn':'ok'}))}const f=` ${r.toLowerCase()} `,g=e=>{const t=(0,j.actionById)(e);if(!t)return 0;try{return t.match?t.match(f):t.keywords.filter(e=>f.includes(e)).length}catch{return 0}},y=()=>(0,j.toolSpecs)().filter(t=>{const n=(0,j.actionById)(t.function.name);return!!n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))}).map((e,t)=>({t:e,i:t,s:g(e.function.name)})).sort((e,t)=>t.s-e.s||e.i-t.i).slice(0,60).map(e=>e.t),m=async t=>{if('call'===t.kind){const n=(0,j.actionById)(t.name);if(n&&(!n.apps||n.apps.includes(e))&&('staff'!==e||(0,j.staffMay)(n))){const e=n.params.filter(e=>e.required&&(void 0===t.args[e.name]||''===t.args[e.name]));if(1===e.length&&$.includes(e[0].name))return p({heard:r,text:A,ask:{id:n.id,params:t.args,field:e[0].name},tone:'info'}),!0;const o=await(0,j.runAction)(n.id,t.args,s,!1);return'needs_confirmation'===o.status?p({heard:r,text:o.preview,pending:{id:n.id,params:t.args,preview:o.preview}}):p({heard:r,text:o.message,tone:'error'===o.status?'warn':'ok'}),!0}}return'text'===t.kind&&(p({heard:r,text:(0,j.moneySafe)(e,s.role)?(0,j.noMoney)(t.text):t.text,tone:'info'}),!0)};if('help'===l.kind){const t=l.ids.map(C.helpById).filter(Boolean)[0];if(!(((0,S.searchHelp)(C.HELP,r,1)[0]?.score??0)>=2.5)){const n=await(0,T.askServer)(e,r,y(),o);if(await m(n))return;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(`${t.title}. ${t.body}`)?void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}.`,tone:'info'}):void p({heard:r,text:`${T.SOON_TEXT} ${G[e].slice(0,2).join(' or ')}. This guide might help: ${t.title}.`,help:l.ids,tone:'info'})}const n=`${t.title}. ${t.body}`;return(0,j.moneySafe)(e,s.role)&&(0,j.hasMoney)(n)?void p({heard:r,text:'That isn\u2019t shown here. Ask a manager in the Managers app.',tone:'info'}):void p({heard:r,text:n,help:l.ids,tone:'info'})}await m(await(0,T.askServer)(e,r,y(),o))||p({heard:r,text:T.SOON_TEXT+' '+G[e].slice(0,2).join(' or ')+'.',tone:'info'})},Se=()=>{fe.current?.abort(),fe.current=null,ye.current?.(),ye.current=null,se(0)};(0,o.useEffect)(()=>()=>{fe.current?.abort(),ye.current?.()},[]);const Ie=async()=>{if(!(0,H.canListen)())return de(!0),void ve({text:(0,H.tabletWithoutMic)()?'This Display tablet app needs an update before it can use the microphone. For now, type below.':'This browser can\u2019t record speech. Type instead below.',tone:'info'});if((0,H.desktopStt)()){if(!(0,M.micExplainedFor)(g))return void pe(!0)}else{const e=await(0,H.micPermission)();if('granted'===e)(0,M.setMicExplainedFor)(g);else{if('denied'===e)return de(!0),void ve({text:F,tone:'warn'});if(!(0,M.micExplainedFor)(g))return void pe(!0)}}if(!He.current.holding&&!Ee.current)return;const t=++ge.current;(0,H.buzz)(35),oe(''),ae(null),de(!1),te('listening');if(fe.current=(0,H.listen)(oe,(e,n,o)=>{if(ye.current?.(),ye.current=null,se(0),fe.current=null,t===ge.current){if('not-allowed'!==n&&'service-not-allowed'!==n)return'stt-failed'===n?(ve({text:'Speech to text didn\u2019t start on this Mac. Type instead below; restarting the app usually fixes it.',tone:'warn'}),void de(!0)):void(n?ve({text:L(n,o),tone:'cap'===n?'info':'warn'}):Re(e,o?.receipt));ve({text:(0,H.desktopStt)()?'The microphone is blocked for CoverCharge. Open System Settings \u203a Privacy & Security \u203a Microphone, switch on CoverCharge for Mac, then try again. Or type instead.':F,tone:'warn'})}},e,se),!fe.current)return te('idle'),void de(!0);if((0,H.desktopStt)()){const e=await(0,H.levelMeter)(se);fe.current?ye.current=e:e()}},Me=()=>{fe.current&&(te('working'),fe.current.stop(),ye.current?.(),ye.current=null,se(0))},Ee=(0,o.useRef)(!1),He=(0,o.useRef)({timer:0,holding:!1}),ze=(0,o.useRef)(Ie);ze.current=Ie;const De=(0,o.useRef)(Me);De.current=Me;const Pe=(0,o.useMemo)(()=>a.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>{const e=He.current;e.holding=!1,(0,M.micExplainedFor)(g)&&(0,H.warmMic)(),e.timer=setTimeout(()=>{e.holding=!0,ze.current()},W)},onPanResponderRelease:()=>{const e=He.current;if(clearTimeout(e.timer),e.holding)return e.holding=!1,void De.current();(0,H.disarmMic)(),de(!0),te(e=>'idle'===e?'answer':e)},onPanResponderTerminate:()=>{const e=He.current;clearTimeout(e.timer),e.holding&&(e.holding=!1,De.current())}}),[e]);(0,o.useRef)(ee).current=ee,(0,o.useEffect)(()=>z.useVoiceKeys.subscribe((e,t)=>{const n=e.last;if(!n||n.n===t.last?.n)return;const o=!!fe.current;'start'!==n.cmd||o?'stop'===n.cmd?(Ee.current=!1,o&&De.current()):'toggle'===n.cmd?o?(Ee.current=!1,De.current()):(Ee.current=!0,ze.current()):'type'===n.cmd&&(de(!0),te(e=>'idle'===e?'answer':e)):(Ee.current=!0,ze.current())}),[]);const Ae=K>=64,$e=(0,o.useRef)(new s.default.Value(0)).current;(0,o.useEffect)(()=>{if('listening'!==ee)return $e.stopAnimation(),void $e.setValue(0);const e=s.default.loop(s.default.timing($e,{toValue:1,duration:1100,easing:i.default.out(i.default.quad),useNativeDriver:!1}));return e.start(),()=>e.stop()},[ee]);const We='listening'===ee,Be='answer'===ee&&(ie||le)||'working'===ee||We,Oe=()=>{ge.current++,Se(),ae(null),de(!1),ue(''),te('idle')};(0,o.useEffect)(()=>{if('working'!==ee&&'listening'!==ee)return;const e=ge.current,t=setTimeout(()=>{e===ge.current&&('listening'!==ee?(ge.current++,Se(),de(!0),be({heard:ne&&!/\u2026$/.test(ne)?ne:void 0,text:O,tone:'warn'})):De.current())},'working'===ee?_:B);return()=>clearTimeout(t)},[ee]);const Ve=()=>{const e=ce.trim();e&&(ue(''),oe(e),ge.current++,Re(e))},Fe='fixed',Le={top:q.y+K+8},Ne=$e.interpolate({inputRange:[0,1],outputRange:[1,1.7]}),Ge=$e.interpolate({inputRange:[0,1],outputRange:[.6,0]}),Xe='warn'===ie?.tone?k.colours.amber:ie?.pending?k.colours.gold:k.colours.border;return(0,P.jsxs)(P.Fragment,{children:[Be?(0,P.jsx)(h.default,{testID:"voice-panel",style:[{position:Fe,left:12,right:12,alignItems:'flex-end',zIndex:60},Le],pointerEvents:"box-none",children:(0,P.jsxs)(h.default,{style:{width:'100%',maxWidth:Ae?720:520,backgroundColor:k.colours.surface,borderRadius:16,borderWidth:2,borderColor:Xe,padding:Ae?20:14,gap:10,maxHeight:U*(Ae?.78:.6)},children:[(0,P.jsxs)(v.Row,{style:{justifyContent:'space-between'},children:[(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.gold,accessibilityRole:"header",children:We?Ae?'Listening\u2026 let go (or press \u2318\u21e7G) to send':'Listening\u2026 let go to send':'working'===ee?'Working on it\u2026':ie?.pending?'Please confirm':'Voice assistant'}),(0,P.jsx)(l.default,{testID:"voice-close",accessibilityRole:"button",accessibilityLabel:"Close voice assistant",hitSlop:12,onPress:Oe,style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:20,colour:k.colours.muted,children:"\u2715"})})]}),(0,P.jsx)(v.T,{testID:"voice-reply-mode",size:14,colour:k.colours.muted,children:"Text replies only"}),We?(0,P.jsxs)(h.default,{style:{gap:8},children:[(0,P.jsx)(h.default,{style:{height:10,borderRadius:5,backgroundColor:k.colours.surface2,overflow:'hidden'},children:(0,P.jsx)(h.default,{testID:"voice-level",style:{width:`${Math.round(8+92*re)}%`,height:10,backgroundColor:k.colours.ok}})}),(0,P.jsx)(v.T,{size:16,children:ne||'Say it now\u2026'})]}):null,'working'===ee?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(r.default,{color:k.colours.gold}),(0,P.jsx)(v.T,{size:15,colour:k.colours.muted,children:ne?/\u2026$/.test(ne)?ne:`\u201c${ne}\u201d`:''})]}):null,'working'===ee||We?(0,P.jsx)(v.Button,{testID:"voice-stop",kind:"secondary",label:"Cancel",onPress:()=>{ge.current++,Se(),de(!1),be({text:'Stopped. Nothing was changed.',tone:'info'})},style:{minHeight:48}}):null,'answer'===ee&&ie?(0,P.jsxs)(c.default,{style:{maxHeight:U*(Ae?.55:.36)},contentContainerStyle:{gap:8},children:[ie.heard?(0,P.jsx)(h.default,{testID:"voice-heard",accessible:!0,accessibilityLabel:`I heard: ${ie.heard}`,children:(0,P.jsxs)(v.T,{size:Ae?16:14,colour:k.colours.muted,children:["I heard: \u201c",ie.heard,"\u201d"]})}):null,ie.note?(0,P.jsx)(h.default,{testID:"voice-usage-note",children:(0,P.jsx)(v.T,{size:13,colour:k.colours.amber,children:ie.note})}):null,(0,P.jsx)(h.default,{testID:"voice-answer",children:(0,P.jsx)(v.T,{size:Ae?24:18,weight:ie.pending?'semibold':'regular',children:ie.text})}),ie.help&&'owner'===e&&X?ie.help.slice(0,3).map(e=>{const t=(0,C.helpById)(e);return t?(0,P.jsx)(v.Button,{small:!0,kind:"secondary",label:`Open help: ${t.title}`,onPress:()=>{X('more','help'),Oe()}},e):null}):null]}):null,'answer'===ee&&ie?.ask?(0,P.jsx)(h.default,{testID:"voice-how-many",style:{flexDirection:'row',flexWrap:'wrap',gap:10},children:[1,2,3,4,5,6,7,8].map(e=>(0,P.jsx)(l.default,{testID:`voice-covers-${e}`,accessibilityRole:"button",accessibilityLabel:1===e?'1 person':`${e} people`,onPress:()=>{Te(ie.ask,e)},style:{width:Ae?96:72,height:Ae?96:72,borderRadius:14,backgroundColor:k.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,P.jsx)(v.T,{size:Ae?40:32,weight:"semibold",colour:k.colours.onGold,children:e})},e))}):null,'answer'===ee&&ie?.pending?(0,P.jsxs)(v.Row,{gap:10,children:[(0,P.jsx)(v.Button,{testID:"voice-confirm",kind:"success",label:"Confirm",onPress:()=>{ke(ie.pending)},style:{flex:1,minHeight:56}}),(0,P.jsx)(v.Button,{testID:"voice-cancel",kind:"secondary",label:"Cancel",onPress:je,style:{flex:1,minHeight:56}})]}):null,'answer'!==ee||ie?.pending?null:(0,P.jsxs)(h.default,{style:{gap:6},children:[le||!(0,H.canListen)()?(0,P.jsxs)(v.Row,{gap:8,children:[(0,P.jsx)(n.TextInput,{testID:"voice-type",value:ce,onChangeText:ue,onSubmitEditing:Ve,placeholder:"Type instead\u2026",placeholderTextColor:k.colours.muted,autoFocus:!0,returnKeyType:"send",style:{flex:1,minWidth:0,width:0,minHeight:48,borderRadius:10,borderWidth:1,borderColor:k.colours.border,backgroundColor:k.colours.surface2,color:k.colours.text,paddingHorizontal:12,fontFamily:k.fonts.regular,fontSize:16}}),(0,P.jsx)(v.Button,{testID:"voice-send",kind:"success",label:"Ask",onPress:Ve,disabled:!ce.trim()})]}):(0,P.jsx)(l.default,{accessibilityRole:"button",onPress:()=>de(!0),children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"Type instead"})}),ie?null:(0,P.jsxs)(v.T,{size:Ae?15:13,colour:k.colours.muted,children:[Ae?'Hold Space (or the gold button) and speak, or press \u2318\u21e7G to start and again to send. ':'Hold the gold button and speak, for example ',Ae?`For example ${G[e].join(', ')}.`:`${G[e].join(', ')}.`]}),'owner'===g&&'owner'===e?(0,P.jsx)(l.default,{testID:"voice-open-assistant",accessibilityRole:"button",onPress:()=>{Oe(),p.useAssistantUi.getState().setOpen(!0)},style:{minHeight:44,justifyContent:'center'},children:(0,P.jsx)(v.T,{size:14,colour:k.colours.gold,children:"\u2726 Open the Assistant (ideas, history and longer requests) \u203a"})}):null]})]})}):null,(0,P.jsxs)(h.default,{style:{position:Fe,left:`clamp(0px, ${q.x}px, calc(100vw - ${K}px))`,top:q.y,width:K,height:K,zIndex:61},pointerEvents:"box-none",children:[We?(0,P.jsx)(s.default.View,{pointerEvents:"none",style:{position:'absolute',left:0,top:0,width:K,height:K,borderRadius:K/2,borderWidth:4,borderColor:k.colours.ok,opacity:Ge,transform:[{scale:Ne}]}}):null,We?(0,P.jsx)(h.default,{pointerEvents:"none",style:{position:'absolute',left:-6,top:-6,width:K+12,height:K+12,borderRadius:(K+12)/2,borderWidth:3+Math.round(7*re),borderColor:k.colours.ok}}):null,(0,P.jsx)(h.default,{testID:"voice-button",accessible:!0,accessibilityRole:"button",accessibilityLabel:'owner'===g&&'owner'===e?'Voice assistant and Assistant. Hold to talk, let go to send. Tap to type or open the Assistant.':'Voice assistant. Hold to talk, let go to send. Tap to type instead.',...Pe.panHandlers,style:[{width:K,height:K,borderRadius:K/2,alignItems:'center',justifyContent:'center',backgroundColor:We?k.colours.ok:k.colours.gold,borderWidth:2,borderColor:k.colours.bg},{userSelect:'none',WebkitUserSelect:'none',WebkitTouchCallout:'none',touchAction:'none',cursor:'pointer'}],children:['kirkton','abbotsford'].includes(t.VENUE_RID)?(0,P.jsx)(v.T,{size:16,weight:"semibold",colour:k.colours.onGold,children:'working'===ee?'Wait':'Talk'}):'working'===ee?(0,P.jsx)(r.default,{color:k.colours.onGold,size:"large"}):(0,P.jsx)(N,{colour:k.colours.onGold,size:Math.round(.5*K)})})]}),(0,P.jsx)(v.Sheet,{visible:he,onClose:()=>{(0,M.setMicExplainedFor)(g),pe(!1)},title:"Talk to CoverCharge",testID:"voice-explain",children:(0,P.jsxs)(h.default,{style:{gap:10},children:[(0,P.jsxs)(v.T,{children:["Hold the gold button, say what you need, then let go. For example ",G[e].slice(0,3).join(', '),"."]}),(0,P.jsx)(v.T,{children:(0,H.desktopStt)()?'Your Mac will now ask once to let CoverCharge use the microphone. It only listens while you hold the button.':'Your device will now ask once to use the microphone. It only listens while you hold the button, for up to 30 seconds.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:(0,H.desktopStt)()?'On this Mac, speech is turned into text on the Mac itself, so what you say isn\u2019t sent anywhere. CoverCharge doesn\u2019t keep the audio.':'What you say while holding is sent to Grok (xAI) to be turned into text. CoverCharge doesn\u2019t keep the audio.'}),(0,P.jsx)(v.T,{size:14,colour:k.colours.muted,children:"The helper replies in text only, never aloud. Any change is shown in text first, with Confirm and Cancel buttons; you can also say \u201cyes\u201d. Orders to suppliers, messages and payments are only ever saved as drafts for the owner."}),(0,P.jsx)(v.Button,{testID:"voice-allow",kind:"success",label:"Allow microphone",onPress:async()=>{(0,M.setMicExplainedFor)(g),pe(!1);const e=!!(0,H.desktopStt)()||await(0,H.askMic)();if((0,H.desktopStt)()){(await(0,H.levelMeter)(()=>{}))()}ve(e?{text:'Ready. Now hold the button and speak.',tone:'ok'}:{text:F,tone:'warn'})}}),(0,P.jsx)(v.Button,{kind:"secondary",label:"Type instead",onPress:()=>{(0,M.setMicExplainedFor)(g),pe(!1),de(!0),te('answer')}})]})})]})}},1422,[5,796,34,385,283,364,380,236,402,295,426,102,1423,1116,2,900,1100,15,865,794,840,1424,930,1438,1434,1435,1439,1117,1440,929,1441,1437,25,277]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ASSISTANT_AVAILABLE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"useAssistantUi",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"AssistantFab",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"AssistantSheet",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"AssistantPage",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"AssistantSettings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"AssistantPlanCard",{enumerable:!0,get:function(){return c}});const t=!1,n={getState:()=>({open:!1,setOpen:t=>{}})},u=()=>null,s=()=>null,l=()=>null,o=()=>null,c=()=>null},1423,[]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1424,[1425,1098,829,1428,1429,865,848,1014,1433,1434,1435,1431,1430,1436,1437,1012,1013]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1425,[1426,1427,1038]); +__d(function(g,r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_LABEL",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HISTORY_NOTE",{enumerable:!0,get:function(){return o}}),e.validPastDate=n,Object.defineProperty(e,"ukHistoryDate",{enumerable:!0,get:function(){return s}}),e.parseHistoryInput=function(t){const o=t.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(o))return o;const n=/^(\d{1,2})[\s/.-]+(\d{1,2})[\s/.-]+(\d{4})$/.exec(o);if(!n)return;const s=`${n[3]}-${n[2].padStart(2,'0')}-${n[1].padStart(2,'0')}`,d=new Date(s+'T12:00:00Z');return Number.isNaN(d.getTime())||d.toISOString().slice(0,10)!==s?void 0:s},e.exactHistoryDate=function(t,o){if(1!==(t.match(/\b(?:\d{4}-\d{2}-\d{2}|\d{1,2}\/\d{1,2}\/\d{4}|\d{1,2}(?:st|nd|rd|th)?\s+[a-z]+\s+\d{4})\b/gi)??[]).length)return;const s=t.match(/\b(\d{4}-\d{2}-\d{2})\b/);let d=s?.[1];if(!d){const o=t.match(/\b(\d{1,2})\/(\d{1,2})\/(\d{4})\b/);o&&(d=`${o[3]}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`)}if(!d){const o=t.toLowerCase().match(/\b(\d{1,2})(?:st|nd|rd|th)?\s+(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)\s+(\d{4})\b/),n=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'];o&&(d=`${o[3]}-${String(n.indexOf(o[2].slice(0,3))+1).padStart(2,'0')}-${o[1].padStart(2,'0')}`)}return d&&n(d,o)?d:void 0},Object.defineProperty(e,"historyDateLabel",{enumerable:!0,get:function(){return d}}),e.bookingDayText=function(t){const n=`Booked covers on ${d(t.date)}: ${null===t.booked_covers?'not recorded':t.booked_covers}.`,s=t.bookings.map(t=>`${t.time??'Time not recorded'}: party size ${null===t.covers?'not recorded':`${t.covers} Covers`}; ${t.table?`table ${t.table}`:'table not recorded'}; ${t.status??'status not recorded'}${t.counted?'':', excluded from Booked covers'}.`);return[n,...s,t.historical_records?"Includes previous booking system history (incomplete).":'',o,t.bookings.length?'':'No booking records found; incomplete history does not prove there were no bookings.',t.missing_covers?`${t.missing_covers} booking records have no party size; left blank.`:''].filter(Boolean).join(' ')};const t='Includes previous booking system history (incomplete)',o='Recovered booking records, not confirmed attendance. Cancelled bookings are shown but excluded from Booked covers.';function n(t,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;const n=new Date(t+'T12:00:00Z');return!Number.isNaN(n.getTime())&&n.toISOString().slice(0,10)===t&&t{const[o,n,s]=t.split('-');return`${s} ${n} ${o}`};const d=t=>new Date(t+'T12:00:00Z').toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'Europe/London'})},1426,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.historyAccess=c,_e.lookupBookingDay=l,_e.useHistoricalBookingDay=function(t,o,u,y=0){const k=(0,s.useSync)(e=>[e.kind,e.venueId,e.venueSlug,e.perms.join(',')].join(':')),f=c(t),h=f&&(0,n.validPastDate)(o,u)?`${k}:${o}:${y}`:'',[w,p]=(0,e.useState)({key:'',data:null,error:''});return(0,e.useEffect)(()=>{if(!h)return void p({key:'',data:null,error:''});let e=!0;return l(t,o).then(t=>{e&&p({key:h,data:t,error:''})}).catch(t=>{e&&p({key:h,data:null,error:t.message})}),()=>{e=!1}},[h,t,o]),{allowed:f,data:h&&w.key===h?w.data:null,error:h&&w.key===h?w.error:''}};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]);function c(e){const n=s.useSync.getState();return'owner'===t.APP_VARIANT&&'staff'===n.kind&&n.venueSlug===e&&!!n.venueId&&(n.perms.includes('*')||n.perms.includes('staff.manage'))}async function l(e,t){if(!c(e))throw new Error('Sign in to the Managers app with manager or owner access to Look back.');if(!(0,n.validPastDate)(t,(0,o.venueYmd)(new Date)))throw new Error('Choose an exact past date, with day, month and year.');const l=(0,u.getSupabase)(),{data:y,error:k}=await l.rpc('historical_booking_day',{p_venue:s.useSync.getState().venueId,p_date:t});if(k||!y||!Array.isArray(y.bookings))throw new Error('Booking history could not be loaded. Reconnect and try again.');return y}},1427,[34,846,1426,827,985,931]); +__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"niceDay",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"appNow",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"num",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"tableIn",{enumerable:!0,get:function(){return L}}),e.resolveTable=q,Object.defineProperty(e,"tokensOf",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"hm",{enumerable:!0,get:function(){return x}}),e.findBooking=A,Object.defineProperty(e,"staffOf",{enumerable:!0,get:function(){return me}}),Object.defineProperty(e,"findCard",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(e,"allergenList",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(e,"OPS_VOICE_ACTIONS",{enumerable:!0,get:function(){return ye}});var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),o=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),d=_r(_d[7]),l=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),b=_r(_d[11]),p=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]);const f=t=>{const[n,r,a]=t.split('-').map(Number);return new Date(n,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},y=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},k=(t,n)=>n.test(t),w=t=>t.who??('display'===t.app?'Main Display':'Assistant'),v={a:1,an:1,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,fifteen:15,twenty:20,half:.5},S=t=>null==t||''===t?void 0:'number'==typeof t?t:v[String(t).toLowerCase()]??(Number.isFinite(Number(t))?Number(t):void 0),$=['owner','staff','display'],C=['owner','staff','chef','display'],I=['staff'],N=/\btables?\s+([a-z]?\d{1,3}[a-z]?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/i,L=t=>{const n=t.match(N);return n?String(S(n[1])??n[1]).toUpperCase():void 0};function q(t,n){const r=String(n??'').replace(/^tables?\s+/i,'').trim();if(!r)return;const a=String(S(r)??r).toLowerCase(),o=(0,s.planOf)(t),i=[...new Set([...(o?.tables??[]).map(t=>t.name),...Object.keys(s.useFloor.getState().live[t]??{})])];return i.find(t=>t.toLowerCase()===a)??(o?.tables??[]).find(t=>(t.label??'').toLowerCase()===a)?.name??i.find(t=>t.toLowerCase().replace(/[^0-9a-z]/g,'').replace(/^t(?=\d)/,'')===a.replace(/[^0-9a-z]/g,''))}const O=(t,n)=>s.useFloor.getState().live[t]?.[n]??{},_=new Set(['the','and','for','table','booking','party','seat','seated','cancel','move','mark','finished','show','arrived','here','has','have','they','them','who','with','from','tonight','today','please','change','confirm','decline','request','people','covers','guests','their','into','onto','done','left','gone']),D=t=>t.toLowerCase().replace(/[^a-z0-9: ]/g,' ').split(/\s+/).filter(t=>t.length>2&&!_.has(t)),x=t=>{const n=t.match(/\b(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/i);if(!n)return null;let r=Number(n[1]);return'pm'===n[3]?.toLowerCase()&&r<12&&(r+=12),!n[3]&&r>=1&&r<=11&&(r+=12),`${String(r).padStart(2,'0')}:${n[2]??'00'}`};function A(t,n,r,a,o){const d=String(r??'').toLowerCase(),l=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status)&&!/walk-?in/i.test(r.name??'')),c=i.useStore.getState().bookings.filter(r=>r.restaurantId===t&&r.date===n&&a.includes(r.status));if(!d&&!o)return;const u=c.find(t=>t.ref&&d.includes(t.ref.toLowerCase()));if(u)return u;const b=D(d),p=l.filter(t=>D(t.name).some(t=>b.includes(t)));if(1===p.length)return p[0];if(o){const t=c.filter(t=>(0,s.tablesOf)(t.table).some(t=>t.toLowerCase()===o.toLowerCase())),n=p.length?t.filter(t=>p.includes(t)):t;if(n.length)return n.sort((t,n)=>('seated'===t.status?-1:1)-('seated'===n.status?-1:1))[0]}const h=/\d/.test(d.replace(N,''))?x(d.replace(N,'')):null;if(h){const t=(p.length?p:l).filter(t=>t.time===h);if(1===t.length)return t[0]}return p.length?p.sort((t,n)=>t.time.localeCompare(n.time))[0]:void 0}const j=t=>`${t.name}, ${t.partySize} at ${t.time}${t.table?`, table ${t.table}`:''}`,M=[{name:'booking',type:'string',required:!0,description:'Guest name, booking reference or time, as said'},{name:'table',type:'string',description:'Table, if said'}],T=t=>({booking:t,table:L(t)}),P='I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.';function z(t,n,r,a,i,s,d,l=""){return{id:t,apps:$,title:n,risk:'change',params:M,keywords:[],description:`${n}: today\u2019s booking by guest name, reference, table or time.${l}`,match:t=>k(t,i)?7:0,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return r?`${s}: ${j(r)}?${l}`:P},run:async(t,n)=>{const i=A(n.rid,n.today,t.booking,a,q(n.rid,t.table)??(t.table?String(t.table):void 0));return i?(await o.repo.bookings.setStatus(i.id,r),d&&await d(i,n,t),`Done: ${i.name} ${'noshow'===r?'marked as a no-show':'cancelled'===r?'cancelled':'finished'===r?'finished':r}.`):"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d."}}}const F=(t,n)=>(0,s.tablesOf)(n).forEach(n=>s.useFloor.getState().setLive(t,n,{stage:'seated',dirty:!1})),B={id:'seat_booking',apps:$,title:'Seat a booking',risk:'change',params:M,keywords:[],description:'Seat a guest with a booking today (at their booked table, or the table said). Walk-ins use add_walkin.',match:t=>!k(t,/\b(seat|sit)\b/)||k(t,/\b(walk.?in|walkin|no booking)\b/)||k(t,/\b(\d+|one|two|three|four|five|six|seven|eight|nine|ten) (people|covers|guests)\b/)?k(t,/\b(have|has|are|is) (arrived|here)\b/)?7:0:7,parse:T,preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']),o=q(n.rid,t.table)??r?.table;if(!r)return P;const i=o?O(n.rid,(0,s.tablesOf)(o)[0]):{};return`Seat ${r.name}, ${r.partySize} at ${r.time}${o?`, at table ${o}`:' (no table yet)'}?${i.blocked?` ${(0,a.tableNumbers)(o)} is marked blocked.`:i.dirty?` ${(0,a.tableNumbers)(o)} still needs clearing.`:i.stage?` ${(0,a.tableNumbers)(o)} already has people seated.`:''}`},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const a=q(n.rid,t.table);return t.table&&!a?`Nothing changed: there\u2019s no table ${t.table} on the plan.`:(a&&a!==r.table&&await o.repo.bookings.update(r.id,{table:a}),await o.repo.bookings.setStatus(r.id,'seated'),F(n.rid,a??r.table),`Done: ${r.name} seated${a??r.table?` at table ${a??r.table}`:''}.`)}},E=z('finish_booking','Finish a table (party left)','finished',['seated'],/\b(finished|have left|has left|left|gone|paid and gone|party left|they'?re done)\b/,'Mark finished',(t,n)=>{(0,s.tablesOf)(t.table).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0}))},' The table is then marked as needing clearing.'),R=z('no_show','Mark a no-show','noshow',['confirmed','pending'],/\b(no.?show|didn'?t (turn up|show|come)|not (turned|turning) up)\b/,'Mark as a no-show'),H=z('cancel_booking','Cancel a booking','cancelled',['confirmed','pending'],/^(?!.*\b(shifts?|orders?|rota)\b).*(\bcancel+(ed)?\b.*\b(booking|reservation|table for|party)\b|\bcancel\s+(?!that\b|it\b|this\b|now\b|please\b)[a-z]{3,})/,'Cancel the booking',void 0,' The guest is not messaged from here.'),W={id:'move_booking',apps:$,title:'Move a booking to another table',risk:'change',params:[M[0],{name:'table',type:'string',required:!0,description:'New table'}],keywords:[],description:'Give a booking today a different table (seated parties move too).',match:t=>k(t,/\b(move|put|switch|change)\b/)&&k(t,/\btables?\b/)&&!k(t,/\b(shift|rota)\b/)?7:0,parse:t=>{const n=[...t.matchAll(new RegExp(N.source,'gi'))],r=n[n.length-1];return{booking:t,table:r?String(S(r[1])??r[1]).toUpperCase():void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),o=q(n.rid,t.table);return r?o?`Move ${j(r)} to table ${o}?${O(n.rid,o).stage||O(n.rid,o).blocked?` ${(0,a.tableNumbers)(o)} is not free.`:''}`:`There\u2019s no table ${t.table??''} on the plan.`:P},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending','seated']),a=q(n.rid,t.table);if(!r)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";if(!a)return'Nothing changed: I couldn\u2019t find that table on the plan.';const i=r.table;return await o.repo.bookings.update(r.id,{table:a,tableSetHere:!0}),'seated'===r.status&&((0,s.tablesOf)(i).forEach(t=>s.useFloor.getState().setLive(n.rid,t,{stage:void 0,dirty:!0})),F(n.rid,a)),`Done: ${r.name} moved to table ${a}.`}},G={id:'change_booking',apps:['owner','staff'],title:'Change a booking\u2019s time or party size',risk:'change',params:[M[0],{name:'time',type:'time',description:'New time HH:mm'},{name:'covers',type:'integer',description:'New party size'}],keywords:[],description:'Change the time or the number of people on a booking today. The guest is not messaged from here.',match:t=>k(t,/\b(change|make it|now|instead|update|actually)\b/)&&k(t,/\b(booking|reservation|party)\b/)&&k(t,/\b(\d|one|two|three|four|five|six|seven|eight|nine|ten)\b/)?6:0,parse:t=>{const n=t.toLowerCase(),r=n.match(/\b(?:to|for|now|of)\s+(\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\s*(?:people|covers|guests|pax)?\b(?!\s*[:.]\d)(?!\s*(?:am|pm|o'?clock))/),a=n.match(/\b(?:to|at)\s+(\d{1,2}(?::\d{2})?\s*(?:am|pm)|\d{1,2}:\d{2}|\d{1,2}\s*o'?clock)/);return{booking:t,covers:r&&/people|covers|guests|pax|party|for/.test(n)&&!a?.[1]?.startsWith(r[1])?S(r[1]):void 0,time:a?x(a[1].replace(/o'?clock/,''))??void 0:void 0}},preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['confirmed','pending']);return r?t.time||t.covers?`Change ${j(r)} to ${[t.covers?`${t.covers} people`:'',t.time?`${t.time}`:''].filter(Boolean).join(' at ')}? The guest is not messaged from here.`:`What should change on ${r.name}\u2019s booking? Say the new time or number of people.`:P},run:async(t,r)=>{const a=A(r.rid,r.today,t.booking,['confirmed','pending']);if(!a)return"Nothing changed. I couldn\u2019t find that booking today. Say the guest\u2019s name, for example \u201cSmith at 7\u201d.";const i=S(t.covers);if(!(null==t.covers||i&&(0,n.validParty)(i)))return`Nothing changed: ${n.PARTY_RULE}`;const s=t.time?x(String(t.time)):null;return i||s?(await o.repo.bookings.update(a.id,{...i?{partySize:i}:{},...s?{time:s}:{}}),`Done: ${a.name} is now ${i??a.partySize} at ${s??a.time}.`):'Nothing changed.'}},U={id:'decide_booking',apps:['owner'],title:'Accept or decline a booking request',risk:'change',params:[M[0],{name:'outcome',type:'string',required:!0,description:'confirmed or declined',enum:['confirmed','declined']}],keywords:[],description:'Accept or decline a booking request that is waiting (the same as the Accept / Decline buttons).',match:t=>k(t,/\b(accept|approve|confirm|decline|reject|turn down)\b/)&&k(t,/\b(booking|request|reservation)\b/)?7:0,parse:t=>({booking:t,outcome:/\b(decline|reject|turn down)\b/i.test(t)?'declined':'confirmed'}),preview:(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?`${'declined'===t.outcome?'Decline':'Accept'} the request from ${r.name}, ${r.partySize} on ${f(r.date)} at ${r.time}?`:'I couldn\u2019t find a waiting request with that name.'},run:async(t,n)=>{const r=A(n.rid,n.today,t.booking,['pending'])??i.useStore.getState().bookings.find(r=>r.restaurantId===n.rid&&'pending'===r.status&&D(r.name).some(n=>D(String(t.booking)).includes(n)));return r?(await o.repo.bookings.decide(r.id,'declined'===t.outcome?'declined':'confirmed',w(n)),`Done: ${r.name}\u2019s request ${'declined'===t.outcome?'declined':'accepted'}.`):'Nothing changed: I couldn\u2019t find a waiting request with that name.'}},V=[{name:'table',type:'string',required:!0,description:'Table name or number'}],Y={id:'table_cleared',apps:$,title:'Mark a table cleared',risk:'change',params:V,keywords:[],description:'Mark a table cleared and free (after clearing it down).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(cleared|clear(ed)? down|is clean|wiped|reset|is free|is ready|ready again)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} cleared and free?${O(n.rid,r).stage?' People are still marked as seated there.':''}`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!1,stage:void 0}),`Done: table ${r} is free.`):'Nothing changed: I couldn\u2019t find that table.'}},J={id:'table_needs_clearing',apps:$,title:'Mark a table as needing clearing',risk:'change',params:V,keywords:[],description:'Mark a table as needing clearing (dirty).',match:t=>k(t,/\btables?\b/)&&k(t,/\b(needs? (clearing|clearing down|a clean|wiping)|dirty|to be cleared)\b/)?8:0,parse:t=>({table:L(t)}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Mark table ${r} as needing clearing?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{dirty:!0,stage:void 0}),`Done: table ${r} needs clearing.`):'Nothing changed: I couldn\u2019t find that table.'}},K={id:'block_table',apps:$,title:'Block or unblock a table',risk:'change',params:[...V,{name:'blocked',type:'string',required:!0,description:'yes to block, no to unblock',enum:['yes','no']}],keywords:[],description:'Block a table (not used tonight) or unblock it.',match:t=>k(t,/\b(un.?block|block|out of use|not in use|close)\b/)&&k(t,/\btables?\b/)&&!k(t,/\barea\b/)?8:0,parse:t=>({table:L(t),blocked:/\b(un.?block|back in use|open)\b/i.test(t)?'no':'yes'}),preview:(t,n)=>{const r=q(n.rid,t.table);return r?`${'no'===t.blocked?'Unblock':'Block'} table ${r}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table);return r?(s.useFloor.getState().setLive(n.rid,r,{blocked:'no'!==t.blocked}),`Done: table ${r} ${'no'===t.blocked?'unblocked':'blocked'}.`):'Nothing changed: I couldn\u2019t find that table.'}},Q={mains:'mains',main:'mains',dessert:'dessert',desserts:'dessert',pudding:'dessert',bill:'bill',check:'bill',seated:'seated',starters:'seated'},X={id:'table_stage',apps:$,title:'Set a table\u2019s course',risk:'change',params:[...V,{name:'stage',type:'string',required:!0,description:'seated, mains, dessert or bill',enum:['seated','mains','dessert','bill']}],keywords:[],description:'Set where a seated table is: seated (starters), mains, dessert or bill.',match:t=>k(t,/\btables?\b/)&&k(t,/\b(on|at|having|wants?|asked for|ready for|onto)\b.*\b(mains?|desserts?|pudding|bill|check)\b/)?8:0,parse:t=>{const n=t.toLowerCase().match(/\b(mains?|desserts?|pudding|bill|check|starters)\b/);return{table:L(t),stage:n?Q[n[1]]:void 0}},preview:(t,n)=>{const r=q(n.rid,t.table);return r?`Set table ${r} to ${t.stage}?`:`There\u2019s no table ${t.table??''} on the plan.`},run:(t,n)=>{const r=q(n.rid,t.table),a=Q[String(t.stage??'').toLowerCase()];return r&&a?(s.useFloor.getState().setLive(n.rid,r,{stage:a,dirty:!1}),`Done: table ${r} is on ${a}.`):'Nothing changed: say the table and mains, dessert or bill.'}},Z=t=>/\b(how many|how much|what'?s|what is|what are|any|have we got|do we have|are there|is there)\b|\?\s*$/.test(t),ee=t=>/\b(roast|chickens?|beef)\b/.test(t)&&!/\b(sold out|86|off the menu|menu|dish|special|allerg)/.test(t)&&Object.values(d.useShellStore.getState().items).some(t=>t.some(t=>t.active&&(0,l.isRoastItem)(t))),te=t=>(d.useShellStore.getState().items[t]??[]).filter(t=>t.active),ne=(t,n)=>{const r=String(n??'').toLowerCase();return te(t).find(t=>[t.name,t.plural,t.key].some(t=>t&&new RegExp(`\\b${t.toLowerCase().replace(/[^a-z0-9 ]/g,'')}`).test(r)))},re={id:'shellfish_count',apps:C,title:'Shellfish count: sold, delivery or recount',risk:'change',params:[{name:'item',type:'string',required:!0,description:'Item, e.g. lobster'},{name:'qty',type:'string',required:!0,description:'How many (\xbd allowed for half items)'},{name:'mode',type:'string',required:!0,description:'sold, delivery or count',enum:['sold','delivery','count']}],keywords:[],description:'Record shellfish (or other counted stock) sold, a delivery in, or a recount (sets the count).',match:t=>!k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)&&!ee(t)||k(t,/\b(allerg|contain|chat|message|tell|text|post)/)||Z(t)||!k(t,/\b(\d+|\xbd|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|sold|deliver(ed|y)?|came in|arrived|got in|count(ed)?|recount)\b/)?0:7,parse:(n,r)=>{const a=n.toLowerCase(),o=a.match(/\b(\d+(?:\.5)?|\xbd|a half|half|an?|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|fifteen|twenty)\b/),i=/\b(deliver(ed|y)?|came in|arrived|got in|received)\b/.test(a)?'delivery':/\b(count|we have|we'?ve got|there are|recount|left in)\b/.test(a)?'count':'sold',s=ne(r.rid,a);return s&&(0,t.fishInStone)(r.rid,s)?{item:s.name,qty:(0,t.parseStoneAmount)(n),mode:i}:{item:s?.name??n,qty:o?'\xbd'===o[1]||/half/.test(o[1])?.5:S(o[1]):1,mode:i}},preview:(n,a)=>{const o=ne(a.rid,n.item);if(!o||'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'I couldn\u2019t find that item in the shellfish counts.';if((0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||!Number.isInteger(2*r))return'Use stone in half-stone steps, for example one and a half stone.';const i=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,s=(0,t.fromStone)(r,o.unit),l='count'===n.mode?s:'delivery'===n.mode?i+s:i-s;return`${o.name}: ${n.mode} ${(0,t.stoneSpeech)(r)}, after ${(0,t.stoneSpeech)((0,t.toStone)(Math.max(0,l),o.unit))}?`}const i=S(n.qty)??0,s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c='count'===n.mode?i:'delivery'===n.mode?s+i:s-i;return`${'count'===n.mode?`Set ${o.plural||o.name} to ${(0,l.fmtCount)(i)}`:'delivery'===n.mode?`Add a delivery of ${(0,l.fmtCount)(i)} ${o.plural||o.name}`:`Record ${(0,l.fmtCount)(i)} ${1===i?o.name:o.plural||o.name} sold`} (now ${(0,l.fmtCount)(s)}, after ${(0,l.fmtCount)(Math.max(0,c))})?`},run:(n,a)=>{const o=ne(a.rid,n.item);if(o&&'chef'===a.app&&!(0,r.chefCanSee)(a.rid,o))return'Nothing changed: that item is not in Head Chef stock.';if(o&&(0,t.fishInStone)(a.rid,o)){const r=(0,t.parseStoneAmount)(n.qty??'');if(null==r||r<0||r>500||!Number.isInteger(2*r))return'Nothing changed: use stone in half-stone steps.';const i=(0,t.fromStone)(r,o.unit),s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,l='count'===n.mode?i-s:'delivery'===n.mode?i:-i;return s+l<0?`Nothing changed: only ${(0,t.stoneSpeech)((0,t.toStone)(s,o.unit))} left.`:(l&&d.shellfish.append({rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner',delta:l,reason:'count'===n.mode?'count':'delivery'===n.mode?'delivery':'sold'}),`Done: ${o.name}, ${(0,t.stoneSpeech)((0,t.toStone)(s+l,o.unit))} left.`)}const i=S(n.qty);if(!o||null==i||!(i>=0)||i>500)return'Nothing changed: say the item and how many.';if('half'!==o.unit&&i%1)return`Nothing changed: ${o.plural||o.name} are counted whole.`;const s=(0,d.venueCounts)(d.useShellStore.getState(),a.rid)[o.key]??0,c={rid:a.rid,kind:o.key,by:w(a),app:a.app??'owner'};return'count'===n.mode?(i!==s&&d.shellfish.append({...c,delta:i-s,reason:'count'}),`Done: ${o.plural||o.name} counted at ${(0,l.fmtCount)(i)}.`):'delivery'===n.mode?i<=0?'Nothing changed.':(d.shellfish.append({...c,delta:i,reason:'delivery'}),`Done: ${(0,l.fmtCount)(i)} in. ${(0,l.fmtCount)(s+i)} now.`):s(k(t,/\b(lobsters?|crabs?|langoustines?|oysters?|scallops?|mussels?|shellfish|haddock|salmon|cod|hake|fish)\b/)||ee(t))&&Z(t)&&!k(t,/\b(allerg|contain)/)?8:0,parse:(t,n)=>({item:ne(n.rid,t)?.name}),preview:()=>'Shellfish left',run:(n,a)=>{const o=(0,d.venueCounts)(d.useShellStore.getState(),a.rid),i=ne(a.rid,n.item),s=(i?[i]:te(a.rid).filter(t=>!(0,l.isRoastItem)(t)||(0,l.isSundayIn)(new Date))).filter(t=>'chef'!==a.app||(0,r.chefCanSee)(a.rid,t));return s.length?s.map(n=>`${n.plural||n.name}: ${(0,t.fishInStone)(a.rid,n)?(0,t.stoneSpeech)((0,t.toStone)(o[n.key]??0,n.unit)):(0,l.fmtCount)(o[n.key]??0)} left`).join('. ')+'.':'No shellfish counts are set up here.'}},oe={accept:'acknowledged',preparing:'preparing',ready:'ready',collected:'collected'},ie=(t,n)=>{const r=String(n??'').toLowerCase(),a=i.useStore.getState().orders.filter(n=>n.restaurantId===t&&!['closed','cancelled','collected','served'].includes(n.status));return a.find(t=>t.ref&&r.includes(t.ref.toLowerCase()))??a.find(t=>{const n=r.match(/\b(?:number|no\.?|order)\s*(\d{1,4})\b/);return!!n&&t.ref.replace(/\D/g,'').endsWith(n[1])})??(()=>{const t=a.filter(t=>D(t.customerName??'').some(t=>D(r).includes(t)));return 1===t.length?t[0]:void 0})()},se={id:'order_status',apps:C,title:'Move an order on: accept, preparing, ready or collected',risk:'change',params:[{name:'order',type:'string',required:!0,description:'Order reference, number or customer name'},{name:'status',type:'string',required:!0,description:'accept, preparing, ready or collected',enum:['accept','preparing','ready','collected']}],keywords:[],description:'Accept a takeaway or table order, or mark it preparing, ready or collected (the same as the order buttons).',match:t=>k(t,/\b(orders?|takeaways?|collection|ticket)\b/)&&k(t,/\b(accept|ready|collected|picked up|preparing|start(ed)?|on it)\b/)&&!k(t,/\b(read|any|list|what)\b/)?7:0,parse:t=>{const n=t.toLowerCase();return{order:t,status:/\baccept/.test(n)?'accept':/\b(collected|picked up)\b/.test(n)?'collected':/\bready\b/.test(n)?'ready':'preparing'}},preview:(t,n)=>{const r=ie(n.rid,t.order);return r?`Mark order ${r.ref} for ${r.customerName} as ${'accept'===t.status?'accepted':t.status}?`:'I couldn\u2019t find that order. Say the order number or the name.'},run:async(t,n)=>{const r=ie(n.rid,t.order),a=oe[String(t.status)];if(!r||!a)return'Nothing changed: I couldn\u2019t find that order.';if('acknowledged'===a){return await o.repo.orders.accept(r.id,w(n))?`Done: order ${r.ref} accepted.`:`Order ${r.ref} was already accepted.`}return await o.repo.orders.setStatus(r.id,a,w(n)),`Done: order ${r.ref} is ${a}.`}},de={id:'order_list_add',apps:C,title:'Add to an order list',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What we need'},{name:'qty',type:'integer',description:'How many (default 1)'},{name:'list',type:'string',description:'Which list (supplier), if said'}],keywords:[],description:'Add an item to an order list (or add to the quantity if it is already on it). Nothing is ordered from the supplier.',match:t=>k(t,/\b(add|put)\b.*\b(to|on)\b.*\b(order|shopping|cash and carry|list)\b|\bwe need (more )?\w+/)&&!k(t,/\b(chat|message|tell|text|post|shift|rota)\b/)?6:0,parse:t=>{const n=t.toLowerCase().replace(/[.?!]+$/,'').match(/\b(?:add|put|need(?: more)?)\s+(?:(\d+|an?|one|two|three|four|five|six|seven|eight|nine|ten|twelve|twenty)\s+)?(.+?)(?:\s+(?:to|on)\s+(?:the\s+)?(.+?)(?:\s+(?:order|list|order list))*)?$/);return n?{qty:S(n[1])??1,item:n[2].replace(/^(?:some|more)\s+/,'').trim(),list:n[3]?.replace(/\b(order|list|shopping)\b/g,'').trim()||void 0}:{item:t}},preview:(t,n)=>{const r=c.useOrderLists.getState().lists.filter(t=>t.rid===n.rid),a=String(t.list??'').toLowerCase(),o=a&&r.find(t=>t.name.toLowerCase().includes(a))||r[0];return o?`Add ${t.qty??1} ${t.item} to ${o.name}? Nothing is ordered from the supplier.`:'There are no order lists yet. Set one up in Order lists.'},run:(t,n)=>{const r=c.useOrderLists.getState(),a=r.lists.filter(t=>t.rid===n.rid),o=String(t.list??'').toLowerCase(),i=o&&a.find(t=>t.name.toLowerCase().includes(o))||a[0],s=String(t.item??'').trim().slice(0,60),d=Math.max(1,Math.min(99,Math.round(S(t.qty)??1)));if(!i||s.length<2)return'Nothing changed: say what we need.';const l={id:n.whoId??'assistant',name:w(n)},u=r.items.find(t=>t.rid===n.rid&&t.listId===i.id&&'open'===t.status&&t.name.toLowerCase()===s.toLowerCase());return u?(r.bump(u.id,d,l),`Done: added ${d} more ${s} on ${i.name}.`):(r.addItem(n.rid,{listId:i.id,name:s,qty:d,unit:'',addedBy:l.id,addedByName:l.name}),`Done: ${d} ${s} added to ${i.name}.`)}},le={in:'Clock you in',out:'Clock you out',break_start:'Start your break',break_end:'End your break'};function ce(t,n,r){return{id:t,apps:I,title:le[n].replace('you','me').replace('your','my'),risk:'change',params:[],keywords:[],description:`${le[n]} now (only for the person signed in; the same location check as the Clock tab).`,match:t=>k(t,r)?8:0,preview:()=>`${le[n]} now?`,run:async(t,r)=>{if(!r.whoId)return'Sign in to the Staff app first.';const a=y().toISOString(),o=await(0,b.clockAction)(n,{rid:r.rid,staffId:r.whoId,date:r.today,at:a});return o.ok?'Done: '+{in:'clocked in',out:'clocked out',break_start:'break started',break_end:'break ended'}[n]+` at ${new Date(a).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}.`+(o.warn?' '+o.warn:''):'Nothing changed: '+o.message}}}const ue=ce('clock_in','in',/\bclock (me )?in\b|\bclocking in\b|\bstart(ing)? my shift\b/),be=ce('clock_out','out',/\bclock (me )?out\b|\bclocking out\b|\b(finish|end)(ing)? my shift\b/),pe=ce('break_start','break_start',/\b(start|starting|taking|take|going on|begin)( my| a)? break\b|\bon (my )?break now\b/),he=ce('break_end','break_end',/\b(end|ending|finish|finished|back from)( my| a| the)? break\b|\bback from break\b/),me=t=>{const n=u.useOwner.getState().staff,r=String(t??'').toLowerCase();return n.find(n=>n.id===t)?.id??n.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>D(r).includes(t)))?.id},ge=(t,n)=>{if(!(0,p.hasRecipeCards)())return;const r=D(String(n??''));let a;for(const n of(0,p.recipeCards)().list(t)){const t=D(n.dish).filter(t=>r.includes(t)).length;t&&t>(a?.s??0)&&(a={c:n,s:t})}return a?.c},fe=t=>{const n=m.ALLERGENS.filter(n=>t[n.id]).map(n=>('may'===t[n.id]?'may contain ':'')+n.label.toLowerCase());return n.length?n.join(', '):'none of the 14 allergens'},ye=[B,E,R,H,W,G,U,Y,J,K,X,re,ae,se,de,ue,be,pe,he,{id:'decide_leave',apps:['owner'],title:'Approve or decline a holiday request',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff member id or first name'},{name:'outcome',type:'string',required:!0,description:'approved or declined',enum:['approved','declined']}],keywords:[],description:'Approve or decline someone\u2019s waiting holiday (leave) request.',match:t=>k(t,/\b(approve|accept|decline|reject|ok|okay)\b/)&&k(t,/\b(holiday|leave|time off|day off|days off)\b/)?7:0,parse:t=>{const n=t.toLowerCase(),r=u.useOwner.getState().staff.find(t=>t.active&&D(t.name.replace(' (example)','')).some(t=>new RegExp(`\\b${t}\\b`).test(n)));return{staffId:r?.id,outcome:/\b(decline|reject|refuse)\b/.test(n)?'declined':'approved'}},preview:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status),o=n.staff.find(t=>t.id===r)?.name.replace(' (example)','');return a?`${'declined'===t.outcome?'Decline':'Approve'} ${o}\u2019s holiday, ${f(a.from)}${a.to!==a.from?` to ${f(a.to)}`:''}?`:`There\u2019s no waiting holiday request${o?` from ${o}`:''}.`},run:t=>{const n=u.useOwner.getState(),r=me(t.staffId),a=n.leave.find(t=>t.staffId===r&&'pending'===t.status);return a?(n.setLeave(a.id,'declined'===t.outcome?'declined':'approved'),`Done: holiday ${'declined'===t.outcome?'declined':'approved'}.`):'Nothing changed: no waiting request found.'}},{id:'allergen_signoff',apps:['chef'],title:'Sign off a dish\u2019s allergens',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'}],keywords:[],description:'Head chef signs off a recipe card (its allergens). The allergens are read back first.',match:t=>k(t,/\bsign(ed)?.?off\b|\bapprove\b.*\b(card|recipe|allergens?)\b/)?8:0,parse:t=>({dish:t}),preview:(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?`${r.dish} can\u2019t be signed off yet: ${a}`:`Sign off ${r.dish}? Allergens: ${fe(r.allergens)}.`},run:async(t,n)=>{const r=ge(n.rid,t.dish);if(!r)return'Nothing changed: I couldn\u2019t find that recipe card.';const a=(0,h.signOffBlock)(r);return a?'Nothing changed: '+a:(await(0,p.recipeCards)().signOff(r.id,{name:w(n),role:'head-chef'}),`Done: ${r.dish} signed off.`)}}]},1428,[982,1098,804,829,848,800,1014,981,983,1025,865,1071,856,832,830]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.spokenDate=j,Object.defineProperty(_e,"GAP_VOICE_ACTIONS",{enumerable:!0,get:function(){return be}});var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),l=_r(_d[12]),f=_r(_d[13]),u=_r(_d[14]),m=_r(_d[15]),g=_r(_d[16]),y=_r(_d[17]),b=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),S=_r(_d[21]),$=_r(_d[22]);const v=(e,t)=>t.test(e),I=e=>e.who??('display'===e.app?'Main Display':'Assistant'),N=e=>(e??'').replace(' (example)',''),A=e=>String(e).padStart(2,'0'),D=()=>{const e=(0,$.appNow)();return`${A(e.getHours())}:${A(e.getMinutes())}`},C=['owner','staff','display'],T=['owner'],q=['staff','owner'],O=['owner','chef'],_=e=>`\u201c${e}\u201d`,x=(e,t)=>n.useOwner.getState().sys(e,t,(0,$.appNow)().toISOString()),M=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],R=e=>`${A(Math.floor(e))}:${A(Math.round(e%1*60))}`,L=['january','february','march','april','may','june','july','august','september','october','november','december'];function j(e,t){const a=e.toLowerCase(),r=a.match(new RegExp(`\\b(\\d{1,2})(?:st|nd|rd|th)?(?:\\s+of)?\\s+(${L.join('|')})\\b`))??a.match(new RegExp(`\\b(${L.join('|')})\\s+(\\d{1,2})(?:st|nd|rd|th)?\\b`));if(r){const e=Number(/\d/.test(r[1])?r[1]:r[2]),a=L.indexOf(/\d/.test(r[1])?r[2]:r[1]);let n=Number(t.slice(0,4));return`${n}-${A(a+1)}-${A(e)}`e.active)){const r=[N(e.name).split(' ')[0],e.nickname].filter(Boolean).map(e=>e.toLowerCase()),n=Math.min(...r.map(e=>{const a=t.match(new RegExp(`\\b${e.replace(/[^a-z']/g,'')}\\b`));return a?.index??1/0}));n<1/0&&a.push({s:e,at:n})}return a.sort((e,t)=>e.at-t.at).map(e=>e.s)}const F=e=>n.useOwner.getState().staff.find(t=>t.id===e),E=e=>F(e)??W(String(e??''))[0],U=e=>a.useStore.getState().waitlist.filter(t=>t.restaurantId===e&&('waiting'===t.status||'notified'===t.status)).sort((e,t)=>e.number-t.number);function z(e,t){const a=String(t??'').toLowerCase(),r=U(e);if(!r.length)return;const n=a.match(/(?:#|number|no\.?)\s*(\d{1,3})\b/);if(n)return r.find(e=>e.number===Number(n[1]));const i=(0,$.tokensOf)(a).filter(e=>!['waitlist','wait','list','off','remove','told','ready','next'].includes(e)),s=r.filter(e=>(0,$.tokensOf)(e.name).some(e=>i.includes(e)));return s.length?s[0]:/\b(next|first)\b/.test(a)||1===r.length?r[0]:void 0}const Y=e=>`waitlist number ${e.number}, ${e.name}, party of ${e.partySize}`;function B(e,t){const n=a.useStore.getState(),i=n.restaurants.find(t=>t.id===e);if(!i)return;const s=(0,$.appNow)(),o=(0,l.ymdOf)(s),d=r.useFloor.getState(),c=d.plans[e]??(0,r.seedPlan)(e),h=n.bookings.filter(t=>t.restaurantId===e),p=(0,w.closedAreasAt)(w.useBlocks.getState().blocks,e,o,D()),f=(0,b.floorView)(c,h,n.orders.filter(t=>t.restaurantId===e),d.live[e]??{},s,i.settings.turnMins,p);return(0,b.suggestTable)(c,h.filter(e=>e.date===o),f,t,s,(0,b.turnFor)(t,i.settings.turnMins))?.table}const P=/\bwait ?(ing )?list\b|\bwaiting\b/,H=[{name:'who',type:'string',required:!0,description:'Waitlist number or name, as said (or "next")'}],K={id:'waitlist_seat',apps:C,title:'Seat someone from the waitlist',risk:'change',params:[...H,{name:'table',type:'string',required:!1,description:'Table (else the best free table)'}],keywords:[],description:'Seat a waiting party from the waitlist at a table (the suggested table unless one is said), like the Seat button.',match:e=>v(e,P)&&v(e,/\bseat\b|\bsit\b/)?9:0,parse:e=>({who:e,table:(0,$.tableIn)(e)}),preview:(e,t)=>{const a=z(t.rid,e.who);if(!a)return'I couldn\u2019t find that party on the waitlist. Say their number or name.';const r=(0,$.resolveTable)(t.rid,e.table)??B(t.rid,a.partySize);return r?`Seat ${Y(a)}, at table ${r}?`:`There\u2019s no free table for ${a.partySize} right now. Say a table to seat them anyway.`},run:async(e,a)=>{const n=z(a.rid,e.who);if(!n)return'Nothing changed: I couldn\u2019t find that party on the waitlist.';const i=(0,$.resolveTable)(a.rid,e.table)??B(a.rid,n.partySize);return i?(await t.repo.waitlist.setStatus(n.id,'seated'),await t.repo.bookings.seatWalkIn(a.rid,n.partySize,i,`From waitlist #${n.number}`),(0,r.tablesOf)(i).forEach(e=>r.useFloor.getState().setLive(a.rid,e,{stage:'seated',dirty:!1})),`Done: waitlist number ${n.number} seated at table ${i}.`):'Nothing changed: there\u2019s no free table for them. Say a table.'}};function V(e,t){if(!e.whoId)return;const a=n.useOwner.getState().shifts.filter(t=>t.staffId===e.whoId&&!1!==t.published&&t.date>=e.today).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start),r=j(String(t??''),e.today);return r?a.find(e=>e.date===r):a[0]}const G=e=>`${(0,$.niceDay)(e.date)}, ${R(e.start)} to ${R(e.end)}`,Q=/\b(approve|accept|decline|reject|okay|ok)\b/,Z='I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d.';function J(e,t){const a=e.toLowerCase(),r=a.match(/\bfrom\s+(.+?)\s+(?:to|until|till)\s+(.+)$/);if(r){const e=j(r[1],t),a=j(r[2],t)??e;return{from:e,to:a&&e&&a'open'===e.status&&(!r||e.kind===r)),s=W(String(e??'')).map(e=>e.id);return s.length?i.find(e=>s.includes(e.fromId)&&(!e.toId||1===s.length||s.includes(e.toId)))??i.find(e=>s.includes(e.fromId)||e.toId&&s.includes(e.toId)):1===i.length?i[0]:void 0}const ee=(t,a)=>'chef'!==a?.app||(0,e.chefCanSee)(a.rid,t)&&(0,e.chefCanSee)(a.rid,i.useSafety.getState().points.find(e=>e.id===t.pointId)),te=(e,t)=>{const a=i.useSafety.getState().entries.filter(a=>(0,l.ymdOf)(new Date(a.at))===e&&ee(a,t));return{n:a.length,bad:a.filter(e=>!e.ok).length,fixed:a.filter(e=>!e.ok&&e.corrective).length}},ae=/\b(food safety|safety diary|diary|haccp|safe methods|sfbb)\b/;function re(e,t){const a=(0,m.weekStart)(new Date(e+'T12:00:00')),r=new Date(a+'T00:00:00').getTime(),n=r+6048e5,s=i.useSafety.getState().entries.filter(e=>{const a=new Date(e.at).getTime();return a>=r&&a!e.ok).length,actions:s.filter(e=>!e.ok&&e.corrective).length,daysSigned:o.filter(e=>{const t=new Date(e.date+'T00:00:00').getTime();return t>=r&&te.test(t))?.[1]??'Other',location:s?s[1].replace(/^the /,''):'Not said',firstAid:o?o[1]:'',what:e.trim().replace(/^(?:please\s+)?(?:record|log|report|add|write up|put in the accident book)\s+(?:an?\s+)?(?:accident|near miss|injury)?\s*(?:in the accident book)?\s*[:,-]?\s*/i,'').replace(/^\w/,e=>e.toUpperCase())||e.trim()}}function se(e,t){const a=(0,d.ukClock)((0,$.appNow)()),r=new Date(`${a.ymd}T12:00:00Z`).getUTCDay(),n=(0,$.tokensOf)(String(t??'')).filter(e=>!['tick','ticked','task','off','mark','done','did','finished','completed','ive','i\u2019ve','list'].includes(e)),i=e=>(0,$.tokensOf)(e).filter(e=>n.some(t=>t===e||t.length>3&&e.startsWith(t.slice(0,4)))).length,h=e.whoId?(0,o.tasksFor)((0,s.tasksOf)(e.rid,e.whoId),r):[];let p=h.map(e=>({t:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.t;const l='chef'===e.app?['all','kitchen']:'staff'===e.app?['all','foh']:['all','foh','kitchen'],f=p?void 0:c.useReminders.getState().reminders.filter(t=>t.rid===e.rid&&!t.removed&&!t.paused&&t.days.includes(a.dow)&&l.includes(t.audience)).map(e=>({r:e,s:i(e.text)})).filter(e=>e.s).sort((e,t)=>t.s-e.s)[0]?.r;return{ymd:a.ymd,task:p,rem:f}}const oe=e=>a.useStore.getState().menu.filter(t=>t.restaurantId===e);function de(e,t){const a=(0,$.tokensOf)(String(t??''));let r;for(const t of oe(e)){const e=(0,$.tokensOf)(t.name).filter(e=>a.includes(e)).length;e&&e>(r?.s??0)&&(r={m:t,s:e})}return r?.m}const ce=e=>{const t=e.match(/\xa3\s?(\d+(?:\.\d{1,2})?)|\b(\d+(?:\.\d{2}))\b|\b(\d+)\s*(?:pounds|quid)(?:\s*(\d{1,2}))?/i);if(t)return t[1]?Number(t[1]):t[2]?Number(t[2]):Number(t[3])+(t[4]?Number(t[4])/100:0)},he={gram:'g',grams:'g',g:'g',kilo:'kg',kilos:'kg',kg:'kg',ml:'ml',millilitres:'ml',litre:'l',litres:'l',l:'l',tablespoon:'tbsp',tablespoons:'tbsp',tbsp:'tbsp',teaspoon:'tsp',teaspoons:'tsp',tsp:'tsp',pinch:'pinch',slice:'slice',slices:'slices',whole:'whole'};function pe(e){const t=e.match(/\badd\s+(\d+(?:\.\d+)?|a|an|one|two|three|four|five|six|half)\s*(grams?|g|kilos?|kg|ml|millilitres|litres?|l|tablespoons?|tbsp|teaspoons?|tsp|pinch|slices?|whole)?\s+(?:of\s+)?(.+?)\s+(?:to|into|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*$/i);if(t)return{qty:String((0,$.num)(t[1])??t[1]),unit:t[2]?he[t[2].toLowerCase()]??t[2]:'',name:t[3].trim(),dish:t[4]}}const le={in:'Clock {n} in',out:'Clock {n} out',break_start:'Start a break for {n}',break_end:'End {n}\u2019s break'},fe=e=>null==e?'not entered':`\xa3${e.toLocaleString('en-GB',{minimumFractionDigits:2,maximumFractionDigits:2})}`,ue=e=>'owner'===e.app&&'staff'!==e.role,me=['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];function ge(e){if(/\bweekdays?\b/.test(e))return[1,2,3,4,5];if(/\bweekends?\b/.test(e))return[0,6];const t=me.map((t,a)=>new RegExp(`\\b${t}s?\\b`).test(e)?a:-1).filter(e=>e>=0);return t.length?t:[0,1,2,3,4,5,6]}const ye={all:'everyone on shift',foh:'front of house',kitchen:'the kitchen'},be=[K,{id:'waitlist_remove',apps:C,title:'Take someone off the waitlist',risk:'change',params:H,keywords:[],description:'Take a party off the waitlist (they left or no longer need a table), like the Remove button. It stays in the records.',match:e=>v(e,P)&&v(e,/\b(remove|take .*off|cross .*off|strike .*off|gave up|have left|has left|left|gone)\b/)&&!v(e,/\b(seat|told|ready)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Take ${Y(a)}, off the waitlist?`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,a)=>{const r=z(a.rid,e.who);return r?(await t.repo.waitlist.setStatus(r.id,'removed'),`Done: number ${r.number} is off the waitlist.`):'Nothing changed: I couldn\u2019t find that party.'}},{id:'waitlist_told',apps:C,title:'Mark a waiting party as told their table is ready',risk:'change',params:H,keywords:[],description:'Record that a waiting party has been told their table is ready, like the Mark as told button. No text is sent.',match:e=>v(e,P)&&v(e,/\b(told|tell|let .* know|notif|ready|called)\b/)&&!v(e,/\b(seat|remove)\b/)?9:0,parse:e=>({who:e}),preview:(e,t)=>{const a=z(t.rid,e.who);return a?`Mark ${Y(a)}, as told their table is ready? No text is sent from here.`:'I couldn\u2019t find that party on the waitlist.'},run:async(e,n)=>{const i=z(n.rid,e.who);if(!i)return'Nothing changed: I couldn\u2019t find that party.';const s=a.useStore.getState().restaurants.find(e=>e.id===n.rid);return r.useFloor.getState().logSms(n.rid,(0,$.appNow)().toISOString(),`#${i.number} ${i.partySize}: Your table at ${s?.name??'the restaurant'} is ready.`),await t.repo.waitlist.setStatus(i.id,'notified'),`Done: number ${i.number} marked as told. No text was sent.`}},{id:'request_cover',apps:q,title:'Ask for cover for my shift',risk:'change',params:[{name:'day',type:'string',required:!1,description:'Day or date of your shift (else your next shift)'}],keywords:[],description:'Ask the team to cover one of your own shifts, like the Ask for cover button. A \u201cCover needed\u201d note goes in the team chat.',match:e=>v(e,/\bcover\b/)&&v(e,/\b(my|me)\b/)&&v(e,/\b(shift|ask|need|someone|anyone|can)\b/)&&!v(e,Q)?9:0,parse:e=>({day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day);return a?`Ask for cover for your shift on ${G(a)}? A \u201cCover needed\u201d note goes in the team chat.`:Z},run:(e,t)=>{const a=V(t,e.day);return a&&t.whoId?n.useOwner.getState().swaps.some(e=>e.shiftId===a.id&&'open'===e.status)?'There\u2019s already an open request for that shift.':(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,kind:'cover',note:'Can anyone cover?'}),x('all',`Cover needed: ${M[a.day]} ${R(a.start)}\u2013${R(a.end)} (${N(F(t.whoId)?.name??t.who)})`),`Done: cover asked for ${G(a)}. A manager approves it once someone takes it.`):"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_swap',apps:q,title:'Ask to swap my shift with someone',risk:'change',params:[{name:'with',type:'string',required:!0,description:'Who you agreed to swap with (first name)'},{name:'day',type:'string',required:!1,description:'Day or date of your shift'}],keywords:[],description:'Ask a manager to approve swapping one of your shifts with a colleague you agreed it with, like the Swap with button.',match:e=>v(e,/\bswap\b/)&&!v(e,Q)?9:0,parse:(e,t)=>({with:W(e).find(e=>e.id!==t?.whoId)?.id,day:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I know whose shift it is.';const a=V(t,e.day),r=E(e.with);return r&&r.id!==t.whoId?a?`Ask to swap your shift on ${G(a)} with ${N(r.name)}? A manager still approves it.`:Z:'Who are you swapping with? Say their first name.'},run:(e,t)=>{const a=V(t,e.day),r=E(e.with);return a&&t.whoId?r&&r.id!==t.whoId?(n.useOwner.getState().addSwap({shiftId:a.id,fromId:t.whoId,toId:r.id,kind:'swap',note:'Agreed between us'}),`Done: swap with ${N(r.name)} asked for. A manager approves it.`):'Nothing changed: say who you\u2019re swapping with.':"Nothing changed: I couldn\u2019t find a published shift of yours on that day. Say the day, for example \u201cFriday\u201d."}},{id:'request_holiday',apps:q,title:'Ask for holiday',risk:'change',params:[{name:'from',type:'string',required:!0,description:'First day off, YYYY-MM-DD'},{name:'to',type:'string',required:!0,description:'Last day off, YYYY-MM-DD'},{name:'reason',type:'string',required:!1,description:'Reason (default Holiday)'}],keywords:[],description:'Send your own holiday (time off) request to a manager, like the Send request button.',match:e=>v(e,/\b(holiday|time off|day off|days off|annual leave|leave)\b/)&&v(e,/\b(request|book|ask|want|need|like|have|put in|take|off)\b/)&&!v(e,Q)&&!v(e,/\b(who|how many|when is)\b/)?8:0,parse:(e,t)=>{const a=J(e,t?.today??(0,l.ymdOf)((0,$.appNow)())),r=e.match(/\b(?:for|because)\s+(?:a |an |my )?([a-z][a-z ]{2,40}?)\s*$/i);return{...a,reason:r&&!/\b(from|to|monday|tuesday|wednesday|thursday|friday|saturday|sunday|tomorrow|\d)/i.test(r[1])?r[1]:void 0}},preview:(e,t)=>t.whoId?`Ask for ${e.reason??'holiday'} from ${(0,$.niceDay)(String(e.from))}${e.to!==e.from?` to ${(0,$.niceDay)(String(e.to))}`:''}? A manager approves it.`:'Sign in first so I know who\u2019s asking.',run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const a=e=>/^\d{4}-\d{2}-\d{2}$/.test(String(e));return!a(e.from)||!a(e.to)||String(e.to)v(e,Q)&&v(e,/\b(swap|cover|swaps)\b/)?9:0,parse:e=>({who:e,outcome:/\b(decline|reject|refuse|no)\b/i.test(e)?'declined':'approved'}),preview:e=>{const t=X(e.who);if(!t)return'I couldn\u2019t find that open swap or cover request. Say the name on it.';const a=n.useOwner.getState().shifts.find(e=>e.id===t.shiftId),r=N(F(t.fromId)?.name),i=N(F(t.toId)?.name),s='swap'===t.kind?`${r}\u2019s swap with ${i}`:t.toId?`${i} covering ${r}`:`${r}\u2019s cover request`;return'declined'===e.outcome||t.toId?`${'declined'===e.outcome?'Decline':'Approve'} ${s}${a?` for ${G(a)}`:''}?${'declined'===e.outcome?'':' The shift moves and a note goes in the team chat.'}`:`Nobody has taken ${r}\u2019s cover yet, so it can\u2019t be approved. You can decline it.`},run:e=>{const t=X(e.who);if(!t)return'Nothing changed: no open request found.';if('declined'!==e.outcome&&!t.toId)return'Nothing changed: nobody has taken that cover yet.';const a=n.useOwner.getState(),r=a.shifts.find(e=>e.id===t.shiftId);if(a.setSwap(t.id,'declined'===e.outcome?'declined':'approved'),'declined'===e.outcome)return'Done: request declined.';const i=e=>N(F(e)?.name);return x('all','swap'===t.kind?`Shift swap: ${i(t.fromId)} \u2194 ${i(t.toId)} approved`:`Cover approved: ${i(t.toId)} covers ${i(t.fromId)}${r?` (${M[r.day]} ${R(r.start)}\u2013${R(r.end)})`:''}`),'Done: approved and posted in the team chat.'}},{id:'sign_safety_day',apps:O,title:'Sign today\u2019s food safety diary',risk:'change',params:[],keywords:[],description:'Sign today\u2019s food safety diary: the opening and closing checks were done and the safe methods were followed, like the diary Sign button. Today only.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,ae)&&!v(e,/\bweek(ly)?\b/)?9:0,preview:(e,t)=>{const a=(i.useSafety.getState().daySigns??[]).find(e=>e.date===t.today);if(a)return`Today\u2019s diary is already signed by ${a.by}.`;const r=te(t.today,t);return`Sign today\u2019s food safety diary as ${I(t)}: the opening and closing checks were done and the safe methods were followed today? Today: ${r.n} checks, ${r.bad} out of range${r.bad?`, ${r.fixed} with an action`:''}.`},run:(e,t)=>'staff'===t.role?'Nothing changed: only a manager or the head chef signs the diary.':(i.useSafety.getState().daySigns??[]).some(e=>e.date===t.today)?'It\u2019s already signed today.':(i.useSafety.getState().signDay({date:t.today,by:N(I(t)),byId:t.whoId??'',at:(0,$.appNow)().toISOString()}),'Done: today\u2019s diary signed.')},{id:'sign_safety_week',apps:O,title:'Sign off this week\u2019s food safety review',risk:'change',params:[],keywords:[],description:'Weekly food safety review: reads the six statements back; Confirm means yes to all six. If any reading is out of range without an action, it must be done on screen with a note.',match:e=>v(e,/\bsign(ed|ing)?\b/)&&v(e,/\bweek(ly)?\b/)&&(v(e,ae)||v(e,/\b(review|safety|checks)\b/))?9:0,preview:(e,t)=>{const{week:a,summary:r}=re(t.today,t),n=(i.useSafety.getState().weekly??[]).find(e=>e.week===a);if(n)return`This week is already signed off by ${n.by}.`;const s=`Week of ${(0,$.niceDay)(a)}: ${r.entries} checks, ${r.outOfRange} out of range, ${r.actions} with an action, diary signed ${r.daysSigned} of 7 days.`;return r.actions`${t+1}. ${e}.`).join(' ')} Sign off the week?`},run:(e,t)=>{if('staff'===t.role)return'Nothing changed: only a manager or the head chef signs off the week.';const{week:a,summary:r}=re(t.today,t);return(i.useSafety.getState().weekly??[]).some(e=>e.week===a)?'This week is already signed off.':r.actions!0),note:'Signed by voice: yes to all.',summary:r}),'Done: week signed off.')}},{id:'record_accident',title:'Record an accident or near miss',risk:'change',params:[{name:'what',type:'string',required:!0,description:'What happened, in the speaker\u2019s words'},{name:'person',type:'string',required:!1,description:'Who was hurt'},{name:'location',type:'string',required:!1,description:'Where'},{name:'injury',type:'string',required:!1,description:'The injury'},{name:'firstAid',type:'string',required:!1,description:'First aid given'}],keywords:[],description:'Add an entry to the accident book (accident or near miss) with what was said; every field is read back first.',match:e=>v(e,/\baccident book\b/)?10:v(e,/\b(accident|injur(y|ed)|near miss|hurt|cut (him|her|them|my)self|burn(ed|t)? (him|her|them|my)self|slipped|tripped|fell over|scalded)\b/)&&v(e,/\b(record|log|report|write|add|book|had|there was|has|have|just)\b/)&&!v(e,/\b(how many|show|read)\b/)?8:0,parse:e=>{const t=ie(e);return{what:t.what,person:t.person,location:t.location,firstAid:t.firstAid}},preview:e=>{const t=ie(String(e.what)),a=String(e.person??t.person),r=String(e.location??t.location);return`Add to the accident book: when, today at ${D()}; who, ${a} (${t.personType}); where, ${r}; type, ${t.category}; what happened, ${_(t.what)}; injury, ${e.injury?String(e.injury):'Near miss'===t.category?'none (near miss)':'not recorded'}; first aid, ${e.firstAid||t.firstAid||'none recorded'}; reported by you. Check it before you confirm; you can add more in the Accident book.`},run:(e,t)=>{const a=ie(String(e.what)),r='Near miss'===a.category,n=(0,$.appNow)();return i.useSafety.getState().addAccident({when:`${(0,l.ymdOf)(n)}T${D()}`,location:String(e.location??a.location),person:String(e.person??a.person),personType:a.personType,category:a.category,what:a.what,injury:String(e.injury??'')||(r?'None (near miss)':'Not recorded'),firstAid:String(e.firstAid||a.firstAid||'')||'None recorded',witnesses:'None',reportedBy:N(I(t)),reportedById:t.whoId??'',app:'staff'===t.app?'staff':'chef'===t.app?'chef':'managers'}),'Done: added to the accident book.'+(/(hospital|fracture|broke|unconscious|ambulance)/i.test(a.what)?' This may need reporting under RIDDOR; check the Accident book.':'')}},{id:'tick_task',apps:['staff','chef','owner'],title:'Tick off one of my tasks',risk:'change',params:[{name:'task',type:'string',required:!0,description:'The task or reminder, as said'}],keywords:[],description:'Tick off one of today\u2019s daily tasks (yours), or mark a venue reminder like \u201cchairs up\u201d as done, like the tick and Done buttons.',match:e=>v(e,/\btick(ed)?( off)?\b|\bmark .* (as )?done\b|\b(i'?ve|i have|we'?ve) (done|finished|completed)\b|\b(task|reminder) (is )?done\b|\bdone the\b/)&&!v(e,/\b(shift|break|order|table|booking|clock)\b/)?7:0,parse:e=>({task:e}),preview:(e,t)=>{if(!t.whoId)return'Sign in first so I tick your tasks.';const{ymd:a,task:r,rem:n}=se(t,e.task);return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?`${_(r.text)} is already ticked today.`:`Tick off today\u2019s task ${_(r.text)}?`:n?`Mark the reminder ${_(n.text)} as done for today?`:'I couldn\u2019t find that in today\u2019s tasks. Say a word from the task.'},run:(e,t)=>{if(!t.whoId)return'Nothing changed: sign in first.';const{ymd:a,task:r,rem:n}=se(t,e.task),i={id:t.whoId,name:N(I(t))};return r?s.useDailyTasks.getState().ticks.some(e=>e.id===(0,s.tickId)(t.rid,t.whoId,r.id,a))?'Already ticked today.':(s.useDailyTasks.getState().toggleTick(t.rid,t.whoId,r.id,a,i),`Done: ${_(r.text)} ticked.`):n?(c.useReminders.getState().markDone({rid:t.rid,reminderId:n.id,forDate:a,at:(0,$.appNow)().toISOString(),staffRef:t.whoId,staffName:i.name}),`Done: ${_(n.text)} marked done.`):'Nothing changed: I couldn\u2019t find that task.'}},{id:'add_dish',apps:T,title:'Add a dish to the menu',risk:'change',params:[{name:'name',type:'string',required:!0,description:'Dish name'},{name:'section',type:'string',required:!1,description:'Menu section'},{name:'price',type:'string',required:!0,description:'Price in pounds'},{name:'description',type:'string',required:!1,description:'Short description'}],keywords:[],description:'Add a new dish to the menu, like Manage \u203a Add dish. It stays off the menu until the head chef signs off its recipe card.',match:e=>v(e,/\b(add|new|put)\b/)&&v(e,/\b(dish|menu item|to the menu|on the menu|onto the menu)\b/)&&!v(e,/\b(special|specials|sold out|order list)\b/)?8:0,parse:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t?.rid),n=e.toLowerCase(),i=e.match(/\b(?:called|named)\s+(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i)??e.match(/\b(?:add|put)\s+(?:a |an |the )?(?:new )?(?:dish\s+)?(.+?)(?=\s+(?:to|in|on|under|at|for|priced|\xa3)\b|[,.]|$)/i),s=r?.sections.find(e=>n.includes(e.toLowerCase())||n.includes(e.toLowerCase().replace(/s$/,''))),o=ce(e);return{name:i?.[1]?.replace(/^(?:a |an )?(?:new )?dish\s*/i,'').trim(),section:s,price:null!=o?String(o):void 0}},preview:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=String(e.section??r?.sections[0]??'Mains');return`Add ${_(String(e.name))} to ${n} at \xa3${Number(e.price).toFixed(2)}${e.description?`, described as ${_(String(e.description))}`:''}? It stays off the menu until the head chef signs off its recipe card.`},run:(e,t)=>{const r=a.useStore.getState().restaurants.find(e=>e.id===t.rid),n=Number(e.price),i=String(e.name??'').trim();return i.length<2||!Number.isFinite(n)||n<=0?'Nothing changed: I need a dish name and a price.':de(t.rid,i)?.name.toLowerCase()===i.toLowerCase()?'That dish is already on the menu.':(a.useStore.getState().addMenuItem({restaurantId:t.rid,section:String(e.section??r?.sections[0]??'Mains'),name:i,description:String(e.description??''),price:n,dietary:[],allergens:{},prepMins:10,soldOut:!1,signOff:null}),`Done: ${i} added. The head chef needs to add its recipe card and sign off the allergens before it shows.`)}},{id:'edit_dish',apps:T,title:'Rename a dish or change its description',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name now'},{name:'field',type:'string',required:!0,description:'name or description',enum:['name','description']},{name:'value',type:'string',required:!0,description:'The new name or description'}],keywords:[],description:'Rename a dish or change its menu description, like Manage \u203a Save dish. Renaming changes its recipe card, so the head chef signs it off again.',match:e=>v(e,/\brename\b|\b(change|update|set|edit)\b.*\b(description|name)\b|\bdescri(be|ption)\b.*\bas\b/)&&!v(e,/\b(price|booking|special|my name)\b/)?8:0,parse:e=>{const t=e.match(/\brename\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i);if(t)return{dish:t[1],field:'name',value:t[2].trim()};const a=e.match(/\bname of\s+(?:the\s+)?(.+?)\s+to\s+(.+)$/i);if(a)return{dish:a[1],field:'name',value:a[2].trim()};const r=e.match(/\bdescription (?:of|for)\s+(?:the\s+)?(.+?)\s+(?:to|as)\s+(.+)$/i)??e.match(/\b(?:describe|change|update|set)\s+(?:the\s+)?(.+?)(?:'s|\u2019s)?\s+(?:description\s+)?(?:to|as)\s+(.+)$/i);return r?{dish:r[1],field:'description',value:r[2].trim()}:{dish:e}},preview:(e,t)=>{const a=de(t.rid,e.dish);return a?'name'===e.field?`Rename ${_(a.name)} to ${_(String(e.value))}? Its recipe card changes too, so the head chef signs it off again.`:`Change the description of ${a.name} to ${_(String(e.value))}?`:'I couldn\u2019t find that dish on the menu.'},run:(e,t)=>{const r=de(t.rid,e.dish),n=String(e.value??'').trim();return r?n.length<2?'Nothing changed: say the new wording.':(a.useStore.getState().updateMenuItem(r.id,'name'===e.field?{name:n}:{description:n}),'name'===e.field?`Done: renamed to ${n}.`:`Done: description of ${r.name} changed.`):'Nothing changed: I couldn\u2019t find that dish.'}},{id:'add_recipe_ingredient',apps:['chef'],title:'Add an ingredient to a recipe card',risk:'change',params:[{name:'text',type:'string',required:!0,description:'e.g. add 50 grams of butter to the haggis'}],keywords:[],description:'Add an ingredient line to a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\badd\b/)&&v(e,/\b(ingredient|recipe|card)\b|\badd\s+\d+\s*(g|grams?|kg|ml|tbsp|tsp)\b/)&&!v(e,/\b(step|method|order list|special)\b/)?8:0,parse:e=>({text:e}),preview:(e,t)=>{const a=pe(String(e.text));if(!a)return'Say it like \u201cadd 50 grams of butter to the haggis\u201d.';const r=(0,$.findCard)(t.rid,a.dish);return r?`Add ${[a.qty,a.unit].filter(Boolean).join(' ')} ${a.name} to ${r.dish}\u2019s recipe card?${r.signOff?' It\u2019s signed off now, so it will need signing off again.':''} Check its allergens on the card.`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=pe(String(e.text)),r=a&&(0,$.findCard)(t.rid,a.dish);return a&&r?(await(0,y.recipeCards)().update(r.id,{ingredients:[...r.ingredients,{id:(0,k.uuid)(),name:a.name,qty:a.qty,unit:a.unit}]},{name:N(I(t)),role:'head-chef'}),`Done: ${a.name} added to ${r.dish}.${r.signOff?' It needs signing off again.':''}`):'Nothing changed: I couldn\u2019t find that recipe card.'}},{id:'add_recipe_step',apps:['chef'],title:'Add a method step to a recipe card',risk:'change',params:[{name:'dish',type:'string',required:!0,description:'Dish name'},{name:'step',type:'string',required:!0,description:'The step wording'}],keywords:[],description:'Add a method step to the end of a recipe card. Changing a signed-off card means it must be signed off again.',match:e=>v(e,/\b(add|new)\b/)&&v(e,/\b(step|method)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:to|for)\s+(?:the\s+)?(.+?)(?:\s+(?:recipe|card|recipe card))?\s*[:,]\s*(.+)$/i)??e.match(/\bstep\s+(?:to|for)\s+(?:the\s+)?(.+?)\s+(?:saying|that says|reading)\s+(.+)$/i);return t?{dish:t[1],step:t[2].trim()}:{dish:e}},preview:(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0;return a?`Add step ${a.steps.length+1} to ${a.dish}: ${_(String(e.step))}?${a.signOff?' It will need signing off again.':''}`:'I couldn\u2019t find that recipe card.'},run:async(e,t)=>{const a=(0,y.hasRecipeCards)()?(0,$.findCard)(t.rid,e.dish):void 0,r=String(e.step??'').trim();return!a||r.length<3?'Nothing changed: I need the dish and the step.':(await(0,y.recipeCards)().update(a.id,{steps:[...a.steps,r]},{name:N(I(t)),role:'head-chef'}),`Done: step added to ${a.dish}.`)}},{id:'manager_clock',apps:T,title:'Clock someone in or out (manager correction)',risk:'change',params:[{name:'staffId',type:'string',required:!0,description:'Staff first name or id'},{name:'action',type:'string',required:!0,description:'in, out, break_start or break_end',enum:['in','out','break_start','break_end']},{name:'reason',type:'string',required:!0,description:'Why (at least 3 letters)'}],keywords:[],description:'A manager clocks a member of staff in or out, or starts or ends their break, now, with a reason, like the Clock tab\u2019s manager buttons. It is marked as a manager correction.',match:e=>v(e,/\bclock\s+\w+\s+(in|out)\b|\bclock (in|out)\s+[a-z]+\b|\b(start|end)\s+(a |the )?break for\b|\b(end|finish)\s+\w+'?s break\b/)&&!v(e,/\b(me|myself|my|who|is|are|has)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=W(e)[0],r=e.match(/\b(?:reason|because|as)\b[:,]?\s*(.+)$/i),n=/\bbreak\b/.test(t)?/\b(end|finish|back)\b/.test(t)?'break_end':'break_start':/\bout\b/.test(t)?'out':'in';return{staffId:a?.id,action:n,reason:r?.[1]?.trim()}},preview:e=>{const t=E(e.staffId);return t?`${le[e.action??'in'].replace('{n}',N(t.name))} now, at ${D()}? Reason: ${_(String(e.reason))}. It\u2019s marked as a manager correction.`:'Who? Say their first name.'},run:(e,t)=>{const a=E(e.staffId);if(!a)return'Nothing changed: I couldn\u2019t tell who.';const r=e.action??'in',n=(0,g.managerClockAction)(r,{rid:t.rid,staffId:a.id,date:t.today,at:(0,$.appNow)().toISOString()},{id:t.whoId??'manager',name:N(I(t))},String(e.reason??''));return n.ok?`Done: ${N(a.name)} ${{in:'clocked in',out:'clocked out',break_start:'on a break',break_end:'back from break'}[r]} at ${D()}.${n.warn?' '+n.warn:''}`:'Nothing changed: '+n.message}},{id:'tips_pot',apps:T,title:'What\u2019s in the tips pot',risk:'look',params:[],keywords:[],description:'Managers only: the confirmed tips held for the team since the last payout (the Tips pot card).',match:e=>v(e,/\btips? (pot|jar|so far|held|this (period|fortnight|month|week))\b|\bin the tips\b|\bhow much (have we got |is there )?in tips\b|\bwhat are the tips\b|\bhow much (are|is) (the )?tips\b/)&&!v(e,/\b(pay|payout|split|share out)\b/)?8:0,preview:()=>'Tips pot',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const r=h.useCashUp.getState(),n=a.useStore.getState().restaurants.find(e=>e.id===t.rid),i=(0,f.payFor)(t.rid,n?.settings.pay,u.useOnboard.getState().answers).pay,s=(0,p.tipsPot)(r.tips.filter(e=>e.rid===t.rid),r.pot.filter(e=>e.rid===t.rid),(0,l.tipsPeriod)(i,t.today).start,t.today);return`The tips pot holds ${fe(s.total)} from ${(0,$.niceDay)(s.from)} to today, from ${s.days.length} confirmed cash-up${1===s.days.length?'':'s'}.${s.lastPayout?` Last paid out through ${(0,$.niceDay)(s.lastPayout.throughDate)}.`:''}`}},{id:'cash_up_summary',apps:T,title:'Read the latest cash-up',risk:'look',params:[{name:'day',type:'string',required:!1,description:'Day (else the latest)'}],keywords:[],description:'Managers only: the latest (or a named day\u2019s) cash-up: gross takings, tips and who confirmed it.',match:e=>v(e,/\bcash.?up\b|\btakings\b|\bhow much did we take\b/)&&!v(e,/\b(add|enter|start|do the|unlock|edit)\b/)?8:0,parse:(e,t)=>({day:j(e.replace(/\btonight\b/i,'today'),t?.today??(0,l.ymdOf)((0,$.appNow)()))??(/\b(last night|yesterday)\b/i.test(e)?'yesterday':void 0)}),preview:()=>'Cash-up read-out',run:(e,t)=>{if(!ue(t))return'That isn\u2019t shown here. Ask a manager in the Managers app.';const a=new Date(t.today+'T12:00:00');a.setDate(a.getDate()-1);const r='yesterday'===e.day?(0,l.ymdOf)(a):e.day,n=h.useCashUp.getState().cashUps.filter(e=>e.rid===t.rid&&(!r||e.date===r)).sort((e,t)=>t.date.localeCompare(e.date)),i=n[0];return i?`Cash-up for ${(0,$.niceDay)(i.date)}: gross takings ${fe((0,p.grossOf)(i.vals))}, tips ${fe((0,p.combinedTips)(i.vals))} (cash and card). ${i.confirmedAt?`Confirmed${i.confirmedBy?` by ${i.confirmedBy}`:''}.`:'Not confirmed yet.'}`:r?`There\u2019s no cash-up for ${(0,$.niceDay)(r)}.`:'There\u2019s no cash-up yet.'}},{id:'table_note',apps:C,title:'Add a note to a table',risk:'change',params:[{name:'table',type:'string',required:!0,description:'Table'},{name:'note',type:'string',required:!0,description:'The note (say \u201cclear\u201d to remove it)'}],keywords:[],description:'Put a short note on a table on the floor plan (e.g. \u201chigh chair\u201d, \u201cbirthday\u201d), like the table sheet\u2019s Note.',match:e=>v(e,/\btables?\s+\w+/)&&v(e,/\bnote\b/)&&!v(e,/\bshift note\b/)?9:0,parse:e=>{const t=e.match(/\bnote\b(?:\s+(?:on|for|to)\s+tables?\s+\w+)?\s*(?:[:,-]|saying|that says|that|says|reading)?\s*(.+)$/i),a=/\b(clear|remove|delete) (the )?note\b/i.test(e);return{table:(0,$.tableIn)(e),note:a?'clear':t?.[1]?.replace(/^(?:on|for|to)?\s*tables?\s+\w+\s*[:,-]?\s*/i,'').trim()}},preview:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);return a?'clear'===e.note?`Clear the note on table ${a}?`:`Note on table ${a}: ${_(String(e.note))}?`:'Which table?'},run:(e,t)=>{const a=(0,$.resolveTable)(t.rid,e.table);if(!a)return'Nothing changed: I couldn\u2019t find that table.';const n='clear'===e.note?'':String(e.note??'').trim().slice(0,80);return(0,r.tablesOf)(a).forEach(e=>r.useFloor.getState().setLive(t.rid,e,{note:n||void 0})),n?`Done: note on table ${a}.`:`Done: note cleared on table ${a}.`}},{id:'log_lost_property',apps:T,title:'Log lost property',risk:'change',params:[{name:'item',type:'string',required:!0,description:'What was found'},{name:'where',type:'string',required:!1,description:'Where it was found'}],keywords:[],description:'Add an item to the lost property log (held), like Extras \u203a Lost property \u203a Add.',match:e=>v(e,/\blost property\b|\b(found|someone left|left behind|handed in)\b\s+(a|an|some|their|his|her)\b|\b(a|an)\s+\w+(\s+\w+)?\s+(was )?(left behind|handed in)\b/)&&!v(e,/\b(how many|what'?s in|list|read|returned)\b/)?8:0,parse:e=>{const t=e.match(/\b(?:found|left(?: behind)?|handed in|log|add)\s+(?:a |an |some |their |his |her )?(.+?)(?=\s+(?:at|on|in|under|by|near|from)\s|[,.]|$)/i)??e.match(/\b(?:a|an)\s+(.+?)\s+(?:was )?(?:left behind|handed in)/i),a=e.match(/\s(?:at|on|in|under|by|near)\s+(?:the\s+)?(table\s+\w+|bar|toilets?|coat ?rack|cloakroom|door|entrance|terrace|garden|car park|dining room|booth\s+\w+|[a-z]+ table)\b/i);return{item:t?.[1]?.replace(/^(?:lost property|to lost property)\s*:?\s*/i,'').trim(),where:a?.[1]}},preview:e=>`Log lost property: ${_(String(e.item))}, found ${e.where?`at ${e.where}`:'(place not noted)'}, today at ${D()}? It\u2019s marked as held.`,run:(e,t)=>{const a=String(e.item??'').trim();if(a.length<2)return'Nothing changed: say what was found.';const r=(0,$.appNow)();return n.useOwner.getState().addLost({item:a,where:String(e.where??'').trim()||'Not noted',foundAt:`${(0,l.ymdOf)(r)} ${D()}`,foundBy:N(I(t))}),`Done: ${a} logged as held.`}},{id:'add_reminder',apps:T,title:'Add a venue reminder for staff',risk:'change',params:[{name:'text',type:'string',required:!0,description:'What it says'},{name:'time',type:'string',required:!0,description:'HH:MM, UK time'},{name:'days',type:'string',required:!1,description:'Days (default every day)'},{name:'audience',type:'string',required:!1,description:'all, foh or kitchen',enum:['all','foh','kitchen']}],keywords:[],description:'Add a venue reminder shown to staff on shift at a time on chosen days, like Settings \u203a Advanced \u203a Reminders \u203a Add.',match:e=>v(e,/\b(remind|reminder)\b/)&&v(e,/\b(add|set|new|create|every|daily|weekdays?|weekends?|at \d)\b/)&&!v(e,/\b(me|my)\b/)?8:0,parse:e=>{const t=e.toLowerCase(),a=/\b(kitchen|chefs?)\b/.test(t)?'kitchen':/\b(front of house|foh|floor|waiters?|servers?)\b/.test(t)?'foh':'all',r=e.match(/\bremind(?:er)?\s+(?:for\s+)?(?:everyone|all staff|staff|the team|the kitchen|kitchen|front of house|foh|the floor|chefs?)?\s*(?:to|that|:)\s+(.+?)(?=\s+(?:at\s+\d|every\b|on\s+(?:mon|tue|wed|thu|fri|sat|sun)|daily|weekdays?|weekends?)|$)/i)??e.match(/\breminder\s*(?:saying|that says|:)\s*(.+?)(?=\s+(?:at\s+\d|every\b|daily)|$)/i),n=e.match(/\bat\s+(\d{1,2}(?:[:.]\d{2})?\s*(?:am|pm)?)/i);return{text:r?.[1]?.trim(),time:n?(0,$.hm)(n[1])??void 0:void 0,days:ge(t).join(','),audience:a}},preview:e=>{const t=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number),a=String(e.text??''),r=a.charAt(0).toUpperCase()+a.slice(1);return`Add a reminder for ${ye[e.audience??'all']}: ${_(r)}, ${7===t.length?'every day':'every '+t.map(e=>me[e].replace(/^\w/,e=>e.toUpperCase())).join(', ')} at ${e.time} (UK time)?`},run:(e,t)=>{const a=String(e.text??'').trim(),r=String(e.time??'');if(a.length<2||!/^\d{2}:\d{2}$/.test(r))return'Nothing changed: I need the wording and a time like 21:00.';const n=String(e.days??'0,1,2,3,4,5,6').split(',').map(Number).filter(e=>e>=0&&e<=6).sort();return c.useReminders.getState().ensure(t.rid),c.useReminders.getState().add(t.rid,{text:a.charAt(0).toUpperCase()+a.slice(1),days:n,time:r,audience:e.audience??'all'}),'Done: reminder added.'}}]},1429,[804,848,800,1014,865,1019,1029,1030,1002,1001,1024,13,1049,1050,1051,1020,1071,856,1079,1011,839,1430,1428]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.dishesFor=R,_e.findDish=E,_e.allergensSaid=M,_e.timeFrom=Y,_e.coversFrom=G,_e.dateFrom=Z,_e.nameFrom=$,Object.defineProperty(_e,"VOICE_ACTIONS",{enumerable:!0,get:function(){return X}});var e=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),s=_r(_d[7]),d=_r(_d[8]),l=_r(_d[9]),c=_r(_d[10]),p=_r(_d[11]),u=_r(_d[12]),h=_r(_d[13]),m=_r(_d[14]),f=_r(_d[15]),g=_r(_d[16]),b=_r(_d[17]),y=_r(_d[18]);const w=()=>{try{return(0,i.nowFrom)(i.useStore.getState().clock)}catch{return new Date}},v=e=>String(e).padStart(2,'0'),k=e=>e.getFullYear()+'-'+v(e.getMonth()+1)+'-'+v(e.getDate()),S=e=>{const[t,r,a]=e.split('-').map(Number);return new Date(t,r-1,a).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},N=(e,t)=>t.test(e),I=(e,t)=>e+' '+t+(1===e?'':'s'),A={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},T=e=>null==e?void 0:A[e.toLowerCase()]??(Number.isFinite(Number(e))?Number(e):void 0),x=e=>e.who??('display'===e.app?'Main Display':'Assistant'),D={owner:'Managers',staff:'Staff',chef:'Head Chef',display:'Main Display'},C=e=>D[e.app??'owner'],O=new Set(['the','and','with','our','for']),L=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').split(/\s+/).filter(e=>e.length>2&&!O.has(e));function R(e){const t=i.useStore.getState(),r=(0,c.resolveMenu)(t.menu.filter(t=>t.restaurantId===e&&!t.hidden)).map(e=>({kind:'menu',id:e.id,name:e.name,allergens:e.allergens,soldOut:e.soldOut,price:e.price,signedOff:!!e.signOff})),a=l.useSpecials.getState().current[e];return[...r,...(a?.items??[]).map(e=>({kind:'special',id:e.id,name:e.name,allergens:e.allergens,price:e.price,signedOff:!!a?.allergenCheck}))]}const _=e=>e.replace(/s$/,'');function E(e,t){const r=new Set(L(e).map(_)),a=e.toLowerCase();let n;for(const e of R(t)){const t=L(e.name);if(!t.length)continue;const o=t.filter(e=>r.has(_(e))).length;if(!o)continue;const i=o/t.length+.25*o+(a.includes(e.name.toLowerCase())?2:0);(o>=Math.min(2,t.length)||t.length<=3)&&(!n||i>n.s)&&(n={d:e,s:i})}return n?.d}const F=[[/\b(gluten|wheat|coeliac|celiac|barley|rye)\b/,['gluten']],[/\bpeanuts?\b/,['peanuts']],[/\b(tree ?nuts?|almonds?|walnuts?|hazelnuts?|cashews?|pecans?|pistachios?)\b/,['treenuts']],[/\bnuts?\b/,['peanuts','treenuts']],[/\b(dairy|milk|lactose|cheese|cream|butter)\b/,['milk']],[/\beggs?\b/,['eggs']],[/\b(shellfish|crustaceans?|prawns?|crab|langoustines?)\b/,['crustaceans']],[/\b(molluscs?|mussels?|oysters?|squid|scallops?|clams?)\b/,['molluscs']],[/\bfish\b/,['fish']],[/\b(soya|soy)\b/,['soya']],[/\bcelery\b/,['celery']],[/\bmustard\b/,['mustard']],[/\bsesame\b/,['sesame']],[/\b(sulphites?|sulfites?|sulphur)\b/,['sulphites']],[/\blupin\b/,['lupin']]];function M(e){const t=new Set;for(const[r,a]of F)r.test(e)&&a.forEach(e=>t.add(e));return[...t]}const q=e=>p.ALLERGENS.find(t=>t.id===e)?.short??e,z='Always check the signed-off recipe card and tell the kitchen about any allergy.';function B(t,r){if('chef'===r?.app&&(0,e.isAnchorage)(r.rid)&&(0,e.isBarFridge)(t))return[];const a=d.useSafety.getState().points.filter(t=>'chef'!==r?.app||(0,e.chefCanSee)(r.rid,t)),n=/\b(done|complete|completed|finished|ok|okay|checked)\b/i.test(t);return(0,f.parseQuick)(t,a).filter(e=>e.point).map(e=>{const t=(0,f.isTempKind)(e.point.kind);return{pointId:e.point.id,value:t?e.value:null,done:t?void 0:n}})}const j=e=>{try{return JSON.parse(String(e.readings??'[]'))}catch{return[]}};function H(e){const t=d.useSafety.getState().points.find(t=>t.id===e.pointId);return t?(0,f.isTempKind)(t.kind)?null==e.value?t.name+': no temperature heard':t.name+': '+e.value+'\xb0C '+((0,f.inRange)(t,e.value)?'(safe)':'OUT OF RANGE (safe: '+(0,f.limitText)(t)+')'):t.name+': '+(e.done?'done':'NOT done'):'?'}function Y(e){const t=e.match(/\b(?:at|around|about)\s+(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})[:.](\d{2})\s*(am|pm)?\b/)??e.match(/\b(\d{1,2})()\s*(am|pm)\b/);if(!t){const t=e.match(new RegExp("\\bhalf (?:past )?(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b"));if(!t)return;let r=T(t[1])??0;return r>=1&&r<=10&&(r+=12),v(r)+':30'}let r=Number(t[1]);const a=Number(t[2]||0),n=t[3];return'pm'===n&&r<12&&(r+=12),'am'===n&&12===r&&(r=0),!n&&r>=1&&r<=10&&(r+=12),r>23||a>59?void 0:v(r)+':'+v(a)}function G(e){const r=e.match(new RegExp("\\b(?:table for|party of|for|of)\\s+(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))"))??e.match(new RegExp("\\b(\\d{1,3}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\\s*(?:covers|people|guests|adults|of us)\\b")),a=T(r?.[1]);return a&&(0,t.validParty)(a)?a:void 0}const P=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function Z(e,t){const r=new Date(t+'T12:00:00');if(/\btomorrow\b/.test(e))return r.setDate(r.getDate()+1),k(r);const a=P.findIndex(t=>e.includes(t));if(a>=0){const t=(r.getDay()+6)%7;return r.setDate(r.getDate()+((a-t+7)%7||(/\bnext\b/.test(e)?7:0))),k(r)}return t}function U(e,t,r,a){const n=i.useStore.getState(),o=n.restaurants.find(t=>t.id===e),d=s.useFloor.getState().plans[e]??(0,s.seedPlan)(e),l=o?.settings.turnMins??90,c=n.bookings.filter(r=>r.restaurantId===e&&r.date===t);return(0,u.freeTablesAt)(d,c,a,new Date(t+'T'+r+':00'),(0,u.turnFor)(a,l),l)}const K=(e,t)=>{const[r,a]=e.split(':').map(Number),n=60*r+a+t;return v(Math.floor(n/60))+':'+v(n%60)},W=e=>e.replace(/^\w/,e=>e.toUpperCase());function $(e){const t=e.match(/\b(?:under|name of|named|called)\s+([A-Za-z][A-Za-z'\u2019-]+(?:\s+[A-Z][A-Za-z'\u2019-]+)?)/i)??e.match(/\bname(?:'s| is)?\s+([A-Za-z][A-Za-z'\u2019-]+)/i);return t?W(t[1]):void 0}const J=e=>!/\b(how do i|how do you|where do i|how to)\b/.test(e),V=e=>!['collected','served','closed','cancelled'].includes(e.status),Q=e=>e.toUpperCase().replace(/[\s-]/g,''),X=[{id:'next_table_free',title:'When is the next table free?',risk:'look',description:'Estimate when the next table frees up, and how long a walk-in for 2 or 4 would wait.',params:[],keywords:['next table','table free'],match:e=>N(e,/\b(next|soonest|first)\b.*\btables?\b.*\b(free|ready|available|clear)\b|\bhow long\b.*\b(wait|walk)|\bwait(ing)? (time|for a table)\b|\bwhen\b.*\btable\b.*\b(free|ready)\b/)?4:0,preview:()=>'Next table free',run:(e,t)=>{const r=i.useStore.getState(),a=w(),n=k(a),o=r.restaurants.find(e=>e.id===t.rid);if(!o)return'I can\u2019t see this venue\u2019s tables yet.';const d=s.useFloor.getState(),l=d.plans[t.rid]??(0,s.seedPlan)(t.rid),c=r.bookings.filter(e=>e.restaurantId===t.rid),p=(0,m.closedAreasAt)(m.useBlocks.getState().blocks,t.rid,n,v(a.getHours())+':'+v(a.getMinutes())),f=(0,u.floorView)(l,c,r.orders.filter(e=>e.restaurantId===t.rid),d.live[t.rid]??{},a,o.settings.turnMins,p);return(0,h.nextFreeSentence)((0,h.nextTablesFree)(o,f,c.filter(e=>e.date===n),a,c),a)+' It\u2019s an estimate.'}},{id:'log_check',title:'Log a temperature or kitchen check',risk:'change',description:'Record fridge, freezer, cooking, cooling, hot-hold or delivery temperatures, or a cleaning or kitchen check, in the food safety log. Out-of-range readings are flagged.',params:[{name:'readings',type:'string',required:!0,description:'JSON list of {pointId, value in \xb0C or null, done for non-temperature checks}'}],keywords:['fridge','freezer','temperature','probe'],match:e=>J(e)&&N(e,/\b(fridges?|freezers?|walk.?in|cold room|temps?|temperatures?|degrees|probe|core temp|hot hold|cooling|cleaning|clean down|deep clean)\b/)&&(!N(e,/\b(seat|seated|party|covers?|people|guests?|table \w+|walk.?ins? (of|for)|just arrived)\b/)||N(e,/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus)\b/))?3:0,parse:(e,t)=>({readings:JSON.stringify(B(e,t))}),preview:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));return n.length?'Log in the food safety log: '+n.map(H).join('; ')+'?':'I didn\u2019t catch which fridge, freezer or check. Try \u201cwalk-in fridge 3 degrees\u201d.'},run:(t,r)=>{const a=d.useSafety.getState().points.filter(t=>'chef'!==r.app||(0,e.chefCanSee)(r.rid,t)),n=j(t).filter(e=>a.some(t=>t.id===e.pointId));if(!n.length)return'Nothing logged: I didn\u2019t catch which unit or check.';if(n.some(e=>{const t=a.find(t=>t.id===e.pointId);return!!t&&(0,f.isTempKind)(t.kind)&&null==e.value}))return'Nothing logged: a temperature was missing. Say the number, for example \u201cfreezer minus 19\u201d.';const o=w().toISOString(),i='chef'===r.app?'chef':'owner'===r.app?'managers':'staff',s=n.filter(e=>a.some(t=>t.id===e.pointId)).map(e=>{const t=a.find(t=>t.id===e.pointId),n=(0,f.isTempKind)(t.kind),s=n?(0,f.inRange)(t,e.value):!!e.done,d=['display'===r.app?'Logged on the Main Display.':'',s?'':'Out of range: add the corrective action.'].filter(Boolean).join(' ');return{pointId:t.id,name:t.name,kind:t.kind,at:o,by:x(r),byId:r.whoId??'voice-'+(r.app??'owner'),app:i,value:n?e.value:void 0,done:n?void 0:!!e.done,ok:s,source:'voice',note:d||void 0}});d.useSafety.getState().addEntries(s);const l=s.filter(e=>!e.ok);return l.length?'Logged. '+l.map(e=>e.name+' is OUT OF RANGE').join(', ')+'. Check it now and add what you did in the food safety log.':'Logged: '+s.map(e=>e.name+' '+(null!=e.value?e.value+'\xb0C':'done')).join(', ')+'. All fine.'}},{id:'allergen_info',title:'Allergen question',risk:'look',description:'Answer allergen questions from the recipe cards and the menu: what a dish contains or may contain, or which dishes are free of an allergen.',params:[{name:'dish',type:'string',description:'Dish name'},{name:'allergens',type:'string',description:'Comma-separated allergen ids'}],keywords:['allergen','allergy','contain'],match:e=>!N(e,/(allergens?|allerg(y|ic|ies)|contains?|coeliac|celiac|safe for|free from|.free\b|intoleran)/)||N(e,/\b(sold out|price|draft)\b/)||N(e,/\btables?\b.*\bfree\b|\bfree\b.*\btables?\b/)?0:3,parse:(e,t)=>{const r=E(e,t.rid);let a=e.toLowerCase();if(r)for(const e of L(r.name))a=a.replace(new RegExp('\\b'+e+'\\b','g'),' ');return{dish:r?.name,allergens:M(a).join(',')}},preview:e=>'Allergens'+(e.dish?' in '+e.dish:''),run:(e,t)=>{const r=R(t.rid),a=e.dish?r.find(t=>t.name===e.dish):void 0,n=String(e.allergens??'').split(',').filter(Boolean);if(a){const e=p.ALLERGENS.filter(e=>'contains'===a.allergens[e.id]).map(e=>e.short),t=p.ALLERGENS.filter(e=>'may'===a.allergens[e.id]).map(e=>e.short);return(n.length?n.map(e=>'contains'===a.allergens[e]?a.name+' CONTAINS '+q(e)+'.':'may'===a.allergens[e]?a.name+' MAY CONTAIN '+q(e)+'.':'No '+q(e)+' is listed for '+a.name+'.').join(' '):a.name+' contains '+(e.length?e.join(', '):'none of the 14 allergens')+(t.length?', and may contain '+t.join(', '):'')+'.')+(a.signedOff?'':' Its allergens are NOT signed off yet.')+' '+z}if(n.length){const e=r.filter(e=>!e.soldOut&&n.every(t=>!e.allergens[t])),t=r.filter(e=>n.some(t=>'contains'===e.allergens[t]));return e.length+(1===e.length?' dish has':' dishes have')+' no '+n.map(q).join(' or ')+' listed'+(e.length?', for example '+e.slice(0,5).map(e=>e.name).join(', '):'')+'. '+t.length+' contain it. '+z}return'Which dish, or which allergen? For example \u201cdoes the fish supper contain gluten?\u201d.'}},{id:'set_sold_out',title:'Mark a dish sold out or back on',risk:'change',description:'Mark a menu dish sold out or back on. A reminder for staff: it shows on the Display and in the Sold out list.',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'soldOut',type:'string',required:!0,description:'yes = sold out, no = back on',enum:['yes','no']}],keywords:['sold out','back on','86'],match:e=>N(e,/\b(sold out|run out|ran out|out of stock|86|eighty.?six|back on|available again|back in stock|un.?86|none left)\b/)?4:0,parse:(e,t)=>{const r=E(e,t.rid),a=/\b(back on|available again|back in stock|un.?86)\b/i.test(e);return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,soldOut:a?'no':'yes'}},preview:e=>e.itemId?'Mark '+e.name+' '+('no'===e.soldOut?'back on':'sold out')+'?':e.name?e.name+' is on the Specials board; change it there.':'I couldn\u2019t find that dish on the menu.',run:async e=>e.itemId?(await o.repo.menu.updateItem(String(e.itemId),{soldOut:'no'!==e.soldOut}),'Done: '+e.name+' is '+('no'===e.soldOut?'back on':'sold out')+'.'):'Nothing changed: I couldn\u2019t find that dish on the menu.'},{id:'change_price',apps:['owner'],title:'Change a menu price',risk:'change',description:'Change the price of a menu dish (managers only).',params:[{name:'itemId',type:'string',required:!0,description:'Menu item id'},{name:'name',type:'string',description:'Dish name'},{name:'pence',type:'integer',required:!0,description:'New price in pence'}],keywords:['price'],match:e=>N(e,/\b(price|charge|cost)\b/)&&N(e,/(\xa3|\d|pound)/)&&!N(e,/\b(special|offer)\b/)?3:0,parse:(e,t)=>{const r=E(e,t.rid),a=e.match(/\b(?:to|at)\s*\xa3?\s*(\d{1,3})(?:[.:](\d{1,2}))?/i)??e.match(/\xa3\s*(\d{1,3})(?:\.(\d{1,2}))?/)??e.match(/(\d{1,3})\s*pounds?(?:\s*(\d{1,2}))?/i),n=a?100*Number(a[1])+Number((a[2]??'0').padEnd(2,'0')):void 0;return{itemId:'menu'===r?.kind?r.id:void 0,name:r?.name,pence:n,old:r?.price??void 0}},preview:e=>e.itemId?'Change '+e.name+' from '+(null!=e.old?(0,g.gbp)(Number(e.old)):'its current price')+' to '+(null!=e.pence?(0,g.gbp)(Number(e.pence)):'?')+'?':'I couldn\u2019t find that dish on the menu.',run:async(e,t)=>{if(t.role&&!['owner','manager'].includes(t.role))return'Only managers can change prices.';const r=Number(e.pence);return e.itemId&&r>0&&r<1e5?(await o.repo.menu.updateItem(String(e.itemId),{price:r}),'Done: '+e.name+' is now '+(0,g.gbp)(r)+'.'):'Nothing changed: I need the dish and a price.'}},{id:'draft_special',apps:['owner','chef'],title:'Draft a special',risk:'draft',description:'Save a special as a draft for the owner to approve. It goes on the Specials board only after its allergens are checked.',params:[{name:'text',type:'string',required:!0,description:'The special, e.g. \u201cHake with mussels, \xa318\u201d'}],keywords:['special'],match:e=>N(e,/\bspecials?\b/)&&N(e,/\b(add|new|put|draft|today'?s|tonight'?s|change|set)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\bspecials?\b(?:\s*(?:board|is|are|to|:))?\s*/i,'').trim()||e}),preview:e=>'Save a draft special: \u201c'+e.text+'\u201d. Its allergens get checked before it goes on the board.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'special',title:'New special',lines:[String(e.text),'Add its allergens and post it on the Specials board when approved.'],by:x(t),app:C(t)}),'Saved as a draft special for the owner to approve. It isn\u2019t on the board yet.')},{id:'check_availability',title:'Check table availability',risk:'look',description:'Check whether a table is free for a party at a date and time, and suggest nearby times if not.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'}],keywords:['availability','table for','free table'],match:e=>N(e,/\b(availability|available|space|room for|any room|got room|any tables?|got a table|free table|have we got|is there a table|can we fit|fit in)\b/)&&!N(e,/\b(sold|back on|allerg)/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r)}},preview:e=>'Check a table for '+(e.covers??'?')+' at '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'today'),run:(e,t)=>{const r=Number(e.covers),a=String(e.time),n=String(e.date??t.today),o=U(t.rid,n,a,r);if(o.length)return'Yes, there\u2019s room for '+r+' at '+a+' on '+S(n)+'. Best fit: table '+o[0].table+(o[0].area?' ('+o[0].area+')':'')+'.';const i=[];for(const e of[-30,30,-60,60,-90,90]){const o=K(a,e);if(U(t.rid,n,o,r).length&&i.push(o),i.length>=3)break}return'No table for '+r+' at '+a+' on '+S(n)+'.'+(i.length?' Free nearby: '+i.sort().join(', ')+'.':' Nothing free within 90 minutes either.')}},{id:'draft_booking',title:'Take a booking (draft)',risk:'draft',description:'Take a booking as a DRAFT for the owner to confirm in Bookings. The guest confirmation is only sent from there.',params:[{name:'covers',type:'integer',required:!0,description:'Party size'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'time',type:'time',required:!0,description:'HH:mm'},{name:'name',type:'string',description:'Guest name'}],keywords:['book','booking','reserve'],match:e=>N(e,/\b(book|booking|reserve|reservation)\b/)&&!N(e,/\b(availability|any tables?|have we got|is there|how many|move|cancel|booker)\b/)?3:0,parse:(e,t)=>{const r=e.toLowerCase();return{covers:G(r),date:Z(r,t.today),time:Y(r),name:$(e)}},preview:(e,t)=>{const r=e.covers&&e.time?U(t.rid,String(e.date??t.today),String(e.time),Number(e.covers)):[],a=e.covers&&e.time?r.length?' Table '+r[0].table+' is free.':' NO table is free then.':'';return'Draft booking: '+(e.name??'guest')+', '+(e.covers??'?')+' covers, '+(e.time??'?')+' on '+(e.date?S(String(e.date)):'?')+'.'+a+' The owner confirms it in Bookings; nothing is sent to the guest now.'},run:(e,r)=>(0,t.validParty)(Number(e.covers))?(b.useDrafts.getState().add({rid:r.rid,kind:'booking',title:'Booking: '+(e.name??'guest')+', '+e.covers+' covers',lines:[S(String(e.date))+' at '+e.time,'Take their phone number when you confirm it in Bookings.'],data:{covers:e.covers,date:e.date,time:e.time,name:e.name},by:x(r),app:C(r)}),'Saved as a draft booking for the owner to confirm. No confirmation has been sent.'):`Nothing saved. ${t.PARTY_RULE} How many people?`},{id:'add_waitlist',title:'Add to the waitlist',risk:'change',description:'Add a party to the waitlist. Nobody is messaged.',params:[{name:'name',type:'string',description:'Name'},{name:'covers',type:'integer',required:!0,description:'Party size'}],keywords:['waitlist','waiting list'],match:e=>N(e,/\b(wait ?list|waiting list|queue)\b/)?4:0,parse:e=>({name:$(e)??e.match(/\badd\s+([A-Z][a-z'\u2019-]+)\b/)?.[1],covers:G(e.toLowerCase())}),preview:e=>'Add '+(e.name??'a guest')+', '+(e.covers??'?')+' covers, to the waitlist?',run:async(e,r)=>{const a=Number(e.covers);if(!(0,t.validParty)(a))return`Nothing added: how many people? ${t.PARTY_RULE}`;return'Done: '+(await o.repo.waitlist.join(r.rid,String(e.name??'Guest'),a)).name+' is on the waitlist. Nobody has been messaged.'}},{id:'read_orders',title:'Read out orders',risk:'look',description:'Read out the live orders and takeaways.',params:[],keywords:['orders'],match:e=>N(e,/\b(orders?|takeaways?|tickets?|collections?)\b/)&&N(e,/\b(read|what|any|list|how many|open|live|waiting|outstanding|pending|due|next)\b/)&&!N(e,/\b(shopping|booker|bidfood|supplier)\b/)?3:0,preview:()=>'Read out the live orders',run:(e,t)=>{const a=i.useStore.getState().orders.filter(e=>e.restaurantId===t.rid&&V(e)).sort((e,t)=>(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt));if(!a.length)return'No live orders right now.';const n=a.filter(e=>'takeaway'===e.type).length;return I(a.length,'live order')+' ('+n+' takeaway). '+a.slice(0,6).map(e=>{return('takeaway'===e.type?'Takeaway ':(0,r.tableNumbers)(e.tableNo)+' ')+e.ref+' for '+e.customerName+', '+I(e.lines.reduce((e,t)=>e+t.qty,0),'item')+', '+e.status+(e.slotTime?', due '+(t=e.slotTime,new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})):'')+(e.allergies.length?', HAS ALLERGIES':'');var t}).join('. ')+(a.length>6?'. And '+(a.length-6)+' more.':'.')}},{id:'day_numbers',title:'Covers, sales and forecast',risk:'look',description:'How many covers are booked today and tomorrow, sales through CoverCharge so far today, and the forecast for the rest of today.',params:[],keywords:['covers','sales','forecast'],match:e=>N(e,/\b(covers|sales|takings|revenue|forecast|how busy|busy tonight|expected|how many (people|guests|bookings))\b/)&&!N(e,/\b(walk|seat|wait ?list|add|book (a|for|in))\b/)?3:0,preview:()=>'Today\u2019s covers, sales and forecast',run:(e,t)=>{const r=i.useStore.getState(),n=w(),o=k(n),s=r.restaurants.find(e=>e.id===t.rid),d=r.bookings.filter(e=>e.restaurantId===t.rid),l=d.filter(e=>e.date===o&&['confirmed','seated','finished'].includes(e.status)),c=l.reduce((e,t)=>e+t.partySize,0),p=l.filter(e=>e.walkIn).reduce((e,t)=>e+t.partySize,0),u=new Date(n);u.setDate(u.getDate()+1);const h=k(u),m=d.filter(e=>e.date===h&&['confirmed','pending'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),f=r.orders.filter(e=>e.restaurantId===t.rid),b=f.filter(e=>e.createdAt.slice(0,10)===o&&'cancelled'!==e.status),y=b.reduce((e,t)=>e+t.subtotal,0);let v='';if(s){const e=(0,a.forecastToday)(s,d,f,r.events,n);v=e.open?e.enough?' Forecast for the rest of today: about '+e.restOfDay.covers+' covers ('+(0,a.coversRange)(e.restOfDay.low,e.restOfDay.high,!1)+')'+(e.example?', example figures.':'.'):' No forecast yet: not enough history ('+e.restOfDay.booked+' covers booked for the rest of today).':''}return'Today: '+c+' covers booked or seated'+(p?', including '+p+' walk-in':'')+'. '+I(b.length,'order')+' through CoverCharge so far'+('display'===t.app||'staff'===t.app||'staff'===t.role?'.':', '+(0,g.gbp)(y)+' before tips (till sales aren\u2019t included).')+v+' Tomorrow: '+m+' covers booked so far.'}},{id:'supplier_list',title:'Add to a Booker or Bidfood shopping list',risk:'draft',description:'Add items to a DRAFT shopping list for Booker or Bidfood for the owner to check and order on the supplier\u2019s site. Never places an order.',params:[{name:'supplier',type:'string',required:!0,description:'Supplier',enum:['booker','bidfood']},{name:'items',type:'string',required:!0,description:'Items separated by semicolons'}],keywords:['booker','bidfood','shopping list'],match:e=>N(e,/\b(booker|bidfood|bid food)\b/)?4:N(e,/\b(shopping list|order list|we need more|we'?re low on|running low)\b/)?3:0,parse:e=>({supplier:/\bbid ?food\b/i.test(e)?'bidfood':'booker',items:e.replace(/\b(to|on|onto)\s+(the\s+)?(booker|bidfood|bid food)?\s*(shopping\s+|order\s+)?list\b.*$/i,'').replace(/\b(from|at)\s+(booker|bidfood|bid food)\b/i,'').replace(/[,.]?\s*\b(put|add|stick)\s+(it|them|that|those)\b.*$/i,'').replace(/^.*?\b(add|need|order|get|put|low on)\b\s*/i,'').trim().split(/\s*(?:,|\band\b)\s*/i).map(e=>e.trim()).filter(Boolean).join('; ')}),preview:e=>'Add to the draft '+('bidfood'===e.supplier?'Bidfood':'Booker')+' list: '+String(e.items??'').split('; ').join(', ')+'. Nothing is ordered; the owner checks it and orders on the supplier\u2019s site.',run:(e,t)=>{const r=String(e.items??'').split('; ').filter(Boolean);if(!r.length)return'Nothing added: which items?';const a=b.useDrafts.getState().addToList(t.rid,'bidfood'===e.supplier?'bidfood':'booker',r,x(t),C(t));return'Added to the draft '+a.title+' ('+I(a.lines.length,'item')+'). Nothing has been ordered.'}},{id:'draft_offer',title:'Draft an offer',risk:'draft',description:'Save an offer or promotion as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The offer'}],keywords:['offer','promotion'],match:e=>N(e,/\b(offer|promotion|promo|deal|discount|happy hour|two for one|2 for 1)\b/)&&N(e,/\b(draft|create|make|set up|new|add|run|do)\b/)?3:0,parse:e=>({text:e.replace(/^.*?\b(?:offer|promotion|promo|deal)\b\s*(?:for|of|:)?\s*/i,'').trim()||e}),preview:e=>'Save a draft offer for the owner to approve: \u201c'+e.text+'\u201d. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'offer',title:'New offer',lines:[String(e.text)],by:x(t),app:C(t)}),'Saved as a draft offer for the owner to approve. Nothing was published or sent.')},{id:'draft_event',title:'Draft an event',risk:'draft',description:'Save an event (quiz, live music, tasting night) as a draft for the owner to approve. Nothing is published or sent.',params:[{name:'text',type:'string',required:!0,description:'The event'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['event'],match:e=>N(e,/\b(event|quiz|live music|tasting|gig|party night|music night|open mic|ceilidh)\b/)&&N(e,/\b(draft|create|make|plan|set up|new|add|put on|run)\b/)?3:0,parse:(e,t)=>({text:e.replace(/^.*?\b(?:draft|create|make|plan|set up|add|put on|run)\b\s*(?:an?|the)?\s*(?:new\s+)?(?:event)?\s*(?:for|:)?\s*/i,'').trim()||e,date:/\b(tomorrow|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i.test(e)?Z(e.toLowerCase(),t.today):void 0}),preview:e=>'Save a draft event for the owner to approve: \u201c'+e.text+'\u201d'+(e.date?' on '+S(String(e.date)):'')+'. Nothing is published or sent.',run:(e,t)=>(b.useDrafts.getState().add({rid:t.rid,kind:'event',title:'New event',lines:[String(e.text),...e.date?[S(String(e.date))]:[]],data:{date:e.date},by:x(t),app:C(t)}),'Saved as a draft event for the owner to approve. Nothing was published or sent.')},{id:'card_balance',apps:['owner','chef'],title:'Gift card or stamp card balance',risk:'look',description:'Look up a gift card balance by its code, or a summary of stamp cards.',params:[{name:'code',type:'string',description:'Gift card code'},{name:'kind',type:'string',description:'gift or stamp',enum:['gift','stamp']}],keywords:['gift card','voucher','stamp card'],match:e=>N(e,/\b(gift ?cards?|gift vouchers?|vouchers?|stamp ?cards?|stamps|loyalty)\b/)?3:0,parse:e=>{const t=e.toUpperCase().replace(/\b(GIFT|CARDS?|VOUCHERS?|BALANCE|CHECK|WHAT'?S|WHAT|THE|ON|IS|CODE|FOR|OF|HOW|MUCH|LEFT|STAMPS?|A)\b/g,' ').match(/[A-Z0-9][A-Z0-9 -]{3,}[A-Z0-9]/);return{kind:/stamp|loyalty/i.test(e)?'stamp':'gift',code:t?Q(t[0]):void 0}},preview:e=>'stamp'===e.kind?'Stamp cards':'Gift card '+(e.code??''),run:(e,t)=>{const r=i.useStore.getState();if('stamp'===e.kind&&(0,n.staffServer)())return(0,n.loyaltySummary)().then(e=>I(e.members,'guest')+' have stamp cards here; '+I(e.rewardsReady,'reward')+' ready to use. To check one guest, open Stamp card and find or scan them.',()=>'I couldn\u2019t reach the stamp cards just now. Try again in a moment.');if('stamp'===e.kind){const e=r.stampCards.filter(e=>e.restaurantId===t.rid),a=e.reduce((e,t)=>e+t.rewardsAvailable,0);return I(e.length,'guest')+' have stamp cards here; '+I(a,'reward')+' ready to claim. To check one guest, scan their card in Stamp cards.'}if(!e.code)return'Read me the code on the gift card, letter by letter.';const a=String(e.code),o=r.giftCards.filter(e=>e.restaurantId===t.rid).find(e=>Q(e.code)===a||a.length>=4&&Q(e.code).includes(a));return o?'Gift card '+o.code+': '+(0,g.gbp)(o.balance)+' left of '+(0,g.gbp)(o.initial)+'.':'I couldn\u2019t find a gift card with that code. Check it and try again.'}},{id:'feedback_summary',title:'Summarise feedback',risk:'look',description:'Summarise the last 7 days of guest ratings and comments.',params:[],keywords:['feedback','reviews'],match:e=>N(e,/\b(feedback|reviews?|ratings?|complaints?|comments?|what are (guests|people) saying)\b/)?3:0,preview:()=>'Summarise this week\u2019s feedback',run:(e,t)=>{const r=w().getTime()-6048e5,a=i.useStore.getState().ratings.filter(e=>e.restaurantId===t.rid&&new Date(e.createdAt).getTime()>=r);if(!a.length)return'No guest feedback in the last 7 days.';const n=a.reduce((e,t)=>e+t.stars,0)/a.length,o=a.filter(e=>e.stars<=3&&e.comment).slice(0,2),s=a.filter(e=>e.stars>=5&&e.comment).slice(0,1);return I(a.length,'rating')+' in the last 7 days, averaging '+n.toFixed(1)+' stars.'+(s.length?' Best: \u201c'+s[0].comment+'\u201d.':'')+(o.length?' To look at: '+o.map(e=>'\u201c'+e.comment+'\u201d ('+e.stars+' stars)').join('; ')+'.':' No low scores.')}},{id:'shift_note',title:'Leave a shift note',risk:'change',description:'Leave a note for the next shift.',params:[{name:'text',type:'string',required:!0,description:'The note'}],keywords:['shift note','handover'],match:e=>N(e,/\b(shift note|leave a note|note for|handover|tell the next shift|let the next shift know|note that)\b/)&&!N(e,/\b(read|any notes|what notes)\b/)?4:0,parse:e=>({text:e.replace(/^.*?\b(?:shift note|leave a note|note for (?:the )?(?:next shift|tomorrow|tonight|morning|evening)|handover note|handover|tell the next shift|let the next shift know|note that)\b\s*(?:that|:|,|for the next shift)?\s*/i,'').trim()||e}),preview:e=>'Leave a shift note: \u201c'+e.text+'\u201d?',run:(e,t)=>(y.useShiftNotes.getState().add({rid:t.rid,text:String(e.text),by:x(t),app:C(t)}),'Shift note saved. It shows on the Shift notes screen.')},{id:'read_shift_notes',title:'Read shift notes',risk:'look',description:'Read out the latest open shift notes.',params:[],keywords:['notes'],match:e=>N(e,/\b(read|any|what|latest)\b.*\b(shift notes?|notes|handover)\b/)?5:0,preview:()=>'Read the latest shift notes',run:(e,t)=>{const r=y.useShiftNotes.getState().notes.filter(e=>e.rid===t.rid&&!e.done).slice(0,5);return r.length?r.map(e=>e.by+', '+new Date(e.at).toLocaleString('en-GB',{weekday:'short',hour:'2-digit',minute:'2-digit'})+': '+e.text).join('. '):'No open shift notes.'}}]},1430,[804,1098,829,1120,1204,848,800,1014,1019,989,831,830,1079,1080,1011,1020,836,1431,1432]); +__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return f}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},d=r(_d[1]),n=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},f=(0,d.create)()((0,n.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,d,n,o,f)=>{const p=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===d&&'draft'===e.status);if(p){const t={...p,lines:[...p.lines,...n]};return e(e=>({drafts:e.drafts.map(e=>e.id===p.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:d,title:('bidfood'===d?'Bidfood':'Booker')+" shopping list",lines:n,by:o,app:f})},decide:(t,s,d)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:d,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,n.createJSONStorage)(()=>s.default)}))},1431,[808,815,818]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1432,[808,815,818]); +__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,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1433,[798,34,283,364,236,402,102,815,794,840,25]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return a}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],o=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from Bidfood or Booker',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add Bidfood or Booker for this venue, with your account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add Bidfood or Add Booker (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and Booker or Bidfood lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cwalk-in fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, Booker and Bidfood shopping lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cwalk-in fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Take a picture of the taking sheet, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Take a picture of the taking sheet, or upload a spreadsheet',keywords:['cash up','photo','spreadsheet','csv','excel','xlsx','camera','sheet','gross','card','cash','tips','takings'],body:'In Cash up & sales tap Take a picture of the taking sheet: the camera opens and the figures are filled in from the photo. Check every figure beside the photo (gross, card, cash, tips, food and drink), change anything that is wrong, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. If the photo can\u2019t be read, type the figures in.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'The taking sheet buttons are here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display then shows a Buy a gift card button with a large QR code. Guests buy on your website; the Display shows no prices or balances.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per person, the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Upload cash up sheet. Your phone camera opens; take a photo of the paper sheet (you can add several). The review screen shows the photo beside the figures. Automatic reading isn\u2019t switched on yet, so type each figure from the photo; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'upload-cashup'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],a=t=>o.find(o=>o.id===t)},1434,[]); +__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1435,[]); +__d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return x}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]);const i=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},h=e=>String(e).padStart(2,'0'),c=e=>e.getFullYear()+'-'+h(e.getMonth()+1)+'-'+h(e.getDate()),d=e=>{const t=new Date(e);return h(t.getHours())+':'+h(t.getMinutes())},l=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return h(Math.floor(t/60))+':'+h(t%60)},u=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),h=new Date(i());return h.setDate(h.getDate()+1),e===c(h)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},m=(e,t)=>t.test(e),p=e=>(e??'').replace(' (example)',''),f=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),b=['staff'],k=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],w={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function y(e,t){return'all'===e||(0,n.inChannel)(e,t)}function S(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:p(e.name),nickname:e.nickname},o))}const v=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>m(e,/\bkitchen (chat|group|channel)\b/)&&!m(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:b,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>m(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&m(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!m(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=S(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:p(o.name)};const h=k.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(w[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=f(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||y(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:i().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(w[s]??'the team chat')+'.'):'You can\u2019t post in '+(w[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:b,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>m(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=f(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||y(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),l=e=>'system'===e.from?'CoverCharge':p(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return l(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(w[t]??t))+' at ')+d(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:b,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>m(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&m(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!m(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=i(),h=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>h)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+u(c.date,s)+', '+l(c.start)+' to '+l(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>u(e.date,s)+' '+l(e.start)+'\u2013'+l(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:b,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>m(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),h=a.today,c=o.getHours()+o.getMinutes()/60,u=s.shifts.find(e=>e.staffId===a.whoId&&e.published&&e.date===h);return n?'You\u2019re clocked in since '+d(n.in)+'.'+(u?' Your shift ends at '+l(u.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':u&&u.end>c?'You\u2019re not clocked in. Your shift today is '+l(u.start)+' to '+l(u.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(u?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:b,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>m(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=i(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const h=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+d(e.start)+'. Breaks today: '+h+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return h?'You\u2019ve had '+h+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:b,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>m(e,/\bspecials?\b/)&&!m(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:b,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>m(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],x=new Set(['log_check','allergen_info','next_table_free',...v.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1436,[800,865,989,836,1430,1032]); +__d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1437,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_KEYTERMS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"MAX_APP_KEYTERMS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"VENUE_WORDS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"cleanTerm",{enumerable:!0,get:function(){return u}}),e.venueKeyterms=function(l){const b=[],f=new Set,h=t=>{const a=u(t??''),n=a.toLowerCase();a.length>=2&&!f.has(n)&&b.lengtht.active).forEach(t=>h(String(t.name).split(/\s+/)[0]))}catch{}try{(n.useFloor.getState().plans[l]??(0,n.seedPlan)(l)).areas.forEach(t=>h(t.name))}catch{}try{s.forEach(h)}catch{}try{a.useStore.getState().menu.filter(t=>!t.restaurantId||t.restaurantId===l).forEach(t=>h(t.name))}catch{}return b};var t=r(d[0]),a=r(d[1]),n=r(d[2]);const l=100,c=80,o=['walk-in','covers','table','seat','seated','clear','cleared','needs clearing','block','unblock','waitlist','lobster','crab','langoustines','scallops','sold out','no-show','Sitooterie','Beer Garden','Main Restaurant','party of','people'],s=['table one','table two','table three','table four','table five','table six','table seven','table eight','table nine','table ten','table eleven','table twelve'],u=t=>t.replace(/\([^)]*\)/g,' ').replace(/[^\p{L}\p{N} '&.-]/gu,' ').replace(/\s+/g,' ').trim().slice(0,50).trim()},1438,[865,800,1014]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useVoiceNav",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).create)(()=>({go:null}))},1439,[815]); +__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_TASKS_PER_MONTH",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"VOICE_WARN_AT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"VOICE_FAIR_USAGE",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"monthKey",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"voiceUsage",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"REACHED_TEXT",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"WARN_TEXT",{enumerable:!0,get:function(){return v}}),_e.useVoiceUsage=function(e,t=new Date){const n=h(n=>n.used[e]?.[f(t)]??0);return _(n)};var e,t=r(_d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(_d[1]),s=r(_d[2]);const u=1e3,c=.8,d='Fair usage: 1,000 voice tasks a month per venue',l=new Set(['log_check']),f=(e=new Date)=>e.getFullYear()+'-'+String(e.getMonth()+1).padStart(2,'0'),h=(0,o.create)()((0,s.persist)(e=>({used:{},add:(t,n)=>e(e=>({used:{...e.used,[t]:{[n]:(e.used[t]?.[n]??0)+1}}}))}),{name:'covercharge-voice-usage-v1',version:1,storage:(0,s.createJSONStorage)(()=>n.default)})),_=e=>{const t=e/u;return{used:e,limit:u,pct:t,warn:t>=c,reached:e>=u,line:'Voice assistant: '+e.toLocaleString('en-GB')+' of 1,000 tasks used this month, resets on the 1st'}},b={get:(e,t=new Date)=>_(h.getState().used[e]?.[f(t)]??0),allowed:(e,t,n=new Date)=>null!=t&&l.has(t)||!b.get(e,n).reached,record:(e,t=new Date)=>h.getState().add(e,f(t))},p='This venue has used its fair-usage allowance of 1,000 voice tasks for this month. It starts again on the 1st. Food safety logging still works, and the owner can contact CoverCharge if you need more.',v=e=>e.line+'. That\u2019s '+Math.round(100*e.pct)+'% of this venue\u2019s fair-usage allowance.'},1440,[808,815,818]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useVoiceKeys",{enumerable:!0,get:function(){return e}}),_e.installVoiceKeys=function(){if('undefined'==typeof window||!window.addEventListener)return()=>{};let n=!1;const o=o=>(o.metaKey||o.ctrlKey)&&o.shiftKey&&'g'===o.key.toLowerCase()?(o.preventDefault(),void(o.repeat||e.getState().send('toggle'))):!o.metaKey&&!o.ctrlKey||o.shiftKey||'/'!==o.key?void('Space'!==o.code||o.metaKey||o.ctrlKey||o.altKey||t(o.target)||(o.preventDefault(),o.repeat||n||(n=!0,e.getState().send('start')))):(o.preventDefault(),void e.getState().send('type')),s=t=>{'Space'===t.code&&n&&(t.preventDefault(),n=!1,e.getState().send('stop'))},l=()=>{n&&(n=!1,e.getState().send('stop'))};return window.addEventListener('keydown',o,!0),window.addEventListener('keyup',s,!0),window.addEventListener('blur',l),()=>{window.removeEventListener('keydown',o,!0),window.removeEventListener('keyup',s,!0),window.removeEventListener('blur',l)}};const e=(0,r(d[0]).create)((e,t)=>({last:null,send:n=>e({last:{cmd:n,n:(t().last?.n??0)+1}})})),t=e=>{const t=e?.tagName;return'INPUT'===t||'TEXTAREA'===t||'SELECT'===t||!!e?.isContentEditable}},1441,[815]); +__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=u(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),k=[],A=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);if(i.includes(c))continue;k.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0});const u='st-jack'===t?{auto:'rota'}:{};d=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:f(d,23.5)}:void 0,...u}):d===y&&e<=m&&A.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:f(d,u.auto?e:e-.05),inSite:!0,...u})}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!k.some(e=>e.staffId===t.staffId&&e.date===t.date)),...k],attendance:[...S.attendance,...A]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:f(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:f((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',u=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,f=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1442,[848,800,865,1024,15,997,846]); +__d(function(e,s,o,p,t,a,f){"use strict";t.exports="/staff-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},1443,[]); +__d(function(s,o,e,p,t,c,d){"use strict";t.exports="/staff-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},1444,[]); +__d(function(o,s,e,f,p,t,d){"use strict";p.exports="/staff-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},1445,[]); +__d(function(o,s,p,t,d,e,n){"use strict";d.exports="/staff-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},1446,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},1447,[30,34,846,25]); +__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 t.Head}});const t=(n=r(d[0]),c=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(c,t)||Object.defineProperty(c,t,{enumerable:!0,get:function(){return n[t]}})}),n);var n,c},1448,[1449]); +__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var c in n)Object.defineProperty(t,c,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,c).get})})(e,{get Head(){return u},get default(){return s}});const n=r(d[1]),c=r(d[2]);function o({children:c}){return(0,t().jsx)(n.Helmet,{children:c})}const u=({children:n})=>(0,c.useIsFocused)()?(0,t().jsx)(o,{children:n}):null;u.Provider=n.HelmetProvider;const s=u},1449,[25,1450,591]); +__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>fe,HelmetData:()=>se,HelmetProvider:()=>oe}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[0])),T=u(r(d[0])),A=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(A||{}),O={rel:["amphtml","canonical","alternate"]},C={type:["application/ld+json"]},w={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x=Object.values(A),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},$=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",k="defaultTitle",S="defer",E="encodeSpecialCharacters",M="onChangeClientState",P="titleTemplate",H="prioritizeSeoTags",D=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},L=t=>{let n=D(t,"title");const s=D(t,P);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=D(t,k);return n||i||void 0},I=t=>D(t,M)||(()=>{}),U=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),N=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;it.push(n));const l=Object.keys(o);for(let t=0;t{if(Array.isArray(t)&&t.length)for(let s=0;sArray.isArray(t)?t.join(""):t,z=(t,n)=>{const s=Object.keys(t);for(let i=0;iArray.isArray(t)?t.reduce((t,s)=>(z(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},F=(t,n)=>({...t,[n]:void 0}),Y=["noscript","script","style"],K=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),G=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${K(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),W=(t,n,s,i)=>{const o=G(s),l=R(n);return o?`<${t} ${j}="true" ${o}>${K(l,i)}`:`<${t} ${j}="true">${K(l,i)}`},J=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${K(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===Y.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}`}`},""),Q=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),V=(t,n,s)=>{const i=Q(s,{key:n,[j]:!0});return[T.default.createElement("title",i,n)]},X=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),T.default.createElement(t,i)}),Z=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>V(0,n.title,n.titleAttributes),toString:()=>W(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Q(n),toString:()=>G(n)};default:return{toComponent:()=>X(t,n),toString:()=>J(t,n,s)}}},ee=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=B(t,w),l=B(n,O),c=B(s,C);return{priorityMethods:{toComponent:()=>[...X("meta",o.priority),...X("link",l.priority),...X("script",c.priority)],toString:()=>`${Z("meta",o.priority,i)} ${Z("link",l.priority,i)} ${Z("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},te=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=ee(t)),{priority:T,base:Z("base",n,i),bodyAttributes:Z("bodyAttributes",s,i),htmlAttributes:Z("htmlAttributes",o,i),link:Z("link",y,i),meta:Z("meta",f,i),noscript:Z("noscript",l,i),script:Z("script",b,i),style:Z("style",c,i),title:Z("title",{title:p,titleAttributes:u},i)}},re=[],ne=!("undefined"==typeof window||!window.document||!window.document.createElement),se=class{instances=[];canUseDOM=ne;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?re:this.instances,add:t=>{(this.canUseDOM?re:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?re:this.instances).indexOf(t);(this.canUseDOM?re:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=te({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ie=b.default.createContext({}),oe=class t extends b.Component{static canUseDOM=ne;constructor(n){super(n),this.helmetData=new se(this.props.context||{},t.canUseDOM)}render(){return b.default.createElement(ie.Provider,{value:this.helmetData.value},this.props.children)}},ae=r(d[0]),le=(t,n)=>{if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;const s=Object.keys(t),i=Object.keys(n);return s.length===i.length&&s.every(s=>Object.prototype.hasOwnProperty.call(n,s)&&t[s]===n[s])},ce=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},pe=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},ue=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=R(t)),pe("title",n)},de=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;pe("body",i),pe("html",o),ue(f,b);const T={baseTag:ce("base",s),linkTags:ce("link",l),metaTags:ce("meta",c),noscriptTags:ce("noscript",p),scriptTags:ce("script",h),styleTags:ce("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},he=null,me=t=>{he&&cancelAnimationFrame(he),t.defer?he=requestAnimationFrame(()=>{de(t,()=>{he=null})}):(de(t),he=null)},ye=class extends ae.Component{rendered=!1;shouldComponentUpdate(t){return!le(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:N(["href"],o),bodyAttributes:U("bodyAttributes",o),defer:D(o,S),encode:D(o,E),htmlAttributes:U("htmlAttributes",o),linkTags:q("link",["rel","href"],o),metaTags:q("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:q("noscript",["innerHTML"],o),onChangeClientState:I(o),scriptTags:q("script",["src","innerHTML"],o),styleTags:q("style",["cssText"],o),title:L(o),titleAttributes:U("titleAttributes",o),prioritizeSeoTags:_(o,H)});var o;oe.canUseDOM?me(i):te&&(s=te(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},fe=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(F(this.props,"helmetData"),F(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){if(!x.some(n=>t.type===n))throw new Error("function"==typeof t.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`);if(n&&"string"!=typeof n&&(!Array.isArray(n)||n.some(t=>"string"!=typeof t)))throw new Error(`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`} ) Refer to our API for more information.`);return!0}mapChildrenToProps(t,n){let s={};return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[$[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof se)){i=new se(i.context,!0),delete s.helmetData}return i?y.default.createElement(ye,{...s,context:i.value}):y.default.createElement(ie.Consumer,null,t=>y.default.createElement(ye,{...s,context:t}))}}},1450,[34,172]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1451,[]); +__d(function(g,r,i,a,m,_e,d){"use strict";function t(){const e=r(d[0]);return t=function(){return e},e}function e(){const t=r(d[1]);return e=function(){return t},t}function n(){const t=f(r(d[2]));return n=function(){return t},t}function o(){const t=r(d[3]);return o=function(){return t},t}Object.defineProperty(_e,"__esModule",{value:!0}),Object.defineProperty(_e,"renderRootComponent",{enumerable:!0,get:function(){return y}});const u=f(r(d[4]));function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(c=function(t){return t?n:e})(t)}function f(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=c(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var s=u?Object.getOwnPropertyDescriptor(t,f):null;s&&(s.get||s.set)?Object.defineProperty(o,f,s):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o}function s(t){if('[object Object]'!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function p(t){return t&&'object'==typeof t&&'string'==typeof t.name&&'string'==typeof t.message}function l(t){return p(t)?t:s(t)?new Error(JSON.stringify(t)):new Error(String(t))}function y(c){try{setTimeout(()=>{u._internal_preventAutoHideAsync?.()}),n().startTransition(()=>{(0,e().registerRootComponent)(c)})}catch(n){u.hideAsync();const c=l(n);(0,e().registerRootComponent)(()=>(0,t().jsx)(o().View,{})),console.error(c),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw c})}}},1452,[25,499,34,270,651]); __r(501); __r(21); __r(0); \ No newline at end of file diff --git a/staff-app/admin.html b/staff-app/admin.html index 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 bcc3c0956c6a51ed9915b18171363037c9a5b2b0..8bc1b1de55bf62b6f7be9707c015aa788538a315 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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 78cad0604bf4c8ba94852282393efa9b54cb3b39..312d747eb40a1e64be9de59855e2b9f54d45e510 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-8a8ba96019"; +const V = "cc-staff-ec98ec5eac"; 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=8a8ba96019c9b4a7863583657df8e24fb5ecd1a58b26f035f087132262fe9b9e"]; +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=ec98ec5eacc8e5516f9992debbe75b650593abea66d0d335864576c0e2ea8ede"]; // 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 5320139fd3672cb42e554aa1451206f7ad67444c..9b066b1db33335c0ffdada26223a0f2541d9fb89 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); })(); - +