diff --git a/CHECKSUMS.txt b/CHECKSUMS.txt index 7a80c8f589820c07bb6e86e1f0bae50a60396135..79535476e3bb0c80aff68cd42d0e6f951073e4f0 100644 --- a/CHECKSUMS.txt +++ b/CHECKSUMS.txt @@ -1,23 +1,23 @@ -Cover Charge v0.3.12.201: 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.201. +Cover Charge v0.3.12.202: 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.202. SHA-256 of each web app's start page, service worker, manifest and logo: -253ecb322c953f0b7df338500d13c7d169d1a6ba18dbcef58319277874f4b8d6 owner-app/index.html -d19d2c3593f96fe1f49b84c1619f3584d12e6c0cc8bb4e8d77db8f809627eb9a owner-app/sw.js +f524d07dfccbb7c370e44bb73af1bb6b9ee1c06d327459df65314ec46480e6db owner-app/index.html +aaf36b525c3edbf5167db08cf2b4ec0ea425da5f9410e3fdb2a5d8a5600fb6d8 owner-app/sw.js e305c44d11a9c25f37372f3fa4d329d4ffb04df2edee6e7b4b9ac91f3875ac67 owner-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png -fee514226bc7405a20651718924d5817bcef8d3c544edd9c638ce579e3537659 staff-app/index.html -7bd6914c417d6efe64ea3b794147445a5bf5320395c853a08ad01dd7de152a55 staff-app/sw.js +70203fa2891f24bb40e8328c20252c88eaedcda68c4ae83d1c60b27565e7c0ca staff-app/index.html +f496d3f5246a1cc1dfd4a654e8ba7b94dca51ad5709d593e5509037af169c62a staff-app/sw.js bd1d310ebf8e2a80808e100c41fb7fe1c4369d3026478f3ad8eececaeadaf4ac staff-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png -2753d4abe1624c5a2c087d1f002ee0b2cb63f3b518f906d06fdc90be84e39871 customer-app/index.html -c3285c5cbd3362a72f55a90c97414dad149421c58afe0ca20496f7480fe208f6 customer-app/sw.js +16381a2d733af2dd66a7ecd528513710d8445854df1226d0130e02d06b406ede customer-app/index.html +839ff684aa86b739f8b5bd835430cdcebec38681af843ea6b461174eb1f55ee4 customer-app/sw.js 3bfb1fd10cc13f09ca6be65c461e1f6b5750ae51a3ece12e079750b2a066052e customer-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png -7e82ae7f7b1d53abe0a4e78a38ddded0662e1d0280b8691940e2c20633a96cae display-app/index.html -8ff5e7e6688405a646f8161d337b94c48c7485bc3cc7de81dfbda7378b93f088 display-app/sw.js +a26bb220f35693413baf06ad2febafab4469d8a9298ade456ee14c70e2275766 display-app/index.html +69976c4b9a2c9fdf4bb51922d67792669e3fbeabb7d5c548e85ee6be0bbda2a4 display-app/sw.js 35e2721b86eb1ae1605e55bee64177adcee72f4e53a24ac417d19ea2873434a1 display-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png -435c1e5fc5bd959685b77a02ed263fe53ba1cf817cc825707fc15d49c82ba4c9 chef-app/index.html -4500052008fabde10770b451f7222317507ea4e9cc96dc3810a7d87c88464ea3 chef-app/sw.js +e2e79e47cdf9ef552b37e90f5e1882d93925ac4ba0c7ae5abe99dacd1f8a154b chef-app/index.html +4870a959c06e61b4cf42069f572025dde2ff457980dc76144323efbdc34a4dec chef-app/sw.js 97ed43decde8a888e22b7411e13a2122c6f8b9944cf38b2e28e8f62ef2e25397 chef-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png diff --git a/car-app/_expo/static/js/web/bundle.js b/car-app/_expo/static/js/web/bundle.js index ada1d097ae4356df6a01286d769032c2cd6b2e98..526ae3ccdb6d71343ff158d0b0f443ae5542ab5e 100644 --- a/car-app/_expo/static/js/web/bundle.js +++ b/car-app/_expo/static/js/web/bundle.js @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__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.201'},979,[]); +__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.202'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1247,7 +1247,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,"FOH_ROLE_BADGES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"KITCHEN_ROLE_BADGES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ROLE_BADGES",{enumerable:!0,get:function(){return o}}),e.cleanBadge=c,Object.defineProperty(e,"isKitchenBadge",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isFohBadge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"badgeSpoken",{enumerable:!0,get:function(){return f}}),e.assignShiftBadge=b,e.assignKitchenShiftBadge=function(n,t,o){const s=String(o??'').trim();return s&&!u(s)?n:b(n,t,s?c(s):void 0)},e.applyLiveKitchenBadge=function(n,t,o){const s=String(o??'').trim();if(s&&!u(s))return n;const f=s?c(s):void 0;return n.map(n=>n.id===t?{...n,badge:f}:n)};const n=['Bar','Floor'],t=['Upstairs KP','Downstairs KP','Sauce','Larder'],o=[...n,...t];function c(n){const t=String(n??'').trim().toLowerCase();return o.find(n=>n.toLowerCase()===t)}const u=n=>{const o=c(n);return!!o&&t.includes(o)},s=t=>{const o=c(t);return!!o&&n.includes(o)},f=n=>c(n)?`, on ${c(n)}`:'';function b(n,t,o){const u=c(o);return n.map(n=>n.id===t?{...n,badge:u,changed:!!n.published||n.changed}:n)}},1164,[]); __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.useSuggestions=j,_e.OrdersScreen=function({focus:e}={}){const[s,t]=(0,n.useState)('sheets');return(0,x.jsxs)(l.default,{style:{gap:12},children:[(0,x.jsx)(y.Seg,{value:s,onChange:t,options:[{id:'sheets',label:'Order sheets'},{id:'suggested',label:'Suggested orders'},{id:'history',label:'Order history'}]}),'sheets'===s?(0,x.jsx)(m.OrderSheets,{focus:e}):'suggested'===s?(0,x.jsx)(w,{}):(0,x.jsx)($,{})]})};var s=r(_d[0]),t=r(_d[1]),n=r(_d[2]),i=e(r(_d[3])),l=e(r(_d[4])),d=r(_d[5]),o=r(_d[6]),u=r(_d[7]),c=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),f=r(_d[12]),m=r(_d[13]),x=r(_d[14]);const b=(e,s)=>'kg'===s?Math.ceil(2*e)/2:Math.ceil(e);function j(){const{k:e,now:s,rid:n}=(0,y.useChef)(6e4),{pct:i}=(0,y.useForecast)(),l=(0,u.supplierView)('chef',(0,o.useOwner)(e=>e.suppliers)).filter(e=>!e.archived),d=1+Math.max(0,i)/100;return l.map(i=>{const l=e.ingredients.filter(e=>e.supplierId===i.id).map(e=>({i:e,qty:(0,t.fishInStone)(n,e)?(0,t.fromStone)(Math.ceil(2*(0,t.toStone)(Math.max(0,e.par*d-e.onHand),e.unit))/2,e.unit):b(Math.max(0,e.par*d-e.onHand),e.unit)})).filter(e=>e.qty>0),o=(0,p.weekday)(s),u=i.orderDays.includes(o),[c,h]=(i.cutoff||'23:59').split(':').map(Number),y=new Date(s);y.setHours(c,h,0,0);const f=e.orders.some(e=>e.supplierId===i.id&&new Date(e.at).toDateString()===s.toDateString()),m=[1,2,3,4,5,6,7].map(e=>(o+e)%7).find(e=>i.orderDays.includes(e));return{s:i,lines:l,ordersToday:u,cutPassed:s>y,placedToday:f,nextDay:m,total:Math.round(l.reduce((e,s)=>e+s.qty*s.i.cost,0))}}).filter(e=>e.lines.length||e.ordersToday)}function w(){const{me:e,rid:o}=(0,y.useChef)(),{label:u,covers:m,enough:b,booked:w}=(0,y.useForecast)(),$=(0,f.useKitchen)(e=>e.addOrder),S=j(),[C,M]=(0,n.useState)({}),[O,k]=(0,n.useState)('');return(0,x.jsxs)(l.default,{style:{gap:10},children:[(0,x.jsxs)(d.Muted,{children:[b?`Built from par levels and today's forecast (${m} Covers, ${u} vs a typical day).`:`Built from par levels (no forecast yet: not enough history; ${w} Covers booked so far).`," Adjust, then call the supplier or use their ordering website. Nothing is sent by CoverCharge."]}),O?(0,x.jsx)(d.Banner,{kind:"success",title:"Saved to order history",children:O}):null,S.map(({s:n,lines:u,ordersToday:y,cutPassed:f,placedToday:m,nextDay:b,total:j})=>{const w=u.map(e=>({...e,q:C[`${n.id}:${e.i.id}`]??e.qty})),S=Math.round(w.reduce((e,s)=>e+s.q*s.i.cost,0)),O=s=>{$({supplierId:n.id,by:e,status:s,lines:w.filter(e=>e.q>0).map(e=>({ing:e.i.id,qty:e.q,cost:e.i.cost})),total:S}),k(`${n.name}: ${(0,c.gbp)(S)} (${s}).`)};return(0,x.jsxs)(d.Card,{highlight:!y||m||f?void 0:h.colours.gold,children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{weight:"semibold",children:n.name}),(0,x.jsxs)(d.Muted,{children:[n.category," \xb7 min order ",(0,c.gbp)(n.minOrder)]})]}),m?(0,x.jsx)(d.Badge,{kind:"ok",label:"ORDERED TODAY"}):y?(0,x.jsx)(d.Badge,{kind:f?'red':'amber',label:f?`CUT-OFF ${n.cutoff} PASSED`:`ORDER BY ${n.cutoff}`}):(0,x.jsx)(d.Badge,{label:`NEXT ${null!=b?p.DAY3[b].toUpperCase():'\u2014'}`})]}),w.length?w.map(e=>(0,x.jsxs)(d.Row,{wrap:!0,style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{size:14,children:e.i.name}),(0,x.jsxs)(d.Muted,{children:["On hand ",(0,s.ingredientQty)(o,e.i,e.i.onHand)," \xb7 par ",(0,s.ingredientQty)(o,e.i,e.i.par)]})]}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"Less",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone less':'Less'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,-1)}))}),(0,x.jsx)(l.default,{accessible:!0,accessibilityLabel:(0,s.ingredientSpeech)(o,e.i,e.q),children:(0,x.jsx)(d.T,{size:16,style:{minWidth:76,textAlign:'center'},children:(0,s.ingredientQty)(o,e.i,e.q)})}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"More",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone more':'More'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,1)}))})]},e.i.id)):(0,x.jsx)(d.Muted,{children:"Everything is at par."}),w.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(d.T,{weight:"semibold",children:["Estimated ",(0,c.gbp)(S)]}),S{i.default.openURL(`tel:${n.phones[0].replace(/\s/g,'')}`).catch(()=>{}),O('placed (by phone)')}}):null,n.website?(0,x.jsx)(d.Button,{small:!0,kind:"secondary",label:"Open website",onPress:()=>{i.default.openURL(n.website).catch(()=>{}),O('placed (on website)')}}):null]})]}):null,void 0]},n.id)})]})}function $(){const{k:e,rid:t}=(0,y.useChef)(),n=(0,o.useOwner)(e=>e.suppliers);return(0,x.jsx)(l.default,{style:{gap:8},children:e.orders.map(i=>(0,x.jsxs)(d.Card,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(d.T,{weight:"semibold",style:{flex:1},children:n.find(e=>e.id===i.supplierId)?.name}),(0,x.jsx)(d.Badge,{kind:"neutral",label:i.status.toUpperCase()})]}),(0,x.jsxs)(d.Muted,{children:[new Date(i.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",i.by,i.total?` \xb7 ${(0,c.gbp)(i.total)}`:'']}),i.lines.length?(0,x.jsx)(d.Muted,{children:i.lines.map(n=>{const i=e.ingredients.find(e=>e.id===n.ing);return`${(0,s.ingredientQty)(t,i??{name:n.ing,unit:''},n.qty)} ${i?.name??n.ing}`}).join(', ')}):null]},i.id))})}},1165,[1148,943,17,362,85,777,876,955,851,804,1055,1140,1000,1166,8]); __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.openLink=w,_e.useSheetReminders=C,_e.OrderSheets=function({focus:e}){const{rid:t,now:l}=(0,x.useChef)(3e4),o=(0,u.useSheets)(t).filter(e=>(0,n.chefCanSee)(t,e)&&!e.placeholder),[h,c]=(0,s.useState)(e??null),p=C(),f=(0,b.wd)(l);return(0,j.jsxs)(d.default,{style:{gap:10},testID:"order-sheets",children:[(0,j.jsx)(i.Banner,{kind:"info",title:"Nothing is sent for you",children:"Text, WhatsApp and phone orders open your phone\u2019s own app with the order already written. Check it, then press Send yourself."}),p.map(e=>(0,j.jsx)(r.default,{accessibilityRole:"button",onPress:()=>c(e.supplierId),children:(0,j.jsxs)(i.Banner,{kind:'red'===e.tone?'danger':'warn',title:`\u23f0 ${e.text}`,children:["Tap to open the ",e.name," order sheet."]})},e.supplierId)),(0,j.jsxs)(i.Muted,{children:["Today is ",b.DAYS[f],". Edit suppliers in Managers \u203a Settings \u203a Supplier order sheets."]}),o.map(e=>(0,j.jsx)($,{s:e,open:h===e.id,onToggle:()=>c(h===e.id?null:e.id)},e.id)),o.length?null:(0,j.jsx)(i.Muted,{children:"No order sheets yet. Add suppliers in Managers \u203a Settings \u203a Supplier order sheets."})]})};var t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),o=e(_r(_d[4]));_r(_d[5]);var r=e(_r(_d[6])),d=e(_r(_d[7])),i=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),b=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),j=_r(_d[17]);function w(e){if('undefined'!=typeof window){const t=window;return'function'==typeof t.__ccOpenLink?void t.__ccOpenLink(e):void(/^https?:/.test(e)?window.open(e,'_blank','noopener'):window.location.href=e)}o.default.openURL(e).catch(()=>{})}async function k(e){try{const t='undefined'!=typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0}catch{}return!1}const S={online:'\ud83c\udf10',phone:'\ud83d\udcde',text:'\ud83d\udcac',whatsapp:'\u2706',tbc:'\ud83d\udd8a\ufe0f'},T={borderWidth:1,borderColor:f.colours.border,borderRadius:10,paddingHorizontal:12,paddingVertical:10,color:f.colours.text,backgroundColor:f.colours.surface2,fontSize:f.font.body};function C(){const{rid:e,now:t}=(0,x.useChef)(6e4),l=(0,u.useSheets)(e).filter(t=>(0,n.chefCanSee)(e,t)&&!t.placeholder),s=(0,u.useOrderSheets)(e=>e.opened),o=(0,h.useShellfish)(e,'','chef'),r=(0,b.remindersFor)(l,t,s);for(const n of l){const l=o.items.filter(e=>(e.supplierId===n.id||!e.supplierId&&n.shellfish)&&o.isLow(e.key));!l.length||s[n.id]&&new Date(s[n.id]).toDateString()===t.toDateString()||r.push({supplierId:n.id,name:n.name,text:`${'text'===n.method||'whatsapp'===n.method?'Text':'Order from'} ${n.contact||n.name}: ${l.map(t=>`${(0,c.fmtStockCount)(e,t,o.counts[t.key]??0)} ${t.plural.toLowerCase()}`).join(' and ')} left`,tone:'amber',cutoffPassed:!1})}return r}function $({s:e,open:n,onToggle:o}){const{rid:C,r:$,me:D,now:I}=(0,x.useChef)(3e4),v=(0,u.useOrderSheets)(e=>e.patch),M=(0,u.useOrderSheets)(e=>e.markOpened),B=(0,u.useOrderSheets)(t=>t.opened[e.id]),[L,P]=(0,s.useState)({}),[O,R]=(0,s.useState)(''),[A,z]=(0,s.useState)(''),[_,W]=(0,s.useState)(!1),H=(0,h.useShellfish)(C,D,'chef'),K=(0,b.nextDelivery)(e,I),E=(0,b.orderLines)(e,L,O,C),N=($.address??$.location??'').split(',').map(e=>e.trim()).filter(Boolean),q=N.length>=3?N[1]:N[0]??'',U=(0,b.orderMessage)(e,$.name,q,E,D.split(' ')[0],I),Q=e.orderDays.includes((0,b.wd)(I)),Y=(e,t)=>P(n=>({...n,[e.id]:(0,l.stepQuantity)(C,e,n[e.id]||0,t)})),F=t=>{M(e.id,I.toISOString()),w(t)},G='text'===e.method||'whatsapp'===e.method||'phone'===e.method,V=Math.round(100*((0,y.parseMoneyInput)(A)??NaN)),J=H.items.filter(t=>t.supplierId===e.id||!t.supplierId&&e.shellfish),X=J.filter(e=>H.isLow(e.key));return(0,j.jsxs)(d.default,{testID:`sheet-${e.id}`,style:{borderRadius:14,borderWidth:1.5,borderColor:Q||X.length?f.colours.amber:n?f.colours.gold:f.colours.border,backgroundColor:f.colours.surface,overflow:'hidden'},children:[(0,j.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.name} order sheet`,onPress:o,style:{padding:12,gap:4},children:[(0,j.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(i.T,{weight:"semibold",size:f.font.large,style:{flex:1},children:[S[e.method]," ",e.name]}),(0,j.jsx)(i.Badge,{kind:e.placeholder?'amber':'gold',label:e.placeholder?'To fill in':b.METHOD_LABEL[e.method]})]}),(0,j.jsx)(i.Muted,{children:e.goods}),(0,j.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.deliveryDays.length?(0,j.jsx)(i.Badge,{kind:"neutral",label:`Delivers ${(0,b.dayRange)(e.deliveryDays)}`}):null,e.orderDays.length?(0,j.jsx)(i.Badge,{kind:Q?'amber':'neutral',label:`Order ${(0,b.dayRange)(e.orderDays)}${e.cutoff?` by ${e.cutoff}`:''}`}):null,e.frequency?(0,j.jsx)(i.Badge,{kind:"neutral",label:e.frequency}):null,e.priceCapPerKg?(0,j.jsx)(i.Badge,{kind:"blue",label:`Cap ${(0,p.gbp)(e.priceCapPerKg)}/kg`}):null,J.length?(0,j.jsx)(i.Badge,{kind:X.length?'amber':'ok',label:J.map(e=>`${e.icon} ${(0,c.fmtStockCount)(C,e,H.counts[e.key]??0)}`).join(' \xb7 ')}):null,B&&new Date(B).toDateString()===I.toDateString()?(0,j.jsx)(i.Badge,{kind:"ok",label:"Opened today \u2713"}):null]})]}),n?(0,j.jsxs)(d.default,{style:{padding:12,paddingTop:0,gap:10},children:[K?(0,j.jsxs)(i.Muted,{children:["Next delivery if you order now: ",(0,b.niceDay)(K),"."]}):null,e.reminder?(0,j.jsxs)(i.Muted,{children:["Reminder on ",e.orderDays.map(e=>b.DAYS[e]).join(', '),": ",e.reminder]}):null,e.notes?(0,j.jsx)(i.T,{size:f.font.small,colour:f.colours.muted,children:e.notes}):null,e.placeholder?(0,j.jsx)(i.Banner,{kind:"warn",title:"Still to be set up",children:"Add the supplier, how to order and delivery days in Managers \u203a Settings \u203a Supplier order sheets."}):null,e.items.map(e=>(0,j.jsxs)(d.default,{style:{gap:6},children:[(0,j.jsxs)(i.T,{children:[e.name,e.unit?(0,j.jsxs)(i.T,{size:f.font.small,colour:f.colours.muted,children:[" (",(0,l.quantityUnit)(C,e),")"]}):null]}),(0,j.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone less':'Less'} ${e.name}`,onPress:()=>Y(e,-1),style:{minWidth:44,minHeight:44}}),(0,j.jsx)(d.default,{accessible:!0,accessibilityLabel:(0,l.fishQtySpeech)(C,e,L[e.id]||0),children:(0,j.jsx)(i.T,{weight:"bold",size:20,style:{minWidth:76,textAlign:'center'},children:(0,l.fishInStone)(C,e)?(0,l.fishQtyText)(C,e,L[e.id]||0):L[e.id]||0})}),(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone more':'More'} ${e.name}`,testID:`qty-${e.id}`,onPress:()=>Y(e,1),style:{minWidth:44,minHeight:44}})]})]},e.id)),(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsx)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:"Anything else (one line each)"}),(0,j.jsx)(t.TextInput,{value:O,onChangeText:R,multiline:!0,placeholder:"e.g. 2 boxes lemons",placeholderTextColor:f.colours.muted,style:[T,{minHeight:60}]})]}),G?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['whatsapp'===e.method?'WhatsApp number':'phone'===e.method?'Phone number':'Mobile number',e.number?'':' (blank: fill in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`number-${e.id}`,value:e.number,onChangeText:t=>v(C,e.id,{number:t}),keyboardType:"phone-pad",placeholder:"07\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,'online'===e.method?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['Open Coldweb'===e.urlLabel?'Coldweb ordering link':'Website link',e.url?'':' (blank: paste it in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`url-${e.id}`,value:e.url,onChangeText:t=>v(C,e.id,{url:t.trim()}),autoCapitalize:"none",keyboardType:"url",placeholder:"https://\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,e.priceCapPerKg?(0,j.jsxs)(d.default,{style:{gap:6,padding:10,borderRadius:12,backgroundColor:f.colours.blueBg},children:[(0,j.jsxs)(i.T,{weight:"semibold",colour:"#E2C489",children:["Price cap ",(0,p.gbp)(e.priceCapPerKg),"/kg \xb7 buy from the cheapest UK seller under it"]}),(0,j.jsxs)(i.Muted,{children:["Seller: ",e.seller||'to be chosen']}),(0,j.jsxs)(i.Row,{gap:8,children:[(0,j.jsx)(i.T,{size:f.font.small,style:{flex:1},children:"Price you found (\xa3/kg)"}),(0,j.jsx)(t.TextInput,{testID:"price-found",value:A,onChangeText:e=>z((0,y.sanitiseMoneyTyping)(e)),keyboardType:"decimal-pad",inputMode:"decimal",placeholder:"e.g. 22.50",placeholderTextColor:f.colours.muted,style:[T,{width:120}]})]}),V>0?(0,j.jsx)(i.Badge,{kind:V<=e.priceCapPerKg?'ok':'red',label:V<=e.priceCapPerKg?`${(0,p.gbp)(V)}/kg is under the cap \u2713`:`${(0,p.gbp)(V)}/kg is over the ${(0,p.gbp)(e.priceCapPerKg)} cap: look for a cheaper seller`}):null]}):null,'online'!==e.method&&'tbc'!==e.method?(0,j.jsxs)(d.default,{testID:`preview-${e.id}`,style:{padding:10,borderRadius:12,borderWidth:1,borderColor:f.colours.border,backgroundColor:f.colours.surface2},children:[(0,j.jsx)(i.T,{size:12,weight:"semibold",colour:f.colours.gold,children:'phone'===e.method?'READ THIS OUT':'YOUR MESSAGE'}),(0,j.jsx)(i.T,{size:f.font.small,children:E.length?U:'Add quantities above to write the order.'})]}):null,(0,j.jsxs)(i.Row,{wrap:!0,gap:8,children:['text'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"\ud83d\udcac Open in Messages",disabled:!E.length,onPress:()=>F((0,b.smsLink)(e.number,U))}):null,'whatsapp'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"Open in WhatsApp",disabled:!E.length,onPress:()=>F((0,b.waLink)(e.number,U))}):null,'phone'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83d\udcde Call ${e.name}`,disabled:!e.number,onPress:()=>F((0,b.telLink)(e.number))}):null,'online'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83c\udf10 ${e.urlLabel??'Open website'}`,disabled:!e.url,onPress:()=>F(e.url)}):null,'online'!==e.method&&'tbc'!==e.method&&E.length?(0,j.jsx)(i.Button,{kind:"ghost",label:_?'Copied \u2713':'Copy order',onPress:async()=>{const e=await k(U);W(e),e&&setTimeout(()=>W(!1),2e3)}}):null]}),'text'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: Messages opens with the order written and asks who to send it to."}):null,'whatsapp'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: WhatsApp opens with the order written and asks who to send it to."}):null,'phone'!==e.method||e.number?null:(0,j.jsx)(i.Muted,{children:"Add the phone number above to call from here."}),'online'!==e.method||e.url?null:(0,j.jsx)(i.Muted,{children:"Add the link above and the button opens it."})]}):null]})}},1166,[812,820,943,17,362,219,385,85,777,998,942,944,851,999,804,1140,840,8]); -__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:i,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),i?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:i}):null]}):null,n||w.length||!i?null:(0,j.jsx)(l.default,{accessibilityRole:"button",onPress:i,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:i?()=>{k(!1),i()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const i=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!i.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${i.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,i.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:i.items.map((t,s)=>{const o=i.counts[t.key]??0,l=d[t.key]??0,h=Math.max(0,o-l),m=h<=0,b=m||i.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:l?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,l)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return z}}),_e.ShellfishChip=M,_e.SundayRoastChip=function(e){return(0,j.jsx)(M,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=e(_r(_d[5])),l=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(i.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:i,group:l}){const d=(0,h.useShellfish)(e,s,r,l),m='roast'===l,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const i=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,i,o):Math.max(0,Math.min(99,i+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),z=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),M=(0,o.useRef)(null);M.current||(M.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!M.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,H]=(0,o.useState)(0),F=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?z:D>0,W=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!F.length)return;const e=setInterval(()=>H(e=>e+1),600);return()=>clearInterval(e)},[R.state,F.length]);const P=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void W('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?W('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?W('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-P.current>2e4&&W('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||F.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||F.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${F.length} ${1===F.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&z&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),P.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!z,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),i?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:i}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const z=18;function M({rid:e,by:t,app:r,size:i="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(m&&'roast'===d&&(!f.items.length||!(0,u.isSundayIn)(T)))return(0,j.jsx)(R,{size:i});if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const M='m'===i?20:17,E='roast'!==d,B=E&&f.items.some(e=>(k[e.key]??0)>0),H=B?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==i&&!B;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${E&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,i=p[t.key]??0,d=Math.max(0,n-i),h=d<=0,m=h||f.isLow(t.key),b=E?k[t.key]??0:0,x=h?y.colours.red:E&&'display'!==r?y.colours.shellfishFree:m&&!E?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:B?4:6,paddingHorizontal:B?5:9,paddingVertical:3,flexShrink:0,minWidth:B?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,M-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:M-2}),(0,j.jsx)(c.T,{size:M,weight:"bold",colour:x,style:{lineHeight:M+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(l.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:z,minWidth:z,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):B?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:z,width:z,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,H)})`})}):null,!F||!(i||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':i?`${(0,u.fmtStockCount)(e,t,i)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),i=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),l=(0,f.reservedBookingsOn)(r,i,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(i))}),l.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}function R({size:e}){return(0,j.jsxs)(a.default,{testID:"roast-slot",accessible:!0,accessibilityLabel:"Sunday roast count: shown on Sundays",style:{minHeight:44,minWidth:'xs'===e?64:84,paddingHorizontal:10,borderRadius:12,borderWidth:1,borderColor:y.colours.hairline,backgroundColor:'rgba(255,255,255,0.03)',flexDirection:'row',alignItems:'center',justifyContent:'center',gap:6},children:[(0,j.jsx)(c.T,{size:'m'===e?14:12,colour:y.colours.muted,children:"Roast"}),(0,j.jsx)(c.T,{size:'m'===e?18:16,weight:"bold",colour:y.colours.muted,children:"\u2013"})]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); +__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:l,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(i.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),l?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:l}):null]}):null,n||w.length||!l?null:(0,j.jsx)(i.default,{accessibilityRole:"button",onPress:l,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:l?()=>{k(!1),l()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const l=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!l.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${l.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,l.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:l.items.map((t,s)=>{const o=l.counts[t.key]??0,i=d[t.key]??0,h=Math.max(0,o-i),m=h<=0,b=m||l.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:i?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,i)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return M}}),_e.ShellfishChip=z,_e.SundayRoastChip=function(e){return(0,j.jsx)(z,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),l=e(_r(_d[5])),i=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(l.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:l,group:i}){const d=(0,h.useShellfish)(e,s,r,i),m='roast'===i,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const l=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,l,o):Math.max(0,Math.min(99,l+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),M=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),z=(0,o.useRef)(null);z.current||(z.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!z.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,F]=(0,o.useState)(0),H=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?M:D>0,P=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!H.length)return;const e=setInterval(()=>F(e=>e+1),600);return()=>clearInterval(e)},[R.state,H.length]);const W=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void P('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?P('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?P('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-W.current>2e4&&P('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||H.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||H.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${H.length} ${1===H.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&M&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),W.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!M,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),l?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:l}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const M=18;function z({rid:e,by:t,app:r,size:l="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const z='m'===l?20:17,R='roast'!==d,E=R&&f.items.some(e=>(k[e.key]??0)>0),B=E?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==l&&!E;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${R&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,l=p[t.key]??0,d=Math.max(0,n-l),h=d<=0,m=h||f.isLow(t.key),b=R?k[t.key]??0:0,x=h?y.colours.red:R&&'display'!==r?y.colours.shellfishFree:m&&!R?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:E?4:6,paddingHorizontal:E?5:9,paddingVertical:3,flexShrink:0,minWidth:E?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,z-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:z-2}),(0,j.jsx)(c.T,{size:z,weight:"bold",colour:x,style:{lineHeight:z+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(i.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:M,minWidth:M,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):E?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:M,width:M,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,B)})`})}):null,!F||!(l||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':l?`${(0,u.fmtStockCount)(e,t,l)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),l=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),i=(0,f.reservedBookingsOn)(r,l,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(l))}),i.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"look",{enumerable:!0,get:function(){return n}}),r(d[0]);var o=r(d[1]);const b=o=>o,n={panel:{backgroundColor:'#121110',borderRadius:o.radii.xl,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',boxShadow:'0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 28px rgba(0,0,0,0.45)'},quiet:(b,n="gold")=>({minHeight:o.control.tall,borderRadius:o.radii.button,borderWidth:1,borderColor:'blue'===n?'rgba(226,196,137,0.55)':'rgba(207,164,95,0.38)',backgroundColor:b?'rgba(207,164,95,0.16)':'blue'===n?'rgba(226,196,137,0.10)':'rgba(255,255,255,0.035)',paddingHorizontal:14,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:8,boxShadow:'0 1px 0 rgba(255,255,255,0.05) inset',transition:'background-color 120ms ease'}),primary:o=>({backgroundColor:o?'#B8904F':'#CFA45F',borderWidth:1,borderColor:'rgba(255,226,170,0.55)',backgroundImage:o?'linear-gradient(180deg, #BE9552 0%, #A88143 100%)':'linear-gradient(180deg, #E0BA77 0%, #C69A55 100%)',boxShadow:o?'0 2px 8px rgba(0,0,0,0.4)':'0 1px 0 rgba(255,255,255,0.28) inset, 0 10px 24px rgba(207,164,95,0.22), 0 4px 10px rgba(0,0,0,0.45)',transition:'box-shadow 120ms ease'}),onPrimary:'#17130D',web:b}},1168,[219,811]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STOCK_ICON_IMAGES",{enumerable:!0,get:function(){return A}});const A={'\ud83e\udd9e':{uri:'data:image/png;base64,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',w:47,h:64},'\ud83e\udd80':{uri:'data:image/png;base64,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',w:64,h:45}}},1169,[]); __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.StockScreen=function({initial:e="levels"}){const[t,i]=(0,l.useState)(e);return(0,y.jsxs)(r.default,{style:{gap:12},children:[(0,y.jsx)(p.Seg,{value:t,onChange:i,options:[{id:'levels',label:'Stock levels'},{id:'take',label:'Stock take'},{id:'deliveries',label:'Deliveries in'}]}),'levels'===t?(0,y.jsx)(j,{}):'take'===t?(0,y.jsx)(f,{}):(0,y.jsx)(v,{})]})};var t=_r(_d[0]),i=_r(_d[1]),n=_r(_d[2]),s=_r(_d[3]),l=_r(_d[4]),d=e(_r(_d[5])),r=e(_r(_d[6])),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]);function j(){const{k:e,rid:t}=(0,p.useChef)(),d=(0,c.useOwner)(e=>e.suppliers),b=(0,i.useSheets)(t),[x,j]=(0,l.useState)('all'),f=e.ingredients.filter(e=>e.onHand<=0),v=e.ingredients.filter(e=>(0,p.isLow)(e.onHand,e.par)),k='alerts'===x?[...f,...v]:e.ingredients,S=[...new Set(k.map(e=>e.supplierId))].map(e=>{const t=d.find(t=>t.id===e),i=b.find(t=>t.id===e);return{id:e,name:t?.name||i?.name||'Supplier not linked',category:t?.category||i?.goods||'Stock'}});return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsxs)(o.Row,{wrap:!0,gap:10,children:[(0,y.jsx)(p.Tile,{label:"Stock value (at cost)",value:(0,u.gbp)((0,p.stockValue)(e.ingredients)),sub:`${e.ingredients.length} ingredients`}),(0,y.jsx)(p.Tile,{label:"Low or out",value:`${v.length+f.length}`,sub:`${f.length} out \xb7 ${v.length} below half par`,tone:f.length?'red':v.length?'amber':'ok',onPress:()=>j('alerts')})]}),f.length?(0,y.jsxs)(o.Banner,{kind:"danger",title:"Out of stock",children:[f.map(e=>e.name).join(', '),". Mark the dishes that need it as sold out (Kitchen \u203a Live tickets \u203a Sold out), or order now."]}):null,(0,y.jsx)(p.Seg,{value:x,onChange:j,options:[{id:'all',label:'All'},{id:'alerts',label:'Alerts only'}]}),e.ingredients.length?null:(0,y.jsx)(o.Muted,{children:"No stock items yet. Add your real ingredients to start counting."}),S.map(e=>(0,y.jsxs)(o.Card,{children:[(0,y.jsxs)(o.T,{weight:"semibold",children:[e.category," \xb7 ",e.name]}),k.filter(t=>t.supplierId===e.id).map(e=>{const i=e.onHand<=0?'out':(0,p.isLow)(e.onHand,e.par)?'low':'ok';return(0,y.jsxs)(r.default,{style:{gap:4,paddingVertical:4},accessible:!0,accessibilityLabel:`${e.name} ${(0,n.ingredientSpeech)(t,e,e.onHand)} of par ${(0,n.ingredientSpeech)(t,e,e.par)}`,children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},children:e.name}),'out'===i?(0,y.jsx)(o.Badge,{kind:"red",label:"OUT"}):'low'===i?(0,y.jsx)(o.Badge,{kind:"amber",label:"LOW"}):null,(0,y.jsxs)(o.T,{size:13,colour:h.colours.muted,children:[(0,n.ingredientQty)(t,e,e.onHand)," / par ",(0,n.ingredientQty)(t,e,e.par)]})]}),(0,y.jsx)(p.Bar,{pct:e.onHand/e.par*100,colour:'out'===i?h.colours.red:'low'===i?h.colours.amber:h.colours.gold}),(0,y.jsxs)(o.Muted,{children:[(0,u.gbp)(Math.round((0,s.displayedCost)(t,e,e.cost)))," per ",(0,s.quantityUnit)(t,e)," \xb7 value ",(0,u.gbp)(Math.round(e.onHand*e.cost))]})]},e.id)})]},e.id))]})}function f(){const{k:e,me:i,rid:d}=(0,p.useChef)(),c=(0,b.useKitchen)(e=>e.saveStockTake),[x,j]=(0,l.useState)({}),[f,v]=(0,l.useState)(''),k=e.ingredients.map(e=>{const t=x[e.id],i=void 0===t||''===t?void 0:Number(t.replace(',','.')),n=void 0!==i&&Number.isFinite(i)&&i>=0&&(!(0,s.fishInStone)(d,e)||2*i===Math.round(2*i))?(0,s.inputQuantity)(d,e,i):void 0,l=void 0===n||Number.isNaN(n)?void 0:n-e.onHand;return{i:e,counted:n,variance:l,cost:void 0===l?0:Math.round(l*e.cost)}}),S=k.filter(e=>void 0!==e.variance),w=S.reduce((e,t)=>e+t.cost,0);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Count what's on the shelves. Expected = last count + deliveries \u2212 waste. Fish is entered in stone, in half-stone steps. Variance shows what's unexplained (portioning, theft, missed waste)."}),e.stockTakes[0]?(0,y.jsxs)(o.Muted,{children:["Last stock take ",new Date(e.stockTakes[0].at).toLocaleDateString('en-GB')," by ",e.stockTakes[0].by,": variance ",(0,u.gbp)(Math.round(e.stockTakes[0].lines.reduce((e,t)=>e+(t.counted-t.expected)*t.cost,0))),"."]}):null,(0,y.jsx)(o.Card,{children:k.map(({i:e,variance:i,cost:l})=>(0,y.jsxs)(r.default,{style:{gap:6,paddingVertical:8},children:[(0,y.jsxs)(r.default,{accessible:!0,accessibilityLabel:`${e.name}, expected ${(0,n.ingredientSpeech)(d,e,e.onHand)}`,children:[(0,y.jsx)(o.T,{size:16,children:e.name}),(0,y.jsxs)(o.Muted,{children:["Expected ",(0,n.ingredientQty)(d,e,e.onHand)]})]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,y.jsx)(t.TextInput,{accessibilityLabel:`Count ${e.name} in ${(0,s.quantityUnit)(d,e)}`,accessibilityValue:{text:x[e.id]?(0,n.ingredientSpeech)(d,e,(0,s.inputQuantity)(d,e,Number(x[e.id]))):'Not counted'},keyboardType:"decimal-pad",placeholder:(0,s.quantityUnit)(d,e),placeholderTextColor:h.colours.muted,value:x[e.id]??'',onChangeText:t=>j(i=>({...i,[e.id]:t})),style:{minHeight:44,width:80,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:8,paddingVertical:6,color:h.colours.text,textAlign:'right'}}),(0,s.fishInStone)(d,e)?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Half a stone less ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String(Math.max(0,(0,s.halfStone)(Number(t[e.id])||0)-.5))}))}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Half a stone more ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String((0,s.halfStone)(Number(t[e.id])||0)+.5)}))})]}):null,(0,y.jsx)(r.default,{style:{minWidth:86,alignItems:'flex-end'},accessible:!0,accessibilityLabel:void 0===i?'No variance yet':`${(0,n.ingredientSpeech)(d,e,i)} variance, ${(0,u.gbp)(l)}`,children:void 0===i?(0,y.jsx)(o.Muted,{children:"\u2014"}):(0,y.jsxs)(o.T,{size:14,colour:Math.abs(i)<.001?h.colours.ok:i<0?h.colours.red:h.colours.amber,children:[i>0?'+':'',(0,n.ingredientQty)(d,e,i),'\n',(0,u.gbp)(l)]})})]})]},e.id))}),(0,y.jsxs)(o.Banner,{kind:w<0?'warn':'info',title:`Variance so far: ${(0,u.gbp)(w)}`,children:[S.length," of ",e.ingredients.length," counted."]}),(0,y.jsx)(o.Button,{label:"Save stock take",disabled:!S.length,onPress:()=>{const e={};S.forEach(t=>{e[t.i.id]=t.counted}),c(e,i),j({}),v(`Saved: ${S.length} items, variance ${(0,u.gbp)(w)}. Stock levels updated.`)}}),f?(0,y.jsx)(o.Banner,{kind:"success",title:"Stock take saved",children:f}):null]})}function v(){const{k:e,me:t}=(0,p.useChef)(),i=(0,c.useOwner)(e=>e.suppliers),[n,s]=(0,l.useState)(e.deliveries.find(e=>'expected'===e.status)?.id??null);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Check each delivery against the order: count it in, check the invoice price, flag shorts and price changes. Accepting adds it to stock and updates costs (and GP)."}),e.deliveries.map(e=>{const l=i.find(t=>t.id===e.supplierId);return(0,y.jsxs)(o.Card,{highlight:n===e.id?h.colours.gold:void 0,children:[(0,y.jsx)(d.default,{accessibilityRole:"button",accessibilityLabel:`Delivery from ${l?.name}`,onPress:()=>s(n===e.id?null:e.id),children:(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(o.T,{weight:"semibold",children:l?.name??'Supplier'}),(0,y.jsx)(o.Muted,{children:'expected'===e.status?`Due ${e.due} \xb7 ${e.lines.length} lines`:`Accepted by ${e.checkedBy} ${e.at?new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`})]}),(0,y.jsx)(o.Badge,{kind:'expected'===e.status?'amber':'ok',label:'expected'===e.status?'TO CHECK':'ACCEPTED'})]})}),n===e.id?(0,y.jsx)(k,{id:e.id,me:t}):null]},e.id)})]})}function k({id:e,me:i}){const{k:d,rid:c}=(0,p.useChef)(),b=d.deliveries.find(t=>t.id===e),[j,f]=(0,l.useState)(b.lines.map(e=>({...e}))),v=(e,t)=>f(i=>i.map(i=>i.ing===e?{...i,...t}:i)),k='expected'!==b.status,S=(0,l.useMemo)(()=>j.map(e=>{const t=d.ingredients.find(t=>t.id===e.ing),i=e.receivede.short>0),$=S.filter(e=>Math.abs(e.pct)>=.5),C=j.reduce((e,t)=>e+t.received*t.price,0);return(0,y.jsxs)(r.default,{style:{gap:8,marginTop:8},children:[S.map(({l:e,i:i,short:l,pct:d})=>(0,y.jsxs)(r.default,{style:{gap:4,borderTopWidth:1,borderColor:h.colours.border,paddingTop:6},children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},weight:"medium",children:i.name}),l?(0,y.jsx)(o.Badge,{kind:"red",label:`SHORT ${(0,n.ingredientQty)(c,i,l)}`}):null,Math.abs(d)>=.5?(0,y.jsx)(o.Badge,{kind:"amber",label:`PRICE ${d>0?'+':''}${d.toFixed(0)}%`}):null]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,y.jsxs)(o.Muted,{children:["Ordered ",(0,n.ingredientQty)(c,i,e.ordered)]}),(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Received (",(0,s.quantityUnit)(c,i),")"]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Received ${i.name} in ${(0,s.quantityUnit)(c,i)}`,accessibilityValue:{text:(0,n.ingredientSpeech)(c,i,e.received)},keyboardType:"decimal-pad",value:String((0,s.fishInStone)(c,i)?(0,s.halfStone)((0,s.toStone)(e.received,i.unit)):e.received),onChangeText:t=>v(e.ing,{received:(0,s.inputQuantity)(c,i,Number(t.replace(',','.'))||0)}),style:{minHeight:44,width:60,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]}),(0,s.fishInStone)(c,i)&&!k?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Receive half a stone less ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,-1)})}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Receive half a stone more ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,1)})})]}):null,(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Invoice \xa3/",(0,s.quantityUnit)(c,i)]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Invoice price ${i.name}`,keyboardType:"decimal-pad",inputMode:"decimal",value:((0,s.displayedCost)(c,i,e.price)/100).toFixed(2),onChangeText:t=>v(e.ing,{price:100*((0,x.parseMoneyInput)(t)??0)/((0,s.fishInStone)(c,i)?(0,s.fromStone)(1,i.unit):1)}),style:{minHeight:44,width:70,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]})]}),(0,y.jsxs)(o.Muted,{children:["Last cost ",(0,u.gbp)(Math.round((0,s.displayedCost)(c,i,i.cost)))," per ",(0,s.quantityUnit)(c,i)]})]},e.ing)),(0,y.jsxs)(o.T,{weight:"semibold",children:["Invoice total ",(0,u.gbp)(Math.round(C))]}),w.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Shorts to chase",children:[w.map(e=>`${e.i.name}: ${(0,n.ingredientQty)(c,e.i,e.short)} short`).join(' \xb7 '),". Ask the supplier for a credit note."]}):null,$.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Price changes",children:[$.map(e=>`${e.i.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%`).join(' \xb7 '),". Check GP \u203a Price changes once accepted."]}):null,k?(0,y.jsx)(o.Muted,{children:b.note?`Noted: ${b.note}.`:'No issues noted.'}):(0,y.jsx)(o.Button,{label:"Accept delivery into stock",testID:"accept-delivery",onPress:()=>d.acceptDelivery(e,j,i,[w.length?`${w.length} short`:'',$.length?`${$.length} price changes`:''].filter(Boolean).join(', '))})]})}},1170,[812,998,1148,943,17,385,85,777,876,851,804,1140,1000,840,8]); @@ -1413,7 +1413,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}},1330,[812,843,17,85,777,845,851,1150,1331,858,804,8]); __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})},1331,[892,946,1150]); __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]})}},1332,[13,17,856,1333,1407,8]); -__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'center'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1333,[1051,779,805,806,1334,813,1335,1092,843,1137,1336,1337,1338,1089,1118,1339,1340,1345,1346,1205,1347,856,1352,1353,1354,1111,1110,966,1355,1149,938,1102,1356,17,1070,1181,1016,1085,1357,1209,1359,378,363,385,278,85,409,19,777,1233,1237,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1360,1106,1361,1368,1370,1373,1378,1372,1379,1382,1383,1113,1093,1094,862,1388,1222,1389,1232,1224,993,1394,1399,1400,1052,1050,1115,1402,1403,1404,1069,1168,1405,1167,1158,853,1348,1406,8]); +__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'flex-start'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{testID:"display-header-time",style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1333,[1051,779,805,806,1334,813,1335,1092,843,1137,1336,1337,1338,1089,1118,1339,1340,1345,1346,1205,1347,856,1352,1353,1354,1111,1110,966,1355,1149,938,1102,1356,17,1070,1181,1016,1085,1357,1209,1359,378,363,385,278,85,409,19,777,1233,1237,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1360,1106,1361,1368,1370,1373,1378,1372,1379,1382,1383,1113,1093,1094,862,1388,1222,1389,1232,1224,993,1394,1399,1400,1052,1050,1115,1402,1403,1404,1069,1168,1405,1167,1158,853,1348,1406,8]); __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},1336,[]); @@ -1480,7 +1480,7 @@ __d(function(g,r,i,_a,m,e,_d){"use strict";function t(t,o){if(t.title.trim().len __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STEP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"addDays",{enumerable:!0,get:function(){return u}}),_e.fmt12=i,_e.rangeText=c,_e.openWindow=function(r,o){const a=(0,e.kitchenHoursOn)(r,(0,t.parseYmd)(o));if(!a)return null;let s=(0,t.toMins)(a[1]);for(const e of(0,n.regularEventsOf)(r))(0,n.occursOn)(e,o)&&e.time&&(s=Math.max(s,Math.min(1425,(0,t.toMins)(e.time)+180)));return{from:(0,t.toMins)(a[0]),to:s}},_e.servicesOn=l,_e.serviceOf=function(e,n,r,o){const a=l(e,n,o),s=(0,t.toMins)(r);return a.lunch&&s>=a.lunch.from&&s=a.dinner.from&&s=a.dinner.to?'dinner':a.lunch&&s=e?n:e);if('none'===r.kind||!o||o=h)break}return s},_e.repeatText=function(e,t){if('none'===e.kind)return;const n=t?` until ${p(t)}`:'';return'weekly'===e.kind?`Every ${[...e.days].sort().map(e=>a[e]).join(', ')}${n}`:`Last ${o[e.weekday]} of the month${n}`},Object.defineProperty(_e,"longDate",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"monthLabel",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"scopeText",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"whatText",{enumerable:!0,get:function(){return M}}),_e.confirmLine=function(e){const t=e.dates.length?1===e.dates.length?e.dates[0]===e.today?'today':p(e.dates[0]):e.repeat?`on ${e.dates.length} dates (${e.repeat})`:`${p(e.dates[0])} to ${p(e.dates[e.dates.length-1])}`:'no dates';return`Block ${c(e.from,e.to,e.wholeDay)} ${t}, ${y(e)}`},_e.bookingsInWindow=function(e,n,r,o,a,s){const u=new Set(n),i=(0,t.toMins)(r),c=(0,t.toMins)(o);return e.filter(e=>{if(!u.has(e.date)||!['confirmed','pending','seated'].includes(e.status))return!1;const n=(0,t.toMins)(e.time);if(n=c)return!1;const r=(e.table??'').split(/[^A-Za-z0-9]+/).filter(Boolean);return a.tables?.length?r.some(e=>a.tables.includes(e)):!a.areaId||r.some(e=>s?.(e)===a.areaId)})},_e.groupByMonth=function(e,n,r,o){const a=e.filter(e=>e.rid===n&&!e.removedAt&&(e.date>r||e.date===r&&(0,t.toMins)(e.to)>(0,t.toMins)(o))).sort((e,n)=>e.date===n.date?(0,t.toMins)(e.from)-(0,t.toMins)(n.from):e.date{const r=(0,t.parseYmd)(e);return r.setDate(r.getDate()+n),(0,t.ymd)(r)};function i(e){const n=(0,t.toMins)(e),r=Math.floor(n/60)%24;return`${r%12==0?12:r%12}:${String(n%60).padStart(2,'0')}${r<12?'am':'pm'}`}function c(e,t,n){if(n)return'all day';const r=i(e),o=i(t);return r.slice(-2)===o.slice(-2)?`${r.slice(0,-2)}\u2013${o}`:`${r}\u2013${o}`}function l(n,r,o){const a=(0,e.kitchenHoursOn)(n,(0,t.parseYmd)(r));if(!a)return{lunch:null,dinner:null};const s=(0,t.toMins)(a[0]),u=(0,t.toMins)(a[1]),i=1020,c=(e,n)=>{if(!e)return n;const r=Math.max(s,(0,t.toMins)(e[0])),o=Math.min(u,(0,t.toMins)(e[1]));return o>r?{from:r,to:o}:null};return{lunch:c(o?.lunch,si?{from:Math.max(i,s),to:u}:null)}}const d=e=>Math.ceil(e/r)*r;function f(e,t){const n=[];let r=e;for(;r<=t&&n.length<366;)n.push(r),r=u(r,1);return n}const m=(e,n)=>{const r=(0,t.parseYmd)(e);if(r.getDay()!==n)return!1;const o=new Date(r);return o.setDate(r.getDate()+7),o.getMonth()!==r.getMonth()},h=104;const p=e=>{const n=(0,t.parseYmd)(e);return`${o[n.getDay()]} ${n.getDate()} ${s[n.getMonth()]}`},g=e=>{const n=(0,t.parseYmd)(e);return`${s[n.getMonth()]} ${n.getFullYear()}`},y=e=>e.tables?.length?`table${e.tables.length>1?'s':''} ${e.tables.join(', ')}`:e.areaId?e.areaName??'one area':'all areas',M=e=>{const t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)}},1397,[862,863,861]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"wixBlockPushOn",{enumerable:!0,get:function(){return o}}),e.pushBlocksToWix=function(t,n,c){if(!o(t)||!n.length)return;const l=u.useSync.getState();if(!l.venueId||'guest'===l.kind)return;setTimeout(()=>{(0,s.getSupabase)().functions.invoke('wix-blocks-push',{body:{venue_id:l.venueId,block_ids:n.slice(0,120),action:c}}).catch(()=>{})},4e3)},Object.defineProperty(e,"websiteBlockStatus",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),u=r(d[3]);const o=s=>!t.IS_ISOLATED_VENUE&&!['souters','kirkmichael','wildings'].includes(s)&&!!n.useFloor.getState().settings[s]?.wixBlockPushOn;const c=t=>(t??'awaiting venue sync').replace(/\bWix\b/gi,'Website bookings')},1398,[805,996,892,946]); __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,"DAY_GRAPH_CHROME",{enumerable:!0,get:function(){return j}}),_e.DayGraph=function({todays:e,open:j,close:T,now:b,turnBase:v,blocks:w=[],height:M=150,forecastNote:k,emptyText:D,past:L,closed:I,compact:$=!1,dense:C=!1,bare:A=!1,fill:z=!1,fit:O=!1,tight:_=!1,live:H=!1,onChrome:S}){const[F,P]=(0,t.useState)(0),[E,R]=(0,t.useState)(0),[N,B]=(0,t.useState)(0),[W,X]=(0,t.useState)(0);s.default.useEffect(()=>{S&&O&&W&&S(Math.ceil((A?4:C?2:10)+N+W+(A?2:6)+2))},[S,O,N,W,A,C]);const U=j.getTime()-18e5,G=T.getTime()+36e5,Y=(0,t.useMemo)(()=>(0,f.coverCurve)(e,new Date(U),new Date(G),v),[e,U,G,v]),V=60*j.getHours()+j.getMinutes(),K=60*T.getHours()+T.getMinutes(),Z=(0,t.useMemo)(()=>(0,p.chartBands)(w,V,K),[w,V,K]),q=new Date(j);q.setHours(0,0,0,0);const J=e=>q.getTime()+6e4*e,Q=Math.max(8,...Y.map(e=>e.covers)),ee=Y.reduce((e,t)=>!t.covers||(0,p.minuteInsideVenueBlock)(60*new Date(t.t).getHours()+new Date(t.t).getMinutes(),Z)?e:!e||t.covers>e.covers?{t:t.t,covers:t.covers}:e,null),te=O&&E?Math.max(24,Math.floor(E)):Math.max(48,M-m.AXIS_BAND),se=m.CHART_PAD_L,ie=m.CHART_PAD_R,oe=C?18:22,ne=Math.max(10,F-se-ie),le=Math.max(10,te-oe-14),re=e=>se+(e-U)/(G-U)*ne,ae=e=>oe+le-e/(1.15*Q)*le,he=(0,m.yTicks)(Q),de=(0,m.fitYTicks)(he,ae,te,13),ue=(0,m.nowLineVisible)({now:b,open:j,close:T,live:H,past:L,closed:I}),ce=b.getTime(),ge=ue&&Y.length?(0,m.splitCurve)(Y,ce):{before:Y,after:[]},xe=e=>e.map((e,t)=>`${t?'L':'M'}${re(e.t).toFixed(1)},${ae(e.covers).toFixed(1)}`).join(' '),me=[];for(let e=new Date(U);e.getTime()<=G;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=U&&t.getTime()<=G&&me.push(t.getTime())}const pe=H?(0,m.seatedNowCovers)(e,e[0]?.date??''):0,fe=Math.min(G,Math.max(U,b.getTime())),ye=I?null:H?{t:fe,covers:pe,text:(0,m.seatedNowText)(pe)}:ee,je=F?(0,m.layoutChart)({width:F,height:te,t0:U,t1:G,hours:me,busiest:ye}):{hours:[],busiest:null},Te=xe(Y),be=ue?xe(ge.before):Te,ve=ue?xe(ge.after):'',we=z&&Te&&Y.length>1?`${Te} L${re(Y[Y.length-1].t).toFixed(1)},${ae(0).toFixed(1)} L${re(Y[0].t).toFixed(1)},${ae(0).toFixed(1)} Z`:'',Me=(0,i.coversFour)(e,e[0]?.date??''),ke=`Total ${Me.total} ${1===Me.total?'Cover':'Covers'}`,De=e.filter(e=>!['cancelled','noshow'].includes(e.status)).length,Le=je.busiest?.text??(I?'':H?(0,m.seatedNowText)(pe):ee?(0,m.busiestText)(ee.t,ee.covers):''),Ie=Z.map(e=>e.spoken).join('. '),$e=ue&&T.getTime()>j.getTime()?Math.max(0,Math.min(100,Math.round((ce-j.getTime())/(T.getTime()-j.getTime())*100))):null,Ce=!I&&ee&&ee.covers?(0,m.peakOccupancyText)(ee.t,ee.covers):'',Ae=`Covers through the day. Open ${(0,u.hm)(j)}. Close ${(0,u.hm)(T)}.${Ce?` ${Ce}.`:''}${Le?` ${Le}.`:''}${ue?` It is ${(0,u.hm)(b)}. About ${$e} percent of the way through the day.`:''}${Ie?` ${Ie}.`:''}`,ze=(0,u.hm)(b),Oe=Math.max(44,12*ze.length*.7+16),He=Math.max(se+2,Math.min(Math.max(0,F-ie-Oe),re(ce)-Oe/2)),Se=Math.max(2,Math.min(te-22,oe+le-22)),Fe=s.default.useId().replace(/:/g,'');return(0,y.jsxs)(o.default,{testID:"day-graph",style:[d.look.panel,O?{flex:1,minHeight:0}:null,{overflow:'visible',paddingTop:A?4:C?2:10,paddingBottom:A?2:6,backgroundColor:c.colours.bg}],children:[(0,y.jsxs)(o.default,{testID:"day-graph-head",onLayout:e=>B(e.nativeEvent.layout.height),children:[A?null:$?(0,y.jsxs)(o.default,{style:{alignItems:'center',gap:4,paddingHorizontal:14},children:[(0,y.jsx)(h.T,{center:!0,size:18,weight:"semibold",children:"Covers through the day"}),(0,y.jsx)(h.T,{center:!0,size:14,colour:c.colours.muted,testID:"day-graph-parties",children:ke}),Ce?(0,y.jsx)(h.T,{center:!0,size:13,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,children:Ce}):null]}):(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8},children:[(0,y.jsx)(h.T,{size:C?14:15,weight:"semibold",style:{flexShrink:1},children:"Covers through the day"}),(0,y.jsx)(h.T,{size:12,colour:c.colours.muted,testID:"day-graph-parties",children:ke})]}),A||_?null:I?k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:2,children:k}):null:(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8,paddingTop:2},children:[(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Open ",(0,u.hm)(j)]}),Ce&&!$?(0,y.jsx)(h.T,{size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,center:!0,style:{flex:1,minWidth:0},children:Ce}):k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",numberOfLines:1,style:{flex:1,textAlign:'center'},children:k}):(0,y.jsx)(o.default,{style:{flex:1}}),(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Close ",(0,u.hm)(T)]})]}),A||_||$||!k||!Ce?null:(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:1,style:{paddingHorizontal:14},children:k}),A||!_||!Ce||$?null:(0,y.jsx)(h.T,{center:!0,size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,style:{paddingHorizontal:14},children:Ce})]}),(0,y.jsxs)(o.default,{testID:"day-graph-plot",accessible:!0,accessibilityLabel:Ae,onLayout:e=>{P(e.nativeEvent.layout.width),O&&R(e.nativeEvent.layout.height)},style:O?{flexGrow:1,flexShrink:1,flexBasis:Math.max(48,M-m.AXIS_BAND),minHeight:24,overflow:'hidden',position:'relative'}:{height:te,minHeight:te,position:'relative',overflow:'hidden'},children:[F?(0,y.jsxs)(l.default,{width:F,height:te,children:[(0,y.jsxs)(n.Defs,{children:[(0,y.jsxs)(n.Pattern,{id:`${Fe}-venue`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"1.4"})]}),(0,y.jsxs)(n.Pattern,{id:`${Fe}-area`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622",fillOpacity:"0.35"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"0.8"})]})]}),Z.map((e,t)=>(0,y.jsx)(n.Rect,{x:re(J(e.fromMin)),y:oe,width:Math.max(3,re(J(e.toMin))-re(J(e.fromMin))),height:le,fill:`url(#${Fe}-${e.strength})`},`${e.fromMin}-${t}`)),he.map(e=>(0,y.jsx)(n.Line,{x1:se,x2:se+ne,y1:ae(e),y2:ae(e),stroke:c.colours.muted,strokeWidth:1,opacity:.28},`grid-${e}`)),ue?(0,y.jsx)(n.Rect,{testID:"day-graph-elapsed",x:re(j.getTime()),y:oe,width:Math.max(0,re(ce)-re(j.getTime())),height:le,fill:c.colours.gold,opacity:.12}):null,we?(0,y.jsx)(n.Path,{d:we,fill:"#3A2F1E",stroke:"none"}):null,be?(0,y.jsx)(n.Path,{d:be,stroke:c.colours.gold,strokeWidth:2.5,fill:"none"}):null,ve?(0,y.jsx)(n.Path,{d:ve,stroke:c.colours.gold,strokeWidth:2.5,fill:"none",opacity:.38}):null,I?null:[j,T].map((e,t)=>(0,y.jsx)(n.Line,{x1:re(e.getTime()),x2:re(e.getTime()),y1:oe,y2:oe+le,stroke:c.colours.goldLight,strokeWidth:1.5,strokeDasharray:"4,4"},`service-${t}`)),ue?(0,y.jsx)(n.Line,{testID:"day-graph-now",x1:re(ce),x2:re(ce),y1:oe,y2:oe+le,stroke:c.colours.gold,strokeWidth:2}):null,je.busiest?(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:je.busiest.x+je.busiest.w/2,y:je.busiest.y+je.busiest.h-2,fill:c.colours.gold,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:je.busiest.text}):null,De?null:(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:se+ne/2,y:oe+le/2,fill:c.colours.muted,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:D??'No bookings yet today'})]}):null,F?de.map(e=>(0,y.jsx)(o.default,{testID:"day-graph-ytick",pointerEvents:"none",style:{position:'absolute',left:0,width:se-4,top:e.top,alignItems:'flex-end',justifyContent:'flex-start'},children:(0,y.jsx)(h.T,{size:e.font,numberOfLines:1,colour:c.colours.muted,style:{textAlign:'right'},children:String(e.value)})},`yt-${e.value}`)):null,F&&ue&&te>=m.YTICK_MIN_PLOT?(0,y.jsx)(o.default,{testID:"day-graph-now-label",pointerEvents:"none",style:{position:'absolute',left:He,top:Se,minWidth:Oe,height:20,paddingHorizontal:8,borderRadius:10,backgroundColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:12,weight:"semibold",colour:c.colours.bg,center:!0,numberOfLines:1,children:ze})}):null]}),(0,y.jsxs)(o.default,{testID:"day-graph-axis",onLayout:e=>X(e.nativeEvent.layout.height),style:{minHeight:m.AXIS_BAND,flexShrink:0,position:'relative',justifyContent:'center',paddingBottom:2},children:[(0,y.jsx)(o.default,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{opacity:0,alignSelf:'flex-start'},children:(0,y.jsx)(h.T,{size:m.AXIS_FONT,numberOfLines:1,children:"20"})}),je.hours.map(e=>{const t=Math.min(Math.max(e.w,40),Math.max(e.w,F)),s=e.x+e.w/2-t/2,i=Math.max(0,Math.min(Math.max(0,F-t),s));return(0,y.jsx)(o.default,{pointerEvents:"none",style:{position:'absolute',left:i,width:t,top:0,bottom:0,alignItems:i>s+.5?'flex-start':in.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1400,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.seasonClosedAreaIds=s,e.chartBands=function(t,a,c){const u=s(t,a,c),f=[];for(const s of t){if(s.removedAt)continue;if(s.areaId&&u.has(s.areaId))continue;if(s.areaId||s.tables?.length)continue;const t=s.wholeDay?0:n(s.from),l=s.wholeDay?1440:n(s.to);if(null==t||null==l)continue;const h=Math.max(t,a),M=Math.min(l,c);if(M<=h)continue;const m=o(s,h,M);f.push({fromMin:h,toMin:M,strength:m.strength,spoken:m.spoken})}f.sort((n,t)=>n.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1400,[]); __d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.coverCurve=function(s,c,n,a){const u=s.filter(t=>!['cancelled','noshow'].includes(t.status)).map(o=>{const s=(0,t.startOf)(o).getTime();return{s:s,e:s+6e4*(0,t.durOf)(o,a),n:o.partySize}}),f=[];for(let t=c.getTime();t<=n.getTime();t+=o)f.push({t:t,covers:u.reduce((o,s)=>t>=s.s&&tt.covers));if(!o)return[];const s=[];return t.forEach((c,n)=>{const a=t.slice(Math.max(0,n-3),n+4);c.covers<.6*o||c.coverst.covers))||s.some(t=>Math.abs(t.from-c.t)<36e5)||s.push({from:c.t,to:c.t,covers:c.covers})}),s.slice(0,3)},e.quietOf=function(t,o,s){const c=Math.max(0,...t.map(t=>t.covers)),n=Math.max(2,.25*c),a=[];let u=null;const f=t.filter(t=>t.t>=o&&t.t<=s);return f.forEach((t,o)=>{const s=t.covers<=n;s&&null===u&&(u=t.t);const c=o===f.length-1;if((!s||c)&&null!==u){const o=t.t;o-u>=18e5&&a.push({from:u,to:o}),u=null}}),a.sort((t,o)=>o.to-o.from-(t.to-t.from)).slice(0,3).sort((t,o)=>t.from-o.from)};var t=r(d[0]);const o=9e5},1401,[1074]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CANCEL_TINT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"CANCEL_BORDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"CANCEL_INK",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"CANCEL_MUTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"cancelWhen",{enumerable:!0,get:function(){return d}}),e.cancelledBy=u,e.cancelItem=b,e.cancellationsFor=function(n,t,o){return n.filter(n=>n.date===t&&('cancelled'===n.status||'noshow'===n.status)).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name)).map(n=>b(n,o(n)))},Object.defineProperty(e,"cancellationsHeading",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"cancellationsEmpty",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"cancellationsCounts",{enumerable:!0,get:function(){return f}});var n=r(_d[0]),t=r(_d[1]);const o=n=>n?n.split('+').map(n=>n.trim()).filter(Boolean):[],i='#17140F',a='#6B5A35',l='#F3E7CC',c='#B8AA8A',s={online:'Website',phone:'Phone','in-person':'In person','walk-in':'Walk-in',email:'Email','third-party':'Third party'},d=(n,t)=>{if(!n)return null;const o=new Date(n);if(Number.isNaN(o.getTime()))return null;const i=o.toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'});return o.toLocaleDateString('en-CA',{timeZone:'Europe/London'})===t?i:`${o.toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'Europe/London'})}, ${i}`};function u(n){const t=n;if('noshow'===n.status)return t.cancelled?.by?`Marked no-show by ${t.cancelled.by}`:'Marked no-show';if(t.cancelled?.by)return t.cancelled.by;const o=!!t.wix?.status&&/CANCEL|DECLIN/i.test(t.wix.status);return o&&t.wix?.archived?'Cancelled and archived in Website bookings':o?'Cancelled in Website bookings':(n.tags??[]).some(n=>n.endsWith(': deposit not paid'))||'PAYMENT_INFORMATION_PENDING'===t.wix?.status?'Website booking not finished (deposit not paid)':t.wix?.archived?'Archived in Website bookings':'Not recorded'}function b(i,a){const l=i,c=o(i.table??l.cancelled?.table??void 0),b=c.length?`Table ${(0,n.tableNumbers)(c.join('+'))}`:'No table',p=`${i.partySize} ${1===i.partySize?'person':'people'}`,h=d(l.cancelled?.at??(l.wix?l.wix.updatedDate:null),i.date),f=u(i),w=i.walkIn?'Walk-in':s[i.source??'']??(l.wix?'Website':'Not recorded'),y=(0,t.allergyLine)(i),C='noshow'===i.status,N=`${C?'No-show':'Cancelled'}: ${a}, ${y?`allergy noted: ${y}, `:''}${p}, was ${i.time}, ${b.toLowerCase()}. ${f}${h?` at ${h}`:''}.`;return{id:i.id,date:i.date,name:a,people:p,time:i.time,table:b,tables:c,walkIn:!!i.walkIn,by:f,when:h,source:w,notes:(i.notes??'').trim(),allergy:y,spoken:N,kind:C?'noshow':'cancelled'}}const p=n=>`Cancellations & no-shows ${n}`,h=(n="today")=>`No cancellations or no-shows ${n}.`,f=n=>{const t=n.filter(n=>'noshow'===n.kind).length,o=n.length-t;return`${o} ${1===o?'cancellation':'cancellations'} \xb7 ${t} ${1===t?'no-show':'no-shows'}`}},1402,[843,1380]); __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.CancellationsSection=function({items:e,dayWord:b="today",testID:y="display-cancellations"}){const[p,C]=(0,l.useState)(null),j=(0,s.cancellationsHeading)(e.length);return(0,u.jsxs)(o.default,{testID:y,style:{marginTop:14,borderRadius:12,backgroundColor:s.CANCEL_TINT,borderWidth:1,borderColor:s.CANCEL_BORDER,padding:10,gap:6},children:[(0,u.jsxs)(o.default,{accessible:!0,accessibilityRole:"header",accessibilityLabel:e.length?`${j}: ${(0,s.cancellationsCounts)(e)}. Not counted in Covers.`:`Cancellations and no-shows: none ${b}.`,style:{alignItems:'center',gap:2},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:c.colours.gold,center:!0,testID:"cancellations-head",children:j}),e.length?(0,u.jsx)(n.T,{size:14,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-counts",children:(0,s.cancellationsCounts)(e)}):null]}),e.length?e.map(e=>(0,u.jsxs)(t.default,{testID:`cancel-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.spoken,accessibilityHint:"Opens the details. Read only.",onPress:()=>C(e),dataSet:{centreExempt:'list-row'},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:'rgba(214,180,106,0.18)',backgroundColor:e?'#241F16':'transparent'}),children:[(0,u.jsxs)(o.default,{style:{flexDirection:'row',gap:10,alignItems:'flex-start'},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{width:58,textDecorationLine:'line-through'},children:e.time}),(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:e.name}),(0,u.jsx)(o.default,{testID:`cancel-kind-${e.id}`,style:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:'noshow'===e.kind?c.colours.amber:s.CANCEL_BORDER},children:(0,u.jsx)(n.T,{size:13,weight:"semibold",colour:'noshow'===e.kind?c.colours.amber:s.CANCEL_MUTED,children:'noshow'===e.kind?'No-show':'Cancelled'})}),e.allergy?(0,u.jsx)(o.default,{style:{paddingTop:1},children:(0,u.jsx)(h.AllergyIcon,{text:e.allergy,size:20,colour:"#D6A23A",ink:"#17140F",testID:`cancel-allergy-${e.id}`})}):null]}),(0,u.jsxs)(n.T,{size:15,colour:s.CANCEL_MUTED,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[e.people," \xb7 ",e.table," \xb7 ",e.by,e.when?` \xb7 ${e.when}`:'']})]},e.id)):(0,u.jsx)(n.T,{size:15,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-empty",children:(0,s.cancellationsEmpty)(b)}),p?(0,u.jsx)(x,{c:p,onClose:()=>C(null)}):null]})},_e.CancelDetail=x;var l=r(d[0]),t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]);function b({k:e,v:l}){return(0,u.jsxs)(o.default,{accessible:!0,accessibilityLabel:`${e}: ${l}`,style:{flexDirection:'row',gap:10,paddingVertical:6,borderBottomWidth:1,borderColor:c.colours.hairline},children:[(0,u.jsx)(n.T,{size:16,colour:c.colours.muted,style:{width:130},children:e}),(0,u.jsx)(n.T,{size:16,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l})]})}function x({c:e,onClose:l}){return(0,u.jsxs)(n.Sheet,{visible:!0,onClose:l,title:`${'noshow'===e.kind?'No-show':'Cancelled'} \xb7 ${e.name}`,maxWidth:560,testID:"cancel-detail",children:[(0,u.jsxs)(o.default,{testID:"cancel-detail-body",style:{gap:2},children:[(0,u.jsx)(b,{k:"Name",v:e.name}),(0,u.jsx)(b,{k:"Party",v:e.people}),e.allergy?(0,u.jsx)(b,{k:"Allergies",v:e.allergy}):null,(0,u.jsx)(b,{k:"Was booked for",v:`${e.date?`${new Date(`${e.date}T12:00:00`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})}, `:''}${e.time}`}),(0,u.jsx)(b,{k:"Table",v:e.table}),(0,u.jsx)(b,{k:'noshow'===e.kind?'No-show':'Cancelled by',v:e.by}),(0,u.jsx)(b,{k:"When",v:e.when??'Not recorded'}),(0,u.jsx)(b,{k:"Booked by",v:e.source}),(0,u.jsx)(b,{k:"Notes",v:e.notes||'None'})]}),(0,u.jsx)(n.T,{size:14,colour:c.colours.muted,center:!0,children:"Read only. Not counted in Covers. Phone numbers stay in the Managers app."})]})}},1403,[17,385,85,777,1402,804,1359,8]); diff --git a/car-app/index.html b/car-app/index.html index 7a9f106a28b66a47bdca41617d4e35f45989207c..d2c68d5e6d6de5b2c47aee9e6c6b1dd417ced969 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 5487ffcfb84b95651d533beefbbdbd3d9649dac3..8153df253a448017c9b62adadd0b3a7f9b027b4a 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 1a37b14d306d1fa867a51e45aad7effbf532d480..66d979ee257241f544c57075aa74e22100bbad31 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-a14bf94b42"; +const V = "cc-car-7a6edae160"; const BASE = "/car-app/"; -const PRECACHE = ["/car-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/car-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.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=a14bf94b42789b39548ba004bd002553c81d230bf77ca6b7d72efc6e24132b04"]; +const PRECACHE = ["/car-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/car-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.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=7a6edae16051da5c1671e01176a434f6f4f3eac2738797bbffe2b95e26445170"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/chef-app/_expo/static/js/web/bundle.js b/chef-app/_expo/static/js/web/bundle.js index d9a33a6a7e77014b9abc2c2e0d1bb276a588943c..31643e353359a62ce57d71eb591a96b319552f7a 100644 --- a/chef-app/_expo/static/js/web/bundle.js +++ b/chef-app/_expo/static/js/web/bundle.js @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__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.201'},979,[]); +__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.202'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1247,7 +1247,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,"FOH_ROLE_BADGES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"KITCHEN_ROLE_BADGES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ROLE_BADGES",{enumerable:!0,get:function(){return o}}),e.cleanBadge=c,Object.defineProperty(e,"isKitchenBadge",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isFohBadge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"badgeSpoken",{enumerable:!0,get:function(){return f}}),e.assignShiftBadge=b,e.assignKitchenShiftBadge=function(n,t,o){const s=String(o??'').trim();return s&&!u(s)?n:b(n,t,s?c(s):void 0)},e.applyLiveKitchenBadge=function(n,t,o){const s=String(o??'').trim();if(s&&!u(s))return n;const f=s?c(s):void 0;return n.map(n=>n.id===t?{...n,badge:f}:n)};const n=['Bar','Floor'],t=['Upstairs KP','Downstairs KP','Sauce','Larder'],o=[...n,...t];function c(n){const t=String(n??'').trim().toLowerCase();return o.find(n=>n.toLowerCase()===t)}const u=n=>{const o=c(n);return!!o&&t.includes(o)},s=t=>{const o=c(t);return!!o&&n.includes(o)},f=n=>c(n)?`, on ${c(n)}`:'';function b(n,t,o){const u=c(o);return n.map(n=>n.id===t?{...n,badge:u,changed:!!n.published||n.changed}:n)}},1164,[]); __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.useSuggestions=j,_e.OrdersScreen=function({focus:e}={}){const[s,t]=(0,n.useState)('sheets');return(0,x.jsxs)(l.default,{style:{gap:12},children:[(0,x.jsx)(y.Seg,{value:s,onChange:t,options:[{id:'sheets',label:'Order sheets'},{id:'suggested',label:'Suggested orders'},{id:'history',label:'Order history'}]}),'sheets'===s?(0,x.jsx)(m.OrderSheets,{focus:e}):'suggested'===s?(0,x.jsx)(w,{}):(0,x.jsx)($,{})]})};var s=r(_d[0]),t=r(_d[1]),n=r(_d[2]),i=e(r(_d[3])),l=e(r(_d[4])),d=r(_d[5]),o=r(_d[6]),u=r(_d[7]),c=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),f=r(_d[12]),m=r(_d[13]),x=r(_d[14]);const b=(e,s)=>'kg'===s?Math.ceil(2*e)/2:Math.ceil(e);function j(){const{k:e,now:s,rid:n}=(0,y.useChef)(6e4),{pct:i}=(0,y.useForecast)(),l=(0,u.supplierView)('chef',(0,o.useOwner)(e=>e.suppliers)).filter(e=>!e.archived),d=1+Math.max(0,i)/100;return l.map(i=>{const l=e.ingredients.filter(e=>e.supplierId===i.id).map(e=>({i:e,qty:(0,t.fishInStone)(n,e)?(0,t.fromStone)(Math.ceil(2*(0,t.toStone)(Math.max(0,e.par*d-e.onHand),e.unit))/2,e.unit):b(Math.max(0,e.par*d-e.onHand),e.unit)})).filter(e=>e.qty>0),o=(0,p.weekday)(s),u=i.orderDays.includes(o),[c,h]=(i.cutoff||'23:59').split(':').map(Number),y=new Date(s);y.setHours(c,h,0,0);const f=e.orders.some(e=>e.supplierId===i.id&&new Date(e.at).toDateString()===s.toDateString()),m=[1,2,3,4,5,6,7].map(e=>(o+e)%7).find(e=>i.orderDays.includes(e));return{s:i,lines:l,ordersToday:u,cutPassed:s>y,placedToday:f,nextDay:m,total:Math.round(l.reduce((e,s)=>e+s.qty*s.i.cost,0))}}).filter(e=>e.lines.length||e.ordersToday)}function w(){const{me:e,rid:o}=(0,y.useChef)(),{label:u,covers:m,enough:b,booked:w}=(0,y.useForecast)(),$=(0,f.useKitchen)(e=>e.addOrder),S=j(),[C,M]=(0,n.useState)({}),[O,k]=(0,n.useState)('');return(0,x.jsxs)(l.default,{style:{gap:10},children:[(0,x.jsxs)(d.Muted,{children:[b?`Built from par levels and today's forecast (${m} Covers, ${u} vs a typical day).`:`Built from par levels (no forecast yet: not enough history; ${w} Covers booked so far).`," Adjust, then call the supplier or use their ordering website. Nothing is sent by CoverCharge."]}),O?(0,x.jsx)(d.Banner,{kind:"success",title:"Saved to order history",children:O}):null,S.map(({s:n,lines:u,ordersToday:y,cutPassed:f,placedToday:m,nextDay:b,total:j})=>{const w=u.map(e=>({...e,q:C[`${n.id}:${e.i.id}`]??e.qty})),S=Math.round(w.reduce((e,s)=>e+s.q*s.i.cost,0)),O=s=>{$({supplierId:n.id,by:e,status:s,lines:w.filter(e=>e.q>0).map(e=>({ing:e.i.id,qty:e.q,cost:e.i.cost})),total:S}),k(`${n.name}: ${(0,c.gbp)(S)} (${s}).`)};return(0,x.jsxs)(d.Card,{highlight:!y||m||f?void 0:h.colours.gold,children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{weight:"semibold",children:n.name}),(0,x.jsxs)(d.Muted,{children:[n.category," \xb7 min order ",(0,c.gbp)(n.minOrder)]})]}),m?(0,x.jsx)(d.Badge,{kind:"ok",label:"ORDERED TODAY"}):y?(0,x.jsx)(d.Badge,{kind:f?'red':'amber',label:f?`CUT-OFF ${n.cutoff} PASSED`:`ORDER BY ${n.cutoff}`}):(0,x.jsx)(d.Badge,{label:`NEXT ${null!=b?p.DAY3[b].toUpperCase():'\u2014'}`})]}),w.length?w.map(e=>(0,x.jsxs)(d.Row,{wrap:!0,style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{size:14,children:e.i.name}),(0,x.jsxs)(d.Muted,{children:["On hand ",(0,s.ingredientQty)(o,e.i,e.i.onHand)," \xb7 par ",(0,s.ingredientQty)(o,e.i,e.i.par)]})]}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"Less",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone less':'Less'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,-1)}))}),(0,x.jsx)(l.default,{accessible:!0,accessibilityLabel:(0,s.ingredientSpeech)(o,e.i,e.q),children:(0,x.jsx)(d.T,{size:16,style:{minWidth:76,textAlign:'center'},children:(0,s.ingredientQty)(o,e.i,e.q)})}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"More",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone more':'More'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,1)}))})]},e.i.id)):(0,x.jsx)(d.Muted,{children:"Everything is at par."}),w.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(d.T,{weight:"semibold",children:["Estimated ",(0,c.gbp)(S)]}),S{i.default.openURL(`tel:${n.phones[0].replace(/\s/g,'')}`).catch(()=>{}),O('placed (by phone)')}}):null,n.website?(0,x.jsx)(d.Button,{small:!0,kind:"secondary",label:"Open website",onPress:()=>{i.default.openURL(n.website).catch(()=>{}),O('placed (on website)')}}):null]})]}):null,void 0]},n.id)})]})}function $(){const{k:e,rid:t}=(0,y.useChef)(),n=(0,o.useOwner)(e=>e.suppliers);return(0,x.jsx)(l.default,{style:{gap:8},children:e.orders.map(i=>(0,x.jsxs)(d.Card,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(d.T,{weight:"semibold",style:{flex:1},children:n.find(e=>e.id===i.supplierId)?.name}),(0,x.jsx)(d.Badge,{kind:"neutral",label:i.status.toUpperCase()})]}),(0,x.jsxs)(d.Muted,{children:[new Date(i.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",i.by,i.total?` \xb7 ${(0,c.gbp)(i.total)}`:'']}),i.lines.length?(0,x.jsx)(d.Muted,{children:i.lines.map(n=>{const i=e.ingredients.find(e=>e.id===n.ing);return`${(0,s.ingredientQty)(t,i??{name:n.ing,unit:''},n.qty)} ${i?.name??n.ing}`}).join(', ')}):null]},i.id))})}},1165,[1148,943,17,362,85,777,876,955,851,804,1055,1140,1000,1166,8]); __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.openLink=w,_e.useSheetReminders=C,_e.OrderSheets=function({focus:e}){const{rid:t,now:l}=(0,x.useChef)(3e4),o=(0,u.useSheets)(t).filter(e=>(0,n.chefCanSee)(t,e)&&!e.placeholder),[h,c]=(0,s.useState)(e??null),p=C(),f=(0,b.wd)(l);return(0,j.jsxs)(d.default,{style:{gap:10},testID:"order-sheets",children:[(0,j.jsx)(i.Banner,{kind:"info",title:"Nothing is sent for you",children:"Text, WhatsApp and phone orders open your phone\u2019s own app with the order already written. Check it, then press Send yourself."}),p.map(e=>(0,j.jsx)(r.default,{accessibilityRole:"button",onPress:()=>c(e.supplierId),children:(0,j.jsxs)(i.Banner,{kind:'red'===e.tone?'danger':'warn',title:`\u23f0 ${e.text}`,children:["Tap to open the ",e.name," order sheet."]})},e.supplierId)),(0,j.jsxs)(i.Muted,{children:["Today is ",b.DAYS[f],". Edit suppliers in Managers \u203a Settings \u203a Supplier order sheets."]}),o.map(e=>(0,j.jsx)($,{s:e,open:h===e.id,onToggle:()=>c(h===e.id?null:e.id)},e.id)),o.length?null:(0,j.jsx)(i.Muted,{children:"No order sheets yet. Add suppliers in Managers \u203a Settings \u203a Supplier order sheets."})]})};var t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),o=e(_r(_d[4]));_r(_d[5]);var r=e(_r(_d[6])),d=e(_r(_d[7])),i=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),b=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),j=_r(_d[17]);function w(e){if('undefined'!=typeof window){const t=window;return'function'==typeof t.__ccOpenLink?void t.__ccOpenLink(e):void(/^https?:/.test(e)?window.open(e,'_blank','noopener'):window.location.href=e)}o.default.openURL(e).catch(()=>{})}async function k(e){try{const t='undefined'!=typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0}catch{}return!1}const S={online:'\ud83c\udf10',phone:'\ud83d\udcde',text:'\ud83d\udcac',whatsapp:'\u2706',tbc:'\ud83d\udd8a\ufe0f'},T={borderWidth:1,borderColor:f.colours.border,borderRadius:10,paddingHorizontal:12,paddingVertical:10,color:f.colours.text,backgroundColor:f.colours.surface2,fontSize:f.font.body};function C(){const{rid:e,now:t}=(0,x.useChef)(6e4),l=(0,u.useSheets)(e).filter(t=>(0,n.chefCanSee)(e,t)&&!t.placeholder),s=(0,u.useOrderSheets)(e=>e.opened),o=(0,h.useShellfish)(e,'','chef'),r=(0,b.remindersFor)(l,t,s);for(const n of l){const l=o.items.filter(e=>(e.supplierId===n.id||!e.supplierId&&n.shellfish)&&o.isLow(e.key));!l.length||s[n.id]&&new Date(s[n.id]).toDateString()===t.toDateString()||r.push({supplierId:n.id,name:n.name,text:`${'text'===n.method||'whatsapp'===n.method?'Text':'Order from'} ${n.contact||n.name}: ${l.map(t=>`${(0,c.fmtStockCount)(e,t,o.counts[t.key]??0)} ${t.plural.toLowerCase()}`).join(' and ')} left`,tone:'amber',cutoffPassed:!1})}return r}function $({s:e,open:n,onToggle:o}){const{rid:C,r:$,me:D,now:I}=(0,x.useChef)(3e4),v=(0,u.useOrderSheets)(e=>e.patch),M=(0,u.useOrderSheets)(e=>e.markOpened),B=(0,u.useOrderSheets)(t=>t.opened[e.id]),[L,P]=(0,s.useState)({}),[O,R]=(0,s.useState)(''),[A,z]=(0,s.useState)(''),[_,W]=(0,s.useState)(!1),H=(0,h.useShellfish)(C,D,'chef'),K=(0,b.nextDelivery)(e,I),E=(0,b.orderLines)(e,L,O,C),N=($.address??$.location??'').split(',').map(e=>e.trim()).filter(Boolean),q=N.length>=3?N[1]:N[0]??'',U=(0,b.orderMessage)(e,$.name,q,E,D.split(' ')[0],I),Q=e.orderDays.includes((0,b.wd)(I)),Y=(e,t)=>P(n=>({...n,[e.id]:(0,l.stepQuantity)(C,e,n[e.id]||0,t)})),F=t=>{M(e.id,I.toISOString()),w(t)},G='text'===e.method||'whatsapp'===e.method||'phone'===e.method,V=Math.round(100*((0,y.parseMoneyInput)(A)??NaN)),J=H.items.filter(t=>t.supplierId===e.id||!t.supplierId&&e.shellfish),X=J.filter(e=>H.isLow(e.key));return(0,j.jsxs)(d.default,{testID:`sheet-${e.id}`,style:{borderRadius:14,borderWidth:1.5,borderColor:Q||X.length?f.colours.amber:n?f.colours.gold:f.colours.border,backgroundColor:f.colours.surface,overflow:'hidden'},children:[(0,j.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.name} order sheet`,onPress:o,style:{padding:12,gap:4},children:[(0,j.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(i.T,{weight:"semibold",size:f.font.large,style:{flex:1},children:[S[e.method]," ",e.name]}),(0,j.jsx)(i.Badge,{kind:e.placeholder?'amber':'gold',label:e.placeholder?'To fill in':b.METHOD_LABEL[e.method]})]}),(0,j.jsx)(i.Muted,{children:e.goods}),(0,j.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.deliveryDays.length?(0,j.jsx)(i.Badge,{kind:"neutral",label:`Delivers ${(0,b.dayRange)(e.deliveryDays)}`}):null,e.orderDays.length?(0,j.jsx)(i.Badge,{kind:Q?'amber':'neutral',label:`Order ${(0,b.dayRange)(e.orderDays)}${e.cutoff?` by ${e.cutoff}`:''}`}):null,e.frequency?(0,j.jsx)(i.Badge,{kind:"neutral",label:e.frequency}):null,e.priceCapPerKg?(0,j.jsx)(i.Badge,{kind:"blue",label:`Cap ${(0,p.gbp)(e.priceCapPerKg)}/kg`}):null,J.length?(0,j.jsx)(i.Badge,{kind:X.length?'amber':'ok',label:J.map(e=>`${e.icon} ${(0,c.fmtStockCount)(C,e,H.counts[e.key]??0)}`).join(' \xb7 ')}):null,B&&new Date(B).toDateString()===I.toDateString()?(0,j.jsx)(i.Badge,{kind:"ok",label:"Opened today \u2713"}):null]})]}),n?(0,j.jsxs)(d.default,{style:{padding:12,paddingTop:0,gap:10},children:[K?(0,j.jsxs)(i.Muted,{children:["Next delivery if you order now: ",(0,b.niceDay)(K),"."]}):null,e.reminder?(0,j.jsxs)(i.Muted,{children:["Reminder on ",e.orderDays.map(e=>b.DAYS[e]).join(', '),": ",e.reminder]}):null,e.notes?(0,j.jsx)(i.T,{size:f.font.small,colour:f.colours.muted,children:e.notes}):null,e.placeholder?(0,j.jsx)(i.Banner,{kind:"warn",title:"Still to be set up",children:"Add the supplier, how to order and delivery days in Managers \u203a Settings \u203a Supplier order sheets."}):null,e.items.map(e=>(0,j.jsxs)(d.default,{style:{gap:6},children:[(0,j.jsxs)(i.T,{children:[e.name,e.unit?(0,j.jsxs)(i.T,{size:f.font.small,colour:f.colours.muted,children:[" (",(0,l.quantityUnit)(C,e),")"]}):null]}),(0,j.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone less':'Less'} ${e.name}`,onPress:()=>Y(e,-1),style:{minWidth:44,minHeight:44}}),(0,j.jsx)(d.default,{accessible:!0,accessibilityLabel:(0,l.fishQtySpeech)(C,e,L[e.id]||0),children:(0,j.jsx)(i.T,{weight:"bold",size:20,style:{minWidth:76,textAlign:'center'},children:(0,l.fishInStone)(C,e)?(0,l.fishQtyText)(C,e,L[e.id]||0):L[e.id]||0})}),(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone more':'More'} ${e.name}`,testID:`qty-${e.id}`,onPress:()=>Y(e,1),style:{minWidth:44,minHeight:44}})]})]},e.id)),(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsx)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:"Anything else (one line each)"}),(0,j.jsx)(t.TextInput,{value:O,onChangeText:R,multiline:!0,placeholder:"e.g. 2 boxes lemons",placeholderTextColor:f.colours.muted,style:[T,{minHeight:60}]})]}),G?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['whatsapp'===e.method?'WhatsApp number':'phone'===e.method?'Phone number':'Mobile number',e.number?'':' (blank: fill in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`number-${e.id}`,value:e.number,onChangeText:t=>v(C,e.id,{number:t}),keyboardType:"phone-pad",placeholder:"07\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,'online'===e.method?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['Open Coldweb'===e.urlLabel?'Coldweb ordering link':'Website link',e.url?'':' (blank: paste it in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`url-${e.id}`,value:e.url,onChangeText:t=>v(C,e.id,{url:t.trim()}),autoCapitalize:"none",keyboardType:"url",placeholder:"https://\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,e.priceCapPerKg?(0,j.jsxs)(d.default,{style:{gap:6,padding:10,borderRadius:12,backgroundColor:f.colours.blueBg},children:[(0,j.jsxs)(i.T,{weight:"semibold",colour:"#E2C489",children:["Price cap ",(0,p.gbp)(e.priceCapPerKg),"/kg \xb7 buy from the cheapest UK seller under it"]}),(0,j.jsxs)(i.Muted,{children:["Seller: ",e.seller||'to be chosen']}),(0,j.jsxs)(i.Row,{gap:8,children:[(0,j.jsx)(i.T,{size:f.font.small,style:{flex:1},children:"Price you found (\xa3/kg)"}),(0,j.jsx)(t.TextInput,{testID:"price-found",value:A,onChangeText:e=>z((0,y.sanitiseMoneyTyping)(e)),keyboardType:"decimal-pad",inputMode:"decimal",placeholder:"e.g. 22.50",placeholderTextColor:f.colours.muted,style:[T,{width:120}]})]}),V>0?(0,j.jsx)(i.Badge,{kind:V<=e.priceCapPerKg?'ok':'red',label:V<=e.priceCapPerKg?`${(0,p.gbp)(V)}/kg is under the cap \u2713`:`${(0,p.gbp)(V)}/kg is over the ${(0,p.gbp)(e.priceCapPerKg)} cap: look for a cheaper seller`}):null]}):null,'online'!==e.method&&'tbc'!==e.method?(0,j.jsxs)(d.default,{testID:`preview-${e.id}`,style:{padding:10,borderRadius:12,borderWidth:1,borderColor:f.colours.border,backgroundColor:f.colours.surface2},children:[(0,j.jsx)(i.T,{size:12,weight:"semibold",colour:f.colours.gold,children:'phone'===e.method?'READ THIS OUT':'YOUR MESSAGE'}),(0,j.jsx)(i.T,{size:f.font.small,children:E.length?U:'Add quantities above to write the order.'})]}):null,(0,j.jsxs)(i.Row,{wrap:!0,gap:8,children:['text'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"\ud83d\udcac Open in Messages",disabled:!E.length,onPress:()=>F((0,b.smsLink)(e.number,U))}):null,'whatsapp'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"Open in WhatsApp",disabled:!E.length,onPress:()=>F((0,b.waLink)(e.number,U))}):null,'phone'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83d\udcde Call ${e.name}`,disabled:!e.number,onPress:()=>F((0,b.telLink)(e.number))}):null,'online'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83c\udf10 ${e.urlLabel??'Open website'}`,disabled:!e.url,onPress:()=>F(e.url)}):null,'online'!==e.method&&'tbc'!==e.method&&E.length?(0,j.jsx)(i.Button,{kind:"ghost",label:_?'Copied \u2713':'Copy order',onPress:async()=>{const e=await k(U);W(e),e&&setTimeout(()=>W(!1),2e3)}}):null]}),'text'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: Messages opens with the order written and asks who to send it to."}):null,'whatsapp'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: WhatsApp opens with the order written and asks who to send it to."}):null,'phone'!==e.method||e.number?null:(0,j.jsx)(i.Muted,{children:"Add the phone number above to call from here."}),'online'!==e.method||e.url?null:(0,j.jsx)(i.Muted,{children:"Add the link above and the button opens it."})]}):null]})}},1166,[812,820,943,17,362,219,385,85,777,998,942,944,851,999,804,1140,840,8]); -__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:i,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),i?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:i}):null]}):null,n||w.length||!i?null:(0,j.jsx)(l.default,{accessibilityRole:"button",onPress:i,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:i?()=>{k(!1),i()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const i=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!i.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${i.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,i.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:i.items.map((t,s)=>{const o=i.counts[t.key]??0,l=d[t.key]??0,h=Math.max(0,o-l),m=h<=0,b=m||i.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:l?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,l)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return z}}),_e.ShellfishChip=M,_e.SundayRoastChip=function(e){return(0,j.jsx)(M,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=e(_r(_d[5])),l=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(i.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:i,group:l}){const d=(0,h.useShellfish)(e,s,r,l),m='roast'===l,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const i=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,i,o):Math.max(0,Math.min(99,i+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),z=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),M=(0,o.useRef)(null);M.current||(M.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!M.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,H]=(0,o.useState)(0),F=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?z:D>0,W=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!F.length)return;const e=setInterval(()=>H(e=>e+1),600);return()=>clearInterval(e)},[R.state,F.length]);const P=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void W('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?W('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?W('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-P.current>2e4&&W('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||F.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||F.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${F.length} ${1===F.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&z&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),P.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!z,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),i?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:i}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const z=18;function M({rid:e,by:t,app:r,size:i="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(m&&'roast'===d&&(!f.items.length||!(0,u.isSundayIn)(T)))return(0,j.jsx)(R,{size:i});if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const M='m'===i?20:17,E='roast'!==d,B=E&&f.items.some(e=>(k[e.key]??0)>0),H=B?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==i&&!B;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${E&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,i=p[t.key]??0,d=Math.max(0,n-i),h=d<=0,m=h||f.isLow(t.key),b=E?k[t.key]??0:0,x=h?y.colours.red:E&&'display'!==r?y.colours.shellfishFree:m&&!E?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:B?4:6,paddingHorizontal:B?5:9,paddingVertical:3,flexShrink:0,minWidth:B?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,M-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:M-2}),(0,j.jsx)(c.T,{size:M,weight:"bold",colour:x,style:{lineHeight:M+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(l.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:z,minWidth:z,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):B?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:z,width:z,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,H)})`})}):null,!F||!(i||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':i?`${(0,u.fmtStockCount)(e,t,i)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),i=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),l=(0,f.reservedBookingsOn)(r,i,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(i))}),l.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}function R({size:e}){return(0,j.jsxs)(a.default,{testID:"roast-slot",accessible:!0,accessibilityLabel:"Sunday roast count: shown on Sundays",style:{minHeight:44,minWidth:'xs'===e?64:84,paddingHorizontal:10,borderRadius:12,borderWidth:1,borderColor:y.colours.hairline,backgroundColor:'rgba(255,255,255,0.03)',flexDirection:'row',alignItems:'center',justifyContent:'center',gap:6},children:[(0,j.jsx)(c.T,{size:'m'===e?14:12,colour:y.colours.muted,children:"Roast"}),(0,j.jsx)(c.T,{size:'m'===e?18:16,weight:"bold",colour:y.colours.muted,children:"\u2013"})]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); +__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:l,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(i.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),l?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:l}):null]}):null,n||w.length||!l?null:(0,j.jsx)(i.default,{accessibilityRole:"button",onPress:l,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:l?()=>{k(!1),l()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const l=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!l.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${l.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,l.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:l.items.map((t,s)=>{const o=l.counts[t.key]??0,i=d[t.key]??0,h=Math.max(0,o-i),m=h<=0,b=m||l.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:i?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,i)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return M}}),_e.ShellfishChip=z,_e.SundayRoastChip=function(e){return(0,j.jsx)(z,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),l=e(_r(_d[5])),i=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(l.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:l,group:i}){const d=(0,h.useShellfish)(e,s,r,i),m='roast'===i,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const l=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,l,o):Math.max(0,Math.min(99,l+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),M=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),z=(0,o.useRef)(null);z.current||(z.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!z.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,F]=(0,o.useState)(0),H=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?M:D>0,P=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!H.length)return;const e=setInterval(()=>F(e=>e+1),600);return()=>clearInterval(e)},[R.state,H.length]);const W=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void P('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?P('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?P('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-W.current>2e4&&P('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||H.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||H.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${H.length} ${1===H.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&M&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),W.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!M,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),l?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:l}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const M=18;function z({rid:e,by:t,app:r,size:l="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const z='m'===l?20:17,R='roast'!==d,E=R&&f.items.some(e=>(k[e.key]??0)>0),B=E?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==l&&!E;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${R&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,l=p[t.key]??0,d=Math.max(0,n-l),h=d<=0,m=h||f.isLow(t.key),b=R?k[t.key]??0:0,x=h?y.colours.red:R&&'display'!==r?y.colours.shellfishFree:m&&!R?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:E?4:6,paddingHorizontal:E?5:9,paddingVertical:3,flexShrink:0,minWidth:E?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,z-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:z-2}),(0,j.jsx)(c.T,{size:z,weight:"bold",colour:x,style:{lineHeight:z+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(i.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:M,minWidth:M,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):E?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:M,width:M,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,B)})`})}):null,!F||!(l||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':l?`${(0,u.fmtStockCount)(e,t,l)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),l=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),i=(0,f.reservedBookingsOn)(r,l,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(l))}),i.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"look",{enumerable:!0,get:function(){return n}}),r(d[0]);var o=r(d[1]);const b=o=>o,n={panel:{backgroundColor:'#121110',borderRadius:o.radii.xl,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',boxShadow:'0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 28px rgba(0,0,0,0.45)'},quiet:(b,n="gold")=>({minHeight:o.control.tall,borderRadius:o.radii.button,borderWidth:1,borderColor:'blue'===n?'rgba(226,196,137,0.55)':'rgba(207,164,95,0.38)',backgroundColor:b?'rgba(207,164,95,0.16)':'blue'===n?'rgba(226,196,137,0.10)':'rgba(255,255,255,0.035)',paddingHorizontal:14,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:8,boxShadow:'0 1px 0 rgba(255,255,255,0.05) inset',transition:'background-color 120ms ease'}),primary:o=>({backgroundColor:o?'#B8904F':'#CFA45F',borderWidth:1,borderColor:'rgba(255,226,170,0.55)',backgroundImage:o?'linear-gradient(180deg, #BE9552 0%, #A88143 100%)':'linear-gradient(180deg, #E0BA77 0%, #C69A55 100%)',boxShadow:o?'0 2px 8px rgba(0,0,0,0.4)':'0 1px 0 rgba(255,255,255,0.28) inset, 0 10px 24px rgba(207,164,95,0.22), 0 4px 10px rgba(0,0,0,0.45)',transition:'box-shadow 120ms ease'}),onPrimary:'#17130D',web:b}},1168,[219,811]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STOCK_ICON_IMAGES",{enumerable:!0,get:function(){return A}});const A={'\ud83e\udd9e':{uri:'data:image/png;base64,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',w:47,h:64},'\ud83e\udd80':{uri:'data:image/png;base64,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',w:64,h:45}}},1169,[]); __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.StockScreen=function({initial:e="levels"}){const[t,i]=(0,l.useState)(e);return(0,y.jsxs)(r.default,{style:{gap:12},children:[(0,y.jsx)(p.Seg,{value:t,onChange:i,options:[{id:'levels',label:'Stock levels'},{id:'take',label:'Stock take'},{id:'deliveries',label:'Deliveries in'}]}),'levels'===t?(0,y.jsx)(j,{}):'take'===t?(0,y.jsx)(f,{}):(0,y.jsx)(v,{})]})};var t=_r(_d[0]),i=_r(_d[1]),n=_r(_d[2]),s=_r(_d[3]),l=_r(_d[4]),d=e(_r(_d[5])),r=e(_r(_d[6])),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]);function j(){const{k:e,rid:t}=(0,p.useChef)(),d=(0,c.useOwner)(e=>e.suppliers),b=(0,i.useSheets)(t),[x,j]=(0,l.useState)('all'),f=e.ingredients.filter(e=>e.onHand<=0),v=e.ingredients.filter(e=>(0,p.isLow)(e.onHand,e.par)),k='alerts'===x?[...f,...v]:e.ingredients,S=[...new Set(k.map(e=>e.supplierId))].map(e=>{const t=d.find(t=>t.id===e),i=b.find(t=>t.id===e);return{id:e,name:t?.name||i?.name||'Supplier not linked',category:t?.category||i?.goods||'Stock'}});return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsxs)(o.Row,{wrap:!0,gap:10,children:[(0,y.jsx)(p.Tile,{label:"Stock value (at cost)",value:(0,u.gbp)((0,p.stockValue)(e.ingredients)),sub:`${e.ingredients.length} ingredients`}),(0,y.jsx)(p.Tile,{label:"Low or out",value:`${v.length+f.length}`,sub:`${f.length} out \xb7 ${v.length} below half par`,tone:f.length?'red':v.length?'amber':'ok',onPress:()=>j('alerts')})]}),f.length?(0,y.jsxs)(o.Banner,{kind:"danger",title:"Out of stock",children:[f.map(e=>e.name).join(', '),". Mark the dishes that need it as sold out (Kitchen \u203a Live tickets \u203a Sold out), or order now."]}):null,(0,y.jsx)(p.Seg,{value:x,onChange:j,options:[{id:'all',label:'All'},{id:'alerts',label:'Alerts only'}]}),e.ingredients.length?null:(0,y.jsx)(o.Muted,{children:"No stock items yet. Add your real ingredients to start counting."}),S.map(e=>(0,y.jsxs)(o.Card,{children:[(0,y.jsxs)(o.T,{weight:"semibold",children:[e.category," \xb7 ",e.name]}),k.filter(t=>t.supplierId===e.id).map(e=>{const i=e.onHand<=0?'out':(0,p.isLow)(e.onHand,e.par)?'low':'ok';return(0,y.jsxs)(r.default,{style:{gap:4,paddingVertical:4},accessible:!0,accessibilityLabel:`${e.name} ${(0,n.ingredientSpeech)(t,e,e.onHand)} of par ${(0,n.ingredientSpeech)(t,e,e.par)}`,children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},children:e.name}),'out'===i?(0,y.jsx)(o.Badge,{kind:"red",label:"OUT"}):'low'===i?(0,y.jsx)(o.Badge,{kind:"amber",label:"LOW"}):null,(0,y.jsxs)(o.T,{size:13,colour:h.colours.muted,children:[(0,n.ingredientQty)(t,e,e.onHand)," / par ",(0,n.ingredientQty)(t,e,e.par)]})]}),(0,y.jsx)(p.Bar,{pct:e.onHand/e.par*100,colour:'out'===i?h.colours.red:'low'===i?h.colours.amber:h.colours.gold}),(0,y.jsxs)(o.Muted,{children:[(0,u.gbp)(Math.round((0,s.displayedCost)(t,e,e.cost)))," per ",(0,s.quantityUnit)(t,e)," \xb7 value ",(0,u.gbp)(Math.round(e.onHand*e.cost))]})]},e.id)})]},e.id))]})}function f(){const{k:e,me:i,rid:d}=(0,p.useChef)(),c=(0,b.useKitchen)(e=>e.saveStockTake),[x,j]=(0,l.useState)({}),[f,v]=(0,l.useState)(''),k=e.ingredients.map(e=>{const t=x[e.id],i=void 0===t||''===t?void 0:Number(t.replace(',','.')),n=void 0!==i&&Number.isFinite(i)&&i>=0&&(!(0,s.fishInStone)(d,e)||2*i===Math.round(2*i))?(0,s.inputQuantity)(d,e,i):void 0,l=void 0===n||Number.isNaN(n)?void 0:n-e.onHand;return{i:e,counted:n,variance:l,cost:void 0===l?0:Math.round(l*e.cost)}}),S=k.filter(e=>void 0!==e.variance),w=S.reduce((e,t)=>e+t.cost,0);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Count what's on the shelves. Expected = last count + deliveries \u2212 waste. Fish is entered in stone, in half-stone steps. Variance shows what's unexplained (portioning, theft, missed waste)."}),e.stockTakes[0]?(0,y.jsxs)(o.Muted,{children:["Last stock take ",new Date(e.stockTakes[0].at).toLocaleDateString('en-GB')," by ",e.stockTakes[0].by,": variance ",(0,u.gbp)(Math.round(e.stockTakes[0].lines.reduce((e,t)=>e+(t.counted-t.expected)*t.cost,0))),"."]}):null,(0,y.jsx)(o.Card,{children:k.map(({i:e,variance:i,cost:l})=>(0,y.jsxs)(r.default,{style:{gap:6,paddingVertical:8},children:[(0,y.jsxs)(r.default,{accessible:!0,accessibilityLabel:`${e.name}, expected ${(0,n.ingredientSpeech)(d,e,e.onHand)}`,children:[(0,y.jsx)(o.T,{size:16,children:e.name}),(0,y.jsxs)(o.Muted,{children:["Expected ",(0,n.ingredientQty)(d,e,e.onHand)]})]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,y.jsx)(t.TextInput,{accessibilityLabel:`Count ${e.name} in ${(0,s.quantityUnit)(d,e)}`,accessibilityValue:{text:x[e.id]?(0,n.ingredientSpeech)(d,e,(0,s.inputQuantity)(d,e,Number(x[e.id]))):'Not counted'},keyboardType:"decimal-pad",placeholder:(0,s.quantityUnit)(d,e),placeholderTextColor:h.colours.muted,value:x[e.id]??'',onChangeText:t=>j(i=>({...i,[e.id]:t})),style:{minHeight:44,width:80,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:8,paddingVertical:6,color:h.colours.text,textAlign:'right'}}),(0,s.fishInStone)(d,e)?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Half a stone less ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String(Math.max(0,(0,s.halfStone)(Number(t[e.id])||0)-.5))}))}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Half a stone more ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String((0,s.halfStone)(Number(t[e.id])||0)+.5)}))})]}):null,(0,y.jsx)(r.default,{style:{minWidth:86,alignItems:'flex-end'},accessible:!0,accessibilityLabel:void 0===i?'No variance yet':`${(0,n.ingredientSpeech)(d,e,i)} variance, ${(0,u.gbp)(l)}`,children:void 0===i?(0,y.jsx)(o.Muted,{children:"\u2014"}):(0,y.jsxs)(o.T,{size:14,colour:Math.abs(i)<.001?h.colours.ok:i<0?h.colours.red:h.colours.amber,children:[i>0?'+':'',(0,n.ingredientQty)(d,e,i),'\n',(0,u.gbp)(l)]})})]})]},e.id))}),(0,y.jsxs)(o.Banner,{kind:w<0?'warn':'info',title:`Variance so far: ${(0,u.gbp)(w)}`,children:[S.length," of ",e.ingredients.length," counted."]}),(0,y.jsx)(o.Button,{label:"Save stock take",disabled:!S.length,onPress:()=>{const e={};S.forEach(t=>{e[t.i.id]=t.counted}),c(e,i),j({}),v(`Saved: ${S.length} items, variance ${(0,u.gbp)(w)}. Stock levels updated.`)}}),f?(0,y.jsx)(o.Banner,{kind:"success",title:"Stock take saved",children:f}):null]})}function v(){const{k:e,me:t}=(0,p.useChef)(),i=(0,c.useOwner)(e=>e.suppliers),[n,s]=(0,l.useState)(e.deliveries.find(e=>'expected'===e.status)?.id??null);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Check each delivery against the order: count it in, check the invoice price, flag shorts and price changes. Accepting adds it to stock and updates costs (and GP)."}),e.deliveries.map(e=>{const l=i.find(t=>t.id===e.supplierId);return(0,y.jsxs)(o.Card,{highlight:n===e.id?h.colours.gold:void 0,children:[(0,y.jsx)(d.default,{accessibilityRole:"button",accessibilityLabel:`Delivery from ${l?.name}`,onPress:()=>s(n===e.id?null:e.id),children:(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(o.T,{weight:"semibold",children:l?.name??'Supplier'}),(0,y.jsx)(o.Muted,{children:'expected'===e.status?`Due ${e.due} \xb7 ${e.lines.length} lines`:`Accepted by ${e.checkedBy} ${e.at?new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`})]}),(0,y.jsx)(o.Badge,{kind:'expected'===e.status?'amber':'ok',label:'expected'===e.status?'TO CHECK':'ACCEPTED'})]})}),n===e.id?(0,y.jsx)(k,{id:e.id,me:t}):null]},e.id)})]})}function k({id:e,me:i}){const{k:d,rid:c}=(0,p.useChef)(),b=d.deliveries.find(t=>t.id===e),[j,f]=(0,l.useState)(b.lines.map(e=>({...e}))),v=(e,t)=>f(i=>i.map(i=>i.ing===e?{...i,...t}:i)),k='expected'!==b.status,S=(0,l.useMemo)(()=>j.map(e=>{const t=d.ingredients.find(t=>t.id===e.ing),i=e.receivede.short>0),$=S.filter(e=>Math.abs(e.pct)>=.5),C=j.reduce((e,t)=>e+t.received*t.price,0);return(0,y.jsxs)(r.default,{style:{gap:8,marginTop:8},children:[S.map(({l:e,i:i,short:l,pct:d})=>(0,y.jsxs)(r.default,{style:{gap:4,borderTopWidth:1,borderColor:h.colours.border,paddingTop:6},children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},weight:"medium",children:i.name}),l?(0,y.jsx)(o.Badge,{kind:"red",label:`SHORT ${(0,n.ingredientQty)(c,i,l)}`}):null,Math.abs(d)>=.5?(0,y.jsx)(o.Badge,{kind:"amber",label:`PRICE ${d>0?'+':''}${d.toFixed(0)}%`}):null]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,y.jsxs)(o.Muted,{children:["Ordered ",(0,n.ingredientQty)(c,i,e.ordered)]}),(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Received (",(0,s.quantityUnit)(c,i),")"]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Received ${i.name} in ${(0,s.quantityUnit)(c,i)}`,accessibilityValue:{text:(0,n.ingredientSpeech)(c,i,e.received)},keyboardType:"decimal-pad",value:String((0,s.fishInStone)(c,i)?(0,s.halfStone)((0,s.toStone)(e.received,i.unit)):e.received),onChangeText:t=>v(e.ing,{received:(0,s.inputQuantity)(c,i,Number(t.replace(',','.'))||0)}),style:{minHeight:44,width:60,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]}),(0,s.fishInStone)(c,i)&&!k?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Receive half a stone less ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,-1)})}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Receive half a stone more ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,1)})})]}):null,(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Invoice \xa3/",(0,s.quantityUnit)(c,i)]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Invoice price ${i.name}`,keyboardType:"decimal-pad",inputMode:"decimal",value:((0,s.displayedCost)(c,i,e.price)/100).toFixed(2),onChangeText:t=>v(e.ing,{price:100*((0,x.parseMoneyInput)(t)??0)/((0,s.fishInStone)(c,i)?(0,s.fromStone)(1,i.unit):1)}),style:{minHeight:44,width:70,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]})]}),(0,y.jsxs)(o.Muted,{children:["Last cost ",(0,u.gbp)(Math.round((0,s.displayedCost)(c,i,i.cost)))," per ",(0,s.quantityUnit)(c,i)]})]},e.ing)),(0,y.jsxs)(o.T,{weight:"semibold",children:["Invoice total ",(0,u.gbp)(Math.round(C))]}),w.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Shorts to chase",children:[w.map(e=>`${e.i.name}: ${(0,n.ingredientQty)(c,e.i,e.short)} short`).join(' \xb7 '),". Ask the supplier for a credit note."]}):null,$.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Price changes",children:[$.map(e=>`${e.i.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%`).join(' \xb7 '),". Check GP \u203a Price changes once accepted."]}):null,k?(0,y.jsx)(o.Muted,{children:b.note?`Noted: ${b.note}.`:'No issues noted.'}):(0,y.jsx)(o.Button,{label:"Accept delivery into stock",testID:"accept-delivery",onPress:()=>d.acceptDelivery(e,j,i,[w.length?`${w.length} short`:'',$.length?`${$.length} price changes`:''].filter(Boolean).join(', '))})]})}},1170,[812,998,1148,943,17,385,85,777,876,851,804,1140,1000,840,8]); @@ -1413,7 +1413,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}},1330,[812,843,17,85,777,845,851,1150,1331,858,804,8]); __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})},1331,[892,946,1150]); __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]})}},1332,[13,17,856,1333,1407,8]); -__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'center'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1333,[1051,779,805,806,1334,813,1335,1092,843,1137,1336,1337,1338,1089,1118,1339,1340,1345,1346,1205,1347,856,1352,1353,1354,1111,1110,966,1355,1149,938,1102,1356,17,1070,1181,1016,1085,1357,1209,1359,378,363,385,278,85,409,19,777,1233,1237,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1360,1106,1361,1368,1370,1373,1378,1372,1379,1382,1383,1113,1093,1094,862,1388,1222,1389,1232,1224,993,1394,1399,1400,1052,1050,1115,1402,1403,1404,1069,1168,1405,1167,1158,853,1348,1406,8]); +__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'flex-start'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{testID:"display-header-time",style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1333,[1051,779,805,806,1334,813,1335,1092,843,1137,1336,1337,1338,1089,1118,1339,1340,1345,1346,1205,1347,856,1352,1353,1354,1111,1110,966,1355,1149,938,1102,1356,17,1070,1181,1016,1085,1357,1209,1359,378,363,385,278,85,409,19,777,1233,1237,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1360,1106,1361,1368,1370,1373,1378,1372,1379,1382,1383,1113,1093,1094,862,1388,1222,1389,1232,1224,993,1394,1399,1400,1052,1050,1115,1402,1403,1404,1069,1168,1405,1167,1158,853,1348,1406,8]); __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},1336,[]); @@ -1480,7 +1480,7 @@ __d(function(g,r,i,_a,m,e,_d){"use strict";function t(t,o){if(t.title.trim().len __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STEP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"addDays",{enumerable:!0,get:function(){return u}}),_e.fmt12=i,_e.rangeText=c,_e.openWindow=function(r,o){const a=(0,e.kitchenHoursOn)(r,(0,t.parseYmd)(o));if(!a)return null;let s=(0,t.toMins)(a[1]);for(const e of(0,n.regularEventsOf)(r))(0,n.occursOn)(e,o)&&e.time&&(s=Math.max(s,Math.min(1425,(0,t.toMins)(e.time)+180)));return{from:(0,t.toMins)(a[0]),to:s}},_e.servicesOn=l,_e.serviceOf=function(e,n,r,o){const a=l(e,n,o),s=(0,t.toMins)(r);return a.lunch&&s>=a.lunch.from&&s=a.dinner.from&&s=a.dinner.to?'dinner':a.lunch&&s=e?n:e);if('none'===r.kind||!o||o=h)break}return s},_e.repeatText=function(e,t){if('none'===e.kind)return;const n=t?` until ${p(t)}`:'';return'weekly'===e.kind?`Every ${[...e.days].sort().map(e=>a[e]).join(', ')}${n}`:`Last ${o[e.weekday]} of the month${n}`},Object.defineProperty(_e,"longDate",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"monthLabel",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"scopeText",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"whatText",{enumerable:!0,get:function(){return M}}),_e.confirmLine=function(e){const t=e.dates.length?1===e.dates.length?e.dates[0]===e.today?'today':p(e.dates[0]):e.repeat?`on ${e.dates.length} dates (${e.repeat})`:`${p(e.dates[0])} to ${p(e.dates[e.dates.length-1])}`:'no dates';return`Block ${c(e.from,e.to,e.wholeDay)} ${t}, ${y(e)}`},_e.bookingsInWindow=function(e,n,r,o,a,s){const u=new Set(n),i=(0,t.toMins)(r),c=(0,t.toMins)(o);return e.filter(e=>{if(!u.has(e.date)||!['confirmed','pending','seated'].includes(e.status))return!1;const n=(0,t.toMins)(e.time);if(n=c)return!1;const r=(e.table??'').split(/[^A-Za-z0-9]+/).filter(Boolean);return a.tables?.length?r.some(e=>a.tables.includes(e)):!a.areaId||r.some(e=>s?.(e)===a.areaId)})},_e.groupByMonth=function(e,n,r,o){const a=e.filter(e=>e.rid===n&&!e.removedAt&&(e.date>r||e.date===r&&(0,t.toMins)(e.to)>(0,t.toMins)(o))).sort((e,n)=>e.date===n.date?(0,t.toMins)(e.from)-(0,t.toMins)(n.from):e.date{const r=(0,t.parseYmd)(e);return r.setDate(r.getDate()+n),(0,t.ymd)(r)};function i(e){const n=(0,t.toMins)(e),r=Math.floor(n/60)%24;return`${r%12==0?12:r%12}:${String(n%60).padStart(2,'0')}${r<12?'am':'pm'}`}function c(e,t,n){if(n)return'all day';const r=i(e),o=i(t);return r.slice(-2)===o.slice(-2)?`${r.slice(0,-2)}\u2013${o}`:`${r}\u2013${o}`}function l(n,r,o){const a=(0,e.kitchenHoursOn)(n,(0,t.parseYmd)(r));if(!a)return{lunch:null,dinner:null};const s=(0,t.toMins)(a[0]),u=(0,t.toMins)(a[1]),i=1020,c=(e,n)=>{if(!e)return n;const r=Math.max(s,(0,t.toMins)(e[0])),o=Math.min(u,(0,t.toMins)(e[1]));return o>r?{from:r,to:o}:null};return{lunch:c(o?.lunch,si?{from:Math.max(i,s),to:u}:null)}}const d=e=>Math.ceil(e/r)*r;function f(e,t){const n=[];let r=e;for(;r<=t&&n.length<366;)n.push(r),r=u(r,1);return n}const m=(e,n)=>{const r=(0,t.parseYmd)(e);if(r.getDay()!==n)return!1;const o=new Date(r);return o.setDate(r.getDate()+7),o.getMonth()!==r.getMonth()},h=104;const p=e=>{const n=(0,t.parseYmd)(e);return`${o[n.getDay()]} ${n.getDate()} ${s[n.getMonth()]}`},g=e=>{const n=(0,t.parseYmd)(e);return`${s[n.getMonth()]} ${n.getFullYear()}`},y=e=>e.tables?.length?`table${e.tables.length>1?'s':''} ${e.tables.join(', ')}`:e.areaId?e.areaName??'one area':'all areas',M=e=>{const t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)}},1397,[862,863,861]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"wixBlockPushOn",{enumerable:!0,get:function(){return o}}),e.pushBlocksToWix=function(t,n,c){if(!o(t)||!n.length)return;const l=u.useSync.getState();if(!l.venueId||'guest'===l.kind)return;setTimeout(()=>{(0,s.getSupabase)().functions.invoke('wix-blocks-push',{body:{venue_id:l.venueId,block_ids:n.slice(0,120),action:c}}).catch(()=>{})},4e3)},Object.defineProperty(e,"websiteBlockStatus",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),u=r(d[3]);const o=s=>!t.IS_ISOLATED_VENUE&&!['souters','kirkmichael','wildings'].includes(s)&&!!n.useFloor.getState().settings[s]?.wixBlockPushOn;const c=t=>(t??'awaiting venue sync').replace(/\bWix\b/gi,'Website bookings')},1398,[805,996,892,946]); __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,"DAY_GRAPH_CHROME",{enumerable:!0,get:function(){return j}}),_e.DayGraph=function({todays:e,open:j,close:T,now:b,turnBase:v,blocks:w=[],height:M=150,forecastNote:k,emptyText:D,past:L,closed:I,compact:$=!1,dense:C=!1,bare:A=!1,fill:z=!1,fit:O=!1,tight:_=!1,live:H=!1,onChrome:S}){const[F,P]=(0,t.useState)(0),[E,R]=(0,t.useState)(0),[N,B]=(0,t.useState)(0),[W,X]=(0,t.useState)(0);s.default.useEffect(()=>{S&&O&&W&&S(Math.ceil((A?4:C?2:10)+N+W+(A?2:6)+2))},[S,O,N,W,A,C]);const U=j.getTime()-18e5,G=T.getTime()+36e5,Y=(0,t.useMemo)(()=>(0,f.coverCurve)(e,new Date(U),new Date(G),v),[e,U,G,v]),V=60*j.getHours()+j.getMinutes(),K=60*T.getHours()+T.getMinutes(),Z=(0,t.useMemo)(()=>(0,p.chartBands)(w,V,K),[w,V,K]),q=new Date(j);q.setHours(0,0,0,0);const J=e=>q.getTime()+6e4*e,Q=Math.max(8,...Y.map(e=>e.covers)),ee=Y.reduce((e,t)=>!t.covers||(0,p.minuteInsideVenueBlock)(60*new Date(t.t).getHours()+new Date(t.t).getMinutes(),Z)?e:!e||t.covers>e.covers?{t:t.t,covers:t.covers}:e,null),te=O&&E?Math.max(24,Math.floor(E)):Math.max(48,M-m.AXIS_BAND),se=m.CHART_PAD_L,ie=m.CHART_PAD_R,oe=C?18:22,ne=Math.max(10,F-se-ie),le=Math.max(10,te-oe-14),re=e=>se+(e-U)/(G-U)*ne,ae=e=>oe+le-e/(1.15*Q)*le,he=(0,m.yTicks)(Q),de=(0,m.fitYTicks)(he,ae,te,13),ue=(0,m.nowLineVisible)({now:b,open:j,close:T,live:H,past:L,closed:I}),ce=b.getTime(),ge=ue&&Y.length?(0,m.splitCurve)(Y,ce):{before:Y,after:[]},xe=e=>e.map((e,t)=>`${t?'L':'M'}${re(e.t).toFixed(1)},${ae(e.covers).toFixed(1)}`).join(' '),me=[];for(let e=new Date(U);e.getTime()<=G;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=U&&t.getTime()<=G&&me.push(t.getTime())}const pe=H?(0,m.seatedNowCovers)(e,e[0]?.date??''):0,fe=Math.min(G,Math.max(U,b.getTime())),ye=I?null:H?{t:fe,covers:pe,text:(0,m.seatedNowText)(pe)}:ee,je=F?(0,m.layoutChart)({width:F,height:te,t0:U,t1:G,hours:me,busiest:ye}):{hours:[],busiest:null},Te=xe(Y),be=ue?xe(ge.before):Te,ve=ue?xe(ge.after):'',we=z&&Te&&Y.length>1?`${Te} L${re(Y[Y.length-1].t).toFixed(1)},${ae(0).toFixed(1)} L${re(Y[0].t).toFixed(1)},${ae(0).toFixed(1)} Z`:'',Me=(0,i.coversFour)(e,e[0]?.date??''),ke=`Total ${Me.total} ${1===Me.total?'Cover':'Covers'}`,De=e.filter(e=>!['cancelled','noshow'].includes(e.status)).length,Le=je.busiest?.text??(I?'':H?(0,m.seatedNowText)(pe):ee?(0,m.busiestText)(ee.t,ee.covers):''),Ie=Z.map(e=>e.spoken).join('. '),$e=ue&&T.getTime()>j.getTime()?Math.max(0,Math.min(100,Math.round((ce-j.getTime())/(T.getTime()-j.getTime())*100))):null,Ce=!I&&ee&&ee.covers?(0,m.peakOccupancyText)(ee.t,ee.covers):'',Ae=`Covers through the day. Open ${(0,u.hm)(j)}. Close ${(0,u.hm)(T)}.${Ce?` ${Ce}.`:''}${Le?` ${Le}.`:''}${ue?` It is ${(0,u.hm)(b)}. About ${$e} percent of the way through the day.`:''}${Ie?` ${Ie}.`:''}`,ze=(0,u.hm)(b),Oe=Math.max(44,12*ze.length*.7+16),He=Math.max(se+2,Math.min(Math.max(0,F-ie-Oe),re(ce)-Oe/2)),Se=Math.max(2,Math.min(te-22,oe+le-22)),Fe=s.default.useId().replace(/:/g,'');return(0,y.jsxs)(o.default,{testID:"day-graph",style:[d.look.panel,O?{flex:1,minHeight:0}:null,{overflow:'visible',paddingTop:A?4:C?2:10,paddingBottom:A?2:6,backgroundColor:c.colours.bg}],children:[(0,y.jsxs)(o.default,{testID:"day-graph-head",onLayout:e=>B(e.nativeEvent.layout.height),children:[A?null:$?(0,y.jsxs)(o.default,{style:{alignItems:'center',gap:4,paddingHorizontal:14},children:[(0,y.jsx)(h.T,{center:!0,size:18,weight:"semibold",children:"Covers through the day"}),(0,y.jsx)(h.T,{center:!0,size:14,colour:c.colours.muted,testID:"day-graph-parties",children:ke}),Ce?(0,y.jsx)(h.T,{center:!0,size:13,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,children:Ce}):null]}):(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8},children:[(0,y.jsx)(h.T,{size:C?14:15,weight:"semibold",style:{flexShrink:1},children:"Covers through the day"}),(0,y.jsx)(h.T,{size:12,colour:c.colours.muted,testID:"day-graph-parties",children:ke})]}),A||_?null:I?k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:2,children:k}):null:(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8,paddingTop:2},children:[(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Open ",(0,u.hm)(j)]}),Ce&&!$?(0,y.jsx)(h.T,{size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,center:!0,style:{flex:1,minWidth:0},children:Ce}):k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",numberOfLines:1,style:{flex:1,textAlign:'center'},children:k}):(0,y.jsx)(o.default,{style:{flex:1}}),(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Close ",(0,u.hm)(T)]})]}),A||_||$||!k||!Ce?null:(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:1,style:{paddingHorizontal:14},children:k}),A||!_||!Ce||$?null:(0,y.jsx)(h.T,{center:!0,size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,style:{paddingHorizontal:14},children:Ce})]}),(0,y.jsxs)(o.default,{testID:"day-graph-plot",accessible:!0,accessibilityLabel:Ae,onLayout:e=>{P(e.nativeEvent.layout.width),O&&R(e.nativeEvent.layout.height)},style:O?{flexGrow:1,flexShrink:1,flexBasis:Math.max(48,M-m.AXIS_BAND),minHeight:24,overflow:'hidden',position:'relative'}:{height:te,minHeight:te,position:'relative',overflow:'hidden'},children:[F?(0,y.jsxs)(l.default,{width:F,height:te,children:[(0,y.jsxs)(n.Defs,{children:[(0,y.jsxs)(n.Pattern,{id:`${Fe}-venue`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"1.4"})]}),(0,y.jsxs)(n.Pattern,{id:`${Fe}-area`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622",fillOpacity:"0.35"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"0.8"})]})]}),Z.map((e,t)=>(0,y.jsx)(n.Rect,{x:re(J(e.fromMin)),y:oe,width:Math.max(3,re(J(e.toMin))-re(J(e.fromMin))),height:le,fill:`url(#${Fe}-${e.strength})`},`${e.fromMin}-${t}`)),he.map(e=>(0,y.jsx)(n.Line,{x1:se,x2:se+ne,y1:ae(e),y2:ae(e),stroke:c.colours.muted,strokeWidth:1,opacity:.28},`grid-${e}`)),ue?(0,y.jsx)(n.Rect,{testID:"day-graph-elapsed",x:re(j.getTime()),y:oe,width:Math.max(0,re(ce)-re(j.getTime())),height:le,fill:c.colours.gold,opacity:.12}):null,we?(0,y.jsx)(n.Path,{d:we,fill:"#3A2F1E",stroke:"none"}):null,be?(0,y.jsx)(n.Path,{d:be,stroke:c.colours.gold,strokeWidth:2.5,fill:"none"}):null,ve?(0,y.jsx)(n.Path,{d:ve,stroke:c.colours.gold,strokeWidth:2.5,fill:"none",opacity:.38}):null,I?null:[j,T].map((e,t)=>(0,y.jsx)(n.Line,{x1:re(e.getTime()),x2:re(e.getTime()),y1:oe,y2:oe+le,stroke:c.colours.goldLight,strokeWidth:1.5,strokeDasharray:"4,4"},`service-${t}`)),ue?(0,y.jsx)(n.Line,{testID:"day-graph-now",x1:re(ce),x2:re(ce),y1:oe,y2:oe+le,stroke:c.colours.gold,strokeWidth:2}):null,je.busiest?(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:je.busiest.x+je.busiest.w/2,y:je.busiest.y+je.busiest.h-2,fill:c.colours.gold,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:je.busiest.text}):null,De?null:(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:se+ne/2,y:oe+le/2,fill:c.colours.muted,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:D??'No bookings yet today'})]}):null,F?de.map(e=>(0,y.jsx)(o.default,{testID:"day-graph-ytick",pointerEvents:"none",style:{position:'absolute',left:0,width:se-4,top:e.top,alignItems:'flex-end',justifyContent:'flex-start'},children:(0,y.jsx)(h.T,{size:e.font,numberOfLines:1,colour:c.colours.muted,style:{textAlign:'right'},children:String(e.value)})},`yt-${e.value}`)):null,F&&ue&&te>=m.YTICK_MIN_PLOT?(0,y.jsx)(o.default,{testID:"day-graph-now-label",pointerEvents:"none",style:{position:'absolute',left:He,top:Se,minWidth:Oe,height:20,paddingHorizontal:8,borderRadius:10,backgroundColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:12,weight:"semibold",colour:c.colours.bg,center:!0,numberOfLines:1,children:ze})}):null]}),(0,y.jsxs)(o.default,{testID:"day-graph-axis",onLayout:e=>X(e.nativeEvent.layout.height),style:{minHeight:m.AXIS_BAND,flexShrink:0,position:'relative',justifyContent:'center',paddingBottom:2},children:[(0,y.jsx)(o.default,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{opacity:0,alignSelf:'flex-start'},children:(0,y.jsx)(h.T,{size:m.AXIS_FONT,numberOfLines:1,children:"20"})}),je.hours.map(e=>{const t=Math.min(Math.max(e.w,40),Math.max(e.w,F)),s=e.x+e.w/2-t/2,i=Math.max(0,Math.min(Math.max(0,F-t),s));return(0,y.jsx)(o.default,{pointerEvents:"none",style:{position:'absolute',left:i,width:t,top:0,bottom:0,alignItems:i>s+.5?'flex-start':in.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1400,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.seasonClosedAreaIds=s,e.chartBands=function(t,a,c){const u=s(t,a,c),f=[];for(const s of t){if(s.removedAt)continue;if(s.areaId&&u.has(s.areaId))continue;if(s.areaId||s.tables?.length)continue;const t=s.wholeDay?0:n(s.from),l=s.wholeDay?1440:n(s.to);if(null==t||null==l)continue;const h=Math.max(t,a),M=Math.min(l,c);if(M<=h)continue;const m=o(s,h,M);f.push({fromMin:h,toMin:M,strength:m.strength,spoken:m.spoken})}f.sort((n,t)=>n.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1400,[]); __d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.coverCurve=function(s,c,n,a){const u=s.filter(t=>!['cancelled','noshow'].includes(t.status)).map(o=>{const s=(0,t.startOf)(o).getTime();return{s:s,e:s+6e4*(0,t.durOf)(o,a),n:o.partySize}}),f=[];for(let t=c.getTime();t<=n.getTime();t+=o)f.push({t:t,covers:u.reduce((o,s)=>t>=s.s&&tt.covers));if(!o)return[];const s=[];return t.forEach((c,n)=>{const a=t.slice(Math.max(0,n-3),n+4);c.covers<.6*o||c.coverst.covers))||s.some(t=>Math.abs(t.from-c.t)<36e5)||s.push({from:c.t,to:c.t,covers:c.covers})}),s.slice(0,3)},e.quietOf=function(t,o,s){const c=Math.max(0,...t.map(t=>t.covers)),n=Math.max(2,.25*c),a=[];let u=null;const f=t.filter(t=>t.t>=o&&t.t<=s);return f.forEach((t,o)=>{const s=t.covers<=n;s&&null===u&&(u=t.t);const c=o===f.length-1;if((!s||c)&&null!==u){const o=t.t;o-u>=18e5&&a.push({from:u,to:o}),u=null}}),a.sort((t,o)=>o.to-o.from-(t.to-t.from)).slice(0,3).sort((t,o)=>t.from-o.from)};var t=r(d[0]);const o=9e5},1401,[1074]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CANCEL_TINT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"CANCEL_BORDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"CANCEL_INK",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"CANCEL_MUTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"cancelWhen",{enumerable:!0,get:function(){return d}}),e.cancelledBy=u,e.cancelItem=b,e.cancellationsFor=function(n,t,o){return n.filter(n=>n.date===t&&('cancelled'===n.status||'noshow'===n.status)).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name)).map(n=>b(n,o(n)))},Object.defineProperty(e,"cancellationsHeading",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"cancellationsEmpty",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"cancellationsCounts",{enumerable:!0,get:function(){return f}});var n=r(_d[0]),t=r(_d[1]);const o=n=>n?n.split('+').map(n=>n.trim()).filter(Boolean):[],i='#17140F',a='#6B5A35',l='#F3E7CC',c='#B8AA8A',s={online:'Website',phone:'Phone','in-person':'In person','walk-in':'Walk-in',email:'Email','third-party':'Third party'},d=(n,t)=>{if(!n)return null;const o=new Date(n);if(Number.isNaN(o.getTime()))return null;const i=o.toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'});return o.toLocaleDateString('en-CA',{timeZone:'Europe/London'})===t?i:`${o.toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'Europe/London'})}, ${i}`};function u(n){const t=n;if('noshow'===n.status)return t.cancelled?.by?`Marked no-show by ${t.cancelled.by}`:'Marked no-show';if(t.cancelled?.by)return t.cancelled.by;const o=!!t.wix?.status&&/CANCEL|DECLIN/i.test(t.wix.status);return o&&t.wix?.archived?'Cancelled and archived in Website bookings':o?'Cancelled in Website bookings':(n.tags??[]).some(n=>n.endsWith(': deposit not paid'))||'PAYMENT_INFORMATION_PENDING'===t.wix?.status?'Website booking not finished (deposit not paid)':t.wix?.archived?'Archived in Website bookings':'Not recorded'}function b(i,a){const l=i,c=o(i.table??l.cancelled?.table??void 0),b=c.length?`Table ${(0,n.tableNumbers)(c.join('+'))}`:'No table',p=`${i.partySize} ${1===i.partySize?'person':'people'}`,h=d(l.cancelled?.at??(l.wix?l.wix.updatedDate:null),i.date),f=u(i),w=i.walkIn?'Walk-in':s[i.source??'']??(l.wix?'Website':'Not recorded'),y=(0,t.allergyLine)(i),C='noshow'===i.status,N=`${C?'No-show':'Cancelled'}: ${a}, ${y?`allergy noted: ${y}, `:''}${p}, was ${i.time}, ${b.toLowerCase()}. ${f}${h?` at ${h}`:''}.`;return{id:i.id,date:i.date,name:a,people:p,time:i.time,table:b,tables:c,walkIn:!!i.walkIn,by:f,when:h,source:w,notes:(i.notes??'').trim(),allergy:y,spoken:N,kind:C?'noshow':'cancelled'}}const p=n=>`Cancellations & no-shows ${n}`,h=(n="today")=>`No cancellations or no-shows ${n}.`,f=n=>{const t=n.filter(n=>'noshow'===n.kind).length,o=n.length-t;return`${o} ${1===o?'cancellation':'cancellations'} \xb7 ${t} ${1===t?'no-show':'no-shows'}`}},1402,[843,1380]); __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.CancellationsSection=function({items:e,dayWord:b="today",testID:y="display-cancellations"}){const[p,C]=(0,l.useState)(null),j=(0,s.cancellationsHeading)(e.length);return(0,u.jsxs)(o.default,{testID:y,style:{marginTop:14,borderRadius:12,backgroundColor:s.CANCEL_TINT,borderWidth:1,borderColor:s.CANCEL_BORDER,padding:10,gap:6},children:[(0,u.jsxs)(o.default,{accessible:!0,accessibilityRole:"header",accessibilityLabel:e.length?`${j}: ${(0,s.cancellationsCounts)(e)}. Not counted in Covers.`:`Cancellations and no-shows: none ${b}.`,style:{alignItems:'center',gap:2},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:c.colours.gold,center:!0,testID:"cancellations-head",children:j}),e.length?(0,u.jsx)(n.T,{size:14,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-counts",children:(0,s.cancellationsCounts)(e)}):null]}),e.length?e.map(e=>(0,u.jsxs)(t.default,{testID:`cancel-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.spoken,accessibilityHint:"Opens the details. Read only.",onPress:()=>C(e),dataSet:{centreExempt:'list-row'},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:'rgba(214,180,106,0.18)',backgroundColor:e?'#241F16':'transparent'}),children:[(0,u.jsxs)(o.default,{style:{flexDirection:'row',gap:10,alignItems:'flex-start'},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{width:58,textDecorationLine:'line-through'},children:e.time}),(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:e.name}),(0,u.jsx)(o.default,{testID:`cancel-kind-${e.id}`,style:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:'noshow'===e.kind?c.colours.amber:s.CANCEL_BORDER},children:(0,u.jsx)(n.T,{size:13,weight:"semibold",colour:'noshow'===e.kind?c.colours.amber:s.CANCEL_MUTED,children:'noshow'===e.kind?'No-show':'Cancelled'})}),e.allergy?(0,u.jsx)(o.default,{style:{paddingTop:1},children:(0,u.jsx)(h.AllergyIcon,{text:e.allergy,size:20,colour:"#D6A23A",ink:"#17140F",testID:`cancel-allergy-${e.id}`})}):null]}),(0,u.jsxs)(n.T,{size:15,colour:s.CANCEL_MUTED,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[e.people," \xb7 ",e.table," \xb7 ",e.by,e.when?` \xb7 ${e.when}`:'']})]},e.id)):(0,u.jsx)(n.T,{size:15,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-empty",children:(0,s.cancellationsEmpty)(b)}),p?(0,u.jsx)(x,{c:p,onClose:()=>C(null)}):null]})},_e.CancelDetail=x;var l=r(d[0]),t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]);function b({k:e,v:l}){return(0,u.jsxs)(o.default,{accessible:!0,accessibilityLabel:`${e}: ${l}`,style:{flexDirection:'row',gap:10,paddingVertical:6,borderBottomWidth:1,borderColor:c.colours.hairline},children:[(0,u.jsx)(n.T,{size:16,colour:c.colours.muted,style:{width:130},children:e}),(0,u.jsx)(n.T,{size:16,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l})]})}function x({c:e,onClose:l}){return(0,u.jsxs)(n.Sheet,{visible:!0,onClose:l,title:`${'noshow'===e.kind?'No-show':'Cancelled'} \xb7 ${e.name}`,maxWidth:560,testID:"cancel-detail",children:[(0,u.jsxs)(o.default,{testID:"cancel-detail-body",style:{gap:2},children:[(0,u.jsx)(b,{k:"Name",v:e.name}),(0,u.jsx)(b,{k:"Party",v:e.people}),e.allergy?(0,u.jsx)(b,{k:"Allergies",v:e.allergy}):null,(0,u.jsx)(b,{k:"Was booked for",v:`${e.date?`${new Date(`${e.date}T12:00:00`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})}, `:''}${e.time}`}),(0,u.jsx)(b,{k:"Table",v:e.table}),(0,u.jsx)(b,{k:'noshow'===e.kind?'No-show':'Cancelled by',v:e.by}),(0,u.jsx)(b,{k:"When",v:e.when??'Not recorded'}),(0,u.jsx)(b,{k:"Booked by",v:e.source}),(0,u.jsx)(b,{k:"Notes",v:e.notes||'None'})]}),(0,u.jsx)(n.T,{size:14,colour:c.colours.muted,center:!0,children:"Read only. Not counted in Covers. Phone numbers stay in the Managers app."})]})}},1403,[17,385,85,777,1402,804,1359,8]); diff --git a/chef-app/admin.html b/chef-app/admin.html index a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 d029121c0aaa30bbf8ea2c2110926e1c98756133..a7004ef0d13b185d799d57b214683aff0f0e6158 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 f6584ad097aceb3ebf00bafd82f988185c5e8b89..851506cf94d9e0d79f746c9ecf9edd40be8c1f1e 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-bf6f8631db"; +const V = "cc-chef-962ceb0caf"; const BASE = "/chef-app/"; -const PRECACHE = ["/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/chef-app/assets/assets/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=bf6f8631db31719a5277e97afed8ab8ce62bab86e76d6add62f808e760452ab9"]; +const PRECACHE = ["/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/chef-app/assets/assets/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=962ceb0caffa9043a1d52799ca2273020d38df601496d3a12e4e8c7e286022c7"]; // 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 a8810a298939e32245bba9f78f3c6c396c96a90d..6f9acd13b1d7aeab4c037c79c25edcf8e9a33841 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 3666f93db84cce10a6ff9a1e86ac77c12bb48f87..83fb9d6ecf3381ebd3e83a0b2fcea1f932b2a8a7 100644 --- a/customer-app/_expo/static/js/web/bundle.js +++ b/customer-app/_expo/static/js/web/bundle.js @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__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.201'},979,[]); +__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.202'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1247,7 +1247,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,"FOH_ROLE_BADGES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"KITCHEN_ROLE_BADGES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ROLE_BADGES",{enumerable:!0,get:function(){return o}}),e.cleanBadge=c,Object.defineProperty(e,"isKitchenBadge",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isFohBadge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"badgeSpoken",{enumerable:!0,get:function(){return f}}),e.assignShiftBadge=b,e.assignKitchenShiftBadge=function(n,t,o){const s=String(o??'').trim();return s&&!u(s)?n:b(n,t,s?c(s):void 0)},e.applyLiveKitchenBadge=function(n,t,o){const s=String(o??'').trim();if(s&&!u(s))return n;const f=s?c(s):void 0;return n.map(n=>n.id===t?{...n,badge:f}:n)};const n=['Bar','Floor'],t=['Upstairs KP','Downstairs KP','Sauce','Larder'],o=[...n,...t];function c(n){const t=String(n??'').trim().toLowerCase();return o.find(n=>n.toLowerCase()===t)}const u=n=>{const o=c(n);return!!o&&t.includes(o)},s=t=>{const o=c(t);return!!o&&n.includes(o)},f=n=>c(n)?`, on ${c(n)}`:'';function b(n,t,o){const u=c(o);return n.map(n=>n.id===t?{...n,badge:u,changed:!!n.published||n.changed}:n)}},1164,[]); __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.useSuggestions=j,_e.OrdersScreen=function({focus:e}={}){const[s,t]=(0,n.useState)('sheets');return(0,x.jsxs)(l.default,{style:{gap:12},children:[(0,x.jsx)(y.Seg,{value:s,onChange:t,options:[{id:'sheets',label:'Order sheets'},{id:'suggested',label:'Suggested orders'},{id:'history',label:'Order history'}]}),'sheets'===s?(0,x.jsx)(m.OrderSheets,{focus:e}):'suggested'===s?(0,x.jsx)(w,{}):(0,x.jsx)($,{})]})};var s=r(_d[0]),t=r(_d[1]),n=r(_d[2]),i=e(r(_d[3])),l=e(r(_d[4])),d=r(_d[5]),o=r(_d[6]),u=r(_d[7]),c=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),f=r(_d[12]),m=r(_d[13]),x=r(_d[14]);const b=(e,s)=>'kg'===s?Math.ceil(2*e)/2:Math.ceil(e);function j(){const{k:e,now:s,rid:n}=(0,y.useChef)(6e4),{pct:i}=(0,y.useForecast)(),l=(0,u.supplierView)('chef',(0,o.useOwner)(e=>e.suppliers)).filter(e=>!e.archived),d=1+Math.max(0,i)/100;return l.map(i=>{const l=e.ingredients.filter(e=>e.supplierId===i.id).map(e=>({i:e,qty:(0,t.fishInStone)(n,e)?(0,t.fromStone)(Math.ceil(2*(0,t.toStone)(Math.max(0,e.par*d-e.onHand),e.unit))/2,e.unit):b(Math.max(0,e.par*d-e.onHand),e.unit)})).filter(e=>e.qty>0),o=(0,p.weekday)(s),u=i.orderDays.includes(o),[c,h]=(i.cutoff||'23:59').split(':').map(Number),y=new Date(s);y.setHours(c,h,0,0);const f=e.orders.some(e=>e.supplierId===i.id&&new Date(e.at).toDateString()===s.toDateString()),m=[1,2,3,4,5,6,7].map(e=>(o+e)%7).find(e=>i.orderDays.includes(e));return{s:i,lines:l,ordersToday:u,cutPassed:s>y,placedToday:f,nextDay:m,total:Math.round(l.reduce((e,s)=>e+s.qty*s.i.cost,0))}}).filter(e=>e.lines.length||e.ordersToday)}function w(){const{me:e,rid:o}=(0,y.useChef)(),{label:u,covers:m,enough:b,booked:w}=(0,y.useForecast)(),$=(0,f.useKitchen)(e=>e.addOrder),S=j(),[C,M]=(0,n.useState)({}),[O,k]=(0,n.useState)('');return(0,x.jsxs)(l.default,{style:{gap:10},children:[(0,x.jsxs)(d.Muted,{children:[b?`Built from par levels and today's forecast (${m} Covers, ${u} vs a typical day).`:`Built from par levels (no forecast yet: not enough history; ${w} Covers booked so far).`," Adjust, then call the supplier or use their ordering website. Nothing is sent by CoverCharge."]}),O?(0,x.jsx)(d.Banner,{kind:"success",title:"Saved to order history",children:O}):null,S.map(({s:n,lines:u,ordersToday:y,cutPassed:f,placedToday:m,nextDay:b,total:j})=>{const w=u.map(e=>({...e,q:C[`${n.id}:${e.i.id}`]??e.qty})),S=Math.round(w.reduce((e,s)=>e+s.q*s.i.cost,0)),O=s=>{$({supplierId:n.id,by:e,status:s,lines:w.filter(e=>e.q>0).map(e=>({ing:e.i.id,qty:e.q,cost:e.i.cost})),total:S}),k(`${n.name}: ${(0,c.gbp)(S)} (${s}).`)};return(0,x.jsxs)(d.Card,{highlight:!y||m||f?void 0:h.colours.gold,children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{weight:"semibold",children:n.name}),(0,x.jsxs)(d.Muted,{children:[n.category," \xb7 min order ",(0,c.gbp)(n.minOrder)]})]}),m?(0,x.jsx)(d.Badge,{kind:"ok",label:"ORDERED TODAY"}):y?(0,x.jsx)(d.Badge,{kind:f?'red':'amber',label:f?`CUT-OFF ${n.cutoff} PASSED`:`ORDER BY ${n.cutoff}`}):(0,x.jsx)(d.Badge,{label:`NEXT ${null!=b?p.DAY3[b].toUpperCase():'\u2014'}`})]}),w.length?w.map(e=>(0,x.jsxs)(d.Row,{wrap:!0,style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{size:14,children:e.i.name}),(0,x.jsxs)(d.Muted,{children:["On hand ",(0,s.ingredientQty)(o,e.i,e.i.onHand)," \xb7 par ",(0,s.ingredientQty)(o,e.i,e.i.par)]})]}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"Less",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone less':'Less'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,-1)}))}),(0,x.jsx)(l.default,{accessible:!0,accessibilityLabel:(0,s.ingredientSpeech)(o,e.i,e.q),children:(0,x.jsx)(d.T,{size:16,style:{minWidth:76,textAlign:'center'},children:(0,s.ingredientQty)(o,e.i,e.q)})}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"More",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone more':'More'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,1)}))})]},e.i.id)):(0,x.jsx)(d.Muted,{children:"Everything is at par."}),w.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(d.T,{weight:"semibold",children:["Estimated ",(0,c.gbp)(S)]}),S{i.default.openURL(`tel:${n.phones[0].replace(/\s/g,'')}`).catch(()=>{}),O('placed (by phone)')}}):null,n.website?(0,x.jsx)(d.Button,{small:!0,kind:"secondary",label:"Open website",onPress:()=>{i.default.openURL(n.website).catch(()=>{}),O('placed (on website)')}}):null]})]}):null,void 0]},n.id)})]})}function $(){const{k:e,rid:t}=(0,y.useChef)(),n=(0,o.useOwner)(e=>e.suppliers);return(0,x.jsx)(l.default,{style:{gap:8},children:e.orders.map(i=>(0,x.jsxs)(d.Card,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(d.T,{weight:"semibold",style:{flex:1},children:n.find(e=>e.id===i.supplierId)?.name}),(0,x.jsx)(d.Badge,{kind:"neutral",label:i.status.toUpperCase()})]}),(0,x.jsxs)(d.Muted,{children:[new Date(i.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",i.by,i.total?` \xb7 ${(0,c.gbp)(i.total)}`:'']}),i.lines.length?(0,x.jsx)(d.Muted,{children:i.lines.map(n=>{const i=e.ingredients.find(e=>e.id===n.ing);return`${(0,s.ingredientQty)(t,i??{name:n.ing,unit:''},n.qty)} ${i?.name??n.ing}`}).join(', ')}):null]},i.id))})}},1165,[1148,943,17,362,85,777,876,955,851,804,1055,1140,1000,1166,8]); __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.openLink=w,_e.useSheetReminders=C,_e.OrderSheets=function({focus:e}){const{rid:t,now:l}=(0,x.useChef)(3e4),o=(0,u.useSheets)(t).filter(e=>(0,n.chefCanSee)(t,e)&&!e.placeholder),[h,c]=(0,s.useState)(e??null),p=C(),f=(0,b.wd)(l);return(0,j.jsxs)(d.default,{style:{gap:10},testID:"order-sheets",children:[(0,j.jsx)(i.Banner,{kind:"info",title:"Nothing is sent for you",children:"Text, WhatsApp and phone orders open your phone\u2019s own app with the order already written. Check it, then press Send yourself."}),p.map(e=>(0,j.jsx)(r.default,{accessibilityRole:"button",onPress:()=>c(e.supplierId),children:(0,j.jsxs)(i.Banner,{kind:'red'===e.tone?'danger':'warn',title:`\u23f0 ${e.text}`,children:["Tap to open the ",e.name," order sheet."]})},e.supplierId)),(0,j.jsxs)(i.Muted,{children:["Today is ",b.DAYS[f],". Edit suppliers in Managers \u203a Settings \u203a Supplier order sheets."]}),o.map(e=>(0,j.jsx)($,{s:e,open:h===e.id,onToggle:()=>c(h===e.id?null:e.id)},e.id)),o.length?null:(0,j.jsx)(i.Muted,{children:"No order sheets yet. Add suppliers in Managers \u203a Settings \u203a Supplier order sheets."})]})};var t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),o=e(_r(_d[4]));_r(_d[5]);var r=e(_r(_d[6])),d=e(_r(_d[7])),i=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),b=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),j=_r(_d[17]);function w(e){if('undefined'!=typeof window){const t=window;return'function'==typeof t.__ccOpenLink?void t.__ccOpenLink(e):void(/^https?:/.test(e)?window.open(e,'_blank','noopener'):window.location.href=e)}o.default.openURL(e).catch(()=>{})}async function k(e){try{const t='undefined'!=typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0}catch{}return!1}const S={online:'\ud83c\udf10',phone:'\ud83d\udcde',text:'\ud83d\udcac',whatsapp:'\u2706',tbc:'\ud83d\udd8a\ufe0f'},T={borderWidth:1,borderColor:f.colours.border,borderRadius:10,paddingHorizontal:12,paddingVertical:10,color:f.colours.text,backgroundColor:f.colours.surface2,fontSize:f.font.body};function C(){const{rid:e,now:t}=(0,x.useChef)(6e4),l=(0,u.useSheets)(e).filter(t=>(0,n.chefCanSee)(e,t)&&!t.placeholder),s=(0,u.useOrderSheets)(e=>e.opened),o=(0,h.useShellfish)(e,'','chef'),r=(0,b.remindersFor)(l,t,s);for(const n of l){const l=o.items.filter(e=>(e.supplierId===n.id||!e.supplierId&&n.shellfish)&&o.isLow(e.key));!l.length||s[n.id]&&new Date(s[n.id]).toDateString()===t.toDateString()||r.push({supplierId:n.id,name:n.name,text:`${'text'===n.method||'whatsapp'===n.method?'Text':'Order from'} ${n.contact||n.name}: ${l.map(t=>`${(0,c.fmtStockCount)(e,t,o.counts[t.key]??0)} ${t.plural.toLowerCase()}`).join(' and ')} left`,tone:'amber',cutoffPassed:!1})}return r}function $({s:e,open:n,onToggle:o}){const{rid:C,r:$,me:D,now:I}=(0,x.useChef)(3e4),v=(0,u.useOrderSheets)(e=>e.patch),M=(0,u.useOrderSheets)(e=>e.markOpened),B=(0,u.useOrderSheets)(t=>t.opened[e.id]),[L,P]=(0,s.useState)({}),[O,R]=(0,s.useState)(''),[A,z]=(0,s.useState)(''),[_,W]=(0,s.useState)(!1),H=(0,h.useShellfish)(C,D,'chef'),K=(0,b.nextDelivery)(e,I),E=(0,b.orderLines)(e,L,O,C),N=($.address??$.location??'').split(',').map(e=>e.trim()).filter(Boolean),q=N.length>=3?N[1]:N[0]??'',U=(0,b.orderMessage)(e,$.name,q,E,D.split(' ')[0],I),Q=e.orderDays.includes((0,b.wd)(I)),Y=(e,t)=>P(n=>({...n,[e.id]:(0,l.stepQuantity)(C,e,n[e.id]||0,t)})),F=t=>{M(e.id,I.toISOString()),w(t)},G='text'===e.method||'whatsapp'===e.method||'phone'===e.method,V=Math.round(100*((0,y.parseMoneyInput)(A)??NaN)),J=H.items.filter(t=>t.supplierId===e.id||!t.supplierId&&e.shellfish),X=J.filter(e=>H.isLow(e.key));return(0,j.jsxs)(d.default,{testID:`sheet-${e.id}`,style:{borderRadius:14,borderWidth:1.5,borderColor:Q||X.length?f.colours.amber:n?f.colours.gold:f.colours.border,backgroundColor:f.colours.surface,overflow:'hidden'},children:[(0,j.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.name} order sheet`,onPress:o,style:{padding:12,gap:4},children:[(0,j.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(i.T,{weight:"semibold",size:f.font.large,style:{flex:1},children:[S[e.method]," ",e.name]}),(0,j.jsx)(i.Badge,{kind:e.placeholder?'amber':'gold',label:e.placeholder?'To fill in':b.METHOD_LABEL[e.method]})]}),(0,j.jsx)(i.Muted,{children:e.goods}),(0,j.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.deliveryDays.length?(0,j.jsx)(i.Badge,{kind:"neutral",label:`Delivers ${(0,b.dayRange)(e.deliveryDays)}`}):null,e.orderDays.length?(0,j.jsx)(i.Badge,{kind:Q?'amber':'neutral',label:`Order ${(0,b.dayRange)(e.orderDays)}${e.cutoff?` by ${e.cutoff}`:''}`}):null,e.frequency?(0,j.jsx)(i.Badge,{kind:"neutral",label:e.frequency}):null,e.priceCapPerKg?(0,j.jsx)(i.Badge,{kind:"blue",label:`Cap ${(0,p.gbp)(e.priceCapPerKg)}/kg`}):null,J.length?(0,j.jsx)(i.Badge,{kind:X.length?'amber':'ok',label:J.map(e=>`${e.icon} ${(0,c.fmtStockCount)(C,e,H.counts[e.key]??0)}`).join(' \xb7 ')}):null,B&&new Date(B).toDateString()===I.toDateString()?(0,j.jsx)(i.Badge,{kind:"ok",label:"Opened today \u2713"}):null]})]}),n?(0,j.jsxs)(d.default,{style:{padding:12,paddingTop:0,gap:10},children:[K?(0,j.jsxs)(i.Muted,{children:["Next delivery if you order now: ",(0,b.niceDay)(K),"."]}):null,e.reminder?(0,j.jsxs)(i.Muted,{children:["Reminder on ",e.orderDays.map(e=>b.DAYS[e]).join(', '),": ",e.reminder]}):null,e.notes?(0,j.jsx)(i.T,{size:f.font.small,colour:f.colours.muted,children:e.notes}):null,e.placeholder?(0,j.jsx)(i.Banner,{kind:"warn",title:"Still to be set up",children:"Add the supplier, how to order and delivery days in Managers \u203a Settings \u203a Supplier order sheets."}):null,e.items.map(e=>(0,j.jsxs)(d.default,{style:{gap:6},children:[(0,j.jsxs)(i.T,{children:[e.name,e.unit?(0,j.jsxs)(i.T,{size:f.font.small,colour:f.colours.muted,children:[" (",(0,l.quantityUnit)(C,e),")"]}):null]}),(0,j.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone less':'Less'} ${e.name}`,onPress:()=>Y(e,-1),style:{minWidth:44,minHeight:44}}),(0,j.jsx)(d.default,{accessible:!0,accessibilityLabel:(0,l.fishQtySpeech)(C,e,L[e.id]||0),children:(0,j.jsx)(i.T,{weight:"bold",size:20,style:{minWidth:76,textAlign:'center'},children:(0,l.fishInStone)(C,e)?(0,l.fishQtyText)(C,e,L[e.id]||0):L[e.id]||0})}),(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone more':'More'} ${e.name}`,testID:`qty-${e.id}`,onPress:()=>Y(e,1),style:{minWidth:44,minHeight:44}})]})]},e.id)),(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsx)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:"Anything else (one line each)"}),(0,j.jsx)(t.TextInput,{value:O,onChangeText:R,multiline:!0,placeholder:"e.g. 2 boxes lemons",placeholderTextColor:f.colours.muted,style:[T,{minHeight:60}]})]}),G?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['whatsapp'===e.method?'WhatsApp number':'phone'===e.method?'Phone number':'Mobile number',e.number?'':' (blank: fill in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`number-${e.id}`,value:e.number,onChangeText:t=>v(C,e.id,{number:t}),keyboardType:"phone-pad",placeholder:"07\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,'online'===e.method?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['Open Coldweb'===e.urlLabel?'Coldweb ordering link':'Website link',e.url?'':' (blank: paste it in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`url-${e.id}`,value:e.url,onChangeText:t=>v(C,e.id,{url:t.trim()}),autoCapitalize:"none",keyboardType:"url",placeholder:"https://\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,e.priceCapPerKg?(0,j.jsxs)(d.default,{style:{gap:6,padding:10,borderRadius:12,backgroundColor:f.colours.blueBg},children:[(0,j.jsxs)(i.T,{weight:"semibold",colour:"#E2C489",children:["Price cap ",(0,p.gbp)(e.priceCapPerKg),"/kg \xb7 buy from the cheapest UK seller under it"]}),(0,j.jsxs)(i.Muted,{children:["Seller: ",e.seller||'to be chosen']}),(0,j.jsxs)(i.Row,{gap:8,children:[(0,j.jsx)(i.T,{size:f.font.small,style:{flex:1},children:"Price you found (\xa3/kg)"}),(0,j.jsx)(t.TextInput,{testID:"price-found",value:A,onChangeText:e=>z((0,y.sanitiseMoneyTyping)(e)),keyboardType:"decimal-pad",inputMode:"decimal",placeholder:"e.g. 22.50",placeholderTextColor:f.colours.muted,style:[T,{width:120}]})]}),V>0?(0,j.jsx)(i.Badge,{kind:V<=e.priceCapPerKg?'ok':'red',label:V<=e.priceCapPerKg?`${(0,p.gbp)(V)}/kg is under the cap \u2713`:`${(0,p.gbp)(V)}/kg is over the ${(0,p.gbp)(e.priceCapPerKg)} cap: look for a cheaper seller`}):null]}):null,'online'!==e.method&&'tbc'!==e.method?(0,j.jsxs)(d.default,{testID:`preview-${e.id}`,style:{padding:10,borderRadius:12,borderWidth:1,borderColor:f.colours.border,backgroundColor:f.colours.surface2},children:[(0,j.jsx)(i.T,{size:12,weight:"semibold",colour:f.colours.gold,children:'phone'===e.method?'READ THIS OUT':'YOUR MESSAGE'}),(0,j.jsx)(i.T,{size:f.font.small,children:E.length?U:'Add quantities above to write the order.'})]}):null,(0,j.jsxs)(i.Row,{wrap:!0,gap:8,children:['text'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"\ud83d\udcac Open in Messages",disabled:!E.length,onPress:()=>F((0,b.smsLink)(e.number,U))}):null,'whatsapp'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"Open in WhatsApp",disabled:!E.length,onPress:()=>F((0,b.waLink)(e.number,U))}):null,'phone'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83d\udcde Call ${e.name}`,disabled:!e.number,onPress:()=>F((0,b.telLink)(e.number))}):null,'online'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83c\udf10 ${e.urlLabel??'Open website'}`,disabled:!e.url,onPress:()=>F(e.url)}):null,'online'!==e.method&&'tbc'!==e.method&&E.length?(0,j.jsx)(i.Button,{kind:"ghost",label:_?'Copied \u2713':'Copy order',onPress:async()=>{const e=await k(U);W(e),e&&setTimeout(()=>W(!1),2e3)}}):null]}),'text'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: Messages opens with the order written and asks who to send it to."}):null,'whatsapp'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: WhatsApp opens with the order written and asks who to send it to."}):null,'phone'!==e.method||e.number?null:(0,j.jsx)(i.Muted,{children:"Add the phone number above to call from here."}),'online'!==e.method||e.url?null:(0,j.jsx)(i.Muted,{children:"Add the link above and the button opens it."})]}):null]})}},1166,[812,820,943,17,362,219,385,85,777,998,942,944,851,999,804,1140,840,8]); -__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:i,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),i?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:i}):null]}):null,n||w.length||!i?null:(0,j.jsx)(l.default,{accessibilityRole:"button",onPress:i,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:i?()=>{k(!1),i()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const i=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!i.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${i.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,i.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:i.items.map((t,s)=>{const o=i.counts[t.key]??0,l=d[t.key]??0,h=Math.max(0,o-l),m=h<=0,b=m||i.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:l?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,l)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return z}}),_e.ShellfishChip=M,_e.SundayRoastChip=function(e){return(0,j.jsx)(M,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=e(_r(_d[5])),l=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(i.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:i,group:l}){const d=(0,h.useShellfish)(e,s,r,l),m='roast'===l,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const i=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,i,o):Math.max(0,Math.min(99,i+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),z=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),M=(0,o.useRef)(null);M.current||(M.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!M.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,H]=(0,o.useState)(0),F=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?z:D>0,W=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!F.length)return;const e=setInterval(()=>H(e=>e+1),600);return()=>clearInterval(e)},[R.state,F.length]);const P=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void W('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?W('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?W('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-P.current>2e4&&W('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||F.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||F.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${F.length} ${1===F.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&z&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),P.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!z,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),i?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:i}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const z=18;function M({rid:e,by:t,app:r,size:i="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(m&&'roast'===d&&(!f.items.length||!(0,u.isSundayIn)(T)))return(0,j.jsx)(R,{size:i});if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const M='m'===i?20:17,E='roast'!==d,B=E&&f.items.some(e=>(k[e.key]??0)>0),H=B?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==i&&!B;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${E&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,i=p[t.key]??0,d=Math.max(0,n-i),h=d<=0,m=h||f.isLow(t.key),b=E?k[t.key]??0:0,x=h?y.colours.red:E&&'display'!==r?y.colours.shellfishFree:m&&!E?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:B?4:6,paddingHorizontal:B?5:9,paddingVertical:3,flexShrink:0,minWidth:B?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,M-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:M-2}),(0,j.jsx)(c.T,{size:M,weight:"bold",colour:x,style:{lineHeight:M+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(l.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:z,minWidth:z,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):B?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:z,width:z,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,H)})`})}):null,!F||!(i||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':i?`${(0,u.fmtStockCount)(e,t,i)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),i=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),l=(0,f.reservedBookingsOn)(r,i,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(i))}),l.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}function R({size:e}){return(0,j.jsxs)(a.default,{testID:"roast-slot",accessible:!0,accessibilityLabel:"Sunday roast count: shown on Sundays",style:{minHeight:44,minWidth:'xs'===e?64:84,paddingHorizontal:10,borderRadius:12,borderWidth:1,borderColor:y.colours.hairline,backgroundColor:'rgba(255,255,255,0.03)',flexDirection:'row',alignItems:'center',justifyContent:'center',gap:6},children:[(0,j.jsx)(c.T,{size:'m'===e?14:12,colour:y.colours.muted,children:"Roast"}),(0,j.jsx)(c.T,{size:'m'===e?18:16,weight:"bold",colour:y.colours.muted,children:"\u2013"})]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); +__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:l,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(i.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),l?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:l}):null]}):null,n||w.length||!l?null:(0,j.jsx)(i.default,{accessibilityRole:"button",onPress:l,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:l?()=>{k(!1),l()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const l=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!l.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${l.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,l.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:l.items.map((t,s)=>{const o=l.counts[t.key]??0,i=d[t.key]??0,h=Math.max(0,o-i),m=h<=0,b=m||l.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:i?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,i)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return M}}),_e.ShellfishChip=z,_e.SundayRoastChip=function(e){return(0,j.jsx)(z,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),l=e(_r(_d[5])),i=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(l.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:l,group:i}){const d=(0,h.useShellfish)(e,s,r,i),m='roast'===i,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const l=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,l,o):Math.max(0,Math.min(99,l+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),M=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),z=(0,o.useRef)(null);z.current||(z.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!z.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,F]=(0,o.useState)(0),H=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?M:D>0,P=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!H.length)return;const e=setInterval(()=>F(e=>e+1),600);return()=>clearInterval(e)},[R.state,H.length]);const W=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void P('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?P('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?P('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-W.current>2e4&&P('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||H.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||H.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${H.length} ${1===H.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&M&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),W.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!M,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),l?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:l}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const M=18;function z({rid:e,by:t,app:r,size:l="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const z='m'===l?20:17,R='roast'!==d,E=R&&f.items.some(e=>(k[e.key]??0)>0),B=E?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==l&&!E;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${R&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,l=p[t.key]??0,d=Math.max(0,n-l),h=d<=0,m=h||f.isLow(t.key),b=R?k[t.key]??0:0,x=h?y.colours.red:R&&'display'!==r?y.colours.shellfishFree:m&&!R?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:E?4:6,paddingHorizontal:E?5:9,paddingVertical:3,flexShrink:0,minWidth:E?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,z-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:z-2}),(0,j.jsx)(c.T,{size:z,weight:"bold",colour:x,style:{lineHeight:z+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(i.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:M,minWidth:M,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):E?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:M,width:M,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,B)})`})}):null,!F||!(l||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':l?`${(0,u.fmtStockCount)(e,t,l)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),l=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),i=(0,f.reservedBookingsOn)(r,l,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(l))}),i.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"look",{enumerable:!0,get:function(){return n}}),r(d[0]);var o=r(d[1]);const b=o=>o,n={panel:{backgroundColor:'#121110',borderRadius:o.radii.xl,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',boxShadow:'0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 28px rgba(0,0,0,0.45)'},quiet:(b,n="gold")=>({minHeight:o.control.tall,borderRadius:o.radii.button,borderWidth:1,borderColor:'blue'===n?'rgba(226,196,137,0.55)':'rgba(207,164,95,0.38)',backgroundColor:b?'rgba(207,164,95,0.16)':'blue'===n?'rgba(226,196,137,0.10)':'rgba(255,255,255,0.035)',paddingHorizontal:14,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:8,boxShadow:'0 1px 0 rgba(255,255,255,0.05) inset',transition:'background-color 120ms ease'}),primary:o=>({backgroundColor:o?'#B8904F':'#CFA45F',borderWidth:1,borderColor:'rgba(255,226,170,0.55)',backgroundImage:o?'linear-gradient(180deg, #BE9552 0%, #A88143 100%)':'linear-gradient(180deg, #E0BA77 0%, #C69A55 100%)',boxShadow:o?'0 2px 8px rgba(0,0,0,0.4)':'0 1px 0 rgba(255,255,255,0.28) inset, 0 10px 24px rgba(207,164,95,0.22), 0 4px 10px rgba(0,0,0,0.45)',transition:'box-shadow 120ms ease'}),onPrimary:'#17130D',web:b}},1168,[219,811]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STOCK_ICON_IMAGES",{enumerable:!0,get:function(){return A}});const A={'\ud83e\udd9e':{uri:'data:image/png;base64,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',w:47,h:64},'\ud83e\udd80':{uri:'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAtCAYAAAAeA21aAAAWJklEQVR42r2aeZhV1ZX2f3ufc+58ax6hikGgmAVBEI1CoaCACEZTOEQ73YlN9HNI8kU7dqfTRWnyGWM6MZ3BBLWj0dZOVUyiokFFoRyQURAQKeYaqKKGW/Mdzzl7f3/cW1hGbY1K3+e5T/1zz6611l7vu9Z61xF8Dp9qkGuqEKIOF2BBIaHvzGBaiY+5JWEquhJMkAofBlp66D96wvzh8teczRrkGqAG1BuLKcrK5yfZLhcIUBqIuhwKWew50s0bTzTy2tqDdAHoKgxRhwL0Z7VdfNYDaqswVmUc/9Fsxl0+hmsLvCyzPEwKQo6wAAVIQAoSjQH15j7Psotael5QYABaCNTmwqLpM2bGtgbGDvqxM64Z6f8xaOMmbd5pT/KnRw/y0I/20qI1AgHiMwbhMwVAVyNFDerusym/YhTfKvPzj1l+QgA4gE4HxjVQRp/XGjwSTuxt8F17XrzlTxpk5qYFIJYy3nqgIFU7ZnJ0hTsuYguNiUIj0RIEJhIJkSht+7u5e/561gJudTWypgb1vx6ATBq6Gy/k8qnF/LQwxBhsQOEiAI3EQGALzfE80X080HWkU1wzN9m04Z7p5P7zXnqGQ6gG1DcpKP2XosCOwvLkCKZ1KISWmfvVgEIDJoYScLyXJ9bu4v/ce5Q+DeLTZsKnCsDQ7b2xiGtmlPF40Iskho3ATCdm+uS+XksdOJwrQ+3eLZs69fUsa7GX+Lgr4OHCdzr55uKXeWoIQrsu45+Uh51NfynoXRIKP5Ma01fsndotver9NiqNlgIXL2akl9cea2DFN3fT92nhID8N5tHoR87izMll4pfBqYagQjqEhYXOGKvTAQgczdVu1MOfswZa5ixvmXtdLtvH5fN3pSHK4i4mQFVtmiFyffz91Gyem3F5V9nvA/21b0Z8RuJwlsIEPcwtKRAaTJXAyc/lgmVn8BshkFSnoXTaA1BVixICFozhrtxxItf1obCEifme4wBaglU+aIxwBWeYni9N8Fn/le2jEBfn5AB71zbwrABYgwDUgMurXh/ebEc+pb36hpKkQXbca+hMfv912kowVAJnXB6rdn+RL4salK4+zQGoqsIQAv3f53JBaZ5YQUBoAwx6NPToDKdnLHSAwhgF4RSelKQ/JRQKO+oi26J8Z10bMVWNrNuf9q+nnyfjCZLxpEV20huanGXDlAjCzVSRD4JXSIU0QI/28/3VFRSImlOkenoCUNuRPvy8IlZ6cxCYKBTQqd93+wAiTVgE8pOEHZOoKxV+rOZuHpi1jr/oKgxRg15Vh1LVyPkbqG8Z4AdKC8PvSsczcgDGA6Ot9wL7QeslNjrHT/lNFVwJsGnBUPH8/AMg2IQCjIRisrZADd10LHOS/iBbEkqhUG5xQJmRfrav3cUdWiOGNTJa1KBrqzAq6vj+7k4eKA1qk5Bj45WaUhMKDHA/HOEqXW90np8lgKhM2yg+9wDoNAGpm6aTlWVQLlS6FHzcQ9pnu2PzbUMYTu+Bblb/pJlk3aoPhEu/U4fWqzFXvJn4RirlPoHQFj3KxQWKTPB+OBRkOgoiaDDpZzMpkCLdRZ4WCAgBb3SQSmhipDL9akyD8yHIS2eHa+Q4xhkTI9HnD6ql5z/PbiFQVXUfdOUugRJrsQF77tH2Lze57n8xoEwVdW3CArIlH3G3AgX52QRum0JYpxuLT5wB5t/QMGg9H1PUE5UedhHVc+W7SpP6kLTUaKlx8GP1xXTr87363nmXcd7hJXzpQKexXjzobhhOFQI4ZyS+f7vMunbpNGfesXZ98Nkd7o+vjjAj37Kn0S9tPagt8SEwU+nMpD9OdEucwdPaCNWCcRW4D81jwXUVvOwRSK0QwwxTCrQ0MPBAb4zNuweNn85apO+QCf9ccAiEnWTLCbl6dI39O12LQVV6FtjxHXHX7El8ry/iJeDROKQ2vrDOvOO8AvvHRQEqsXEzRGv8FcxcPBgn2s29lz47cv4e0dir9CfvDP+2MpjuScS8hrKVnoMFBlJo4ckMLSbgQUovRo9D94Fu7s99jIvOXqBmvXGocO6MByoSFz9WkTzcHvQKy7kyc6ASAnXrErKml3Ljpn05euHDFalFj05IHYsEF46bZecWP8HSI/08PAgSb6YeaJw0fWZ8UKi8ltxJawP6fA1s4pNXAvm33L4A9WB2wayRAfl1tzFMakuxUE1hVJ9HM+BxuvrElu0d3LGjkfMn1/Et/Rvctg7Ppf+xpUAHPa7n5KBpPbarQEvn/QaOMBgbTxk5928pIYmwmvoto/5olioPMAZEYnwtN9Sf4LLWfrYkQOPFxERhARbCOZql/J1hqzDbrURDJZ98ODL/htsXAKO9nBWUMqClckSvz7R7fa7XEEafq5p/0cbSGhp7hyZFWvHmh1W+JbVQCATaFQjTb3JyGAR1foj4oCtVJG4KU2ptCmTQcmwtOAhK6NXCFGt5Dnjp9UtZUiiNayu07yoctNsREE5bQJiWxlUidNo6wU2ZvwlXtyfQCg3K1FpKhOPgNsWSv6ihsU/Pxhoak8+umZ1Uwun8yswuDI3O9bpcMrGbvAJ9KHOoBIgX0RgSTusVk3qJpgxVOXpQXDyut61nkOMg9JpSXF2NlILU+c/xzMRn3avf3Vj4a3dnqbCbw8o00S5ax121FYApmFojdDVSV//PPn5cBoiNCzAqb0bzS9gxiLXtsPN61HV3hyxrlmtr1wzbxuDI3lSXFTV/dgSP2InNTrTWSCF22t0xY/OVs7tmTsyLKsvSYmJRnC0NshsUbAKtEUKQ/OI9+qVvLWxd/YVR3c6sUSmjO+K8Ne5eWrRGrhGwBvjeAsyaepwX5zMhld0oHOnXRmtAmW1hs13Zzz6Wk/yDaAexn9SwsQytEWsEouZDoGH+T2KHrEEtrMehfvg01teTY5pfn4/4eaGU56hJER0uTpgLNfcWeegQh3lk+2qsNZXpGf7ESfePI3ONr00riXsA1R+TurObTl2NZD/y0G0Yuho7bhkNuJq5I2NgCHwWe3U1cBtWDSQBqEfVncfZs0bxx3y/LkfGtCMdaM/CcFXjfQ2RgXtGkXvJLK6uCHDtoGJgX4QHhOBZQA9l5scGINOnu0Dg1Uu4cnoRS5XG3XmSuos38Oy1kciO50v01y6QoTdCps52k0IZlhamhy9p+N3cB7FFOojmzhG8Go/orX6/nE8KJS0tOiWDGUNOdRFP36Kbl00CUxoCR7O9g2OLfqIVkFzkCU+Ykidy2mWib8EZqZ/nZ1GuBklhYZonQ2YypZ31Pc6fty1n6ZgQ/68wxEyAoIY8H0sPXcl/17dyp6ihceMCzIX1OB/VBwhdjRA1qBcWc/G0PO7O9zPXa6R/GXNw2wd5fssJqq99U+zqLCp/rWBm3/lqVJ8jwUykaP5hI1N+tR86O0lVgXsUvE9+W9RMKJO3q0FtSyGsfYfV4y3Nek/IR6jIw0jHRXuDlI0qEZdY6aleNLXpzdFB9rpKBA81ZVUOxDzZg7aOTyhQRRWlMT2qOCFESxhnT2H0dTv66+DCdjEtwDf8fgxiwsaWluNzMTO2d0fZv6WDr1y6gR3DZTQxrG0/NXa/dRn/OiGX74Y8eIclTBIXDxaiP0HfScXd2/9QevjK0eJR3zkd4cZ+Q7R1e53DXYH6AYes4mBqYOmMnt5+pcs9mtG5FsW4GVR6PoR+35cPpHv/IYkjKelLGMSSBvuaA7ppwOKSbJuclqwj9aHeV+ae3zul0MP5uLh0+HWqMdvsSjqPOtO6Nvo9rC7wcZ4IQDxKz7tdXDr7Od7U/5aGgxiOeWrQB1byg0kl/DM6PekN2Ox+qymQKvXKuWNLoq5laAADA04kqI/tzC9qlubkoza6KGiLcdk2RWGHwqwU+N33nHOGOaQ+ok7LYWEZ/huBSKvKaDTy1YYs3d0UFlON1J6CBZ15uQHKGBT2YFOWtf9EgGNRddfVbe3VQ4+vv5iFZ+Xwf0M+Ko/38pupz3D7kKYphouS1WdSsWY2DTa4vUme60uy7oZ3ebJtf6nv5jH2yzMLOXNKab9bkJeSroE2YpZ8+Z0cTrpwUUUfJeEU5OJSiKALTRdaCSQCIcVnVKB1+itNiCckf96by/y+ICOn9JDKjzvHDuaY2zus4y/EY7c/3tn31J1nUnHrRGY3DzJGmKS2tfLihhYGZpYxWLMzvV/4AAfccz6504Ms7+glGndpvnkH+2rLYFULccB3T3nR2skhef3U7KQeP3aA9sNZel2nTy6eEWFUfhIVkoixAjwg+jUcUJyWj4BXGrIxW0J6glfrt6Qr9gyIjbK484Gl49xgsRRf9Rp6athPvmGk4dYXJ3q0h2/OWsdDw4nwPQjUYohVuE/O54KLRvMjSzEn7nIyy09jez/NSZdtnYodL76dXzXKsL46y8TvU5J3/CmxYlo3vmwNE2WaSCTQpOCk5pRW+Dl9NCBM2HU0xJ7GECFDk50Tt8ef0b+t2M8Zfj+lGREdXFJoZAZMpivhlSZWX7yBB3U1pqjBEcM1/ucu5PIvjKQu24eJi4uV6dkzDtgJUnGHQyd6fKP3NIdD8aRBUTjF4kk9WGOAETKt3HRpaFSfw97pw6EgLNjbHODYgVwu9GpCF7RqfAiiEvrNFINeg6Rl0OchoVVST4y4/rAbwMXp07g7O1hx0Xpe1FUY5sYFmKIO58VKFpxbziMhA4EDJCyDkz7wOOC1bXyOY5n4LT9Ts7ITlOY4vLorn37bwEFgBXT6dmIamk9T6g9XmoQmS0EIAa0h4XR7dSLqEcmU4WlPQJ5tvNQaT22WfeH6HtGfmjXdXZvtY0q2i55XxKPblrNC1LHdXFiP88BMJswZweMhgywEoiPOrld3WA/M6co/1x9wzg16qAgGleVaLsJrI4MOOUGHOUqyIaWJpyR+Moxv8wGB9HRwgOsI4oamwRac2JOjBwwdbdXu0ZhMbn4unnpoY1ffzlMs9zasz2HlWSP5fVGAWQGDkvFhHv3pDJYZ1xUTvHEWjxdnMRMQrQO88vBbrLrpkL3p/kTv0xt1/++/EMv7yx8Tbtu+JMHWASs/FgkY3Sf9HPM4dGlBgdehoMyBsEQkMhL56fI9U0pbIz6O9VkkwykCowa0zBt8O1Tc/9KSydH9145Pjq0aS+HaBg7pauTUTqyVO+gs0zydE2BUlsHUUA6FIS+WOPwl7htXzO3JKDRHefiGOm6ph8SO2VizAbET++aLyP/hZM5q6WL8u62euT0DnvlFeMZ6BjyiGyFKCqNUnt2PHmcgujQcVWCdxgyQsPFgGO/RXM6t6EdM7gUbG4mVVm8hlUId7+XX/76VOx5sI/bKMOZ/dhHL5hZyzYkoL4nXl7F+VD6e1g5+O+8FHgOoXoB5Vz2OBt5cxt9PyuOunADlQ82R7dJnIELySI7R0BTi7fwYV07uxijRkGdAj0oToTh9HPDMvlwmdYSpmB7RlEUVKcBIL2aVAxJMvMimXtbdtpXrn26ktxaMqwTu8FWbmAf+LWnuTunMpubqP+BeORL/D+Zx37gsbpYCsEliYpzaTMl0hzawuYTnkoLzJkcYdbaNLpQIB9inIK4/xfLt4/GfTAme2VXA1JiH8rwUIuwgtEAbGjc7RnZBEpVCaXANP1ZrL3/5l61c8chxkoi0arxpE7KyMtMKCwHq9xisSq+gV5VScN98fjc6lyXEUQg0FgatQdxuH07ABaFJmArZFKQ+bpBb1s8XzhtAjTCRUQWH1UcuMz5TCTThZI+HjfuyddAQIuG6kZNRY6t0zWafFJ0eObircl7f5aPyuB4bFxeFH6spwsOjn+LrWqOGb5JNDUJoEKtwa6swVgk4dAX3js5jCTESGPiSGvVus/jxO/XBXTHDzCVbTOrCKS+XzMrzivKIxyHZ7yHeLPH1OumhRp2mSiCgPWYQinnEhSMSMC0SjMQpPpFia9DgTzPq2MtT/HH/FbRPzud2QJEkWZbD1zYuY5MUPK6qMMi81XLKxKH28JVFLDi3jBc9GqSBJ+YQPdDNrbPX8VuAdSs4Z3qQRe0J5o3R8uxAylcycCRb19uIqRP6mDYihnZAyNODfUx4+UAW4WM5zJ0RgbJoOtgm9CfQHQP855tH+Mbf7SG6ZyXfm5zHXaaLwoNojfLmyCffewfpfZpgZWW6YSzP5kafiUcKrEiC7m3tXD57Hb+970yCjVfy4OIctowK8f05+SwvzFMlwfKYW3JGP1Nsg91tAeJJiTBPTweIAT0xQ3d3+N2KnKRLaSztiAbi2FkSd3wRX5s4mhuFgDOf5u53O7jVNbBxUfkGc391DmfpzAB4KgDVGano/nOZNsLPChQqoel/rZVVC19gg65Gzh/LNaPyuMEjUCQzw6prQNwwKIyJ6dm2ndfjVVubQjA8xJ9f5oNAH2oNiIA2DccURmp/ntT78kj2eDUWFi4SBzUuxK3/kEdYa+SZz/GLg738GInh9WJUjuAqgDW16SNNgDWb0uPw4mKuC/jwa404HOEHX9zEy7oaE1AjfVyPRiNQCU2su9WzXh3LdvtcUZrwcE4Iwz/SD7s7/RzNSrlnlCakthFCfG7k5wwMWObhk36nS8fXNcdkn7/Zs0v2Gg3Hc63mK+a3XzMpnzsNB5HvZfTl07lYCJ7StRgrb+LetYtYWVzANL/kvDOLCRpXEQWEqUFQj/va+eSWBFiMH9F6kj9NX8f9QxPTfWcx+papzNEOwhaYB7v59oz1qYegE8DzldLcOZPD7jKvYH4W8uxdjdm+sFdRmJdSykZK8Zlwr4XARUhz+/FAbM8A37i3rfuh96VGD1gR/r0kzKp8k/GY6MWjmAs8deg1zGciDNzQzi0X+VnvNyjMTWDpzCsNsq4KKUAnfJQpD+M7u3nz1Qg3CYG9dl06TQqDzBHgExa6c5BXZqzjEV2NqRdgarAfbet5486Dke9+qyGycF80Of3AoPPzVxqy4r29XimtNFiUft+rPh/rttIopXExEHgx3zlhbH7iqHnpvW0dD2kwdRVGLRhaI/VqrDtfp7c/zgZMhAYRSZADMOEkTm0VxopN1O84wcp9PdxZ38ep/aG5Kr2qFnsGOdzVxPKj3Rz47m46q6uRq0F/fScsG0mF14PGRu7u4ZcCnLoajFWZSl8FRhWwCpyftvQfBm67tSTnqe7d4e9WjjMXTy6Lp4dyF6V0Bkjv1SCBHqYYCLQUCGmlm62BBP2NffzsH/fZ92yJROK16dHdoW5YtNam63pdLw+W+viqLwvLdt8j+FV1uBqEeIkXh80UeogDNMC3txAHXjslkNag1mS2Kl6DMsLIlhM8vXwDz1aDzDgPoOvArRsmrgJSnOytB169pbfoy1Vxdc2scfGZBozwe4cJJHqY5qffe8sk6uAmEhzsirL+9Q5+dcNmGmSGuYfeSv0rglSZBcuuHctZMzObe3xmRmKdMsSf6b0AwPDdwHB0itoqZFUdaqhLGhJKdl7Gj7IDjN66nxuv20fPJ1k/V4HxlMAdqgYvLmKyXzLnzGKmtMSo0C75UiKlxOe6DGgwDYPOfJODDRG2betg27ff5sSQHQyz6yNaBDE0LO5ezuq4Yte5z7N1SO/8qOf+P3szMKsEIBYrAAAAAElFTkSuQmCC',w:64,h:45}}},1169,[]); __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.StockScreen=function({initial:e="levels"}){const[t,i]=(0,l.useState)(e);return(0,y.jsxs)(r.default,{style:{gap:12},children:[(0,y.jsx)(p.Seg,{value:t,onChange:i,options:[{id:'levels',label:'Stock levels'},{id:'take',label:'Stock take'},{id:'deliveries',label:'Deliveries in'}]}),'levels'===t?(0,y.jsx)(j,{}):'take'===t?(0,y.jsx)(f,{}):(0,y.jsx)(v,{})]})};var t=_r(_d[0]),i=_r(_d[1]),n=_r(_d[2]),s=_r(_d[3]),l=_r(_d[4]),d=e(_r(_d[5])),r=e(_r(_d[6])),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]);function j(){const{k:e,rid:t}=(0,p.useChef)(),d=(0,c.useOwner)(e=>e.suppliers),b=(0,i.useSheets)(t),[x,j]=(0,l.useState)('all'),f=e.ingredients.filter(e=>e.onHand<=0),v=e.ingredients.filter(e=>(0,p.isLow)(e.onHand,e.par)),k='alerts'===x?[...f,...v]:e.ingredients,S=[...new Set(k.map(e=>e.supplierId))].map(e=>{const t=d.find(t=>t.id===e),i=b.find(t=>t.id===e);return{id:e,name:t?.name||i?.name||'Supplier not linked',category:t?.category||i?.goods||'Stock'}});return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsxs)(o.Row,{wrap:!0,gap:10,children:[(0,y.jsx)(p.Tile,{label:"Stock value (at cost)",value:(0,u.gbp)((0,p.stockValue)(e.ingredients)),sub:`${e.ingredients.length} ingredients`}),(0,y.jsx)(p.Tile,{label:"Low or out",value:`${v.length+f.length}`,sub:`${f.length} out \xb7 ${v.length} below half par`,tone:f.length?'red':v.length?'amber':'ok',onPress:()=>j('alerts')})]}),f.length?(0,y.jsxs)(o.Banner,{kind:"danger",title:"Out of stock",children:[f.map(e=>e.name).join(', '),". Mark the dishes that need it as sold out (Kitchen \u203a Live tickets \u203a Sold out), or order now."]}):null,(0,y.jsx)(p.Seg,{value:x,onChange:j,options:[{id:'all',label:'All'},{id:'alerts',label:'Alerts only'}]}),e.ingredients.length?null:(0,y.jsx)(o.Muted,{children:"No stock items yet. Add your real ingredients to start counting."}),S.map(e=>(0,y.jsxs)(o.Card,{children:[(0,y.jsxs)(o.T,{weight:"semibold",children:[e.category," \xb7 ",e.name]}),k.filter(t=>t.supplierId===e.id).map(e=>{const i=e.onHand<=0?'out':(0,p.isLow)(e.onHand,e.par)?'low':'ok';return(0,y.jsxs)(r.default,{style:{gap:4,paddingVertical:4},accessible:!0,accessibilityLabel:`${e.name} ${(0,n.ingredientSpeech)(t,e,e.onHand)} of par ${(0,n.ingredientSpeech)(t,e,e.par)}`,children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},children:e.name}),'out'===i?(0,y.jsx)(o.Badge,{kind:"red",label:"OUT"}):'low'===i?(0,y.jsx)(o.Badge,{kind:"amber",label:"LOW"}):null,(0,y.jsxs)(o.T,{size:13,colour:h.colours.muted,children:[(0,n.ingredientQty)(t,e,e.onHand)," / par ",(0,n.ingredientQty)(t,e,e.par)]})]}),(0,y.jsx)(p.Bar,{pct:e.onHand/e.par*100,colour:'out'===i?h.colours.red:'low'===i?h.colours.amber:h.colours.gold}),(0,y.jsxs)(o.Muted,{children:[(0,u.gbp)(Math.round((0,s.displayedCost)(t,e,e.cost)))," per ",(0,s.quantityUnit)(t,e)," \xb7 value ",(0,u.gbp)(Math.round(e.onHand*e.cost))]})]},e.id)})]},e.id))]})}function f(){const{k:e,me:i,rid:d}=(0,p.useChef)(),c=(0,b.useKitchen)(e=>e.saveStockTake),[x,j]=(0,l.useState)({}),[f,v]=(0,l.useState)(''),k=e.ingredients.map(e=>{const t=x[e.id],i=void 0===t||''===t?void 0:Number(t.replace(',','.')),n=void 0!==i&&Number.isFinite(i)&&i>=0&&(!(0,s.fishInStone)(d,e)||2*i===Math.round(2*i))?(0,s.inputQuantity)(d,e,i):void 0,l=void 0===n||Number.isNaN(n)?void 0:n-e.onHand;return{i:e,counted:n,variance:l,cost:void 0===l?0:Math.round(l*e.cost)}}),S=k.filter(e=>void 0!==e.variance),w=S.reduce((e,t)=>e+t.cost,0);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Count what's on the shelves. Expected = last count + deliveries \u2212 waste. Fish is entered in stone, in half-stone steps. Variance shows what's unexplained (portioning, theft, missed waste)."}),e.stockTakes[0]?(0,y.jsxs)(o.Muted,{children:["Last stock take ",new Date(e.stockTakes[0].at).toLocaleDateString('en-GB')," by ",e.stockTakes[0].by,": variance ",(0,u.gbp)(Math.round(e.stockTakes[0].lines.reduce((e,t)=>e+(t.counted-t.expected)*t.cost,0))),"."]}):null,(0,y.jsx)(o.Card,{children:k.map(({i:e,variance:i,cost:l})=>(0,y.jsxs)(r.default,{style:{gap:6,paddingVertical:8},children:[(0,y.jsxs)(r.default,{accessible:!0,accessibilityLabel:`${e.name}, expected ${(0,n.ingredientSpeech)(d,e,e.onHand)}`,children:[(0,y.jsx)(o.T,{size:16,children:e.name}),(0,y.jsxs)(o.Muted,{children:["Expected ",(0,n.ingredientQty)(d,e,e.onHand)]})]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,y.jsx)(t.TextInput,{accessibilityLabel:`Count ${e.name} in ${(0,s.quantityUnit)(d,e)}`,accessibilityValue:{text:x[e.id]?(0,n.ingredientSpeech)(d,e,(0,s.inputQuantity)(d,e,Number(x[e.id]))):'Not counted'},keyboardType:"decimal-pad",placeholder:(0,s.quantityUnit)(d,e),placeholderTextColor:h.colours.muted,value:x[e.id]??'',onChangeText:t=>j(i=>({...i,[e.id]:t})),style:{minHeight:44,width:80,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:8,paddingVertical:6,color:h.colours.text,textAlign:'right'}}),(0,s.fishInStone)(d,e)?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Half a stone less ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String(Math.max(0,(0,s.halfStone)(Number(t[e.id])||0)-.5))}))}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Half a stone more ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String((0,s.halfStone)(Number(t[e.id])||0)+.5)}))})]}):null,(0,y.jsx)(r.default,{style:{minWidth:86,alignItems:'flex-end'},accessible:!0,accessibilityLabel:void 0===i?'No variance yet':`${(0,n.ingredientSpeech)(d,e,i)} variance, ${(0,u.gbp)(l)}`,children:void 0===i?(0,y.jsx)(o.Muted,{children:"\u2014"}):(0,y.jsxs)(o.T,{size:14,colour:Math.abs(i)<.001?h.colours.ok:i<0?h.colours.red:h.colours.amber,children:[i>0?'+':'',(0,n.ingredientQty)(d,e,i),'\n',(0,u.gbp)(l)]})})]})]},e.id))}),(0,y.jsxs)(o.Banner,{kind:w<0?'warn':'info',title:`Variance so far: ${(0,u.gbp)(w)}`,children:[S.length," of ",e.ingredients.length," counted."]}),(0,y.jsx)(o.Button,{label:"Save stock take",disabled:!S.length,onPress:()=>{const e={};S.forEach(t=>{e[t.i.id]=t.counted}),c(e,i),j({}),v(`Saved: ${S.length} items, variance ${(0,u.gbp)(w)}. Stock levels updated.`)}}),f?(0,y.jsx)(o.Banner,{kind:"success",title:"Stock take saved",children:f}):null]})}function v(){const{k:e,me:t}=(0,p.useChef)(),i=(0,c.useOwner)(e=>e.suppliers),[n,s]=(0,l.useState)(e.deliveries.find(e=>'expected'===e.status)?.id??null);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Check each delivery against the order: count it in, check the invoice price, flag shorts and price changes. Accepting adds it to stock and updates costs (and GP)."}),e.deliveries.map(e=>{const l=i.find(t=>t.id===e.supplierId);return(0,y.jsxs)(o.Card,{highlight:n===e.id?h.colours.gold:void 0,children:[(0,y.jsx)(d.default,{accessibilityRole:"button",accessibilityLabel:`Delivery from ${l?.name}`,onPress:()=>s(n===e.id?null:e.id),children:(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(o.T,{weight:"semibold",children:l?.name??'Supplier'}),(0,y.jsx)(o.Muted,{children:'expected'===e.status?`Due ${e.due} \xb7 ${e.lines.length} lines`:`Accepted by ${e.checkedBy} ${e.at?new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`})]}),(0,y.jsx)(o.Badge,{kind:'expected'===e.status?'amber':'ok',label:'expected'===e.status?'TO CHECK':'ACCEPTED'})]})}),n===e.id?(0,y.jsx)(k,{id:e.id,me:t}):null]},e.id)})]})}function k({id:e,me:i}){const{k:d,rid:c}=(0,p.useChef)(),b=d.deliveries.find(t=>t.id===e),[j,f]=(0,l.useState)(b.lines.map(e=>({...e}))),v=(e,t)=>f(i=>i.map(i=>i.ing===e?{...i,...t}:i)),k='expected'!==b.status,S=(0,l.useMemo)(()=>j.map(e=>{const t=d.ingredients.find(t=>t.id===e.ing),i=e.receivede.short>0),$=S.filter(e=>Math.abs(e.pct)>=.5),C=j.reduce((e,t)=>e+t.received*t.price,0);return(0,y.jsxs)(r.default,{style:{gap:8,marginTop:8},children:[S.map(({l:e,i:i,short:l,pct:d})=>(0,y.jsxs)(r.default,{style:{gap:4,borderTopWidth:1,borderColor:h.colours.border,paddingTop:6},children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},weight:"medium",children:i.name}),l?(0,y.jsx)(o.Badge,{kind:"red",label:`SHORT ${(0,n.ingredientQty)(c,i,l)}`}):null,Math.abs(d)>=.5?(0,y.jsx)(o.Badge,{kind:"amber",label:`PRICE ${d>0?'+':''}${d.toFixed(0)}%`}):null]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,y.jsxs)(o.Muted,{children:["Ordered ",(0,n.ingredientQty)(c,i,e.ordered)]}),(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Received (",(0,s.quantityUnit)(c,i),")"]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Received ${i.name} in ${(0,s.quantityUnit)(c,i)}`,accessibilityValue:{text:(0,n.ingredientSpeech)(c,i,e.received)},keyboardType:"decimal-pad",value:String((0,s.fishInStone)(c,i)?(0,s.halfStone)((0,s.toStone)(e.received,i.unit)):e.received),onChangeText:t=>v(e.ing,{received:(0,s.inputQuantity)(c,i,Number(t.replace(',','.'))||0)}),style:{minHeight:44,width:60,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]}),(0,s.fishInStone)(c,i)&&!k?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Receive half a stone less ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,-1)})}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Receive half a stone more ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,1)})})]}):null,(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Invoice \xa3/",(0,s.quantityUnit)(c,i)]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Invoice price ${i.name}`,keyboardType:"decimal-pad",inputMode:"decimal",value:((0,s.displayedCost)(c,i,e.price)/100).toFixed(2),onChangeText:t=>v(e.ing,{price:100*((0,x.parseMoneyInput)(t)??0)/((0,s.fishInStone)(c,i)?(0,s.fromStone)(1,i.unit):1)}),style:{minHeight:44,width:70,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]})]}),(0,y.jsxs)(o.Muted,{children:["Last cost ",(0,u.gbp)(Math.round((0,s.displayedCost)(c,i,i.cost)))," per ",(0,s.quantityUnit)(c,i)]})]},e.ing)),(0,y.jsxs)(o.T,{weight:"semibold",children:["Invoice total ",(0,u.gbp)(Math.round(C))]}),w.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Shorts to chase",children:[w.map(e=>`${e.i.name}: ${(0,n.ingredientQty)(c,e.i,e.short)} short`).join(' \xb7 '),". Ask the supplier for a credit note."]}):null,$.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Price changes",children:[$.map(e=>`${e.i.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%`).join(' \xb7 '),". Check GP \u203a Price changes once accepted."]}):null,k?(0,y.jsx)(o.Muted,{children:b.note?`Noted: ${b.note}.`:'No issues noted.'}):(0,y.jsx)(o.Button,{label:"Accept delivery into stock",testID:"accept-delivery",onPress:()=>d.acceptDelivery(e,j,i,[w.length?`${w.length} short`:'',$.length?`${$.length} price changes`:''].filter(Boolean).join(', '))})]})}},1170,[812,998,1148,943,17,385,85,777,876,851,804,1140,1000,840,8]); @@ -1401,7 +1401,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}},1318,[812,843,17,85,777,845,851,1150,1319,858,804,8]); __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})},1319,[892,946,1150]); __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]})}},1320,[13,17,856,1321,1395,8]); -__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'center'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1321,[1051,779,805,806,1322,813,1323,1092,843,1137,1324,1325,1326,1089,1118,1327,1328,1333,1334,1199,1335,856,1340,1341,1342,1111,1110,966,1343,1149,938,1102,1344,17,1070,1175,1016,1085,1345,1221,1347,378,363,385,278,85,409,19,777,1215,1219,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1348,1106,1349,1356,1358,1361,1366,1360,1367,1370,1371,1113,1093,1094,862,1376,1204,1377,1214,1206,993,1382,1387,1388,1052,1050,1115,1390,1391,1392,1069,1168,1393,1167,1158,853,1336,1394,8]); +__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'flex-start'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{testID:"display-header-time",style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1321,[1051,779,805,806,1322,813,1323,1092,843,1137,1324,1325,1326,1089,1118,1327,1328,1333,1334,1199,1335,856,1340,1341,1342,1111,1110,966,1343,1149,938,1102,1344,17,1070,1175,1016,1085,1345,1221,1347,378,363,385,278,85,409,19,777,1215,1219,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1348,1106,1349,1356,1358,1361,1366,1360,1367,1370,1371,1113,1093,1094,862,1376,1204,1377,1214,1206,993,1382,1387,1388,1052,1050,1115,1390,1391,1392,1069,1168,1393,1167,1158,853,1336,1394,8]); __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},1324,[]); @@ -1468,7 +1468,7 @@ __d(function(g,r,i,_a,m,e,_d){"use strict";function t(t,o){if(t.title.trim().len __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STEP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"addDays",{enumerable:!0,get:function(){return u}}),_e.fmt12=i,_e.rangeText=c,_e.openWindow=function(r,o){const a=(0,e.kitchenHoursOn)(r,(0,t.parseYmd)(o));if(!a)return null;let s=(0,t.toMins)(a[1]);for(const e of(0,n.regularEventsOf)(r))(0,n.occursOn)(e,o)&&e.time&&(s=Math.max(s,Math.min(1425,(0,t.toMins)(e.time)+180)));return{from:(0,t.toMins)(a[0]),to:s}},_e.servicesOn=l,_e.serviceOf=function(e,n,r,o){const a=l(e,n,o),s=(0,t.toMins)(r);return a.lunch&&s>=a.lunch.from&&s=a.dinner.from&&s=a.dinner.to?'dinner':a.lunch&&s=e?n:e);if('none'===r.kind||!o||o=h)break}return s},_e.repeatText=function(e,t){if('none'===e.kind)return;const n=t?` until ${p(t)}`:'';return'weekly'===e.kind?`Every ${[...e.days].sort().map(e=>a[e]).join(', ')}${n}`:`Last ${o[e.weekday]} of the month${n}`},Object.defineProperty(_e,"longDate",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"monthLabel",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"scopeText",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"whatText",{enumerable:!0,get:function(){return M}}),_e.confirmLine=function(e){const t=e.dates.length?1===e.dates.length?e.dates[0]===e.today?'today':p(e.dates[0]):e.repeat?`on ${e.dates.length} dates (${e.repeat})`:`${p(e.dates[0])} to ${p(e.dates[e.dates.length-1])}`:'no dates';return`Block ${c(e.from,e.to,e.wholeDay)} ${t}, ${y(e)}`},_e.bookingsInWindow=function(e,n,r,o,a,s){const u=new Set(n),i=(0,t.toMins)(r),c=(0,t.toMins)(o);return e.filter(e=>{if(!u.has(e.date)||!['confirmed','pending','seated'].includes(e.status))return!1;const n=(0,t.toMins)(e.time);if(n=c)return!1;const r=(e.table??'').split(/[^A-Za-z0-9]+/).filter(Boolean);return a.tables?.length?r.some(e=>a.tables.includes(e)):!a.areaId||r.some(e=>s?.(e)===a.areaId)})},_e.groupByMonth=function(e,n,r,o){const a=e.filter(e=>e.rid===n&&!e.removedAt&&(e.date>r||e.date===r&&(0,t.toMins)(e.to)>(0,t.toMins)(o))).sort((e,n)=>e.date===n.date?(0,t.toMins)(e.from)-(0,t.toMins)(n.from):e.date{const r=(0,t.parseYmd)(e);return r.setDate(r.getDate()+n),(0,t.ymd)(r)};function i(e){const n=(0,t.toMins)(e),r=Math.floor(n/60)%24;return`${r%12==0?12:r%12}:${String(n%60).padStart(2,'0')}${r<12?'am':'pm'}`}function c(e,t,n){if(n)return'all day';const r=i(e),o=i(t);return r.slice(-2)===o.slice(-2)?`${r.slice(0,-2)}\u2013${o}`:`${r}\u2013${o}`}function l(n,r,o){const a=(0,e.kitchenHoursOn)(n,(0,t.parseYmd)(r));if(!a)return{lunch:null,dinner:null};const s=(0,t.toMins)(a[0]),u=(0,t.toMins)(a[1]),i=1020,c=(e,n)=>{if(!e)return n;const r=Math.max(s,(0,t.toMins)(e[0])),o=Math.min(u,(0,t.toMins)(e[1]));return o>r?{from:r,to:o}:null};return{lunch:c(o?.lunch,si?{from:Math.max(i,s),to:u}:null)}}const d=e=>Math.ceil(e/r)*r;function f(e,t){const n=[];let r=e;for(;r<=t&&n.length<366;)n.push(r),r=u(r,1);return n}const m=(e,n)=>{const r=(0,t.parseYmd)(e);if(r.getDay()!==n)return!1;const o=new Date(r);return o.setDate(r.getDate()+7),o.getMonth()!==r.getMonth()},h=104;const p=e=>{const n=(0,t.parseYmd)(e);return`${o[n.getDay()]} ${n.getDate()} ${s[n.getMonth()]}`},g=e=>{const n=(0,t.parseYmd)(e);return`${s[n.getMonth()]} ${n.getFullYear()}`},y=e=>e.tables?.length?`table${e.tables.length>1?'s':''} ${e.tables.join(', ')}`:e.areaId?e.areaName??'one area':'all areas',M=e=>{const t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)}},1385,[862,863,861]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"wixBlockPushOn",{enumerable:!0,get:function(){return o}}),e.pushBlocksToWix=function(t,n,c){if(!o(t)||!n.length)return;const l=u.useSync.getState();if(!l.venueId||'guest'===l.kind)return;setTimeout(()=>{(0,s.getSupabase)().functions.invoke('wix-blocks-push',{body:{venue_id:l.venueId,block_ids:n.slice(0,120),action:c}}).catch(()=>{})},4e3)},Object.defineProperty(e,"websiteBlockStatus",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),u=r(d[3]);const o=s=>!t.IS_ISOLATED_VENUE&&!['souters','kirkmichael','wildings'].includes(s)&&!!n.useFloor.getState().settings[s]?.wixBlockPushOn;const c=t=>(t??'awaiting venue sync').replace(/\bWix\b/gi,'Website bookings')},1386,[805,996,892,946]); __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,"DAY_GRAPH_CHROME",{enumerable:!0,get:function(){return j}}),_e.DayGraph=function({todays:e,open:j,close:T,now:b,turnBase:v,blocks:w=[],height:M=150,forecastNote:k,emptyText:D,past:L,closed:I,compact:$=!1,dense:C=!1,bare:A=!1,fill:z=!1,fit:O=!1,tight:_=!1,live:H=!1,onChrome:S}){const[F,P]=(0,t.useState)(0),[E,R]=(0,t.useState)(0),[N,B]=(0,t.useState)(0),[W,X]=(0,t.useState)(0);s.default.useEffect(()=>{S&&O&&W&&S(Math.ceil((A?4:C?2:10)+N+W+(A?2:6)+2))},[S,O,N,W,A,C]);const U=j.getTime()-18e5,G=T.getTime()+36e5,Y=(0,t.useMemo)(()=>(0,f.coverCurve)(e,new Date(U),new Date(G),v),[e,U,G,v]),V=60*j.getHours()+j.getMinutes(),K=60*T.getHours()+T.getMinutes(),Z=(0,t.useMemo)(()=>(0,p.chartBands)(w,V,K),[w,V,K]),q=new Date(j);q.setHours(0,0,0,0);const J=e=>q.getTime()+6e4*e,Q=Math.max(8,...Y.map(e=>e.covers)),ee=Y.reduce((e,t)=>!t.covers||(0,p.minuteInsideVenueBlock)(60*new Date(t.t).getHours()+new Date(t.t).getMinutes(),Z)?e:!e||t.covers>e.covers?{t:t.t,covers:t.covers}:e,null),te=O&&E?Math.max(24,Math.floor(E)):Math.max(48,M-m.AXIS_BAND),se=m.CHART_PAD_L,ie=m.CHART_PAD_R,oe=C?18:22,ne=Math.max(10,F-se-ie),le=Math.max(10,te-oe-14),re=e=>se+(e-U)/(G-U)*ne,ae=e=>oe+le-e/(1.15*Q)*le,he=(0,m.yTicks)(Q),de=(0,m.fitYTicks)(he,ae,te,13),ue=(0,m.nowLineVisible)({now:b,open:j,close:T,live:H,past:L,closed:I}),ce=b.getTime(),ge=ue&&Y.length?(0,m.splitCurve)(Y,ce):{before:Y,after:[]},xe=e=>e.map((e,t)=>`${t?'L':'M'}${re(e.t).toFixed(1)},${ae(e.covers).toFixed(1)}`).join(' '),me=[];for(let e=new Date(U);e.getTime()<=G;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=U&&t.getTime()<=G&&me.push(t.getTime())}const pe=H?(0,m.seatedNowCovers)(e,e[0]?.date??''):0,fe=Math.min(G,Math.max(U,b.getTime())),ye=I?null:H?{t:fe,covers:pe,text:(0,m.seatedNowText)(pe)}:ee,je=F?(0,m.layoutChart)({width:F,height:te,t0:U,t1:G,hours:me,busiest:ye}):{hours:[],busiest:null},Te=xe(Y),be=ue?xe(ge.before):Te,ve=ue?xe(ge.after):'',we=z&&Te&&Y.length>1?`${Te} L${re(Y[Y.length-1].t).toFixed(1)},${ae(0).toFixed(1)} L${re(Y[0].t).toFixed(1)},${ae(0).toFixed(1)} Z`:'',Me=(0,i.coversFour)(e,e[0]?.date??''),ke=`Total ${Me.total} ${1===Me.total?'Cover':'Covers'}`,De=e.filter(e=>!['cancelled','noshow'].includes(e.status)).length,Le=je.busiest?.text??(I?'':H?(0,m.seatedNowText)(pe):ee?(0,m.busiestText)(ee.t,ee.covers):''),Ie=Z.map(e=>e.spoken).join('. '),$e=ue&&T.getTime()>j.getTime()?Math.max(0,Math.min(100,Math.round((ce-j.getTime())/(T.getTime()-j.getTime())*100))):null,Ce=!I&&ee&&ee.covers?(0,m.peakOccupancyText)(ee.t,ee.covers):'',Ae=`Covers through the day. Open ${(0,u.hm)(j)}. Close ${(0,u.hm)(T)}.${Ce?` ${Ce}.`:''}${Le?` ${Le}.`:''}${ue?` It is ${(0,u.hm)(b)}. About ${$e} percent of the way through the day.`:''}${Ie?` ${Ie}.`:''}`,ze=(0,u.hm)(b),Oe=Math.max(44,12*ze.length*.7+16),He=Math.max(se+2,Math.min(Math.max(0,F-ie-Oe),re(ce)-Oe/2)),Se=Math.max(2,Math.min(te-22,oe+le-22)),Fe=s.default.useId().replace(/:/g,'');return(0,y.jsxs)(o.default,{testID:"day-graph",style:[d.look.panel,O?{flex:1,minHeight:0}:null,{overflow:'visible',paddingTop:A?4:C?2:10,paddingBottom:A?2:6,backgroundColor:c.colours.bg}],children:[(0,y.jsxs)(o.default,{testID:"day-graph-head",onLayout:e=>B(e.nativeEvent.layout.height),children:[A?null:$?(0,y.jsxs)(o.default,{style:{alignItems:'center',gap:4,paddingHorizontal:14},children:[(0,y.jsx)(h.T,{center:!0,size:18,weight:"semibold",children:"Covers through the day"}),(0,y.jsx)(h.T,{center:!0,size:14,colour:c.colours.muted,testID:"day-graph-parties",children:ke}),Ce?(0,y.jsx)(h.T,{center:!0,size:13,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,children:Ce}):null]}):(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8},children:[(0,y.jsx)(h.T,{size:C?14:15,weight:"semibold",style:{flexShrink:1},children:"Covers through the day"}),(0,y.jsx)(h.T,{size:12,colour:c.colours.muted,testID:"day-graph-parties",children:ke})]}),A||_?null:I?k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:2,children:k}):null:(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8,paddingTop:2},children:[(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Open ",(0,u.hm)(j)]}),Ce&&!$?(0,y.jsx)(h.T,{size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,center:!0,style:{flex:1,minWidth:0},children:Ce}):k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",numberOfLines:1,style:{flex:1,textAlign:'center'},children:k}):(0,y.jsx)(o.default,{style:{flex:1}}),(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Close ",(0,u.hm)(T)]})]}),A||_||$||!k||!Ce?null:(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:1,style:{paddingHorizontal:14},children:k}),A||!_||!Ce||$?null:(0,y.jsx)(h.T,{center:!0,size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,style:{paddingHorizontal:14},children:Ce})]}),(0,y.jsxs)(o.default,{testID:"day-graph-plot",accessible:!0,accessibilityLabel:Ae,onLayout:e=>{P(e.nativeEvent.layout.width),O&&R(e.nativeEvent.layout.height)},style:O?{flexGrow:1,flexShrink:1,flexBasis:Math.max(48,M-m.AXIS_BAND),minHeight:24,overflow:'hidden',position:'relative'}:{height:te,minHeight:te,position:'relative',overflow:'hidden'},children:[F?(0,y.jsxs)(l.default,{width:F,height:te,children:[(0,y.jsxs)(n.Defs,{children:[(0,y.jsxs)(n.Pattern,{id:`${Fe}-venue`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"1.4"})]}),(0,y.jsxs)(n.Pattern,{id:`${Fe}-area`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622",fillOpacity:"0.35"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"0.8"})]})]}),Z.map((e,t)=>(0,y.jsx)(n.Rect,{x:re(J(e.fromMin)),y:oe,width:Math.max(3,re(J(e.toMin))-re(J(e.fromMin))),height:le,fill:`url(#${Fe}-${e.strength})`},`${e.fromMin}-${t}`)),he.map(e=>(0,y.jsx)(n.Line,{x1:se,x2:se+ne,y1:ae(e),y2:ae(e),stroke:c.colours.muted,strokeWidth:1,opacity:.28},`grid-${e}`)),ue?(0,y.jsx)(n.Rect,{testID:"day-graph-elapsed",x:re(j.getTime()),y:oe,width:Math.max(0,re(ce)-re(j.getTime())),height:le,fill:c.colours.gold,opacity:.12}):null,we?(0,y.jsx)(n.Path,{d:we,fill:"#3A2F1E",stroke:"none"}):null,be?(0,y.jsx)(n.Path,{d:be,stroke:c.colours.gold,strokeWidth:2.5,fill:"none"}):null,ve?(0,y.jsx)(n.Path,{d:ve,stroke:c.colours.gold,strokeWidth:2.5,fill:"none",opacity:.38}):null,I?null:[j,T].map((e,t)=>(0,y.jsx)(n.Line,{x1:re(e.getTime()),x2:re(e.getTime()),y1:oe,y2:oe+le,stroke:c.colours.goldLight,strokeWidth:1.5,strokeDasharray:"4,4"},`service-${t}`)),ue?(0,y.jsx)(n.Line,{testID:"day-graph-now",x1:re(ce),x2:re(ce),y1:oe,y2:oe+le,stroke:c.colours.gold,strokeWidth:2}):null,je.busiest?(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:je.busiest.x+je.busiest.w/2,y:je.busiest.y+je.busiest.h-2,fill:c.colours.gold,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:je.busiest.text}):null,De?null:(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:se+ne/2,y:oe+le/2,fill:c.colours.muted,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:D??'No bookings yet today'})]}):null,F?de.map(e=>(0,y.jsx)(o.default,{testID:"day-graph-ytick",pointerEvents:"none",style:{position:'absolute',left:0,width:se-4,top:e.top,alignItems:'flex-end',justifyContent:'flex-start'},children:(0,y.jsx)(h.T,{size:e.font,numberOfLines:1,colour:c.colours.muted,style:{textAlign:'right'},children:String(e.value)})},`yt-${e.value}`)):null,F&&ue&&te>=m.YTICK_MIN_PLOT?(0,y.jsx)(o.default,{testID:"day-graph-now-label",pointerEvents:"none",style:{position:'absolute',left:He,top:Se,minWidth:Oe,height:20,paddingHorizontal:8,borderRadius:10,backgroundColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:12,weight:"semibold",colour:c.colours.bg,center:!0,numberOfLines:1,children:ze})}):null]}),(0,y.jsxs)(o.default,{testID:"day-graph-axis",onLayout:e=>X(e.nativeEvent.layout.height),style:{minHeight:m.AXIS_BAND,flexShrink:0,position:'relative',justifyContent:'center',paddingBottom:2},children:[(0,y.jsx)(o.default,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{opacity:0,alignSelf:'flex-start'},children:(0,y.jsx)(h.T,{size:m.AXIS_FONT,numberOfLines:1,children:"20"})}),je.hours.map(e=>{const t=Math.min(Math.max(e.w,40),Math.max(e.w,F)),s=e.x+e.w/2-t/2,i=Math.max(0,Math.min(Math.max(0,F-t),s));return(0,y.jsx)(o.default,{pointerEvents:"none",style:{position:'absolute',left:i,width:t,top:0,bottom:0,alignItems:i>s+.5?'flex-start':in.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1388,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.seasonClosedAreaIds=s,e.chartBands=function(t,a,c){const u=s(t,a,c),f=[];for(const s of t){if(s.removedAt)continue;if(s.areaId&&u.has(s.areaId))continue;if(s.areaId||s.tables?.length)continue;const t=s.wholeDay?0:n(s.from),l=s.wholeDay?1440:n(s.to);if(null==t||null==l)continue;const h=Math.max(t,a),M=Math.min(l,c);if(M<=h)continue;const m=o(s,h,M);f.push({fromMin:h,toMin:M,strength:m.strength,spoken:m.spoken})}f.sort((n,t)=>n.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1388,[]); __d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.coverCurve=function(s,c,n,a){const u=s.filter(t=>!['cancelled','noshow'].includes(t.status)).map(o=>{const s=(0,t.startOf)(o).getTime();return{s:s,e:s+6e4*(0,t.durOf)(o,a),n:o.partySize}}),f=[];for(let t=c.getTime();t<=n.getTime();t+=o)f.push({t:t,covers:u.reduce((o,s)=>t>=s.s&&tt.covers));if(!o)return[];const s=[];return t.forEach((c,n)=>{const a=t.slice(Math.max(0,n-3),n+4);c.covers<.6*o||c.coverst.covers))||s.some(t=>Math.abs(t.from-c.t)<36e5)||s.push({from:c.t,to:c.t,covers:c.covers})}),s.slice(0,3)},e.quietOf=function(t,o,s){const c=Math.max(0,...t.map(t=>t.covers)),n=Math.max(2,.25*c),a=[];let u=null;const f=t.filter(t=>t.t>=o&&t.t<=s);return f.forEach((t,o)=>{const s=t.covers<=n;s&&null===u&&(u=t.t);const c=o===f.length-1;if((!s||c)&&null!==u){const o=t.t;o-u>=18e5&&a.push({from:u,to:o}),u=null}}),a.sort((t,o)=>o.to-o.from-(t.to-t.from)).slice(0,3).sort((t,o)=>t.from-o.from)};var t=r(d[0]);const o=9e5},1389,[1074]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CANCEL_TINT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"CANCEL_BORDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"CANCEL_INK",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"CANCEL_MUTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"cancelWhen",{enumerable:!0,get:function(){return d}}),e.cancelledBy=u,e.cancelItem=b,e.cancellationsFor=function(n,t,o){return n.filter(n=>n.date===t&&('cancelled'===n.status||'noshow'===n.status)).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name)).map(n=>b(n,o(n)))},Object.defineProperty(e,"cancellationsHeading",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"cancellationsEmpty",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"cancellationsCounts",{enumerable:!0,get:function(){return f}});var n=r(_d[0]),t=r(_d[1]);const o=n=>n?n.split('+').map(n=>n.trim()).filter(Boolean):[],i='#17140F',a='#6B5A35',l='#F3E7CC',c='#B8AA8A',s={online:'Website',phone:'Phone','in-person':'In person','walk-in':'Walk-in',email:'Email','third-party':'Third party'},d=(n,t)=>{if(!n)return null;const o=new Date(n);if(Number.isNaN(o.getTime()))return null;const i=o.toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'});return o.toLocaleDateString('en-CA',{timeZone:'Europe/London'})===t?i:`${o.toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'Europe/London'})}, ${i}`};function u(n){const t=n;if('noshow'===n.status)return t.cancelled?.by?`Marked no-show by ${t.cancelled.by}`:'Marked no-show';if(t.cancelled?.by)return t.cancelled.by;const o=!!t.wix?.status&&/CANCEL|DECLIN/i.test(t.wix.status);return o&&t.wix?.archived?'Cancelled and archived in Website bookings':o?'Cancelled in Website bookings':(n.tags??[]).some(n=>n.endsWith(': deposit not paid'))||'PAYMENT_INFORMATION_PENDING'===t.wix?.status?'Website booking not finished (deposit not paid)':t.wix?.archived?'Archived in Website bookings':'Not recorded'}function b(i,a){const l=i,c=o(i.table??l.cancelled?.table??void 0),b=c.length?`Table ${(0,n.tableNumbers)(c.join('+'))}`:'No table',p=`${i.partySize} ${1===i.partySize?'person':'people'}`,h=d(l.cancelled?.at??(l.wix?l.wix.updatedDate:null),i.date),f=u(i),w=i.walkIn?'Walk-in':s[i.source??'']??(l.wix?'Website':'Not recorded'),y=(0,t.allergyLine)(i),C='noshow'===i.status,N=`${C?'No-show':'Cancelled'}: ${a}, ${y?`allergy noted: ${y}, `:''}${p}, was ${i.time}, ${b.toLowerCase()}. ${f}${h?` at ${h}`:''}.`;return{id:i.id,date:i.date,name:a,people:p,time:i.time,table:b,tables:c,walkIn:!!i.walkIn,by:f,when:h,source:w,notes:(i.notes??'').trim(),allergy:y,spoken:N,kind:C?'noshow':'cancelled'}}const p=n=>`Cancellations & no-shows ${n}`,h=(n="today")=>`No cancellations or no-shows ${n}.`,f=n=>{const t=n.filter(n=>'noshow'===n.kind).length,o=n.length-t;return`${o} ${1===o?'cancellation':'cancellations'} \xb7 ${t} ${1===t?'no-show':'no-shows'}`}},1390,[843,1368]); __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.CancellationsSection=function({items:e,dayWord:b="today",testID:y="display-cancellations"}){const[p,C]=(0,l.useState)(null),j=(0,s.cancellationsHeading)(e.length);return(0,u.jsxs)(o.default,{testID:y,style:{marginTop:14,borderRadius:12,backgroundColor:s.CANCEL_TINT,borderWidth:1,borderColor:s.CANCEL_BORDER,padding:10,gap:6},children:[(0,u.jsxs)(o.default,{accessible:!0,accessibilityRole:"header",accessibilityLabel:e.length?`${j}: ${(0,s.cancellationsCounts)(e)}. Not counted in Covers.`:`Cancellations and no-shows: none ${b}.`,style:{alignItems:'center',gap:2},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:c.colours.gold,center:!0,testID:"cancellations-head",children:j}),e.length?(0,u.jsx)(n.T,{size:14,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-counts",children:(0,s.cancellationsCounts)(e)}):null]}),e.length?e.map(e=>(0,u.jsxs)(t.default,{testID:`cancel-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.spoken,accessibilityHint:"Opens the details. Read only.",onPress:()=>C(e),dataSet:{centreExempt:'list-row'},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:'rgba(214,180,106,0.18)',backgroundColor:e?'#241F16':'transparent'}),children:[(0,u.jsxs)(o.default,{style:{flexDirection:'row',gap:10,alignItems:'flex-start'},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{width:58,textDecorationLine:'line-through'},children:e.time}),(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:e.name}),(0,u.jsx)(o.default,{testID:`cancel-kind-${e.id}`,style:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:'noshow'===e.kind?c.colours.amber:s.CANCEL_BORDER},children:(0,u.jsx)(n.T,{size:13,weight:"semibold",colour:'noshow'===e.kind?c.colours.amber:s.CANCEL_MUTED,children:'noshow'===e.kind?'No-show':'Cancelled'})}),e.allergy?(0,u.jsx)(o.default,{style:{paddingTop:1},children:(0,u.jsx)(h.AllergyIcon,{text:e.allergy,size:20,colour:"#D6A23A",ink:"#17140F",testID:`cancel-allergy-${e.id}`})}):null]}),(0,u.jsxs)(n.T,{size:15,colour:s.CANCEL_MUTED,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[e.people," \xb7 ",e.table," \xb7 ",e.by,e.when?` \xb7 ${e.when}`:'']})]},e.id)):(0,u.jsx)(n.T,{size:15,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-empty",children:(0,s.cancellationsEmpty)(b)}),p?(0,u.jsx)(x,{c:p,onClose:()=>C(null)}):null]})},_e.CancelDetail=x;var l=r(d[0]),t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]);function b({k:e,v:l}){return(0,u.jsxs)(o.default,{accessible:!0,accessibilityLabel:`${e}: ${l}`,style:{flexDirection:'row',gap:10,paddingVertical:6,borderBottomWidth:1,borderColor:c.colours.hairline},children:[(0,u.jsx)(n.T,{size:16,colour:c.colours.muted,style:{width:130},children:e}),(0,u.jsx)(n.T,{size:16,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l})]})}function x({c:e,onClose:l}){return(0,u.jsxs)(n.Sheet,{visible:!0,onClose:l,title:`${'noshow'===e.kind?'No-show':'Cancelled'} \xb7 ${e.name}`,maxWidth:560,testID:"cancel-detail",children:[(0,u.jsxs)(o.default,{testID:"cancel-detail-body",style:{gap:2},children:[(0,u.jsx)(b,{k:"Name",v:e.name}),(0,u.jsx)(b,{k:"Party",v:e.people}),e.allergy?(0,u.jsx)(b,{k:"Allergies",v:e.allergy}):null,(0,u.jsx)(b,{k:"Was booked for",v:`${e.date?`${new Date(`${e.date}T12:00:00`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})}, `:''}${e.time}`}),(0,u.jsx)(b,{k:"Table",v:e.table}),(0,u.jsx)(b,{k:'noshow'===e.kind?'No-show':'Cancelled by',v:e.by}),(0,u.jsx)(b,{k:"When",v:e.when??'Not recorded'}),(0,u.jsx)(b,{k:"Booked by",v:e.source}),(0,u.jsx)(b,{k:"Notes",v:e.notes||'None'})]}),(0,u.jsx)(n.T,{size:14,colour:c.colours.muted,center:!0,children:"Read only. Not counted in Covers. Phone numbers stay in the Managers app."})]})}},1391,[17,385,85,777,1390,804,1347,8]); diff --git a/customer-app/admin.html b/customer-app/admin.html index 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 b522d49f0f0672dbb3557ea22d9a85386fbc5718..023b1bca2913ddccd1e6cb8ad6c82c729b73a679 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 45ac2407631c777e8c8c7a96fe7f22b3b1eca978..8977e291f791a09fd35dcafff6cfc43ecb1339f8 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-22ff2360e4"; +const V = "cc-customer-883c715cf1"; const BASE = "/customer-app/"; -const PRECACHE = ["/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/customer-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/customer-app/assets/assets/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=22ff2360e4cc61053a8149cf60200fa9d2f2b05d9a20fe03c9b97892c3624d31"]; +const PRECACHE = ["/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/customer-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/customer-app/assets/assets/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=883c715cf1ac76eb93ba45fa9800c211e485ba7b1122833e8174e9dedcb329a2"]; // 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 35279a859de6d3483c8347e8cdcbffa936273ccf..fad47c6cc80107ed13d948cdd4336288d914e10b 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 c6bf79b93b8350c4bd3aefeb9a226e79b532005c..b8b4e419b04928602a2228b397c89116543b49d0 100644 --- a/display-app/_expo/static/js/web/bundle.js +++ b/display-app/_expo/static/js/web/bundle.js @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__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.201'},979,[]); +__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.202'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1247,7 +1247,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,"FOH_ROLE_BADGES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"KITCHEN_ROLE_BADGES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ROLE_BADGES",{enumerable:!0,get:function(){return o}}),e.cleanBadge=c,Object.defineProperty(e,"isKitchenBadge",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isFohBadge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"badgeSpoken",{enumerable:!0,get:function(){return f}}),e.assignShiftBadge=b,e.assignKitchenShiftBadge=function(n,t,o){const s=String(o??'').trim();return s&&!u(s)?n:b(n,t,s?c(s):void 0)},e.applyLiveKitchenBadge=function(n,t,o){const s=String(o??'').trim();if(s&&!u(s))return n;const f=s?c(s):void 0;return n.map(n=>n.id===t?{...n,badge:f}:n)};const n=['Bar','Floor'],t=['Upstairs KP','Downstairs KP','Sauce','Larder'],o=[...n,...t];function c(n){const t=String(n??'').trim().toLowerCase();return o.find(n=>n.toLowerCase()===t)}const u=n=>{const o=c(n);return!!o&&t.includes(o)},s=t=>{const o=c(t);return!!o&&n.includes(o)},f=n=>c(n)?`, on ${c(n)}`:'';function b(n,t,o){const u=c(o);return n.map(n=>n.id===t?{...n,badge:u,changed:!!n.published||n.changed}:n)}},1164,[]); __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.useSuggestions=j,_e.OrdersScreen=function({focus:e}={}){const[s,t]=(0,n.useState)('sheets');return(0,x.jsxs)(l.default,{style:{gap:12},children:[(0,x.jsx)(y.Seg,{value:s,onChange:t,options:[{id:'sheets',label:'Order sheets'},{id:'suggested',label:'Suggested orders'},{id:'history',label:'Order history'}]}),'sheets'===s?(0,x.jsx)(m.OrderSheets,{focus:e}):'suggested'===s?(0,x.jsx)(w,{}):(0,x.jsx)($,{})]})};var s=r(_d[0]),t=r(_d[1]),n=r(_d[2]),i=e(r(_d[3])),l=e(r(_d[4])),d=r(_d[5]),o=r(_d[6]),u=r(_d[7]),c=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),f=r(_d[12]),m=r(_d[13]),x=r(_d[14]);const b=(e,s)=>'kg'===s?Math.ceil(2*e)/2:Math.ceil(e);function j(){const{k:e,now:s,rid:n}=(0,y.useChef)(6e4),{pct:i}=(0,y.useForecast)(),l=(0,u.supplierView)('chef',(0,o.useOwner)(e=>e.suppliers)).filter(e=>!e.archived),d=1+Math.max(0,i)/100;return l.map(i=>{const l=e.ingredients.filter(e=>e.supplierId===i.id).map(e=>({i:e,qty:(0,t.fishInStone)(n,e)?(0,t.fromStone)(Math.ceil(2*(0,t.toStone)(Math.max(0,e.par*d-e.onHand),e.unit))/2,e.unit):b(Math.max(0,e.par*d-e.onHand),e.unit)})).filter(e=>e.qty>0),o=(0,p.weekday)(s),u=i.orderDays.includes(o),[c,h]=(i.cutoff||'23:59').split(':').map(Number),y=new Date(s);y.setHours(c,h,0,0);const f=e.orders.some(e=>e.supplierId===i.id&&new Date(e.at).toDateString()===s.toDateString()),m=[1,2,3,4,5,6,7].map(e=>(o+e)%7).find(e=>i.orderDays.includes(e));return{s:i,lines:l,ordersToday:u,cutPassed:s>y,placedToday:f,nextDay:m,total:Math.round(l.reduce((e,s)=>e+s.qty*s.i.cost,0))}}).filter(e=>e.lines.length||e.ordersToday)}function w(){const{me:e,rid:o}=(0,y.useChef)(),{label:u,covers:m,enough:b,booked:w}=(0,y.useForecast)(),$=(0,f.useKitchen)(e=>e.addOrder),S=j(),[C,M]=(0,n.useState)({}),[O,k]=(0,n.useState)('');return(0,x.jsxs)(l.default,{style:{gap:10},children:[(0,x.jsxs)(d.Muted,{children:[b?`Built from par levels and today's forecast (${m} Covers, ${u} vs a typical day).`:`Built from par levels (no forecast yet: not enough history; ${w} Covers booked so far).`," Adjust, then call the supplier or use their ordering website. Nothing is sent by CoverCharge."]}),O?(0,x.jsx)(d.Banner,{kind:"success",title:"Saved to order history",children:O}):null,S.map(({s:n,lines:u,ordersToday:y,cutPassed:f,placedToday:m,nextDay:b,total:j})=>{const w=u.map(e=>({...e,q:C[`${n.id}:${e.i.id}`]??e.qty})),S=Math.round(w.reduce((e,s)=>e+s.q*s.i.cost,0)),O=s=>{$({supplierId:n.id,by:e,status:s,lines:w.filter(e=>e.q>0).map(e=>({ing:e.i.id,qty:e.q,cost:e.i.cost})),total:S}),k(`${n.name}: ${(0,c.gbp)(S)} (${s}).`)};return(0,x.jsxs)(d.Card,{highlight:!y||m||f?void 0:h.colours.gold,children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{weight:"semibold",children:n.name}),(0,x.jsxs)(d.Muted,{children:[n.category," \xb7 min order ",(0,c.gbp)(n.minOrder)]})]}),m?(0,x.jsx)(d.Badge,{kind:"ok",label:"ORDERED TODAY"}):y?(0,x.jsx)(d.Badge,{kind:f?'red':'amber',label:f?`CUT-OFF ${n.cutoff} PASSED`:`ORDER BY ${n.cutoff}`}):(0,x.jsx)(d.Badge,{label:`NEXT ${null!=b?p.DAY3[b].toUpperCase():'\u2014'}`})]}),w.length?w.map(e=>(0,x.jsxs)(d.Row,{wrap:!0,style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{size:14,children:e.i.name}),(0,x.jsxs)(d.Muted,{children:["On hand ",(0,s.ingredientQty)(o,e.i,e.i.onHand)," \xb7 par ",(0,s.ingredientQty)(o,e.i,e.i.par)]})]}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"Less",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone less':'Less'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,-1)}))}),(0,x.jsx)(l.default,{accessible:!0,accessibilityLabel:(0,s.ingredientSpeech)(o,e.i,e.q),children:(0,x.jsx)(d.T,{size:16,style:{minWidth:76,textAlign:'center'},children:(0,s.ingredientQty)(o,e.i,e.q)})}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"More",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone more':'More'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,1)}))})]},e.i.id)):(0,x.jsx)(d.Muted,{children:"Everything is at par."}),w.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(d.T,{weight:"semibold",children:["Estimated ",(0,c.gbp)(S)]}),S{i.default.openURL(`tel:${n.phones[0].replace(/\s/g,'')}`).catch(()=>{}),O('placed (by phone)')}}):null,n.website?(0,x.jsx)(d.Button,{small:!0,kind:"secondary",label:"Open website",onPress:()=>{i.default.openURL(n.website).catch(()=>{}),O('placed (on website)')}}):null]})]}):null,void 0]},n.id)})]})}function $(){const{k:e,rid:t}=(0,y.useChef)(),n=(0,o.useOwner)(e=>e.suppliers);return(0,x.jsx)(l.default,{style:{gap:8},children:e.orders.map(i=>(0,x.jsxs)(d.Card,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(d.T,{weight:"semibold",style:{flex:1},children:n.find(e=>e.id===i.supplierId)?.name}),(0,x.jsx)(d.Badge,{kind:"neutral",label:i.status.toUpperCase()})]}),(0,x.jsxs)(d.Muted,{children:[new Date(i.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",i.by,i.total?` \xb7 ${(0,c.gbp)(i.total)}`:'']}),i.lines.length?(0,x.jsx)(d.Muted,{children:i.lines.map(n=>{const i=e.ingredients.find(e=>e.id===n.ing);return`${(0,s.ingredientQty)(t,i??{name:n.ing,unit:''},n.qty)} ${i?.name??n.ing}`}).join(', ')}):null]},i.id))})}},1165,[1148,943,17,362,85,777,876,955,851,804,1055,1140,1000,1166,8]); __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.openLink=w,_e.useSheetReminders=C,_e.OrderSheets=function({focus:e}){const{rid:t,now:l}=(0,x.useChef)(3e4),o=(0,u.useSheets)(t).filter(e=>(0,n.chefCanSee)(t,e)&&!e.placeholder),[h,c]=(0,s.useState)(e??null),p=C(),f=(0,b.wd)(l);return(0,j.jsxs)(d.default,{style:{gap:10},testID:"order-sheets",children:[(0,j.jsx)(i.Banner,{kind:"info",title:"Nothing is sent for you",children:"Text, WhatsApp and phone orders open your phone\u2019s own app with the order already written. Check it, then press Send yourself."}),p.map(e=>(0,j.jsx)(r.default,{accessibilityRole:"button",onPress:()=>c(e.supplierId),children:(0,j.jsxs)(i.Banner,{kind:'red'===e.tone?'danger':'warn',title:`\u23f0 ${e.text}`,children:["Tap to open the ",e.name," order sheet."]})},e.supplierId)),(0,j.jsxs)(i.Muted,{children:["Today is ",b.DAYS[f],". Edit suppliers in Managers \u203a Settings \u203a Supplier order sheets."]}),o.map(e=>(0,j.jsx)($,{s:e,open:h===e.id,onToggle:()=>c(h===e.id?null:e.id)},e.id)),o.length?null:(0,j.jsx)(i.Muted,{children:"No order sheets yet. Add suppliers in Managers \u203a Settings \u203a Supplier order sheets."})]})};var t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),o=e(_r(_d[4]));_r(_d[5]);var r=e(_r(_d[6])),d=e(_r(_d[7])),i=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),b=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),j=_r(_d[17]);function w(e){if('undefined'!=typeof window){const t=window;return'function'==typeof t.__ccOpenLink?void t.__ccOpenLink(e):void(/^https?:/.test(e)?window.open(e,'_blank','noopener'):window.location.href=e)}o.default.openURL(e).catch(()=>{})}async function k(e){try{const t='undefined'!=typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0}catch{}return!1}const S={online:'\ud83c\udf10',phone:'\ud83d\udcde',text:'\ud83d\udcac',whatsapp:'\u2706',tbc:'\ud83d\udd8a\ufe0f'},T={borderWidth:1,borderColor:f.colours.border,borderRadius:10,paddingHorizontal:12,paddingVertical:10,color:f.colours.text,backgroundColor:f.colours.surface2,fontSize:f.font.body};function C(){const{rid:e,now:t}=(0,x.useChef)(6e4),l=(0,u.useSheets)(e).filter(t=>(0,n.chefCanSee)(e,t)&&!t.placeholder),s=(0,u.useOrderSheets)(e=>e.opened),o=(0,h.useShellfish)(e,'','chef'),r=(0,b.remindersFor)(l,t,s);for(const n of l){const l=o.items.filter(e=>(e.supplierId===n.id||!e.supplierId&&n.shellfish)&&o.isLow(e.key));!l.length||s[n.id]&&new Date(s[n.id]).toDateString()===t.toDateString()||r.push({supplierId:n.id,name:n.name,text:`${'text'===n.method||'whatsapp'===n.method?'Text':'Order from'} ${n.contact||n.name}: ${l.map(t=>`${(0,c.fmtStockCount)(e,t,o.counts[t.key]??0)} ${t.plural.toLowerCase()}`).join(' and ')} left`,tone:'amber',cutoffPassed:!1})}return r}function $({s:e,open:n,onToggle:o}){const{rid:C,r:$,me:D,now:I}=(0,x.useChef)(3e4),v=(0,u.useOrderSheets)(e=>e.patch),M=(0,u.useOrderSheets)(e=>e.markOpened),B=(0,u.useOrderSheets)(t=>t.opened[e.id]),[L,P]=(0,s.useState)({}),[O,R]=(0,s.useState)(''),[A,z]=(0,s.useState)(''),[_,W]=(0,s.useState)(!1),H=(0,h.useShellfish)(C,D,'chef'),K=(0,b.nextDelivery)(e,I),E=(0,b.orderLines)(e,L,O,C),N=($.address??$.location??'').split(',').map(e=>e.trim()).filter(Boolean),q=N.length>=3?N[1]:N[0]??'',U=(0,b.orderMessage)(e,$.name,q,E,D.split(' ')[0],I),Q=e.orderDays.includes((0,b.wd)(I)),Y=(e,t)=>P(n=>({...n,[e.id]:(0,l.stepQuantity)(C,e,n[e.id]||0,t)})),F=t=>{M(e.id,I.toISOString()),w(t)},G='text'===e.method||'whatsapp'===e.method||'phone'===e.method,V=Math.round(100*((0,y.parseMoneyInput)(A)??NaN)),J=H.items.filter(t=>t.supplierId===e.id||!t.supplierId&&e.shellfish),X=J.filter(e=>H.isLow(e.key));return(0,j.jsxs)(d.default,{testID:`sheet-${e.id}`,style:{borderRadius:14,borderWidth:1.5,borderColor:Q||X.length?f.colours.amber:n?f.colours.gold:f.colours.border,backgroundColor:f.colours.surface,overflow:'hidden'},children:[(0,j.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.name} order sheet`,onPress:o,style:{padding:12,gap:4},children:[(0,j.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(i.T,{weight:"semibold",size:f.font.large,style:{flex:1},children:[S[e.method]," ",e.name]}),(0,j.jsx)(i.Badge,{kind:e.placeholder?'amber':'gold',label:e.placeholder?'To fill in':b.METHOD_LABEL[e.method]})]}),(0,j.jsx)(i.Muted,{children:e.goods}),(0,j.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.deliveryDays.length?(0,j.jsx)(i.Badge,{kind:"neutral",label:`Delivers ${(0,b.dayRange)(e.deliveryDays)}`}):null,e.orderDays.length?(0,j.jsx)(i.Badge,{kind:Q?'amber':'neutral',label:`Order ${(0,b.dayRange)(e.orderDays)}${e.cutoff?` by ${e.cutoff}`:''}`}):null,e.frequency?(0,j.jsx)(i.Badge,{kind:"neutral",label:e.frequency}):null,e.priceCapPerKg?(0,j.jsx)(i.Badge,{kind:"blue",label:`Cap ${(0,p.gbp)(e.priceCapPerKg)}/kg`}):null,J.length?(0,j.jsx)(i.Badge,{kind:X.length?'amber':'ok',label:J.map(e=>`${e.icon} ${(0,c.fmtStockCount)(C,e,H.counts[e.key]??0)}`).join(' \xb7 ')}):null,B&&new Date(B).toDateString()===I.toDateString()?(0,j.jsx)(i.Badge,{kind:"ok",label:"Opened today \u2713"}):null]})]}),n?(0,j.jsxs)(d.default,{style:{padding:12,paddingTop:0,gap:10},children:[K?(0,j.jsxs)(i.Muted,{children:["Next delivery if you order now: ",(0,b.niceDay)(K),"."]}):null,e.reminder?(0,j.jsxs)(i.Muted,{children:["Reminder on ",e.orderDays.map(e=>b.DAYS[e]).join(', '),": ",e.reminder]}):null,e.notes?(0,j.jsx)(i.T,{size:f.font.small,colour:f.colours.muted,children:e.notes}):null,e.placeholder?(0,j.jsx)(i.Banner,{kind:"warn",title:"Still to be set up",children:"Add the supplier, how to order and delivery days in Managers \u203a Settings \u203a Supplier order sheets."}):null,e.items.map(e=>(0,j.jsxs)(d.default,{style:{gap:6},children:[(0,j.jsxs)(i.T,{children:[e.name,e.unit?(0,j.jsxs)(i.T,{size:f.font.small,colour:f.colours.muted,children:[" (",(0,l.quantityUnit)(C,e),")"]}):null]}),(0,j.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone less':'Less'} ${e.name}`,onPress:()=>Y(e,-1),style:{minWidth:44,minHeight:44}}),(0,j.jsx)(d.default,{accessible:!0,accessibilityLabel:(0,l.fishQtySpeech)(C,e,L[e.id]||0),children:(0,j.jsx)(i.T,{weight:"bold",size:20,style:{minWidth:76,textAlign:'center'},children:(0,l.fishInStone)(C,e)?(0,l.fishQtyText)(C,e,L[e.id]||0):L[e.id]||0})}),(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone more':'More'} ${e.name}`,testID:`qty-${e.id}`,onPress:()=>Y(e,1),style:{minWidth:44,minHeight:44}})]})]},e.id)),(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsx)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:"Anything else (one line each)"}),(0,j.jsx)(t.TextInput,{value:O,onChangeText:R,multiline:!0,placeholder:"e.g. 2 boxes lemons",placeholderTextColor:f.colours.muted,style:[T,{minHeight:60}]})]}),G?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['whatsapp'===e.method?'WhatsApp number':'phone'===e.method?'Phone number':'Mobile number',e.number?'':' (blank: fill in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`number-${e.id}`,value:e.number,onChangeText:t=>v(C,e.id,{number:t}),keyboardType:"phone-pad",placeholder:"07\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,'online'===e.method?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['Open Coldweb'===e.urlLabel?'Coldweb ordering link':'Website link',e.url?'':' (blank: paste it in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`url-${e.id}`,value:e.url,onChangeText:t=>v(C,e.id,{url:t.trim()}),autoCapitalize:"none",keyboardType:"url",placeholder:"https://\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,e.priceCapPerKg?(0,j.jsxs)(d.default,{style:{gap:6,padding:10,borderRadius:12,backgroundColor:f.colours.blueBg},children:[(0,j.jsxs)(i.T,{weight:"semibold",colour:"#E2C489",children:["Price cap ",(0,p.gbp)(e.priceCapPerKg),"/kg \xb7 buy from the cheapest UK seller under it"]}),(0,j.jsxs)(i.Muted,{children:["Seller: ",e.seller||'to be chosen']}),(0,j.jsxs)(i.Row,{gap:8,children:[(0,j.jsx)(i.T,{size:f.font.small,style:{flex:1},children:"Price you found (\xa3/kg)"}),(0,j.jsx)(t.TextInput,{testID:"price-found",value:A,onChangeText:e=>z((0,y.sanitiseMoneyTyping)(e)),keyboardType:"decimal-pad",inputMode:"decimal",placeholder:"e.g. 22.50",placeholderTextColor:f.colours.muted,style:[T,{width:120}]})]}),V>0?(0,j.jsx)(i.Badge,{kind:V<=e.priceCapPerKg?'ok':'red',label:V<=e.priceCapPerKg?`${(0,p.gbp)(V)}/kg is under the cap \u2713`:`${(0,p.gbp)(V)}/kg is over the ${(0,p.gbp)(e.priceCapPerKg)} cap: look for a cheaper seller`}):null]}):null,'online'!==e.method&&'tbc'!==e.method?(0,j.jsxs)(d.default,{testID:`preview-${e.id}`,style:{padding:10,borderRadius:12,borderWidth:1,borderColor:f.colours.border,backgroundColor:f.colours.surface2},children:[(0,j.jsx)(i.T,{size:12,weight:"semibold",colour:f.colours.gold,children:'phone'===e.method?'READ THIS OUT':'YOUR MESSAGE'}),(0,j.jsx)(i.T,{size:f.font.small,children:E.length?U:'Add quantities above to write the order.'})]}):null,(0,j.jsxs)(i.Row,{wrap:!0,gap:8,children:['text'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"\ud83d\udcac Open in Messages",disabled:!E.length,onPress:()=>F((0,b.smsLink)(e.number,U))}):null,'whatsapp'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"Open in WhatsApp",disabled:!E.length,onPress:()=>F((0,b.waLink)(e.number,U))}):null,'phone'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83d\udcde Call ${e.name}`,disabled:!e.number,onPress:()=>F((0,b.telLink)(e.number))}):null,'online'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83c\udf10 ${e.urlLabel??'Open website'}`,disabled:!e.url,onPress:()=>F(e.url)}):null,'online'!==e.method&&'tbc'!==e.method&&E.length?(0,j.jsx)(i.Button,{kind:"ghost",label:_?'Copied \u2713':'Copy order',onPress:async()=>{const e=await k(U);W(e),e&&setTimeout(()=>W(!1),2e3)}}):null]}),'text'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: Messages opens with the order written and asks who to send it to."}):null,'whatsapp'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: WhatsApp opens with the order written and asks who to send it to."}):null,'phone'!==e.method||e.number?null:(0,j.jsx)(i.Muted,{children:"Add the phone number above to call from here."}),'online'!==e.method||e.url?null:(0,j.jsx)(i.Muted,{children:"Add the link above and the button opens it."})]}):null]})}},1166,[812,820,943,17,362,219,385,85,777,998,942,944,851,999,804,1140,840,8]); -__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:i,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),i?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:i}):null]}):null,n||w.length||!i?null:(0,j.jsx)(l.default,{accessibilityRole:"button",onPress:i,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:i?()=>{k(!1),i()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const i=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!i.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${i.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,i.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:i.items.map((t,s)=>{const o=i.counts[t.key]??0,l=d[t.key]??0,h=Math.max(0,o-l),m=h<=0,b=m||i.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:l?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,l)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return z}}),_e.ShellfishChip=M,_e.SundayRoastChip=function(e){return(0,j.jsx)(M,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=e(_r(_d[5])),l=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(i.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:i,group:l}){const d=(0,h.useShellfish)(e,s,r,l),m='roast'===l,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const i=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,i,o):Math.max(0,Math.min(99,i+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),z=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),M=(0,o.useRef)(null);M.current||(M.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!M.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,H]=(0,o.useState)(0),F=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?z:D>0,W=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!F.length)return;const e=setInterval(()=>H(e=>e+1),600);return()=>clearInterval(e)},[R.state,F.length]);const P=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void W('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?W('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?W('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-P.current>2e4&&W('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||F.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||F.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${F.length} ${1===F.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&z&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),P.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!z,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),i?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:i}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const z=18;function M({rid:e,by:t,app:r,size:i="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(m&&'roast'===d&&(!f.items.length||!(0,u.isSundayIn)(T)))return(0,j.jsx)(R,{size:i});if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const M='m'===i?20:17,E='roast'!==d,B=E&&f.items.some(e=>(k[e.key]??0)>0),H=B?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==i&&!B;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${E&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,i=p[t.key]??0,d=Math.max(0,n-i),h=d<=0,m=h||f.isLow(t.key),b=E?k[t.key]??0:0,x=h?y.colours.red:E&&'display'!==r?y.colours.shellfishFree:m&&!E?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:B?4:6,paddingHorizontal:B?5:9,paddingVertical:3,flexShrink:0,minWidth:B?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,M-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:M-2}),(0,j.jsx)(c.T,{size:M,weight:"bold",colour:x,style:{lineHeight:M+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(l.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:z,minWidth:z,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):B?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:z,width:z,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,H)})`})}):null,!F||!(i||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':i?`${(0,u.fmtStockCount)(e,t,i)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),i=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),l=(0,f.reservedBookingsOn)(r,i,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(i))}),l.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}function R({size:e}){return(0,j.jsxs)(a.default,{testID:"roast-slot",accessible:!0,accessibilityLabel:"Sunday roast count: shown on Sundays",style:{minHeight:44,minWidth:'xs'===e?64:84,paddingHorizontal:10,borderRadius:12,borderWidth:1,borderColor:y.colours.hairline,backgroundColor:'rgba(255,255,255,0.03)',flexDirection:'row',alignItems:'center',justifyContent:'center',gap:6},children:[(0,j.jsx)(c.T,{size:'m'===e?14:12,colour:y.colours.muted,children:"Roast"}),(0,j.jsx)(c.T,{size:'m'===e?18:16,weight:"bold",colour:y.colours.muted,children:"\u2013"})]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); +__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:l,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(i.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),l?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:l}):null]}):null,n||w.length||!l?null:(0,j.jsx)(i.default,{accessibilityRole:"button",onPress:l,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:l?()=>{k(!1),l()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const l=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!l.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${l.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,l.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:l.items.map((t,s)=>{const o=l.counts[t.key]??0,i=d[t.key]??0,h=Math.max(0,o-i),m=h<=0,b=m||l.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:i?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,i)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return M}}),_e.ShellfishChip=z,_e.SundayRoastChip=function(e){return(0,j.jsx)(z,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),l=e(_r(_d[5])),i=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(l.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:l,group:i}){const d=(0,h.useShellfish)(e,s,r,i),m='roast'===i,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const l=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,l,o):Math.max(0,Math.min(99,l+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),M=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),z=(0,o.useRef)(null);z.current||(z.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!z.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,F]=(0,o.useState)(0),H=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?M:D>0,P=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!H.length)return;const e=setInterval(()=>F(e=>e+1),600);return()=>clearInterval(e)},[R.state,H.length]);const W=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void P('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?P('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?P('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-W.current>2e4&&P('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||H.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||H.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${H.length} ${1===H.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&M&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),W.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!M,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),l?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:l}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const M=18;function z({rid:e,by:t,app:r,size:l="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const z='m'===l?20:17,R='roast'!==d,E=R&&f.items.some(e=>(k[e.key]??0)>0),B=E?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==l&&!E;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${R&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,l=p[t.key]??0,d=Math.max(0,n-l),h=d<=0,m=h||f.isLow(t.key),b=R?k[t.key]??0:0,x=h?y.colours.red:R&&'display'!==r?y.colours.shellfishFree:m&&!R?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:E?4:6,paddingHorizontal:E?5:9,paddingVertical:3,flexShrink:0,minWidth:E?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,z-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:z-2}),(0,j.jsx)(c.T,{size:z,weight:"bold",colour:x,style:{lineHeight:z+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(i.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:M,minWidth:M,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):E?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:M,width:M,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,B)})`})}):null,!F||!(l||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':l?`${(0,u.fmtStockCount)(e,t,l)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),l=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),i=(0,f.reservedBookingsOn)(r,l,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(l))}),i.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"look",{enumerable:!0,get:function(){return n}}),r(d[0]);var o=r(d[1]);const b=o=>o,n={panel:{backgroundColor:'#121110',borderRadius:o.radii.xl,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',boxShadow:'0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 28px rgba(0,0,0,0.45)'},quiet:(b,n="gold")=>({minHeight:o.control.tall,borderRadius:o.radii.button,borderWidth:1,borderColor:'blue'===n?'rgba(226,196,137,0.55)':'rgba(207,164,95,0.38)',backgroundColor:b?'rgba(207,164,95,0.16)':'blue'===n?'rgba(226,196,137,0.10)':'rgba(255,255,255,0.035)',paddingHorizontal:14,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:8,boxShadow:'0 1px 0 rgba(255,255,255,0.05) inset',transition:'background-color 120ms ease'}),primary:o=>({backgroundColor:o?'#B8904F':'#CFA45F',borderWidth:1,borderColor:'rgba(255,226,170,0.55)',backgroundImage:o?'linear-gradient(180deg, #BE9552 0%, #A88143 100%)':'linear-gradient(180deg, #E0BA77 0%, #C69A55 100%)',boxShadow:o?'0 2px 8px rgba(0,0,0,0.4)':'0 1px 0 rgba(255,255,255,0.28) inset, 0 10px 24px rgba(207,164,95,0.22), 0 4px 10px rgba(0,0,0,0.45)',transition:'box-shadow 120ms ease'}),onPrimary:'#17130D',web:b}},1168,[219,811]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STOCK_ICON_IMAGES",{enumerable:!0,get:function(){return A}});const A={'\ud83e\udd9e':{uri:'data:image/png;base64,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',w:47,h:64},'\ud83e\udd80':{uri:'data:image/png;base64,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',w:64,h:45}}},1169,[]); __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.StockScreen=function({initial:e="levels"}){const[t,i]=(0,l.useState)(e);return(0,y.jsxs)(r.default,{style:{gap:12},children:[(0,y.jsx)(p.Seg,{value:t,onChange:i,options:[{id:'levels',label:'Stock levels'},{id:'take',label:'Stock take'},{id:'deliveries',label:'Deliveries in'}]}),'levels'===t?(0,y.jsx)(j,{}):'take'===t?(0,y.jsx)(f,{}):(0,y.jsx)(v,{})]})};var t=_r(_d[0]),i=_r(_d[1]),n=_r(_d[2]),s=_r(_d[3]),l=_r(_d[4]),d=e(_r(_d[5])),r=e(_r(_d[6])),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]);function j(){const{k:e,rid:t}=(0,p.useChef)(),d=(0,c.useOwner)(e=>e.suppliers),b=(0,i.useSheets)(t),[x,j]=(0,l.useState)('all'),f=e.ingredients.filter(e=>e.onHand<=0),v=e.ingredients.filter(e=>(0,p.isLow)(e.onHand,e.par)),k='alerts'===x?[...f,...v]:e.ingredients,S=[...new Set(k.map(e=>e.supplierId))].map(e=>{const t=d.find(t=>t.id===e),i=b.find(t=>t.id===e);return{id:e,name:t?.name||i?.name||'Supplier not linked',category:t?.category||i?.goods||'Stock'}});return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsxs)(o.Row,{wrap:!0,gap:10,children:[(0,y.jsx)(p.Tile,{label:"Stock value (at cost)",value:(0,u.gbp)((0,p.stockValue)(e.ingredients)),sub:`${e.ingredients.length} ingredients`}),(0,y.jsx)(p.Tile,{label:"Low or out",value:`${v.length+f.length}`,sub:`${f.length} out \xb7 ${v.length} below half par`,tone:f.length?'red':v.length?'amber':'ok',onPress:()=>j('alerts')})]}),f.length?(0,y.jsxs)(o.Banner,{kind:"danger",title:"Out of stock",children:[f.map(e=>e.name).join(', '),". Mark the dishes that need it as sold out (Kitchen \u203a Live tickets \u203a Sold out), or order now."]}):null,(0,y.jsx)(p.Seg,{value:x,onChange:j,options:[{id:'all',label:'All'},{id:'alerts',label:'Alerts only'}]}),e.ingredients.length?null:(0,y.jsx)(o.Muted,{children:"No stock items yet. Add your real ingredients to start counting."}),S.map(e=>(0,y.jsxs)(o.Card,{children:[(0,y.jsxs)(o.T,{weight:"semibold",children:[e.category," \xb7 ",e.name]}),k.filter(t=>t.supplierId===e.id).map(e=>{const i=e.onHand<=0?'out':(0,p.isLow)(e.onHand,e.par)?'low':'ok';return(0,y.jsxs)(r.default,{style:{gap:4,paddingVertical:4},accessible:!0,accessibilityLabel:`${e.name} ${(0,n.ingredientSpeech)(t,e,e.onHand)} of par ${(0,n.ingredientSpeech)(t,e,e.par)}`,children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},children:e.name}),'out'===i?(0,y.jsx)(o.Badge,{kind:"red",label:"OUT"}):'low'===i?(0,y.jsx)(o.Badge,{kind:"amber",label:"LOW"}):null,(0,y.jsxs)(o.T,{size:13,colour:h.colours.muted,children:[(0,n.ingredientQty)(t,e,e.onHand)," / par ",(0,n.ingredientQty)(t,e,e.par)]})]}),(0,y.jsx)(p.Bar,{pct:e.onHand/e.par*100,colour:'out'===i?h.colours.red:'low'===i?h.colours.amber:h.colours.gold}),(0,y.jsxs)(o.Muted,{children:[(0,u.gbp)(Math.round((0,s.displayedCost)(t,e,e.cost)))," per ",(0,s.quantityUnit)(t,e)," \xb7 value ",(0,u.gbp)(Math.round(e.onHand*e.cost))]})]},e.id)})]},e.id))]})}function f(){const{k:e,me:i,rid:d}=(0,p.useChef)(),c=(0,b.useKitchen)(e=>e.saveStockTake),[x,j]=(0,l.useState)({}),[f,v]=(0,l.useState)(''),k=e.ingredients.map(e=>{const t=x[e.id],i=void 0===t||''===t?void 0:Number(t.replace(',','.')),n=void 0!==i&&Number.isFinite(i)&&i>=0&&(!(0,s.fishInStone)(d,e)||2*i===Math.round(2*i))?(0,s.inputQuantity)(d,e,i):void 0,l=void 0===n||Number.isNaN(n)?void 0:n-e.onHand;return{i:e,counted:n,variance:l,cost:void 0===l?0:Math.round(l*e.cost)}}),S=k.filter(e=>void 0!==e.variance),w=S.reduce((e,t)=>e+t.cost,0);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Count what's on the shelves. Expected = last count + deliveries \u2212 waste. Fish is entered in stone, in half-stone steps. Variance shows what's unexplained (portioning, theft, missed waste)."}),e.stockTakes[0]?(0,y.jsxs)(o.Muted,{children:["Last stock take ",new Date(e.stockTakes[0].at).toLocaleDateString('en-GB')," by ",e.stockTakes[0].by,": variance ",(0,u.gbp)(Math.round(e.stockTakes[0].lines.reduce((e,t)=>e+(t.counted-t.expected)*t.cost,0))),"."]}):null,(0,y.jsx)(o.Card,{children:k.map(({i:e,variance:i,cost:l})=>(0,y.jsxs)(r.default,{style:{gap:6,paddingVertical:8},children:[(0,y.jsxs)(r.default,{accessible:!0,accessibilityLabel:`${e.name}, expected ${(0,n.ingredientSpeech)(d,e,e.onHand)}`,children:[(0,y.jsx)(o.T,{size:16,children:e.name}),(0,y.jsxs)(o.Muted,{children:["Expected ",(0,n.ingredientQty)(d,e,e.onHand)]})]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,y.jsx)(t.TextInput,{accessibilityLabel:`Count ${e.name} in ${(0,s.quantityUnit)(d,e)}`,accessibilityValue:{text:x[e.id]?(0,n.ingredientSpeech)(d,e,(0,s.inputQuantity)(d,e,Number(x[e.id]))):'Not counted'},keyboardType:"decimal-pad",placeholder:(0,s.quantityUnit)(d,e),placeholderTextColor:h.colours.muted,value:x[e.id]??'',onChangeText:t=>j(i=>({...i,[e.id]:t})),style:{minHeight:44,width:80,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:8,paddingVertical:6,color:h.colours.text,textAlign:'right'}}),(0,s.fishInStone)(d,e)?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Half a stone less ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String(Math.max(0,(0,s.halfStone)(Number(t[e.id])||0)-.5))}))}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Half a stone more ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String((0,s.halfStone)(Number(t[e.id])||0)+.5)}))})]}):null,(0,y.jsx)(r.default,{style:{minWidth:86,alignItems:'flex-end'},accessible:!0,accessibilityLabel:void 0===i?'No variance yet':`${(0,n.ingredientSpeech)(d,e,i)} variance, ${(0,u.gbp)(l)}`,children:void 0===i?(0,y.jsx)(o.Muted,{children:"\u2014"}):(0,y.jsxs)(o.T,{size:14,colour:Math.abs(i)<.001?h.colours.ok:i<0?h.colours.red:h.colours.amber,children:[i>0?'+':'',(0,n.ingredientQty)(d,e,i),'\n',(0,u.gbp)(l)]})})]})]},e.id))}),(0,y.jsxs)(o.Banner,{kind:w<0?'warn':'info',title:`Variance so far: ${(0,u.gbp)(w)}`,children:[S.length," of ",e.ingredients.length," counted."]}),(0,y.jsx)(o.Button,{label:"Save stock take",disabled:!S.length,onPress:()=>{const e={};S.forEach(t=>{e[t.i.id]=t.counted}),c(e,i),j({}),v(`Saved: ${S.length} items, variance ${(0,u.gbp)(w)}. Stock levels updated.`)}}),f?(0,y.jsx)(o.Banner,{kind:"success",title:"Stock take saved",children:f}):null]})}function v(){const{k:e,me:t}=(0,p.useChef)(),i=(0,c.useOwner)(e=>e.suppliers),[n,s]=(0,l.useState)(e.deliveries.find(e=>'expected'===e.status)?.id??null);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Check each delivery against the order: count it in, check the invoice price, flag shorts and price changes. Accepting adds it to stock and updates costs (and GP)."}),e.deliveries.map(e=>{const l=i.find(t=>t.id===e.supplierId);return(0,y.jsxs)(o.Card,{highlight:n===e.id?h.colours.gold:void 0,children:[(0,y.jsx)(d.default,{accessibilityRole:"button",accessibilityLabel:`Delivery from ${l?.name}`,onPress:()=>s(n===e.id?null:e.id),children:(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(o.T,{weight:"semibold",children:l?.name??'Supplier'}),(0,y.jsx)(o.Muted,{children:'expected'===e.status?`Due ${e.due} \xb7 ${e.lines.length} lines`:`Accepted by ${e.checkedBy} ${e.at?new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`})]}),(0,y.jsx)(o.Badge,{kind:'expected'===e.status?'amber':'ok',label:'expected'===e.status?'TO CHECK':'ACCEPTED'})]})}),n===e.id?(0,y.jsx)(k,{id:e.id,me:t}):null]},e.id)})]})}function k({id:e,me:i}){const{k:d,rid:c}=(0,p.useChef)(),b=d.deliveries.find(t=>t.id===e),[j,f]=(0,l.useState)(b.lines.map(e=>({...e}))),v=(e,t)=>f(i=>i.map(i=>i.ing===e?{...i,...t}:i)),k='expected'!==b.status,S=(0,l.useMemo)(()=>j.map(e=>{const t=d.ingredients.find(t=>t.id===e.ing),i=e.receivede.short>0),$=S.filter(e=>Math.abs(e.pct)>=.5),C=j.reduce((e,t)=>e+t.received*t.price,0);return(0,y.jsxs)(r.default,{style:{gap:8,marginTop:8},children:[S.map(({l:e,i:i,short:l,pct:d})=>(0,y.jsxs)(r.default,{style:{gap:4,borderTopWidth:1,borderColor:h.colours.border,paddingTop:6},children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},weight:"medium",children:i.name}),l?(0,y.jsx)(o.Badge,{kind:"red",label:`SHORT ${(0,n.ingredientQty)(c,i,l)}`}):null,Math.abs(d)>=.5?(0,y.jsx)(o.Badge,{kind:"amber",label:`PRICE ${d>0?'+':''}${d.toFixed(0)}%`}):null]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,y.jsxs)(o.Muted,{children:["Ordered ",(0,n.ingredientQty)(c,i,e.ordered)]}),(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Received (",(0,s.quantityUnit)(c,i),")"]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Received ${i.name} in ${(0,s.quantityUnit)(c,i)}`,accessibilityValue:{text:(0,n.ingredientSpeech)(c,i,e.received)},keyboardType:"decimal-pad",value:String((0,s.fishInStone)(c,i)?(0,s.halfStone)((0,s.toStone)(e.received,i.unit)):e.received),onChangeText:t=>v(e.ing,{received:(0,s.inputQuantity)(c,i,Number(t.replace(',','.'))||0)}),style:{minHeight:44,width:60,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]}),(0,s.fishInStone)(c,i)&&!k?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Receive half a stone less ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,-1)})}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Receive half a stone more ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,1)})})]}):null,(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Invoice \xa3/",(0,s.quantityUnit)(c,i)]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Invoice price ${i.name}`,keyboardType:"decimal-pad",inputMode:"decimal",value:((0,s.displayedCost)(c,i,e.price)/100).toFixed(2),onChangeText:t=>v(e.ing,{price:100*((0,x.parseMoneyInput)(t)??0)/((0,s.fishInStone)(c,i)?(0,s.fromStone)(1,i.unit):1)}),style:{minHeight:44,width:70,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]})]}),(0,y.jsxs)(o.Muted,{children:["Last cost ",(0,u.gbp)(Math.round((0,s.displayedCost)(c,i,i.cost)))," per ",(0,s.quantityUnit)(c,i)]})]},e.ing)),(0,y.jsxs)(o.T,{weight:"semibold",children:["Invoice total ",(0,u.gbp)(Math.round(C))]}),w.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Shorts to chase",children:[w.map(e=>`${e.i.name}: ${(0,n.ingredientQty)(c,e.i,e.short)} short`).join(' \xb7 '),". Ask the supplier for a credit note."]}):null,$.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Price changes",children:[$.map(e=>`${e.i.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%`).join(' \xb7 '),". Check GP \u203a Price changes once accepted."]}):null,k?(0,y.jsx)(o.Muted,{children:b.note?`Noted: ${b.note}.`:'No issues noted.'}):(0,y.jsx)(o.Button,{label:"Accept delivery into stock",testID:"accept-delivery",onPress:()=>d.acceptDelivery(e,j,i,[w.length?`${w.length} short`:'',$.length?`${$.length} price changes`:''].filter(Boolean).join(', '))})]})}},1170,[812,998,1148,943,17,385,85,777,876,851,804,1140,1000,840,8]); @@ -1401,7 +1401,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}},1318,[812,843,17,85,777,845,851,1150,1319,858,804,8]); __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})},1319,[892,946,1150]); __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]})}},1320,[13,17,856,1321,1395,8]); -__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'center'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1321,[1051,779,805,806,1322,813,1323,1092,843,1137,1324,1325,1326,1089,1118,1327,1328,1333,1334,1199,1335,856,1340,1341,1342,1111,1110,966,1343,1149,938,1102,1344,17,1070,1175,1016,1085,1345,1221,1347,378,363,385,278,85,409,19,777,1215,1219,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1348,1106,1349,1356,1358,1361,1366,1360,1367,1370,1371,1113,1093,1094,862,1376,1204,1377,1214,1206,993,1382,1387,1388,1052,1050,1115,1390,1391,1392,1069,1168,1393,1167,1158,853,1336,1394,8]); +__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'flex-start'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{testID:"display-header-time",style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1321,[1051,779,805,806,1322,813,1323,1092,843,1137,1324,1325,1326,1089,1118,1327,1328,1333,1334,1199,1335,856,1340,1341,1342,1111,1110,966,1343,1149,938,1102,1344,17,1070,1175,1016,1085,1345,1221,1347,378,363,385,278,85,409,19,777,1215,1219,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1348,1106,1349,1356,1358,1361,1366,1360,1367,1370,1371,1113,1093,1094,862,1376,1204,1377,1214,1206,993,1382,1387,1388,1052,1050,1115,1390,1391,1392,1069,1168,1393,1167,1158,853,1336,1394,8]); __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},1324,[]); @@ -1468,7 +1468,7 @@ __d(function(g,r,i,_a,m,e,_d){"use strict";function t(t,o){if(t.title.trim().len __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STEP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"addDays",{enumerable:!0,get:function(){return u}}),_e.fmt12=i,_e.rangeText=c,_e.openWindow=function(r,o){const a=(0,e.kitchenHoursOn)(r,(0,t.parseYmd)(o));if(!a)return null;let s=(0,t.toMins)(a[1]);for(const e of(0,n.regularEventsOf)(r))(0,n.occursOn)(e,o)&&e.time&&(s=Math.max(s,Math.min(1425,(0,t.toMins)(e.time)+180)));return{from:(0,t.toMins)(a[0]),to:s}},_e.servicesOn=l,_e.serviceOf=function(e,n,r,o){const a=l(e,n,o),s=(0,t.toMins)(r);return a.lunch&&s>=a.lunch.from&&s=a.dinner.from&&s=a.dinner.to?'dinner':a.lunch&&s=e?n:e);if('none'===r.kind||!o||o=h)break}return s},_e.repeatText=function(e,t){if('none'===e.kind)return;const n=t?` until ${p(t)}`:'';return'weekly'===e.kind?`Every ${[...e.days].sort().map(e=>a[e]).join(', ')}${n}`:`Last ${o[e.weekday]} of the month${n}`},Object.defineProperty(_e,"longDate",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"monthLabel",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"scopeText",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"whatText",{enumerable:!0,get:function(){return M}}),_e.confirmLine=function(e){const t=e.dates.length?1===e.dates.length?e.dates[0]===e.today?'today':p(e.dates[0]):e.repeat?`on ${e.dates.length} dates (${e.repeat})`:`${p(e.dates[0])} to ${p(e.dates[e.dates.length-1])}`:'no dates';return`Block ${c(e.from,e.to,e.wholeDay)} ${t}, ${y(e)}`},_e.bookingsInWindow=function(e,n,r,o,a,s){const u=new Set(n),i=(0,t.toMins)(r),c=(0,t.toMins)(o);return e.filter(e=>{if(!u.has(e.date)||!['confirmed','pending','seated'].includes(e.status))return!1;const n=(0,t.toMins)(e.time);if(n=c)return!1;const r=(e.table??'').split(/[^A-Za-z0-9]+/).filter(Boolean);return a.tables?.length?r.some(e=>a.tables.includes(e)):!a.areaId||r.some(e=>s?.(e)===a.areaId)})},_e.groupByMonth=function(e,n,r,o){const a=e.filter(e=>e.rid===n&&!e.removedAt&&(e.date>r||e.date===r&&(0,t.toMins)(e.to)>(0,t.toMins)(o))).sort((e,n)=>e.date===n.date?(0,t.toMins)(e.from)-(0,t.toMins)(n.from):e.date{const r=(0,t.parseYmd)(e);return r.setDate(r.getDate()+n),(0,t.ymd)(r)};function i(e){const n=(0,t.toMins)(e),r=Math.floor(n/60)%24;return`${r%12==0?12:r%12}:${String(n%60).padStart(2,'0')}${r<12?'am':'pm'}`}function c(e,t,n){if(n)return'all day';const r=i(e),o=i(t);return r.slice(-2)===o.slice(-2)?`${r.slice(0,-2)}\u2013${o}`:`${r}\u2013${o}`}function l(n,r,o){const a=(0,e.kitchenHoursOn)(n,(0,t.parseYmd)(r));if(!a)return{lunch:null,dinner:null};const s=(0,t.toMins)(a[0]),u=(0,t.toMins)(a[1]),i=1020,c=(e,n)=>{if(!e)return n;const r=Math.max(s,(0,t.toMins)(e[0])),o=Math.min(u,(0,t.toMins)(e[1]));return o>r?{from:r,to:o}:null};return{lunch:c(o?.lunch,si?{from:Math.max(i,s),to:u}:null)}}const d=e=>Math.ceil(e/r)*r;function f(e,t){const n=[];let r=e;for(;r<=t&&n.length<366;)n.push(r),r=u(r,1);return n}const m=(e,n)=>{const r=(0,t.parseYmd)(e);if(r.getDay()!==n)return!1;const o=new Date(r);return o.setDate(r.getDate()+7),o.getMonth()!==r.getMonth()},h=104;const p=e=>{const n=(0,t.parseYmd)(e);return`${o[n.getDay()]} ${n.getDate()} ${s[n.getMonth()]}`},g=e=>{const n=(0,t.parseYmd)(e);return`${s[n.getMonth()]} ${n.getFullYear()}`},y=e=>e.tables?.length?`table${e.tables.length>1?'s':''} ${e.tables.join(', ')}`:e.areaId?e.areaName??'one area':'all areas',M=e=>{const t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)}},1385,[862,863,861]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"wixBlockPushOn",{enumerable:!0,get:function(){return o}}),e.pushBlocksToWix=function(t,n,c){if(!o(t)||!n.length)return;const l=u.useSync.getState();if(!l.venueId||'guest'===l.kind)return;setTimeout(()=>{(0,s.getSupabase)().functions.invoke('wix-blocks-push',{body:{venue_id:l.venueId,block_ids:n.slice(0,120),action:c}}).catch(()=>{})},4e3)},Object.defineProperty(e,"websiteBlockStatus",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),u=r(d[3]);const o=s=>!t.IS_ISOLATED_VENUE&&!['souters','kirkmichael','wildings'].includes(s)&&!!n.useFloor.getState().settings[s]?.wixBlockPushOn;const c=t=>(t??'awaiting venue sync').replace(/\bWix\b/gi,'Website bookings')},1386,[805,996,892,946]); __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,"DAY_GRAPH_CHROME",{enumerable:!0,get:function(){return j}}),_e.DayGraph=function({todays:e,open:j,close:T,now:b,turnBase:v,blocks:w=[],height:M=150,forecastNote:k,emptyText:D,past:L,closed:I,compact:$=!1,dense:C=!1,bare:A=!1,fill:z=!1,fit:O=!1,tight:_=!1,live:H=!1,onChrome:S}){const[F,P]=(0,t.useState)(0),[E,R]=(0,t.useState)(0),[N,B]=(0,t.useState)(0),[W,X]=(0,t.useState)(0);s.default.useEffect(()=>{S&&O&&W&&S(Math.ceil((A?4:C?2:10)+N+W+(A?2:6)+2))},[S,O,N,W,A,C]);const U=j.getTime()-18e5,G=T.getTime()+36e5,Y=(0,t.useMemo)(()=>(0,f.coverCurve)(e,new Date(U),new Date(G),v),[e,U,G,v]),V=60*j.getHours()+j.getMinutes(),K=60*T.getHours()+T.getMinutes(),Z=(0,t.useMemo)(()=>(0,p.chartBands)(w,V,K),[w,V,K]),q=new Date(j);q.setHours(0,0,0,0);const J=e=>q.getTime()+6e4*e,Q=Math.max(8,...Y.map(e=>e.covers)),ee=Y.reduce((e,t)=>!t.covers||(0,p.minuteInsideVenueBlock)(60*new Date(t.t).getHours()+new Date(t.t).getMinutes(),Z)?e:!e||t.covers>e.covers?{t:t.t,covers:t.covers}:e,null),te=O&&E?Math.max(24,Math.floor(E)):Math.max(48,M-m.AXIS_BAND),se=m.CHART_PAD_L,ie=m.CHART_PAD_R,oe=C?18:22,ne=Math.max(10,F-se-ie),le=Math.max(10,te-oe-14),re=e=>se+(e-U)/(G-U)*ne,ae=e=>oe+le-e/(1.15*Q)*le,he=(0,m.yTicks)(Q),de=(0,m.fitYTicks)(he,ae,te,13),ue=(0,m.nowLineVisible)({now:b,open:j,close:T,live:H,past:L,closed:I}),ce=b.getTime(),ge=ue&&Y.length?(0,m.splitCurve)(Y,ce):{before:Y,after:[]},xe=e=>e.map((e,t)=>`${t?'L':'M'}${re(e.t).toFixed(1)},${ae(e.covers).toFixed(1)}`).join(' '),me=[];for(let e=new Date(U);e.getTime()<=G;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=U&&t.getTime()<=G&&me.push(t.getTime())}const pe=H?(0,m.seatedNowCovers)(e,e[0]?.date??''):0,fe=Math.min(G,Math.max(U,b.getTime())),ye=I?null:H?{t:fe,covers:pe,text:(0,m.seatedNowText)(pe)}:ee,je=F?(0,m.layoutChart)({width:F,height:te,t0:U,t1:G,hours:me,busiest:ye}):{hours:[],busiest:null},Te=xe(Y),be=ue?xe(ge.before):Te,ve=ue?xe(ge.after):'',we=z&&Te&&Y.length>1?`${Te} L${re(Y[Y.length-1].t).toFixed(1)},${ae(0).toFixed(1)} L${re(Y[0].t).toFixed(1)},${ae(0).toFixed(1)} Z`:'',Me=(0,i.coversFour)(e,e[0]?.date??''),ke=`Total ${Me.total} ${1===Me.total?'Cover':'Covers'}`,De=e.filter(e=>!['cancelled','noshow'].includes(e.status)).length,Le=je.busiest?.text??(I?'':H?(0,m.seatedNowText)(pe):ee?(0,m.busiestText)(ee.t,ee.covers):''),Ie=Z.map(e=>e.spoken).join('. '),$e=ue&&T.getTime()>j.getTime()?Math.max(0,Math.min(100,Math.round((ce-j.getTime())/(T.getTime()-j.getTime())*100))):null,Ce=!I&&ee&&ee.covers?(0,m.peakOccupancyText)(ee.t,ee.covers):'',Ae=`Covers through the day. Open ${(0,u.hm)(j)}. Close ${(0,u.hm)(T)}.${Ce?` ${Ce}.`:''}${Le?` ${Le}.`:''}${ue?` It is ${(0,u.hm)(b)}. About ${$e} percent of the way through the day.`:''}${Ie?` ${Ie}.`:''}`,ze=(0,u.hm)(b),Oe=Math.max(44,12*ze.length*.7+16),He=Math.max(se+2,Math.min(Math.max(0,F-ie-Oe),re(ce)-Oe/2)),Se=Math.max(2,Math.min(te-22,oe+le-22)),Fe=s.default.useId().replace(/:/g,'');return(0,y.jsxs)(o.default,{testID:"day-graph",style:[d.look.panel,O?{flex:1,minHeight:0}:null,{overflow:'visible',paddingTop:A?4:C?2:10,paddingBottom:A?2:6,backgroundColor:c.colours.bg}],children:[(0,y.jsxs)(o.default,{testID:"day-graph-head",onLayout:e=>B(e.nativeEvent.layout.height),children:[A?null:$?(0,y.jsxs)(o.default,{style:{alignItems:'center',gap:4,paddingHorizontal:14},children:[(0,y.jsx)(h.T,{center:!0,size:18,weight:"semibold",children:"Covers through the day"}),(0,y.jsx)(h.T,{center:!0,size:14,colour:c.colours.muted,testID:"day-graph-parties",children:ke}),Ce?(0,y.jsx)(h.T,{center:!0,size:13,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,children:Ce}):null]}):(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8},children:[(0,y.jsx)(h.T,{size:C?14:15,weight:"semibold",style:{flexShrink:1},children:"Covers through the day"}),(0,y.jsx)(h.T,{size:12,colour:c.colours.muted,testID:"day-graph-parties",children:ke})]}),A||_?null:I?k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:2,children:k}):null:(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8,paddingTop:2},children:[(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Open ",(0,u.hm)(j)]}),Ce&&!$?(0,y.jsx)(h.T,{size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,center:!0,style:{flex:1,minWidth:0},children:Ce}):k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",numberOfLines:1,style:{flex:1,textAlign:'center'},children:k}):(0,y.jsx)(o.default,{style:{flex:1}}),(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Close ",(0,u.hm)(T)]})]}),A||_||$||!k||!Ce?null:(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:1,style:{paddingHorizontal:14},children:k}),A||!_||!Ce||$?null:(0,y.jsx)(h.T,{center:!0,size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,style:{paddingHorizontal:14},children:Ce})]}),(0,y.jsxs)(o.default,{testID:"day-graph-plot",accessible:!0,accessibilityLabel:Ae,onLayout:e=>{P(e.nativeEvent.layout.width),O&&R(e.nativeEvent.layout.height)},style:O?{flexGrow:1,flexShrink:1,flexBasis:Math.max(48,M-m.AXIS_BAND),minHeight:24,overflow:'hidden',position:'relative'}:{height:te,minHeight:te,position:'relative',overflow:'hidden'},children:[F?(0,y.jsxs)(l.default,{width:F,height:te,children:[(0,y.jsxs)(n.Defs,{children:[(0,y.jsxs)(n.Pattern,{id:`${Fe}-venue`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"1.4"})]}),(0,y.jsxs)(n.Pattern,{id:`${Fe}-area`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622",fillOpacity:"0.35"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"0.8"})]})]}),Z.map((e,t)=>(0,y.jsx)(n.Rect,{x:re(J(e.fromMin)),y:oe,width:Math.max(3,re(J(e.toMin))-re(J(e.fromMin))),height:le,fill:`url(#${Fe}-${e.strength})`},`${e.fromMin}-${t}`)),he.map(e=>(0,y.jsx)(n.Line,{x1:se,x2:se+ne,y1:ae(e),y2:ae(e),stroke:c.colours.muted,strokeWidth:1,opacity:.28},`grid-${e}`)),ue?(0,y.jsx)(n.Rect,{testID:"day-graph-elapsed",x:re(j.getTime()),y:oe,width:Math.max(0,re(ce)-re(j.getTime())),height:le,fill:c.colours.gold,opacity:.12}):null,we?(0,y.jsx)(n.Path,{d:we,fill:"#3A2F1E",stroke:"none"}):null,be?(0,y.jsx)(n.Path,{d:be,stroke:c.colours.gold,strokeWidth:2.5,fill:"none"}):null,ve?(0,y.jsx)(n.Path,{d:ve,stroke:c.colours.gold,strokeWidth:2.5,fill:"none",opacity:.38}):null,I?null:[j,T].map((e,t)=>(0,y.jsx)(n.Line,{x1:re(e.getTime()),x2:re(e.getTime()),y1:oe,y2:oe+le,stroke:c.colours.goldLight,strokeWidth:1.5,strokeDasharray:"4,4"},`service-${t}`)),ue?(0,y.jsx)(n.Line,{testID:"day-graph-now",x1:re(ce),x2:re(ce),y1:oe,y2:oe+le,stroke:c.colours.gold,strokeWidth:2}):null,je.busiest?(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:je.busiest.x+je.busiest.w/2,y:je.busiest.y+je.busiest.h-2,fill:c.colours.gold,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:je.busiest.text}):null,De?null:(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:se+ne/2,y:oe+le/2,fill:c.colours.muted,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:D??'No bookings yet today'})]}):null,F?de.map(e=>(0,y.jsx)(o.default,{testID:"day-graph-ytick",pointerEvents:"none",style:{position:'absolute',left:0,width:se-4,top:e.top,alignItems:'flex-end',justifyContent:'flex-start'},children:(0,y.jsx)(h.T,{size:e.font,numberOfLines:1,colour:c.colours.muted,style:{textAlign:'right'},children:String(e.value)})},`yt-${e.value}`)):null,F&&ue&&te>=m.YTICK_MIN_PLOT?(0,y.jsx)(o.default,{testID:"day-graph-now-label",pointerEvents:"none",style:{position:'absolute',left:He,top:Se,minWidth:Oe,height:20,paddingHorizontal:8,borderRadius:10,backgroundColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:12,weight:"semibold",colour:c.colours.bg,center:!0,numberOfLines:1,children:ze})}):null]}),(0,y.jsxs)(o.default,{testID:"day-graph-axis",onLayout:e=>X(e.nativeEvent.layout.height),style:{minHeight:m.AXIS_BAND,flexShrink:0,position:'relative',justifyContent:'center',paddingBottom:2},children:[(0,y.jsx)(o.default,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{opacity:0,alignSelf:'flex-start'},children:(0,y.jsx)(h.T,{size:m.AXIS_FONT,numberOfLines:1,children:"20"})}),je.hours.map(e=>{const t=Math.min(Math.max(e.w,40),Math.max(e.w,F)),s=e.x+e.w/2-t/2,i=Math.max(0,Math.min(Math.max(0,F-t),s));return(0,y.jsx)(o.default,{pointerEvents:"none",style:{position:'absolute',left:i,width:t,top:0,bottom:0,alignItems:i>s+.5?'flex-start':in.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1388,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.seasonClosedAreaIds=s,e.chartBands=function(t,a,c){const u=s(t,a,c),f=[];for(const s of t){if(s.removedAt)continue;if(s.areaId&&u.has(s.areaId))continue;if(s.areaId||s.tables?.length)continue;const t=s.wholeDay?0:n(s.from),l=s.wholeDay?1440:n(s.to);if(null==t||null==l)continue;const h=Math.max(t,a),M=Math.min(l,c);if(M<=h)continue;const m=o(s,h,M);f.push({fromMin:h,toMin:M,strength:m.strength,spoken:m.spoken})}f.sort((n,t)=>n.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1388,[]); __d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.coverCurve=function(s,c,n,a){const u=s.filter(t=>!['cancelled','noshow'].includes(t.status)).map(o=>{const s=(0,t.startOf)(o).getTime();return{s:s,e:s+6e4*(0,t.durOf)(o,a),n:o.partySize}}),f=[];for(let t=c.getTime();t<=n.getTime();t+=o)f.push({t:t,covers:u.reduce((o,s)=>t>=s.s&&tt.covers));if(!o)return[];const s=[];return t.forEach((c,n)=>{const a=t.slice(Math.max(0,n-3),n+4);c.covers<.6*o||c.coverst.covers))||s.some(t=>Math.abs(t.from-c.t)<36e5)||s.push({from:c.t,to:c.t,covers:c.covers})}),s.slice(0,3)},e.quietOf=function(t,o,s){const c=Math.max(0,...t.map(t=>t.covers)),n=Math.max(2,.25*c),a=[];let u=null;const f=t.filter(t=>t.t>=o&&t.t<=s);return f.forEach((t,o)=>{const s=t.covers<=n;s&&null===u&&(u=t.t);const c=o===f.length-1;if((!s||c)&&null!==u){const o=t.t;o-u>=18e5&&a.push({from:u,to:o}),u=null}}),a.sort((t,o)=>o.to-o.from-(t.to-t.from)).slice(0,3).sort((t,o)=>t.from-o.from)};var t=r(d[0]);const o=9e5},1389,[1074]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CANCEL_TINT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"CANCEL_BORDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"CANCEL_INK",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"CANCEL_MUTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"cancelWhen",{enumerable:!0,get:function(){return d}}),e.cancelledBy=u,e.cancelItem=b,e.cancellationsFor=function(n,t,o){return n.filter(n=>n.date===t&&('cancelled'===n.status||'noshow'===n.status)).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name)).map(n=>b(n,o(n)))},Object.defineProperty(e,"cancellationsHeading",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"cancellationsEmpty",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"cancellationsCounts",{enumerable:!0,get:function(){return f}});var n=r(_d[0]),t=r(_d[1]);const o=n=>n?n.split('+').map(n=>n.trim()).filter(Boolean):[],i='#17140F',a='#6B5A35',l='#F3E7CC',c='#B8AA8A',s={online:'Website',phone:'Phone','in-person':'In person','walk-in':'Walk-in',email:'Email','third-party':'Third party'},d=(n,t)=>{if(!n)return null;const o=new Date(n);if(Number.isNaN(o.getTime()))return null;const i=o.toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'});return o.toLocaleDateString('en-CA',{timeZone:'Europe/London'})===t?i:`${o.toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'Europe/London'})}, ${i}`};function u(n){const t=n;if('noshow'===n.status)return t.cancelled?.by?`Marked no-show by ${t.cancelled.by}`:'Marked no-show';if(t.cancelled?.by)return t.cancelled.by;const o=!!t.wix?.status&&/CANCEL|DECLIN/i.test(t.wix.status);return o&&t.wix?.archived?'Cancelled and archived in Website bookings':o?'Cancelled in Website bookings':(n.tags??[]).some(n=>n.endsWith(': deposit not paid'))||'PAYMENT_INFORMATION_PENDING'===t.wix?.status?'Website booking not finished (deposit not paid)':t.wix?.archived?'Archived in Website bookings':'Not recorded'}function b(i,a){const l=i,c=o(i.table??l.cancelled?.table??void 0),b=c.length?`Table ${(0,n.tableNumbers)(c.join('+'))}`:'No table',p=`${i.partySize} ${1===i.partySize?'person':'people'}`,h=d(l.cancelled?.at??(l.wix?l.wix.updatedDate:null),i.date),f=u(i),w=i.walkIn?'Walk-in':s[i.source??'']??(l.wix?'Website':'Not recorded'),y=(0,t.allergyLine)(i),C='noshow'===i.status,N=`${C?'No-show':'Cancelled'}: ${a}, ${y?`allergy noted: ${y}, `:''}${p}, was ${i.time}, ${b.toLowerCase()}. ${f}${h?` at ${h}`:''}.`;return{id:i.id,date:i.date,name:a,people:p,time:i.time,table:b,tables:c,walkIn:!!i.walkIn,by:f,when:h,source:w,notes:(i.notes??'').trim(),allergy:y,spoken:N,kind:C?'noshow':'cancelled'}}const p=n=>`Cancellations & no-shows ${n}`,h=(n="today")=>`No cancellations or no-shows ${n}.`,f=n=>{const t=n.filter(n=>'noshow'===n.kind).length,o=n.length-t;return`${o} ${1===o?'cancellation':'cancellations'} \xb7 ${t} ${1===t?'no-show':'no-shows'}`}},1390,[843,1368]); __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.CancellationsSection=function({items:e,dayWord:b="today",testID:y="display-cancellations"}){const[p,C]=(0,l.useState)(null),j=(0,s.cancellationsHeading)(e.length);return(0,u.jsxs)(o.default,{testID:y,style:{marginTop:14,borderRadius:12,backgroundColor:s.CANCEL_TINT,borderWidth:1,borderColor:s.CANCEL_BORDER,padding:10,gap:6},children:[(0,u.jsxs)(o.default,{accessible:!0,accessibilityRole:"header",accessibilityLabel:e.length?`${j}: ${(0,s.cancellationsCounts)(e)}. Not counted in Covers.`:`Cancellations and no-shows: none ${b}.`,style:{alignItems:'center',gap:2},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:c.colours.gold,center:!0,testID:"cancellations-head",children:j}),e.length?(0,u.jsx)(n.T,{size:14,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-counts",children:(0,s.cancellationsCounts)(e)}):null]}),e.length?e.map(e=>(0,u.jsxs)(t.default,{testID:`cancel-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.spoken,accessibilityHint:"Opens the details. Read only.",onPress:()=>C(e),dataSet:{centreExempt:'list-row'},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:'rgba(214,180,106,0.18)',backgroundColor:e?'#241F16':'transparent'}),children:[(0,u.jsxs)(o.default,{style:{flexDirection:'row',gap:10,alignItems:'flex-start'},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{width:58,textDecorationLine:'line-through'},children:e.time}),(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:e.name}),(0,u.jsx)(o.default,{testID:`cancel-kind-${e.id}`,style:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:'noshow'===e.kind?c.colours.amber:s.CANCEL_BORDER},children:(0,u.jsx)(n.T,{size:13,weight:"semibold",colour:'noshow'===e.kind?c.colours.amber:s.CANCEL_MUTED,children:'noshow'===e.kind?'No-show':'Cancelled'})}),e.allergy?(0,u.jsx)(o.default,{style:{paddingTop:1},children:(0,u.jsx)(h.AllergyIcon,{text:e.allergy,size:20,colour:"#D6A23A",ink:"#17140F",testID:`cancel-allergy-${e.id}`})}):null]}),(0,u.jsxs)(n.T,{size:15,colour:s.CANCEL_MUTED,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[e.people," \xb7 ",e.table," \xb7 ",e.by,e.when?` \xb7 ${e.when}`:'']})]},e.id)):(0,u.jsx)(n.T,{size:15,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-empty",children:(0,s.cancellationsEmpty)(b)}),p?(0,u.jsx)(x,{c:p,onClose:()=>C(null)}):null]})},_e.CancelDetail=x;var l=r(d[0]),t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]);function b({k:e,v:l}){return(0,u.jsxs)(o.default,{accessible:!0,accessibilityLabel:`${e}: ${l}`,style:{flexDirection:'row',gap:10,paddingVertical:6,borderBottomWidth:1,borderColor:c.colours.hairline},children:[(0,u.jsx)(n.T,{size:16,colour:c.colours.muted,style:{width:130},children:e}),(0,u.jsx)(n.T,{size:16,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l})]})}function x({c:e,onClose:l}){return(0,u.jsxs)(n.Sheet,{visible:!0,onClose:l,title:`${'noshow'===e.kind?'No-show':'Cancelled'} \xb7 ${e.name}`,maxWidth:560,testID:"cancel-detail",children:[(0,u.jsxs)(o.default,{testID:"cancel-detail-body",style:{gap:2},children:[(0,u.jsx)(b,{k:"Name",v:e.name}),(0,u.jsx)(b,{k:"Party",v:e.people}),e.allergy?(0,u.jsx)(b,{k:"Allergies",v:e.allergy}):null,(0,u.jsx)(b,{k:"Was booked for",v:`${e.date?`${new Date(`${e.date}T12:00:00`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})}, `:''}${e.time}`}),(0,u.jsx)(b,{k:"Table",v:e.table}),(0,u.jsx)(b,{k:'noshow'===e.kind?'No-show':'Cancelled by',v:e.by}),(0,u.jsx)(b,{k:"When",v:e.when??'Not recorded'}),(0,u.jsx)(b,{k:"Booked by",v:e.source}),(0,u.jsx)(b,{k:"Notes",v:e.notes||'None'})]}),(0,u.jsx)(n.T,{size:14,colour:c.colours.muted,center:!0,children:"Read only. Not counted in Covers. Phone numbers stay in the Managers app."})]})}},1391,[17,385,85,777,1390,804,1347,8]); diff --git a/display-app/admin.html b/display-app/admin.html index 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5720647dc5bc93a2cbc14afe894ac0d5f053d14d..12edcd3685c3eb74905def6fca8e37efa6e2a8cd 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 a22a808c637083ac03d3482e32804fd7ad83a31a..ecba30a7ed1fdc718bbc42fabce5c430e5f51034 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-84c2bd63e0"; +const V = "cc-display-c7b3bbed3e"; const BASE = "/display-app/"; -const PRECACHE = ["/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/display-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/display-app/assets/assets/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=84c2bd63e023602302145c264865349668dd12aee80466d197eca4d035f42d84"]; +const PRECACHE = ["/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/display-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/display-app/assets/assets/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=c7b3bbed3ebe68b3b00dcbb9408c2120c50b315bb32bb1402d8296a746ae82c2"]; // 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 5c545d21450dd9bdca052552784a20108e9a96e3..10799319c80aaa2d7df95a398a7f9d22e23c1673 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 6ef56696bf2bb172d586662f6ac2194c42b78035..42a2794adcdafaab1edcb9d5be94070473626841 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ -Cover Charge: try the apps (v0.3.12.201) +Cover Charge: try the apps (v0.3.12.202) @@ -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.201)

+

Cover Charge: try the apps (v0.3.12.202)

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

+

Cover Charge v0.3.12.202

diff --git a/owner-app/_expo/static/js/web/bundle.js b/owner-app/_expo/static/js/web/bundle.js index 8e00dc1e4c82892a7377d6636b1486e582d7cca8..5ece2ad33666f9a0c180fc6693942e69d6a4441e 100644 --- a/owner-app/_expo/static/js/web/bundle.js +++ b/owner-app/_expo/static/js/web/bundle.js @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__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.201'},979,[]); +__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.202'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1247,7 +1247,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,"FOH_ROLE_BADGES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"KITCHEN_ROLE_BADGES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ROLE_BADGES",{enumerable:!0,get:function(){return o}}),e.cleanBadge=c,Object.defineProperty(e,"isKitchenBadge",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isFohBadge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"badgeSpoken",{enumerable:!0,get:function(){return f}}),e.assignShiftBadge=b,e.assignKitchenShiftBadge=function(n,t,o){const s=String(o??'').trim();return s&&!u(s)?n:b(n,t,s?c(s):void 0)},e.applyLiveKitchenBadge=function(n,t,o){const s=String(o??'').trim();if(s&&!u(s))return n;const f=s?c(s):void 0;return n.map(n=>n.id===t?{...n,badge:f}:n)};const n=['Bar','Floor'],t=['Upstairs KP','Downstairs KP','Sauce','Larder'],o=[...n,...t];function c(n){const t=String(n??'').trim().toLowerCase();return o.find(n=>n.toLowerCase()===t)}const u=n=>{const o=c(n);return!!o&&t.includes(o)},s=t=>{const o=c(t);return!!o&&n.includes(o)},f=n=>c(n)?`, on ${c(n)}`:'';function b(n,t,o){const u=c(o);return n.map(n=>n.id===t?{...n,badge:u,changed:!!n.published||n.changed}:n)}},1164,[]); __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.useSuggestions=j,_e.OrdersScreen=function({focus:e}={}){const[s,t]=(0,n.useState)('sheets');return(0,x.jsxs)(l.default,{style:{gap:12},children:[(0,x.jsx)(y.Seg,{value:s,onChange:t,options:[{id:'sheets',label:'Order sheets'},{id:'suggested',label:'Suggested orders'},{id:'history',label:'Order history'}]}),'sheets'===s?(0,x.jsx)(m.OrderSheets,{focus:e}):'suggested'===s?(0,x.jsx)(w,{}):(0,x.jsx)($,{})]})};var s=r(_d[0]),t=r(_d[1]),n=r(_d[2]),i=e(r(_d[3])),l=e(r(_d[4])),d=r(_d[5]),o=r(_d[6]),u=r(_d[7]),c=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),f=r(_d[12]),m=r(_d[13]),x=r(_d[14]);const b=(e,s)=>'kg'===s?Math.ceil(2*e)/2:Math.ceil(e);function j(){const{k:e,now:s,rid:n}=(0,y.useChef)(6e4),{pct:i}=(0,y.useForecast)(),l=(0,u.supplierView)('chef',(0,o.useOwner)(e=>e.suppliers)).filter(e=>!e.archived),d=1+Math.max(0,i)/100;return l.map(i=>{const l=e.ingredients.filter(e=>e.supplierId===i.id).map(e=>({i:e,qty:(0,t.fishInStone)(n,e)?(0,t.fromStone)(Math.ceil(2*(0,t.toStone)(Math.max(0,e.par*d-e.onHand),e.unit))/2,e.unit):b(Math.max(0,e.par*d-e.onHand),e.unit)})).filter(e=>e.qty>0),o=(0,p.weekday)(s),u=i.orderDays.includes(o),[c,h]=(i.cutoff||'23:59').split(':').map(Number),y=new Date(s);y.setHours(c,h,0,0);const f=e.orders.some(e=>e.supplierId===i.id&&new Date(e.at).toDateString()===s.toDateString()),m=[1,2,3,4,5,6,7].map(e=>(o+e)%7).find(e=>i.orderDays.includes(e));return{s:i,lines:l,ordersToday:u,cutPassed:s>y,placedToday:f,nextDay:m,total:Math.round(l.reduce((e,s)=>e+s.qty*s.i.cost,0))}}).filter(e=>e.lines.length||e.ordersToday)}function w(){const{me:e,rid:o}=(0,y.useChef)(),{label:u,covers:m,enough:b,booked:w}=(0,y.useForecast)(),$=(0,f.useKitchen)(e=>e.addOrder),S=j(),[C,M]=(0,n.useState)({}),[O,k]=(0,n.useState)('');return(0,x.jsxs)(l.default,{style:{gap:10},children:[(0,x.jsxs)(d.Muted,{children:[b?`Built from par levels and today's forecast (${m} Covers, ${u} vs a typical day).`:`Built from par levels (no forecast yet: not enough history; ${w} Covers booked so far).`," Adjust, then call the supplier or use their ordering website. Nothing is sent by CoverCharge."]}),O?(0,x.jsx)(d.Banner,{kind:"success",title:"Saved to order history",children:O}):null,S.map(({s:n,lines:u,ordersToday:y,cutPassed:f,placedToday:m,nextDay:b,total:j})=>{const w=u.map(e=>({...e,q:C[`${n.id}:${e.i.id}`]??e.qty})),S=Math.round(w.reduce((e,s)=>e+s.q*s.i.cost,0)),O=s=>{$({supplierId:n.id,by:e,status:s,lines:w.filter(e=>e.q>0).map(e=>({ing:e.i.id,qty:e.q,cost:e.i.cost})),total:S}),k(`${n.name}: ${(0,c.gbp)(S)} (${s}).`)};return(0,x.jsxs)(d.Card,{highlight:!y||m||f?void 0:h.colours.gold,children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{weight:"semibold",children:n.name}),(0,x.jsxs)(d.Muted,{children:[n.category," \xb7 min order ",(0,c.gbp)(n.minOrder)]})]}),m?(0,x.jsx)(d.Badge,{kind:"ok",label:"ORDERED TODAY"}):y?(0,x.jsx)(d.Badge,{kind:f?'red':'amber',label:f?`CUT-OFF ${n.cutoff} PASSED`:`ORDER BY ${n.cutoff}`}):(0,x.jsx)(d.Badge,{label:`NEXT ${null!=b?p.DAY3[b].toUpperCase():'\u2014'}`})]}),w.length?w.map(e=>(0,x.jsxs)(d.Row,{wrap:!0,style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{size:14,children:e.i.name}),(0,x.jsxs)(d.Muted,{children:["On hand ",(0,s.ingredientQty)(o,e.i,e.i.onHand)," \xb7 par ",(0,s.ingredientQty)(o,e.i,e.i.par)]})]}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"Less",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone less':'Less'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,-1)}))}),(0,x.jsx)(l.default,{accessible:!0,accessibilityLabel:(0,s.ingredientSpeech)(o,e.i,e.q),children:(0,x.jsx)(d.T,{size:16,style:{minWidth:76,textAlign:'center'},children:(0,s.ingredientQty)(o,e.i,e.q)})}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"More",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone more':'More'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,1)}))})]},e.i.id)):(0,x.jsx)(d.Muted,{children:"Everything is at par."}),w.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(d.T,{weight:"semibold",children:["Estimated ",(0,c.gbp)(S)]}),S{i.default.openURL(`tel:${n.phones[0].replace(/\s/g,'')}`).catch(()=>{}),O('placed (by phone)')}}):null,n.website?(0,x.jsx)(d.Button,{small:!0,kind:"secondary",label:"Open website",onPress:()=>{i.default.openURL(n.website).catch(()=>{}),O('placed (on website)')}}):null]})]}):null,void 0]},n.id)})]})}function $(){const{k:e,rid:t}=(0,y.useChef)(),n=(0,o.useOwner)(e=>e.suppliers);return(0,x.jsx)(l.default,{style:{gap:8},children:e.orders.map(i=>(0,x.jsxs)(d.Card,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(d.T,{weight:"semibold",style:{flex:1},children:n.find(e=>e.id===i.supplierId)?.name}),(0,x.jsx)(d.Badge,{kind:"neutral",label:i.status.toUpperCase()})]}),(0,x.jsxs)(d.Muted,{children:[new Date(i.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",i.by,i.total?` \xb7 ${(0,c.gbp)(i.total)}`:'']}),i.lines.length?(0,x.jsx)(d.Muted,{children:i.lines.map(n=>{const i=e.ingredients.find(e=>e.id===n.ing);return`${(0,s.ingredientQty)(t,i??{name:n.ing,unit:''},n.qty)} ${i?.name??n.ing}`}).join(', ')}):null]},i.id))})}},1165,[1148,943,17,362,85,777,876,955,851,804,1055,1140,1000,1166,8]); __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.openLink=w,_e.useSheetReminders=C,_e.OrderSheets=function({focus:e}){const{rid:t,now:l}=(0,x.useChef)(3e4),o=(0,u.useSheets)(t).filter(e=>(0,n.chefCanSee)(t,e)&&!e.placeholder),[h,c]=(0,s.useState)(e??null),p=C(),f=(0,b.wd)(l);return(0,j.jsxs)(d.default,{style:{gap:10},testID:"order-sheets",children:[(0,j.jsx)(i.Banner,{kind:"info",title:"Nothing is sent for you",children:"Text, WhatsApp and phone orders open your phone\u2019s own app with the order already written. Check it, then press Send yourself."}),p.map(e=>(0,j.jsx)(r.default,{accessibilityRole:"button",onPress:()=>c(e.supplierId),children:(0,j.jsxs)(i.Banner,{kind:'red'===e.tone?'danger':'warn',title:`\u23f0 ${e.text}`,children:["Tap to open the ",e.name," order sheet."]})},e.supplierId)),(0,j.jsxs)(i.Muted,{children:["Today is ",b.DAYS[f],". Edit suppliers in Managers \u203a Settings \u203a Supplier order sheets."]}),o.map(e=>(0,j.jsx)($,{s:e,open:h===e.id,onToggle:()=>c(h===e.id?null:e.id)},e.id)),o.length?null:(0,j.jsx)(i.Muted,{children:"No order sheets yet. Add suppliers in Managers \u203a Settings \u203a Supplier order sheets."})]})};var t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),o=e(_r(_d[4]));_r(_d[5]);var r=e(_r(_d[6])),d=e(_r(_d[7])),i=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),b=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),j=_r(_d[17]);function w(e){if('undefined'!=typeof window){const t=window;return'function'==typeof t.__ccOpenLink?void t.__ccOpenLink(e):void(/^https?:/.test(e)?window.open(e,'_blank','noopener'):window.location.href=e)}o.default.openURL(e).catch(()=>{})}async function k(e){try{const t='undefined'!=typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0}catch{}return!1}const S={online:'\ud83c\udf10',phone:'\ud83d\udcde',text:'\ud83d\udcac',whatsapp:'\u2706',tbc:'\ud83d\udd8a\ufe0f'},T={borderWidth:1,borderColor:f.colours.border,borderRadius:10,paddingHorizontal:12,paddingVertical:10,color:f.colours.text,backgroundColor:f.colours.surface2,fontSize:f.font.body};function C(){const{rid:e,now:t}=(0,x.useChef)(6e4),l=(0,u.useSheets)(e).filter(t=>(0,n.chefCanSee)(e,t)&&!t.placeholder),s=(0,u.useOrderSheets)(e=>e.opened),o=(0,h.useShellfish)(e,'','chef'),r=(0,b.remindersFor)(l,t,s);for(const n of l){const l=o.items.filter(e=>(e.supplierId===n.id||!e.supplierId&&n.shellfish)&&o.isLow(e.key));!l.length||s[n.id]&&new Date(s[n.id]).toDateString()===t.toDateString()||r.push({supplierId:n.id,name:n.name,text:`${'text'===n.method||'whatsapp'===n.method?'Text':'Order from'} ${n.contact||n.name}: ${l.map(t=>`${(0,c.fmtStockCount)(e,t,o.counts[t.key]??0)} ${t.plural.toLowerCase()}`).join(' and ')} left`,tone:'amber',cutoffPassed:!1})}return r}function $({s:e,open:n,onToggle:o}){const{rid:C,r:$,me:D,now:I}=(0,x.useChef)(3e4),v=(0,u.useOrderSheets)(e=>e.patch),M=(0,u.useOrderSheets)(e=>e.markOpened),B=(0,u.useOrderSheets)(t=>t.opened[e.id]),[L,P]=(0,s.useState)({}),[O,R]=(0,s.useState)(''),[A,z]=(0,s.useState)(''),[_,W]=(0,s.useState)(!1),H=(0,h.useShellfish)(C,D,'chef'),K=(0,b.nextDelivery)(e,I),E=(0,b.orderLines)(e,L,O,C),N=($.address??$.location??'').split(',').map(e=>e.trim()).filter(Boolean),q=N.length>=3?N[1]:N[0]??'',U=(0,b.orderMessage)(e,$.name,q,E,D.split(' ')[0],I),Q=e.orderDays.includes((0,b.wd)(I)),Y=(e,t)=>P(n=>({...n,[e.id]:(0,l.stepQuantity)(C,e,n[e.id]||0,t)})),F=t=>{M(e.id,I.toISOString()),w(t)},G='text'===e.method||'whatsapp'===e.method||'phone'===e.method,V=Math.round(100*((0,y.parseMoneyInput)(A)??NaN)),J=H.items.filter(t=>t.supplierId===e.id||!t.supplierId&&e.shellfish),X=J.filter(e=>H.isLow(e.key));return(0,j.jsxs)(d.default,{testID:`sheet-${e.id}`,style:{borderRadius:14,borderWidth:1.5,borderColor:Q||X.length?f.colours.amber:n?f.colours.gold:f.colours.border,backgroundColor:f.colours.surface,overflow:'hidden'},children:[(0,j.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.name} order sheet`,onPress:o,style:{padding:12,gap:4},children:[(0,j.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(i.T,{weight:"semibold",size:f.font.large,style:{flex:1},children:[S[e.method]," ",e.name]}),(0,j.jsx)(i.Badge,{kind:e.placeholder?'amber':'gold',label:e.placeholder?'To fill in':b.METHOD_LABEL[e.method]})]}),(0,j.jsx)(i.Muted,{children:e.goods}),(0,j.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.deliveryDays.length?(0,j.jsx)(i.Badge,{kind:"neutral",label:`Delivers ${(0,b.dayRange)(e.deliveryDays)}`}):null,e.orderDays.length?(0,j.jsx)(i.Badge,{kind:Q?'amber':'neutral',label:`Order ${(0,b.dayRange)(e.orderDays)}${e.cutoff?` by ${e.cutoff}`:''}`}):null,e.frequency?(0,j.jsx)(i.Badge,{kind:"neutral",label:e.frequency}):null,e.priceCapPerKg?(0,j.jsx)(i.Badge,{kind:"blue",label:`Cap ${(0,p.gbp)(e.priceCapPerKg)}/kg`}):null,J.length?(0,j.jsx)(i.Badge,{kind:X.length?'amber':'ok',label:J.map(e=>`${e.icon} ${(0,c.fmtStockCount)(C,e,H.counts[e.key]??0)}`).join(' \xb7 ')}):null,B&&new Date(B).toDateString()===I.toDateString()?(0,j.jsx)(i.Badge,{kind:"ok",label:"Opened today \u2713"}):null]})]}),n?(0,j.jsxs)(d.default,{style:{padding:12,paddingTop:0,gap:10},children:[K?(0,j.jsxs)(i.Muted,{children:["Next delivery if you order now: ",(0,b.niceDay)(K),"."]}):null,e.reminder?(0,j.jsxs)(i.Muted,{children:["Reminder on ",e.orderDays.map(e=>b.DAYS[e]).join(', '),": ",e.reminder]}):null,e.notes?(0,j.jsx)(i.T,{size:f.font.small,colour:f.colours.muted,children:e.notes}):null,e.placeholder?(0,j.jsx)(i.Banner,{kind:"warn",title:"Still to be set up",children:"Add the supplier, how to order and delivery days in Managers \u203a Settings \u203a Supplier order sheets."}):null,e.items.map(e=>(0,j.jsxs)(d.default,{style:{gap:6},children:[(0,j.jsxs)(i.T,{children:[e.name,e.unit?(0,j.jsxs)(i.T,{size:f.font.small,colour:f.colours.muted,children:[" (",(0,l.quantityUnit)(C,e),")"]}):null]}),(0,j.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone less':'Less'} ${e.name}`,onPress:()=>Y(e,-1),style:{minWidth:44,minHeight:44}}),(0,j.jsx)(d.default,{accessible:!0,accessibilityLabel:(0,l.fishQtySpeech)(C,e,L[e.id]||0),children:(0,j.jsx)(i.T,{weight:"bold",size:20,style:{minWidth:76,textAlign:'center'},children:(0,l.fishInStone)(C,e)?(0,l.fishQtyText)(C,e,L[e.id]||0):L[e.id]||0})}),(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone more':'More'} ${e.name}`,testID:`qty-${e.id}`,onPress:()=>Y(e,1),style:{minWidth:44,minHeight:44}})]})]},e.id)),(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsx)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:"Anything else (one line each)"}),(0,j.jsx)(t.TextInput,{value:O,onChangeText:R,multiline:!0,placeholder:"e.g. 2 boxes lemons",placeholderTextColor:f.colours.muted,style:[T,{minHeight:60}]})]}),G?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['whatsapp'===e.method?'WhatsApp number':'phone'===e.method?'Phone number':'Mobile number',e.number?'':' (blank: fill in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`number-${e.id}`,value:e.number,onChangeText:t=>v(C,e.id,{number:t}),keyboardType:"phone-pad",placeholder:"07\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,'online'===e.method?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['Open Coldweb'===e.urlLabel?'Coldweb ordering link':'Website link',e.url?'':' (blank: paste it in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`url-${e.id}`,value:e.url,onChangeText:t=>v(C,e.id,{url:t.trim()}),autoCapitalize:"none",keyboardType:"url",placeholder:"https://\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,e.priceCapPerKg?(0,j.jsxs)(d.default,{style:{gap:6,padding:10,borderRadius:12,backgroundColor:f.colours.blueBg},children:[(0,j.jsxs)(i.T,{weight:"semibold",colour:"#E2C489",children:["Price cap ",(0,p.gbp)(e.priceCapPerKg),"/kg \xb7 buy from the cheapest UK seller under it"]}),(0,j.jsxs)(i.Muted,{children:["Seller: ",e.seller||'to be chosen']}),(0,j.jsxs)(i.Row,{gap:8,children:[(0,j.jsx)(i.T,{size:f.font.small,style:{flex:1},children:"Price you found (\xa3/kg)"}),(0,j.jsx)(t.TextInput,{testID:"price-found",value:A,onChangeText:e=>z((0,y.sanitiseMoneyTyping)(e)),keyboardType:"decimal-pad",inputMode:"decimal",placeholder:"e.g. 22.50",placeholderTextColor:f.colours.muted,style:[T,{width:120}]})]}),V>0?(0,j.jsx)(i.Badge,{kind:V<=e.priceCapPerKg?'ok':'red',label:V<=e.priceCapPerKg?`${(0,p.gbp)(V)}/kg is under the cap \u2713`:`${(0,p.gbp)(V)}/kg is over the ${(0,p.gbp)(e.priceCapPerKg)} cap: look for a cheaper seller`}):null]}):null,'online'!==e.method&&'tbc'!==e.method?(0,j.jsxs)(d.default,{testID:`preview-${e.id}`,style:{padding:10,borderRadius:12,borderWidth:1,borderColor:f.colours.border,backgroundColor:f.colours.surface2},children:[(0,j.jsx)(i.T,{size:12,weight:"semibold",colour:f.colours.gold,children:'phone'===e.method?'READ THIS OUT':'YOUR MESSAGE'}),(0,j.jsx)(i.T,{size:f.font.small,children:E.length?U:'Add quantities above to write the order.'})]}):null,(0,j.jsxs)(i.Row,{wrap:!0,gap:8,children:['text'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"\ud83d\udcac Open in Messages",disabled:!E.length,onPress:()=>F((0,b.smsLink)(e.number,U))}):null,'whatsapp'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"Open in WhatsApp",disabled:!E.length,onPress:()=>F((0,b.waLink)(e.number,U))}):null,'phone'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83d\udcde Call ${e.name}`,disabled:!e.number,onPress:()=>F((0,b.telLink)(e.number))}):null,'online'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83c\udf10 ${e.urlLabel??'Open website'}`,disabled:!e.url,onPress:()=>F(e.url)}):null,'online'!==e.method&&'tbc'!==e.method&&E.length?(0,j.jsx)(i.Button,{kind:"ghost",label:_?'Copied \u2713':'Copy order',onPress:async()=>{const e=await k(U);W(e),e&&setTimeout(()=>W(!1),2e3)}}):null]}),'text'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: Messages opens with the order written and asks who to send it to."}):null,'whatsapp'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: WhatsApp opens with the order written and asks who to send it to."}):null,'phone'!==e.method||e.number?null:(0,j.jsx)(i.Muted,{children:"Add the phone number above to call from here."}),'online'!==e.method||e.url?null:(0,j.jsx)(i.Muted,{children:"Add the link above and the button opens it."})]}):null]})}},1166,[812,820,943,17,362,219,385,85,777,998,942,944,851,999,804,1140,840,8]); -__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:i,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),i?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:i}):null]}):null,n||w.length||!i?null:(0,j.jsx)(l.default,{accessibilityRole:"button",onPress:i,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:i?()=>{k(!1),i()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const i=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!i.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${i.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,i.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:i.items.map((t,s)=>{const o=i.counts[t.key]??0,l=d[t.key]??0,h=Math.max(0,o-l),m=h<=0,b=m||i.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:l?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,l)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return z}}),_e.ShellfishChip=M,_e.SundayRoastChip=function(e){return(0,j.jsx)(M,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=e(_r(_d[5])),l=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(i.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:i,group:l}){const d=(0,h.useShellfish)(e,s,r,l),m='roast'===l,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const i=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,i,o):Math.max(0,Math.min(99,i+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),z=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),M=(0,o.useRef)(null);M.current||(M.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!M.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,H]=(0,o.useState)(0),F=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?z:D>0,W=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!F.length)return;const e=setInterval(()=>H(e=>e+1),600);return()=>clearInterval(e)},[R.state,F.length]);const P=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void W('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?W('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?W('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-P.current>2e4&&W('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||F.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||F.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${F.length} ${1===F.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&z&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),P.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!z,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),i?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:i}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const z=18;function M({rid:e,by:t,app:r,size:i="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(m&&'roast'===d&&(!f.items.length||!(0,u.isSundayIn)(T)))return(0,j.jsx)(R,{size:i});if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const M='m'===i?20:17,E='roast'!==d,B=E&&f.items.some(e=>(k[e.key]??0)>0),H=B?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==i&&!B;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${E&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,i=p[t.key]??0,d=Math.max(0,n-i),h=d<=0,m=h||f.isLow(t.key),b=E?k[t.key]??0:0,x=h?y.colours.red:E&&'display'!==r?y.colours.shellfishFree:m&&!E?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:B?4:6,paddingHorizontal:B?5:9,paddingVertical:3,flexShrink:0,minWidth:B?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,M-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:M-2}),(0,j.jsx)(c.T,{size:M,weight:"bold",colour:x,style:{lineHeight:M+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(l.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:z,minWidth:z,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):B?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:z,width:z,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,H)})`})}):null,!F||!(i||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':i?`${(0,u.fmtStockCount)(e,t,i)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),i=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),l=(0,f.reservedBookingsOn)(r,i,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(i))}),l.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}function R({size:e}){return(0,j.jsxs)(a.default,{testID:"roast-slot",accessible:!0,accessibilityLabel:"Sunday roast count: shown on Sundays",style:{minHeight:44,minWidth:'xs'===e?64:84,paddingHorizontal:10,borderRadius:12,borderWidth:1,borderColor:y.colours.hairline,backgroundColor:'rgba(255,255,255,0.03)',flexDirection:'row',alignItems:'center',justifyContent:'center',gap:6},children:[(0,j.jsx)(c.T,{size:'m'===e?14:12,colour:y.colours.muted,children:"Roast"}),(0,j.jsx)(c.T,{size:'m'===e?18:16,weight:"bold",colour:y.colours.muted,children:"\u2013"})]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); +__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:l,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(i.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),l?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:l}):null]}):null,n||w.length||!l?null:(0,j.jsx)(i.default,{accessibilityRole:"button",onPress:l,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:l?()=>{k(!1),l()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const l=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!l.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${l.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,l.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:l.items.map((t,s)=>{const o=l.counts[t.key]??0,i=d[t.key]??0,h=Math.max(0,o-i),m=h<=0,b=m||l.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:i?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,i)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return M}}),_e.ShellfishChip=z,_e.SundayRoastChip=function(e){return(0,j.jsx)(z,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),l=e(_r(_d[5])),i=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(l.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:l,group:i}){const d=(0,h.useShellfish)(e,s,r,i),m='roast'===i,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const l=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,l,o):Math.max(0,Math.min(99,l+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),M=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),z=(0,o.useRef)(null);z.current||(z.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!z.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,F]=(0,o.useState)(0),H=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?M:D>0,P=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!H.length)return;const e=setInterval(()=>F(e=>e+1),600);return()=>clearInterval(e)},[R.state,H.length]);const W=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void P('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?P('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?P('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-W.current>2e4&&P('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||H.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||H.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${H.length} ${1===H.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&M&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),W.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!M,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),l?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:l}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const M=18;function z({rid:e,by:t,app:r,size:l="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const z='m'===l?20:17,R='roast'!==d,E=R&&f.items.some(e=>(k[e.key]??0)>0),B=E?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==l&&!E;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${R&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,l=p[t.key]??0,d=Math.max(0,n-l),h=d<=0,m=h||f.isLow(t.key),b=R?k[t.key]??0:0,x=h?y.colours.red:R&&'display'!==r?y.colours.shellfishFree:m&&!R?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:E?4:6,paddingHorizontal:E?5:9,paddingVertical:3,flexShrink:0,minWidth:E?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,z-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:z-2}),(0,j.jsx)(c.T,{size:z,weight:"bold",colour:x,style:{lineHeight:z+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(i.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:M,minWidth:M,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):E?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:M,width:M,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,B)})`})}):null,!F||!(l||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':l?`${(0,u.fmtStockCount)(e,t,l)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),l=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),i=(0,f.reservedBookingsOn)(r,l,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(l))}),i.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"look",{enumerable:!0,get:function(){return n}}),r(d[0]);var o=r(d[1]);const b=o=>o,n={panel:{backgroundColor:'#121110',borderRadius:o.radii.xl,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',boxShadow:'0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 28px rgba(0,0,0,0.45)'},quiet:(b,n="gold")=>({minHeight:o.control.tall,borderRadius:o.radii.button,borderWidth:1,borderColor:'blue'===n?'rgba(226,196,137,0.55)':'rgba(207,164,95,0.38)',backgroundColor:b?'rgba(207,164,95,0.16)':'blue'===n?'rgba(226,196,137,0.10)':'rgba(255,255,255,0.035)',paddingHorizontal:14,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:8,boxShadow:'0 1px 0 rgba(255,255,255,0.05) inset',transition:'background-color 120ms ease'}),primary:o=>({backgroundColor:o?'#B8904F':'#CFA45F',borderWidth:1,borderColor:'rgba(255,226,170,0.55)',backgroundImage:o?'linear-gradient(180deg, #BE9552 0%, #A88143 100%)':'linear-gradient(180deg, #E0BA77 0%, #C69A55 100%)',boxShadow:o?'0 2px 8px rgba(0,0,0,0.4)':'0 1px 0 rgba(255,255,255,0.28) inset, 0 10px 24px rgba(207,164,95,0.22), 0 4px 10px rgba(0,0,0,0.45)',transition:'box-shadow 120ms ease'}),onPrimary:'#17130D',web:b}},1168,[219,811]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STOCK_ICON_IMAGES",{enumerable:!0,get:function(){return A}});const A={'\ud83e\udd9e':{uri:'data:image/png;base64,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',w:47,h:64},'\ud83e\udd80':{uri:'data:image/png;base64,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',w:64,h:45}}},1169,[]); __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.StockScreen=function({initial:e="levels"}){const[t,i]=(0,l.useState)(e);return(0,y.jsxs)(r.default,{style:{gap:12},children:[(0,y.jsx)(p.Seg,{value:t,onChange:i,options:[{id:'levels',label:'Stock levels'},{id:'take',label:'Stock take'},{id:'deliveries',label:'Deliveries in'}]}),'levels'===t?(0,y.jsx)(j,{}):'take'===t?(0,y.jsx)(f,{}):(0,y.jsx)(v,{})]})};var t=_r(_d[0]),i=_r(_d[1]),n=_r(_d[2]),s=_r(_d[3]),l=_r(_d[4]),d=e(_r(_d[5])),r=e(_r(_d[6])),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]);function j(){const{k:e,rid:t}=(0,p.useChef)(),d=(0,c.useOwner)(e=>e.suppliers),b=(0,i.useSheets)(t),[x,j]=(0,l.useState)('all'),f=e.ingredients.filter(e=>e.onHand<=0),v=e.ingredients.filter(e=>(0,p.isLow)(e.onHand,e.par)),k='alerts'===x?[...f,...v]:e.ingredients,S=[...new Set(k.map(e=>e.supplierId))].map(e=>{const t=d.find(t=>t.id===e),i=b.find(t=>t.id===e);return{id:e,name:t?.name||i?.name||'Supplier not linked',category:t?.category||i?.goods||'Stock'}});return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsxs)(o.Row,{wrap:!0,gap:10,children:[(0,y.jsx)(p.Tile,{label:"Stock value (at cost)",value:(0,u.gbp)((0,p.stockValue)(e.ingredients)),sub:`${e.ingredients.length} ingredients`}),(0,y.jsx)(p.Tile,{label:"Low or out",value:`${v.length+f.length}`,sub:`${f.length} out \xb7 ${v.length} below half par`,tone:f.length?'red':v.length?'amber':'ok',onPress:()=>j('alerts')})]}),f.length?(0,y.jsxs)(o.Banner,{kind:"danger",title:"Out of stock",children:[f.map(e=>e.name).join(', '),". Mark the dishes that need it as sold out (Kitchen \u203a Live tickets \u203a Sold out), or order now."]}):null,(0,y.jsx)(p.Seg,{value:x,onChange:j,options:[{id:'all',label:'All'},{id:'alerts',label:'Alerts only'}]}),e.ingredients.length?null:(0,y.jsx)(o.Muted,{children:"No stock items yet. Add your real ingredients to start counting."}),S.map(e=>(0,y.jsxs)(o.Card,{children:[(0,y.jsxs)(o.T,{weight:"semibold",children:[e.category," \xb7 ",e.name]}),k.filter(t=>t.supplierId===e.id).map(e=>{const i=e.onHand<=0?'out':(0,p.isLow)(e.onHand,e.par)?'low':'ok';return(0,y.jsxs)(r.default,{style:{gap:4,paddingVertical:4},accessible:!0,accessibilityLabel:`${e.name} ${(0,n.ingredientSpeech)(t,e,e.onHand)} of par ${(0,n.ingredientSpeech)(t,e,e.par)}`,children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},children:e.name}),'out'===i?(0,y.jsx)(o.Badge,{kind:"red",label:"OUT"}):'low'===i?(0,y.jsx)(o.Badge,{kind:"amber",label:"LOW"}):null,(0,y.jsxs)(o.T,{size:13,colour:h.colours.muted,children:[(0,n.ingredientQty)(t,e,e.onHand)," / par ",(0,n.ingredientQty)(t,e,e.par)]})]}),(0,y.jsx)(p.Bar,{pct:e.onHand/e.par*100,colour:'out'===i?h.colours.red:'low'===i?h.colours.amber:h.colours.gold}),(0,y.jsxs)(o.Muted,{children:[(0,u.gbp)(Math.round((0,s.displayedCost)(t,e,e.cost)))," per ",(0,s.quantityUnit)(t,e)," \xb7 value ",(0,u.gbp)(Math.round(e.onHand*e.cost))]})]},e.id)})]},e.id))]})}function f(){const{k:e,me:i,rid:d}=(0,p.useChef)(),c=(0,b.useKitchen)(e=>e.saveStockTake),[x,j]=(0,l.useState)({}),[f,v]=(0,l.useState)(''),k=e.ingredients.map(e=>{const t=x[e.id],i=void 0===t||''===t?void 0:Number(t.replace(',','.')),n=void 0!==i&&Number.isFinite(i)&&i>=0&&(!(0,s.fishInStone)(d,e)||2*i===Math.round(2*i))?(0,s.inputQuantity)(d,e,i):void 0,l=void 0===n||Number.isNaN(n)?void 0:n-e.onHand;return{i:e,counted:n,variance:l,cost:void 0===l?0:Math.round(l*e.cost)}}),S=k.filter(e=>void 0!==e.variance),w=S.reduce((e,t)=>e+t.cost,0);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Count what's on the shelves. Expected = last count + deliveries \u2212 waste. Fish is entered in stone, in half-stone steps. Variance shows what's unexplained (portioning, theft, missed waste)."}),e.stockTakes[0]?(0,y.jsxs)(o.Muted,{children:["Last stock take ",new Date(e.stockTakes[0].at).toLocaleDateString('en-GB')," by ",e.stockTakes[0].by,": variance ",(0,u.gbp)(Math.round(e.stockTakes[0].lines.reduce((e,t)=>e+(t.counted-t.expected)*t.cost,0))),"."]}):null,(0,y.jsx)(o.Card,{children:k.map(({i:e,variance:i,cost:l})=>(0,y.jsxs)(r.default,{style:{gap:6,paddingVertical:8},children:[(0,y.jsxs)(r.default,{accessible:!0,accessibilityLabel:`${e.name}, expected ${(0,n.ingredientSpeech)(d,e,e.onHand)}`,children:[(0,y.jsx)(o.T,{size:16,children:e.name}),(0,y.jsxs)(o.Muted,{children:["Expected ",(0,n.ingredientQty)(d,e,e.onHand)]})]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,y.jsx)(t.TextInput,{accessibilityLabel:`Count ${e.name} in ${(0,s.quantityUnit)(d,e)}`,accessibilityValue:{text:x[e.id]?(0,n.ingredientSpeech)(d,e,(0,s.inputQuantity)(d,e,Number(x[e.id]))):'Not counted'},keyboardType:"decimal-pad",placeholder:(0,s.quantityUnit)(d,e),placeholderTextColor:h.colours.muted,value:x[e.id]??'',onChangeText:t=>j(i=>({...i,[e.id]:t})),style:{minHeight:44,width:80,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:8,paddingVertical:6,color:h.colours.text,textAlign:'right'}}),(0,s.fishInStone)(d,e)?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Half a stone less ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String(Math.max(0,(0,s.halfStone)(Number(t[e.id])||0)-.5))}))}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Half a stone more ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String((0,s.halfStone)(Number(t[e.id])||0)+.5)}))})]}):null,(0,y.jsx)(r.default,{style:{minWidth:86,alignItems:'flex-end'},accessible:!0,accessibilityLabel:void 0===i?'No variance yet':`${(0,n.ingredientSpeech)(d,e,i)} variance, ${(0,u.gbp)(l)}`,children:void 0===i?(0,y.jsx)(o.Muted,{children:"\u2014"}):(0,y.jsxs)(o.T,{size:14,colour:Math.abs(i)<.001?h.colours.ok:i<0?h.colours.red:h.colours.amber,children:[i>0?'+':'',(0,n.ingredientQty)(d,e,i),'\n',(0,u.gbp)(l)]})})]})]},e.id))}),(0,y.jsxs)(o.Banner,{kind:w<0?'warn':'info',title:`Variance so far: ${(0,u.gbp)(w)}`,children:[S.length," of ",e.ingredients.length," counted."]}),(0,y.jsx)(o.Button,{label:"Save stock take",disabled:!S.length,onPress:()=>{const e={};S.forEach(t=>{e[t.i.id]=t.counted}),c(e,i),j({}),v(`Saved: ${S.length} items, variance ${(0,u.gbp)(w)}. Stock levels updated.`)}}),f?(0,y.jsx)(o.Banner,{kind:"success",title:"Stock take saved",children:f}):null]})}function v(){const{k:e,me:t}=(0,p.useChef)(),i=(0,c.useOwner)(e=>e.suppliers),[n,s]=(0,l.useState)(e.deliveries.find(e=>'expected'===e.status)?.id??null);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Check each delivery against the order: count it in, check the invoice price, flag shorts and price changes. Accepting adds it to stock and updates costs (and GP)."}),e.deliveries.map(e=>{const l=i.find(t=>t.id===e.supplierId);return(0,y.jsxs)(o.Card,{highlight:n===e.id?h.colours.gold:void 0,children:[(0,y.jsx)(d.default,{accessibilityRole:"button",accessibilityLabel:`Delivery from ${l?.name}`,onPress:()=>s(n===e.id?null:e.id),children:(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(o.T,{weight:"semibold",children:l?.name??'Supplier'}),(0,y.jsx)(o.Muted,{children:'expected'===e.status?`Due ${e.due} \xb7 ${e.lines.length} lines`:`Accepted by ${e.checkedBy} ${e.at?new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`})]}),(0,y.jsx)(o.Badge,{kind:'expected'===e.status?'amber':'ok',label:'expected'===e.status?'TO CHECK':'ACCEPTED'})]})}),n===e.id?(0,y.jsx)(k,{id:e.id,me:t}):null]},e.id)})]})}function k({id:e,me:i}){const{k:d,rid:c}=(0,p.useChef)(),b=d.deliveries.find(t=>t.id===e),[j,f]=(0,l.useState)(b.lines.map(e=>({...e}))),v=(e,t)=>f(i=>i.map(i=>i.ing===e?{...i,...t}:i)),k='expected'!==b.status,S=(0,l.useMemo)(()=>j.map(e=>{const t=d.ingredients.find(t=>t.id===e.ing),i=e.receivede.short>0),$=S.filter(e=>Math.abs(e.pct)>=.5),C=j.reduce((e,t)=>e+t.received*t.price,0);return(0,y.jsxs)(r.default,{style:{gap:8,marginTop:8},children:[S.map(({l:e,i:i,short:l,pct:d})=>(0,y.jsxs)(r.default,{style:{gap:4,borderTopWidth:1,borderColor:h.colours.border,paddingTop:6},children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},weight:"medium",children:i.name}),l?(0,y.jsx)(o.Badge,{kind:"red",label:`SHORT ${(0,n.ingredientQty)(c,i,l)}`}):null,Math.abs(d)>=.5?(0,y.jsx)(o.Badge,{kind:"amber",label:`PRICE ${d>0?'+':''}${d.toFixed(0)}%`}):null]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,y.jsxs)(o.Muted,{children:["Ordered ",(0,n.ingredientQty)(c,i,e.ordered)]}),(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Received (",(0,s.quantityUnit)(c,i),")"]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Received ${i.name} in ${(0,s.quantityUnit)(c,i)}`,accessibilityValue:{text:(0,n.ingredientSpeech)(c,i,e.received)},keyboardType:"decimal-pad",value:String((0,s.fishInStone)(c,i)?(0,s.halfStone)((0,s.toStone)(e.received,i.unit)):e.received),onChangeText:t=>v(e.ing,{received:(0,s.inputQuantity)(c,i,Number(t.replace(',','.'))||0)}),style:{minHeight:44,width:60,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]}),(0,s.fishInStone)(c,i)&&!k?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Receive half a stone less ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,-1)})}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Receive half a stone more ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,1)})})]}):null,(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Invoice \xa3/",(0,s.quantityUnit)(c,i)]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Invoice price ${i.name}`,keyboardType:"decimal-pad",inputMode:"decimal",value:((0,s.displayedCost)(c,i,e.price)/100).toFixed(2),onChangeText:t=>v(e.ing,{price:100*((0,x.parseMoneyInput)(t)??0)/((0,s.fishInStone)(c,i)?(0,s.fromStone)(1,i.unit):1)}),style:{minHeight:44,width:70,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]})]}),(0,y.jsxs)(o.Muted,{children:["Last cost ",(0,u.gbp)(Math.round((0,s.displayedCost)(c,i,i.cost)))," per ",(0,s.quantityUnit)(c,i)]})]},e.ing)),(0,y.jsxs)(o.T,{weight:"semibold",children:["Invoice total ",(0,u.gbp)(Math.round(C))]}),w.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Shorts to chase",children:[w.map(e=>`${e.i.name}: ${(0,n.ingredientQty)(c,e.i,e.short)} short`).join(' \xb7 '),". Ask the supplier for a credit note."]}):null,$.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Price changes",children:[$.map(e=>`${e.i.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%`).join(' \xb7 '),". Check GP \u203a Price changes once accepted."]}):null,k?(0,y.jsx)(o.Muted,{children:b.note?`Noted: ${b.note}.`:'No issues noted.'}):(0,y.jsx)(o.Button,{label:"Accept delivery into stock",testID:"accept-delivery",onPress:()=>d.acceptDelivery(e,j,i,[w.length?`${w.length} short`:'',$.length?`${$.length} price changes`:''].filter(Boolean).join(', '))})]})}},1170,[812,998,1148,943,17,385,85,777,876,851,804,1140,1000,840,8]); @@ -1413,7 +1413,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}},1330,[812,843,17,85,777,845,851,1150,1331,858,804,8]); __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})},1331,[892,946,1150]); __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]})}},1332,[13,17,856,1333,1407,8]); -__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'center'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1333,[1051,779,805,806,1334,813,1335,1092,843,1137,1336,1337,1338,1089,1118,1339,1340,1345,1346,1205,1347,856,1352,1353,1354,1111,1110,966,1355,1149,938,1102,1356,17,1070,1181,1016,1085,1357,1209,1359,378,363,385,278,85,409,19,777,1233,1237,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1360,1106,1361,1368,1370,1373,1378,1372,1379,1382,1383,1113,1093,1094,862,1388,1222,1389,1232,1224,993,1394,1399,1400,1052,1050,1115,1402,1403,1404,1069,1168,1405,1167,1158,853,1348,1406,8]); +__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'flex-start'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{testID:"display-header-time",style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1333,[1051,779,805,806,1334,813,1335,1092,843,1137,1336,1337,1338,1089,1118,1339,1340,1345,1346,1205,1347,856,1352,1353,1354,1111,1110,966,1355,1149,938,1102,1356,17,1070,1181,1016,1085,1357,1209,1359,378,363,385,278,85,409,19,777,1233,1237,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1360,1106,1361,1368,1370,1373,1378,1372,1379,1382,1383,1113,1093,1094,862,1388,1222,1389,1232,1224,993,1394,1399,1400,1052,1050,1115,1402,1403,1404,1069,1168,1405,1167,1158,853,1348,1406,8]); __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},1336,[]); @@ -1480,7 +1480,7 @@ __d(function(g,r,i,_a,m,e,_d){"use strict";function t(t,o){if(t.title.trim().len __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STEP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"addDays",{enumerable:!0,get:function(){return u}}),_e.fmt12=i,_e.rangeText=c,_e.openWindow=function(r,o){const a=(0,e.kitchenHoursOn)(r,(0,t.parseYmd)(o));if(!a)return null;let s=(0,t.toMins)(a[1]);for(const e of(0,n.regularEventsOf)(r))(0,n.occursOn)(e,o)&&e.time&&(s=Math.max(s,Math.min(1425,(0,t.toMins)(e.time)+180)));return{from:(0,t.toMins)(a[0]),to:s}},_e.servicesOn=l,_e.serviceOf=function(e,n,r,o){const a=l(e,n,o),s=(0,t.toMins)(r);return a.lunch&&s>=a.lunch.from&&s=a.dinner.from&&s=a.dinner.to?'dinner':a.lunch&&s=e?n:e);if('none'===r.kind||!o||o=h)break}return s},_e.repeatText=function(e,t){if('none'===e.kind)return;const n=t?` until ${p(t)}`:'';return'weekly'===e.kind?`Every ${[...e.days].sort().map(e=>a[e]).join(', ')}${n}`:`Last ${o[e.weekday]} of the month${n}`},Object.defineProperty(_e,"longDate",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"monthLabel",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"scopeText",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"whatText",{enumerable:!0,get:function(){return M}}),_e.confirmLine=function(e){const t=e.dates.length?1===e.dates.length?e.dates[0]===e.today?'today':p(e.dates[0]):e.repeat?`on ${e.dates.length} dates (${e.repeat})`:`${p(e.dates[0])} to ${p(e.dates[e.dates.length-1])}`:'no dates';return`Block ${c(e.from,e.to,e.wholeDay)} ${t}, ${y(e)}`},_e.bookingsInWindow=function(e,n,r,o,a,s){const u=new Set(n),i=(0,t.toMins)(r),c=(0,t.toMins)(o);return e.filter(e=>{if(!u.has(e.date)||!['confirmed','pending','seated'].includes(e.status))return!1;const n=(0,t.toMins)(e.time);if(n=c)return!1;const r=(e.table??'').split(/[^A-Za-z0-9]+/).filter(Boolean);return a.tables?.length?r.some(e=>a.tables.includes(e)):!a.areaId||r.some(e=>s?.(e)===a.areaId)})},_e.groupByMonth=function(e,n,r,o){const a=e.filter(e=>e.rid===n&&!e.removedAt&&(e.date>r||e.date===r&&(0,t.toMins)(e.to)>(0,t.toMins)(o))).sort((e,n)=>e.date===n.date?(0,t.toMins)(e.from)-(0,t.toMins)(n.from):e.date{const r=(0,t.parseYmd)(e);return r.setDate(r.getDate()+n),(0,t.ymd)(r)};function i(e){const n=(0,t.toMins)(e),r=Math.floor(n/60)%24;return`${r%12==0?12:r%12}:${String(n%60).padStart(2,'0')}${r<12?'am':'pm'}`}function c(e,t,n){if(n)return'all day';const r=i(e),o=i(t);return r.slice(-2)===o.slice(-2)?`${r.slice(0,-2)}\u2013${o}`:`${r}\u2013${o}`}function l(n,r,o){const a=(0,e.kitchenHoursOn)(n,(0,t.parseYmd)(r));if(!a)return{lunch:null,dinner:null};const s=(0,t.toMins)(a[0]),u=(0,t.toMins)(a[1]),i=1020,c=(e,n)=>{if(!e)return n;const r=Math.max(s,(0,t.toMins)(e[0])),o=Math.min(u,(0,t.toMins)(e[1]));return o>r?{from:r,to:o}:null};return{lunch:c(o?.lunch,si?{from:Math.max(i,s),to:u}:null)}}const d=e=>Math.ceil(e/r)*r;function f(e,t){const n=[];let r=e;for(;r<=t&&n.length<366;)n.push(r),r=u(r,1);return n}const m=(e,n)=>{const r=(0,t.parseYmd)(e);if(r.getDay()!==n)return!1;const o=new Date(r);return o.setDate(r.getDate()+7),o.getMonth()!==r.getMonth()},h=104;const p=e=>{const n=(0,t.parseYmd)(e);return`${o[n.getDay()]} ${n.getDate()} ${s[n.getMonth()]}`},g=e=>{const n=(0,t.parseYmd)(e);return`${s[n.getMonth()]} ${n.getFullYear()}`},y=e=>e.tables?.length?`table${e.tables.length>1?'s':''} ${e.tables.join(', ')}`:e.areaId?e.areaName??'one area':'all areas',M=e=>{const t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)}},1397,[862,863,861]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"wixBlockPushOn",{enumerable:!0,get:function(){return o}}),e.pushBlocksToWix=function(t,n,c){if(!o(t)||!n.length)return;const l=u.useSync.getState();if(!l.venueId||'guest'===l.kind)return;setTimeout(()=>{(0,s.getSupabase)().functions.invoke('wix-blocks-push',{body:{venue_id:l.venueId,block_ids:n.slice(0,120),action:c}}).catch(()=>{})},4e3)},Object.defineProperty(e,"websiteBlockStatus",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),u=r(d[3]);const o=s=>!t.IS_ISOLATED_VENUE&&!['souters','kirkmichael','wildings'].includes(s)&&!!n.useFloor.getState().settings[s]?.wixBlockPushOn;const c=t=>(t??'awaiting venue sync').replace(/\bWix\b/gi,'Website bookings')},1398,[805,996,892,946]); __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,"DAY_GRAPH_CHROME",{enumerable:!0,get:function(){return j}}),_e.DayGraph=function({todays:e,open:j,close:T,now:b,turnBase:v,blocks:w=[],height:M=150,forecastNote:k,emptyText:D,past:L,closed:I,compact:$=!1,dense:C=!1,bare:A=!1,fill:z=!1,fit:O=!1,tight:_=!1,live:H=!1,onChrome:S}){const[F,P]=(0,t.useState)(0),[E,R]=(0,t.useState)(0),[N,B]=(0,t.useState)(0),[W,X]=(0,t.useState)(0);s.default.useEffect(()=>{S&&O&&W&&S(Math.ceil((A?4:C?2:10)+N+W+(A?2:6)+2))},[S,O,N,W,A,C]);const U=j.getTime()-18e5,G=T.getTime()+36e5,Y=(0,t.useMemo)(()=>(0,f.coverCurve)(e,new Date(U),new Date(G),v),[e,U,G,v]),V=60*j.getHours()+j.getMinutes(),K=60*T.getHours()+T.getMinutes(),Z=(0,t.useMemo)(()=>(0,p.chartBands)(w,V,K),[w,V,K]),q=new Date(j);q.setHours(0,0,0,0);const J=e=>q.getTime()+6e4*e,Q=Math.max(8,...Y.map(e=>e.covers)),ee=Y.reduce((e,t)=>!t.covers||(0,p.minuteInsideVenueBlock)(60*new Date(t.t).getHours()+new Date(t.t).getMinutes(),Z)?e:!e||t.covers>e.covers?{t:t.t,covers:t.covers}:e,null),te=O&&E?Math.max(24,Math.floor(E)):Math.max(48,M-m.AXIS_BAND),se=m.CHART_PAD_L,ie=m.CHART_PAD_R,oe=C?18:22,ne=Math.max(10,F-se-ie),le=Math.max(10,te-oe-14),re=e=>se+(e-U)/(G-U)*ne,ae=e=>oe+le-e/(1.15*Q)*le,he=(0,m.yTicks)(Q),de=(0,m.fitYTicks)(he,ae,te,13),ue=(0,m.nowLineVisible)({now:b,open:j,close:T,live:H,past:L,closed:I}),ce=b.getTime(),ge=ue&&Y.length?(0,m.splitCurve)(Y,ce):{before:Y,after:[]},xe=e=>e.map((e,t)=>`${t?'L':'M'}${re(e.t).toFixed(1)},${ae(e.covers).toFixed(1)}`).join(' '),me=[];for(let e=new Date(U);e.getTime()<=G;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=U&&t.getTime()<=G&&me.push(t.getTime())}const pe=H?(0,m.seatedNowCovers)(e,e[0]?.date??''):0,fe=Math.min(G,Math.max(U,b.getTime())),ye=I?null:H?{t:fe,covers:pe,text:(0,m.seatedNowText)(pe)}:ee,je=F?(0,m.layoutChart)({width:F,height:te,t0:U,t1:G,hours:me,busiest:ye}):{hours:[],busiest:null},Te=xe(Y),be=ue?xe(ge.before):Te,ve=ue?xe(ge.after):'',we=z&&Te&&Y.length>1?`${Te} L${re(Y[Y.length-1].t).toFixed(1)},${ae(0).toFixed(1)} L${re(Y[0].t).toFixed(1)},${ae(0).toFixed(1)} Z`:'',Me=(0,i.coversFour)(e,e[0]?.date??''),ke=`Total ${Me.total} ${1===Me.total?'Cover':'Covers'}`,De=e.filter(e=>!['cancelled','noshow'].includes(e.status)).length,Le=je.busiest?.text??(I?'':H?(0,m.seatedNowText)(pe):ee?(0,m.busiestText)(ee.t,ee.covers):''),Ie=Z.map(e=>e.spoken).join('. '),$e=ue&&T.getTime()>j.getTime()?Math.max(0,Math.min(100,Math.round((ce-j.getTime())/(T.getTime()-j.getTime())*100))):null,Ce=!I&&ee&&ee.covers?(0,m.peakOccupancyText)(ee.t,ee.covers):'',Ae=`Covers through the day. Open ${(0,u.hm)(j)}. Close ${(0,u.hm)(T)}.${Ce?` ${Ce}.`:''}${Le?` ${Le}.`:''}${ue?` It is ${(0,u.hm)(b)}. About ${$e} percent of the way through the day.`:''}${Ie?` ${Ie}.`:''}`,ze=(0,u.hm)(b),Oe=Math.max(44,12*ze.length*.7+16),He=Math.max(se+2,Math.min(Math.max(0,F-ie-Oe),re(ce)-Oe/2)),Se=Math.max(2,Math.min(te-22,oe+le-22)),Fe=s.default.useId().replace(/:/g,'');return(0,y.jsxs)(o.default,{testID:"day-graph",style:[d.look.panel,O?{flex:1,minHeight:0}:null,{overflow:'visible',paddingTop:A?4:C?2:10,paddingBottom:A?2:6,backgroundColor:c.colours.bg}],children:[(0,y.jsxs)(o.default,{testID:"day-graph-head",onLayout:e=>B(e.nativeEvent.layout.height),children:[A?null:$?(0,y.jsxs)(o.default,{style:{alignItems:'center',gap:4,paddingHorizontal:14},children:[(0,y.jsx)(h.T,{center:!0,size:18,weight:"semibold",children:"Covers through the day"}),(0,y.jsx)(h.T,{center:!0,size:14,colour:c.colours.muted,testID:"day-graph-parties",children:ke}),Ce?(0,y.jsx)(h.T,{center:!0,size:13,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,children:Ce}):null]}):(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8},children:[(0,y.jsx)(h.T,{size:C?14:15,weight:"semibold",style:{flexShrink:1},children:"Covers through the day"}),(0,y.jsx)(h.T,{size:12,colour:c.colours.muted,testID:"day-graph-parties",children:ke})]}),A||_?null:I?k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:2,children:k}):null:(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8,paddingTop:2},children:[(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Open ",(0,u.hm)(j)]}),Ce&&!$?(0,y.jsx)(h.T,{size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,center:!0,style:{flex:1,minWidth:0},children:Ce}):k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",numberOfLines:1,style:{flex:1,textAlign:'center'},children:k}):(0,y.jsx)(o.default,{style:{flex:1}}),(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Close ",(0,u.hm)(T)]})]}),A||_||$||!k||!Ce?null:(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:1,style:{paddingHorizontal:14},children:k}),A||!_||!Ce||$?null:(0,y.jsx)(h.T,{center:!0,size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,style:{paddingHorizontal:14},children:Ce})]}),(0,y.jsxs)(o.default,{testID:"day-graph-plot",accessible:!0,accessibilityLabel:Ae,onLayout:e=>{P(e.nativeEvent.layout.width),O&&R(e.nativeEvent.layout.height)},style:O?{flexGrow:1,flexShrink:1,flexBasis:Math.max(48,M-m.AXIS_BAND),minHeight:24,overflow:'hidden',position:'relative'}:{height:te,minHeight:te,position:'relative',overflow:'hidden'},children:[F?(0,y.jsxs)(l.default,{width:F,height:te,children:[(0,y.jsxs)(n.Defs,{children:[(0,y.jsxs)(n.Pattern,{id:`${Fe}-venue`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"1.4"})]}),(0,y.jsxs)(n.Pattern,{id:`${Fe}-area`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622",fillOpacity:"0.35"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"0.8"})]})]}),Z.map((e,t)=>(0,y.jsx)(n.Rect,{x:re(J(e.fromMin)),y:oe,width:Math.max(3,re(J(e.toMin))-re(J(e.fromMin))),height:le,fill:`url(#${Fe}-${e.strength})`},`${e.fromMin}-${t}`)),he.map(e=>(0,y.jsx)(n.Line,{x1:se,x2:se+ne,y1:ae(e),y2:ae(e),stroke:c.colours.muted,strokeWidth:1,opacity:.28},`grid-${e}`)),ue?(0,y.jsx)(n.Rect,{testID:"day-graph-elapsed",x:re(j.getTime()),y:oe,width:Math.max(0,re(ce)-re(j.getTime())),height:le,fill:c.colours.gold,opacity:.12}):null,we?(0,y.jsx)(n.Path,{d:we,fill:"#3A2F1E",stroke:"none"}):null,be?(0,y.jsx)(n.Path,{d:be,stroke:c.colours.gold,strokeWidth:2.5,fill:"none"}):null,ve?(0,y.jsx)(n.Path,{d:ve,stroke:c.colours.gold,strokeWidth:2.5,fill:"none",opacity:.38}):null,I?null:[j,T].map((e,t)=>(0,y.jsx)(n.Line,{x1:re(e.getTime()),x2:re(e.getTime()),y1:oe,y2:oe+le,stroke:c.colours.goldLight,strokeWidth:1.5,strokeDasharray:"4,4"},`service-${t}`)),ue?(0,y.jsx)(n.Line,{testID:"day-graph-now",x1:re(ce),x2:re(ce),y1:oe,y2:oe+le,stroke:c.colours.gold,strokeWidth:2}):null,je.busiest?(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:je.busiest.x+je.busiest.w/2,y:je.busiest.y+je.busiest.h-2,fill:c.colours.gold,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:je.busiest.text}):null,De?null:(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:se+ne/2,y:oe+le/2,fill:c.colours.muted,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:D??'No bookings yet today'})]}):null,F?de.map(e=>(0,y.jsx)(o.default,{testID:"day-graph-ytick",pointerEvents:"none",style:{position:'absolute',left:0,width:se-4,top:e.top,alignItems:'flex-end',justifyContent:'flex-start'},children:(0,y.jsx)(h.T,{size:e.font,numberOfLines:1,colour:c.colours.muted,style:{textAlign:'right'},children:String(e.value)})},`yt-${e.value}`)):null,F&&ue&&te>=m.YTICK_MIN_PLOT?(0,y.jsx)(o.default,{testID:"day-graph-now-label",pointerEvents:"none",style:{position:'absolute',left:He,top:Se,minWidth:Oe,height:20,paddingHorizontal:8,borderRadius:10,backgroundColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:12,weight:"semibold",colour:c.colours.bg,center:!0,numberOfLines:1,children:ze})}):null]}),(0,y.jsxs)(o.default,{testID:"day-graph-axis",onLayout:e=>X(e.nativeEvent.layout.height),style:{minHeight:m.AXIS_BAND,flexShrink:0,position:'relative',justifyContent:'center',paddingBottom:2},children:[(0,y.jsx)(o.default,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{opacity:0,alignSelf:'flex-start'},children:(0,y.jsx)(h.T,{size:m.AXIS_FONT,numberOfLines:1,children:"20"})}),je.hours.map(e=>{const t=Math.min(Math.max(e.w,40),Math.max(e.w,F)),s=e.x+e.w/2-t/2,i=Math.max(0,Math.min(Math.max(0,F-t),s));return(0,y.jsx)(o.default,{pointerEvents:"none",style:{position:'absolute',left:i,width:t,top:0,bottom:0,alignItems:i>s+.5?'flex-start':in.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1400,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.seasonClosedAreaIds=s,e.chartBands=function(t,a,c){const u=s(t,a,c),f=[];for(const s of t){if(s.removedAt)continue;if(s.areaId&&u.has(s.areaId))continue;if(s.areaId||s.tables?.length)continue;const t=s.wholeDay?0:n(s.from),l=s.wholeDay?1440:n(s.to);if(null==t||null==l)continue;const h=Math.max(t,a),M=Math.min(l,c);if(M<=h)continue;const m=o(s,h,M);f.push({fromMin:h,toMin:M,strength:m.strength,spoken:m.spoken})}f.sort((n,t)=>n.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1400,[]); __d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.coverCurve=function(s,c,n,a){const u=s.filter(t=>!['cancelled','noshow'].includes(t.status)).map(o=>{const s=(0,t.startOf)(o).getTime();return{s:s,e:s+6e4*(0,t.durOf)(o,a),n:o.partySize}}),f=[];for(let t=c.getTime();t<=n.getTime();t+=o)f.push({t:t,covers:u.reduce((o,s)=>t>=s.s&&tt.covers));if(!o)return[];const s=[];return t.forEach((c,n)=>{const a=t.slice(Math.max(0,n-3),n+4);c.covers<.6*o||c.coverst.covers))||s.some(t=>Math.abs(t.from-c.t)<36e5)||s.push({from:c.t,to:c.t,covers:c.covers})}),s.slice(0,3)},e.quietOf=function(t,o,s){const c=Math.max(0,...t.map(t=>t.covers)),n=Math.max(2,.25*c),a=[];let u=null;const f=t.filter(t=>t.t>=o&&t.t<=s);return f.forEach((t,o)=>{const s=t.covers<=n;s&&null===u&&(u=t.t);const c=o===f.length-1;if((!s||c)&&null!==u){const o=t.t;o-u>=18e5&&a.push({from:u,to:o}),u=null}}),a.sort((t,o)=>o.to-o.from-(t.to-t.from)).slice(0,3).sort((t,o)=>t.from-o.from)};var t=r(d[0]);const o=9e5},1401,[1074]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CANCEL_TINT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"CANCEL_BORDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"CANCEL_INK",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"CANCEL_MUTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"cancelWhen",{enumerable:!0,get:function(){return d}}),e.cancelledBy=u,e.cancelItem=b,e.cancellationsFor=function(n,t,o){return n.filter(n=>n.date===t&&('cancelled'===n.status||'noshow'===n.status)).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name)).map(n=>b(n,o(n)))},Object.defineProperty(e,"cancellationsHeading",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"cancellationsEmpty",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"cancellationsCounts",{enumerable:!0,get:function(){return f}});var n=r(_d[0]),t=r(_d[1]);const o=n=>n?n.split('+').map(n=>n.trim()).filter(Boolean):[],i='#17140F',a='#6B5A35',l='#F3E7CC',c='#B8AA8A',s={online:'Website',phone:'Phone','in-person':'In person','walk-in':'Walk-in',email:'Email','third-party':'Third party'},d=(n,t)=>{if(!n)return null;const o=new Date(n);if(Number.isNaN(o.getTime()))return null;const i=o.toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'});return o.toLocaleDateString('en-CA',{timeZone:'Europe/London'})===t?i:`${o.toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'Europe/London'})}, ${i}`};function u(n){const t=n;if('noshow'===n.status)return t.cancelled?.by?`Marked no-show by ${t.cancelled.by}`:'Marked no-show';if(t.cancelled?.by)return t.cancelled.by;const o=!!t.wix?.status&&/CANCEL|DECLIN/i.test(t.wix.status);return o&&t.wix?.archived?'Cancelled and archived in Website bookings':o?'Cancelled in Website bookings':(n.tags??[]).some(n=>n.endsWith(': deposit not paid'))||'PAYMENT_INFORMATION_PENDING'===t.wix?.status?'Website booking not finished (deposit not paid)':t.wix?.archived?'Archived in Website bookings':'Not recorded'}function b(i,a){const l=i,c=o(i.table??l.cancelled?.table??void 0),b=c.length?`Table ${(0,n.tableNumbers)(c.join('+'))}`:'No table',p=`${i.partySize} ${1===i.partySize?'person':'people'}`,h=d(l.cancelled?.at??(l.wix?l.wix.updatedDate:null),i.date),f=u(i),w=i.walkIn?'Walk-in':s[i.source??'']??(l.wix?'Website':'Not recorded'),y=(0,t.allergyLine)(i),C='noshow'===i.status,N=`${C?'No-show':'Cancelled'}: ${a}, ${y?`allergy noted: ${y}, `:''}${p}, was ${i.time}, ${b.toLowerCase()}. ${f}${h?` at ${h}`:''}.`;return{id:i.id,date:i.date,name:a,people:p,time:i.time,table:b,tables:c,walkIn:!!i.walkIn,by:f,when:h,source:w,notes:(i.notes??'').trim(),allergy:y,spoken:N,kind:C?'noshow':'cancelled'}}const p=n=>`Cancellations & no-shows ${n}`,h=(n="today")=>`No cancellations or no-shows ${n}.`,f=n=>{const t=n.filter(n=>'noshow'===n.kind).length,o=n.length-t;return`${o} ${1===o?'cancellation':'cancellations'} \xb7 ${t} ${1===t?'no-show':'no-shows'}`}},1402,[843,1380]); __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.CancellationsSection=function({items:e,dayWord:b="today",testID:y="display-cancellations"}){const[p,C]=(0,l.useState)(null),j=(0,s.cancellationsHeading)(e.length);return(0,u.jsxs)(o.default,{testID:y,style:{marginTop:14,borderRadius:12,backgroundColor:s.CANCEL_TINT,borderWidth:1,borderColor:s.CANCEL_BORDER,padding:10,gap:6},children:[(0,u.jsxs)(o.default,{accessible:!0,accessibilityRole:"header",accessibilityLabel:e.length?`${j}: ${(0,s.cancellationsCounts)(e)}. Not counted in Covers.`:`Cancellations and no-shows: none ${b}.`,style:{alignItems:'center',gap:2},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:c.colours.gold,center:!0,testID:"cancellations-head",children:j}),e.length?(0,u.jsx)(n.T,{size:14,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-counts",children:(0,s.cancellationsCounts)(e)}):null]}),e.length?e.map(e=>(0,u.jsxs)(t.default,{testID:`cancel-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.spoken,accessibilityHint:"Opens the details. Read only.",onPress:()=>C(e),dataSet:{centreExempt:'list-row'},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:'rgba(214,180,106,0.18)',backgroundColor:e?'#241F16':'transparent'}),children:[(0,u.jsxs)(o.default,{style:{flexDirection:'row',gap:10,alignItems:'flex-start'},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{width:58,textDecorationLine:'line-through'},children:e.time}),(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:e.name}),(0,u.jsx)(o.default,{testID:`cancel-kind-${e.id}`,style:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:'noshow'===e.kind?c.colours.amber:s.CANCEL_BORDER},children:(0,u.jsx)(n.T,{size:13,weight:"semibold",colour:'noshow'===e.kind?c.colours.amber:s.CANCEL_MUTED,children:'noshow'===e.kind?'No-show':'Cancelled'})}),e.allergy?(0,u.jsx)(o.default,{style:{paddingTop:1},children:(0,u.jsx)(h.AllergyIcon,{text:e.allergy,size:20,colour:"#D6A23A",ink:"#17140F",testID:`cancel-allergy-${e.id}`})}):null]}),(0,u.jsxs)(n.T,{size:15,colour:s.CANCEL_MUTED,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[e.people," \xb7 ",e.table," \xb7 ",e.by,e.when?` \xb7 ${e.when}`:'']})]},e.id)):(0,u.jsx)(n.T,{size:15,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-empty",children:(0,s.cancellationsEmpty)(b)}),p?(0,u.jsx)(x,{c:p,onClose:()=>C(null)}):null]})},_e.CancelDetail=x;var l=r(d[0]),t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]);function b({k:e,v:l}){return(0,u.jsxs)(o.default,{accessible:!0,accessibilityLabel:`${e}: ${l}`,style:{flexDirection:'row',gap:10,paddingVertical:6,borderBottomWidth:1,borderColor:c.colours.hairline},children:[(0,u.jsx)(n.T,{size:16,colour:c.colours.muted,style:{width:130},children:e}),(0,u.jsx)(n.T,{size:16,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l})]})}function x({c:e,onClose:l}){return(0,u.jsxs)(n.Sheet,{visible:!0,onClose:l,title:`${'noshow'===e.kind?'No-show':'Cancelled'} \xb7 ${e.name}`,maxWidth:560,testID:"cancel-detail",children:[(0,u.jsxs)(o.default,{testID:"cancel-detail-body",style:{gap:2},children:[(0,u.jsx)(b,{k:"Name",v:e.name}),(0,u.jsx)(b,{k:"Party",v:e.people}),e.allergy?(0,u.jsx)(b,{k:"Allergies",v:e.allergy}):null,(0,u.jsx)(b,{k:"Was booked for",v:`${e.date?`${new Date(`${e.date}T12:00:00`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})}, `:''}${e.time}`}),(0,u.jsx)(b,{k:"Table",v:e.table}),(0,u.jsx)(b,{k:'noshow'===e.kind?'No-show':'Cancelled by',v:e.by}),(0,u.jsx)(b,{k:"When",v:e.when??'Not recorded'}),(0,u.jsx)(b,{k:"Booked by",v:e.source}),(0,u.jsx)(b,{k:"Notes",v:e.notes||'None'})]}),(0,u.jsx)(n.T,{size:14,colour:c.colours.muted,center:!0,children:"Read only. Not counted in Covers. Phone numbers stay in the Managers app."})]})}},1403,[17,385,85,777,1402,804,1359,8]); diff --git a/owner-app/admin.html b/owner-app/admin.html index ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ecce91dcde14c8d868fdfeba67a4e54d3eb2ee8f..0b8e157670314771a9f97df58c9c77b24da7f76a 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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 d1bfe2e274508426717ef93457767d253bcf3a34..c846acdad2b3590028bca2c9b8f48a3d776d2917 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-f5dc17f4bc"; +const V = "cc-owner-7a28ac47a1"; const BASE = "/owner-app/"; -const PRECACHE = ["/owner-app/apple-touch-icon.png", "/owner-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.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=f5dc17f4bc69184bec16efd3a2d6b4458c4486271f98cbb87660a69d6ee2cead"]; +const PRECACHE = ["/owner-app/apple-touch-icon.png", "/owner-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.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=7a28ac47a1b0724af75a8450b3a9674b08e819536400a670bb225a497d897620"]; // 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 ace3556ec266251c17cc4e672da60b7122ea4af1..d811a038d61be73852d7ef3948b1403e168a71f1 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/owner-desktop/_expo/static/js/web/bundle.js b/owner-desktop/_expo/static/js/web/bundle.js index 2d36aed0d5b77b22e348a8ae5b98f8ff49b6392a..52a21a527ea6d6aebde367d31662322a9b243a03 100644 --- a/owner-desktop/_expo/static/js/web/bundle.js +++ b/owner-desktop/_expo/static/js/web/bundle.js @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__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.201'},979,[]); +__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.202'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1247,7 +1247,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,"FOH_ROLE_BADGES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"KITCHEN_ROLE_BADGES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ROLE_BADGES",{enumerable:!0,get:function(){return o}}),e.cleanBadge=c,Object.defineProperty(e,"isKitchenBadge",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isFohBadge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"badgeSpoken",{enumerable:!0,get:function(){return f}}),e.assignShiftBadge=b,e.assignKitchenShiftBadge=function(n,t,o){const s=String(o??'').trim();return s&&!u(s)?n:b(n,t,s?c(s):void 0)},e.applyLiveKitchenBadge=function(n,t,o){const s=String(o??'').trim();if(s&&!u(s))return n;const f=s?c(s):void 0;return n.map(n=>n.id===t?{...n,badge:f}:n)};const n=['Bar','Floor'],t=['Upstairs KP','Downstairs KP','Sauce','Larder'],o=[...n,...t];function c(n){const t=String(n??'').trim().toLowerCase();return o.find(n=>n.toLowerCase()===t)}const u=n=>{const o=c(n);return!!o&&t.includes(o)},s=t=>{const o=c(t);return!!o&&n.includes(o)},f=n=>c(n)?`, on ${c(n)}`:'';function b(n,t,o){const u=c(o);return n.map(n=>n.id===t?{...n,badge:u,changed:!!n.published||n.changed}:n)}},1164,[]); __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.useSuggestions=j,_e.OrdersScreen=function({focus:e}={}){const[s,t]=(0,n.useState)('sheets');return(0,x.jsxs)(l.default,{style:{gap:12},children:[(0,x.jsx)(y.Seg,{value:s,onChange:t,options:[{id:'sheets',label:'Order sheets'},{id:'suggested',label:'Suggested orders'},{id:'history',label:'Order history'}]}),'sheets'===s?(0,x.jsx)(m.OrderSheets,{focus:e}):'suggested'===s?(0,x.jsx)(w,{}):(0,x.jsx)($,{})]})};var s=r(_d[0]),t=r(_d[1]),n=r(_d[2]),i=e(r(_d[3])),l=e(r(_d[4])),d=r(_d[5]),o=r(_d[6]),u=r(_d[7]),c=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),f=r(_d[12]),m=r(_d[13]),x=r(_d[14]);const b=(e,s)=>'kg'===s?Math.ceil(2*e)/2:Math.ceil(e);function j(){const{k:e,now:s,rid:n}=(0,y.useChef)(6e4),{pct:i}=(0,y.useForecast)(),l=(0,u.supplierView)('chef',(0,o.useOwner)(e=>e.suppliers)).filter(e=>!e.archived),d=1+Math.max(0,i)/100;return l.map(i=>{const l=e.ingredients.filter(e=>e.supplierId===i.id).map(e=>({i:e,qty:(0,t.fishInStone)(n,e)?(0,t.fromStone)(Math.ceil(2*(0,t.toStone)(Math.max(0,e.par*d-e.onHand),e.unit))/2,e.unit):b(Math.max(0,e.par*d-e.onHand),e.unit)})).filter(e=>e.qty>0),o=(0,p.weekday)(s),u=i.orderDays.includes(o),[c,h]=(i.cutoff||'23:59').split(':').map(Number),y=new Date(s);y.setHours(c,h,0,0);const f=e.orders.some(e=>e.supplierId===i.id&&new Date(e.at).toDateString()===s.toDateString()),m=[1,2,3,4,5,6,7].map(e=>(o+e)%7).find(e=>i.orderDays.includes(e));return{s:i,lines:l,ordersToday:u,cutPassed:s>y,placedToday:f,nextDay:m,total:Math.round(l.reduce((e,s)=>e+s.qty*s.i.cost,0))}}).filter(e=>e.lines.length||e.ordersToday)}function w(){const{me:e,rid:o}=(0,y.useChef)(),{label:u,covers:m,enough:b,booked:w}=(0,y.useForecast)(),$=(0,f.useKitchen)(e=>e.addOrder),S=j(),[C,M]=(0,n.useState)({}),[O,k]=(0,n.useState)('');return(0,x.jsxs)(l.default,{style:{gap:10},children:[(0,x.jsxs)(d.Muted,{children:[b?`Built from par levels and today's forecast (${m} Covers, ${u} vs a typical day).`:`Built from par levels (no forecast yet: not enough history; ${w} Covers booked so far).`," Adjust, then call the supplier or use their ordering website. Nothing is sent by CoverCharge."]}),O?(0,x.jsx)(d.Banner,{kind:"success",title:"Saved to order history",children:O}):null,S.map(({s:n,lines:u,ordersToday:y,cutPassed:f,placedToday:m,nextDay:b,total:j})=>{const w=u.map(e=>({...e,q:C[`${n.id}:${e.i.id}`]??e.qty})),S=Math.round(w.reduce((e,s)=>e+s.q*s.i.cost,0)),O=s=>{$({supplierId:n.id,by:e,status:s,lines:w.filter(e=>e.q>0).map(e=>({ing:e.i.id,qty:e.q,cost:e.i.cost})),total:S}),k(`${n.name}: ${(0,c.gbp)(S)} (${s}).`)};return(0,x.jsxs)(d.Card,{highlight:!y||m||f?void 0:h.colours.gold,children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{weight:"semibold",children:n.name}),(0,x.jsxs)(d.Muted,{children:[n.category," \xb7 min order ",(0,c.gbp)(n.minOrder)]})]}),m?(0,x.jsx)(d.Badge,{kind:"ok",label:"ORDERED TODAY"}):y?(0,x.jsx)(d.Badge,{kind:f?'red':'amber',label:f?`CUT-OFF ${n.cutoff} PASSED`:`ORDER BY ${n.cutoff}`}):(0,x.jsx)(d.Badge,{label:`NEXT ${null!=b?p.DAY3[b].toUpperCase():'\u2014'}`})]}),w.length?w.map(e=>(0,x.jsxs)(d.Row,{wrap:!0,style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{size:14,children:e.i.name}),(0,x.jsxs)(d.Muted,{children:["On hand ",(0,s.ingredientQty)(o,e.i,e.i.onHand)," \xb7 par ",(0,s.ingredientQty)(o,e.i,e.i.par)]})]}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"Less",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone less':'Less'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,-1)}))}),(0,x.jsx)(l.default,{accessible:!0,accessibilityLabel:(0,s.ingredientSpeech)(o,e.i,e.q),children:(0,x.jsx)(d.T,{size:16,style:{minWidth:76,textAlign:'center'},children:(0,s.ingredientQty)(o,e.i,e.q)})}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"More",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone more':'More'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,1)}))})]},e.i.id)):(0,x.jsx)(d.Muted,{children:"Everything is at par."}),w.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(d.T,{weight:"semibold",children:["Estimated ",(0,c.gbp)(S)]}),S{i.default.openURL(`tel:${n.phones[0].replace(/\s/g,'')}`).catch(()=>{}),O('placed (by phone)')}}):null,n.website?(0,x.jsx)(d.Button,{small:!0,kind:"secondary",label:"Open website",onPress:()=>{i.default.openURL(n.website).catch(()=>{}),O('placed (on website)')}}):null]})]}):null,void 0]},n.id)})]})}function $(){const{k:e,rid:t}=(0,y.useChef)(),n=(0,o.useOwner)(e=>e.suppliers);return(0,x.jsx)(l.default,{style:{gap:8},children:e.orders.map(i=>(0,x.jsxs)(d.Card,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(d.T,{weight:"semibold",style:{flex:1},children:n.find(e=>e.id===i.supplierId)?.name}),(0,x.jsx)(d.Badge,{kind:"neutral",label:i.status.toUpperCase()})]}),(0,x.jsxs)(d.Muted,{children:[new Date(i.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",i.by,i.total?` \xb7 ${(0,c.gbp)(i.total)}`:'']}),i.lines.length?(0,x.jsx)(d.Muted,{children:i.lines.map(n=>{const i=e.ingredients.find(e=>e.id===n.ing);return`${(0,s.ingredientQty)(t,i??{name:n.ing,unit:''},n.qty)} ${i?.name??n.ing}`}).join(', ')}):null]},i.id))})}},1165,[1148,943,17,362,85,777,876,955,851,804,1055,1140,1000,1166,8]); __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.openLink=w,_e.useSheetReminders=C,_e.OrderSheets=function({focus:e}){const{rid:t,now:l}=(0,x.useChef)(3e4),o=(0,u.useSheets)(t).filter(e=>(0,n.chefCanSee)(t,e)&&!e.placeholder),[h,c]=(0,s.useState)(e??null),p=C(),f=(0,b.wd)(l);return(0,j.jsxs)(d.default,{style:{gap:10},testID:"order-sheets",children:[(0,j.jsx)(i.Banner,{kind:"info",title:"Nothing is sent for you",children:"Text, WhatsApp and phone orders open your phone\u2019s own app with the order already written. Check it, then press Send yourself."}),p.map(e=>(0,j.jsx)(r.default,{accessibilityRole:"button",onPress:()=>c(e.supplierId),children:(0,j.jsxs)(i.Banner,{kind:'red'===e.tone?'danger':'warn',title:`\u23f0 ${e.text}`,children:["Tap to open the ",e.name," order sheet."]})},e.supplierId)),(0,j.jsxs)(i.Muted,{children:["Today is ",b.DAYS[f],". Edit suppliers in Managers \u203a Settings \u203a Supplier order sheets."]}),o.map(e=>(0,j.jsx)($,{s:e,open:h===e.id,onToggle:()=>c(h===e.id?null:e.id)},e.id)),o.length?null:(0,j.jsx)(i.Muted,{children:"No order sheets yet. Add suppliers in Managers \u203a Settings \u203a Supplier order sheets."})]})};var t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),o=e(_r(_d[4]));_r(_d[5]);var r=e(_r(_d[6])),d=e(_r(_d[7])),i=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),b=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),j=_r(_d[17]);function w(e){if('undefined'!=typeof window){const t=window;return'function'==typeof t.__ccOpenLink?void t.__ccOpenLink(e):void(/^https?:/.test(e)?window.open(e,'_blank','noopener'):window.location.href=e)}o.default.openURL(e).catch(()=>{})}async function k(e){try{const t='undefined'!=typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0}catch{}return!1}const S={online:'\ud83c\udf10',phone:'\ud83d\udcde',text:'\ud83d\udcac',whatsapp:'\u2706',tbc:'\ud83d\udd8a\ufe0f'},T={borderWidth:1,borderColor:f.colours.border,borderRadius:10,paddingHorizontal:12,paddingVertical:10,color:f.colours.text,backgroundColor:f.colours.surface2,fontSize:f.font.body};function C(){const{rid:e,now:t}=(0,x.useChef)(6e4),l=(0,u.useSheets)(e).filter(t=>(0,n.chefCanSee)(e,t)&&!t.placeholder),s=(0,u.useOrderSheets)(e=>e.opened),o=(0,h.useShellfish)(e,'','chef'),r=(0,b.remindersFor)(l,t,s);for(const n of l){const l=o.items.filter(e=>(e.supplierId===n.id||!e.supplierId&&n.shellfish)&&o.isLow(e.key));!l.length||s[n.id]&&new Date(s[n.id]).toDateString()===t.toDateString()||r.push({supplierId:n.id,name:n.name,text:`${'text'===n.method||'whatsapp'===n.method?'Text':'Order from'} ${n.contact||n.name}: ${l.map(t=>`${(0,c.fmtStockCount)(e,t,o.counts[t.key]??0)} ${t.plural.toLowerCase()}`).join(' and ')} left`,tone:'amber',cutoffPassed:!1})}return r}function $({s:e,open:n,onToggle:o}){const{rid:C,r:$,me:D,now:I}=(0,x.useChef)(3e4),v=(0,u.useOrderSheets)(e=>e.patch),M=(0,u.useOrderSheets)(e=>e.markOpened),B=(0,u.useOrderSheets)(t=>t.opened[e.id]),[L,P]=(0,s.useState)({}),[O,R]=(0,s.useState)(''),[A,z]=(0,s.useState)(''),[_,W]=(0,s.useState)(!1),H=(0,h.useShellfish)(C,D,'chef'),K=(0,b.nextDelivery)(e,I),E=(0,b.orderLines)(e,L,O,C),N=($.address??$.location??'').split(',').map(e=>e.trim()).filter(Boolean),q=N.length>=3?N[1]:N[0]??'',U=(0,b.orderMessage)(e,$.name,q,E,D.split(' ')[0],I),Q=e.orderDays.includes((0,b.wd)(I)),Y=(e,t)=>P(n=>({...n,[e.id]:(0,l.stepQuantity)(C,e,n[e.id]||0,t)})),F=t=>{M(e.id,I.toISOString()),w(t)},G='text'===e.method||'whatsapp'===e.method||'phone'===e.method,V=Math.round(100*((0,y.parseMoneyInput)(A)??NaN)),J=H.items.filter(t=>t.supplierId===e.id||!t.supplierId&&e.shellfish),X=J.filter(e=>H.isLow(e.key));return(0,j.jsxs)(d.default,{testID:`sheet-${e.id}`,style:{borderRadius:14,borderWidth:1.5,borderColor:Q||X.length?f.colours.amber:n?f.colours.gold:f.colours.border,backgroundColor:f.colours.surface,overflow:'hidden'},children:[(0,j.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.name} order sheet`,onPress:o,style:{padding:12,gap:4},children:[(0,j.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(i.T,{weight:"semibold",size:f.font.large,style:{flex:1},children:[S[e.method]," ",e.name]}),(0,j.jsx)(i.Badge,{kind:e.placeholder?'amber':'gold',label:e.placeholder?'To fill in':b.METHOD_LABEL[e.method]})]}),(0,j.jsx)(i.Muted,{children:e.goods}),(0,j.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.deliveryDays.length?(0,j.jsx)(i.Badge,{kind:"neutral",label:`Delivers ${(0,b.dayRange)(e.deliveryDays)}`}):null,e.orderDays.length?(0,j.jsx)(i.Badge,{kind:Q?'amber':'neutral',label:`Order ${(0,b.dayRange)(e.orderDays)}${e.cutoff?` by ${e.cutoff}`:''}`}):null,e.frequency?(0,j.jsx)(i.Badge,{kind:"neutral",label:e.frequency}):null,e.priceCapPerKg?(0,j.jsx)(i.Badge,{kind:"blue",label:`Cap ${(0,p.gbp)(e.priceCapPerKg)}/kg`}):null,J.length?(0,j.jsx)(i.Badge,{kind:X.length?'amber':'ok',label:J.map(e=>`${e.icon} ${(0,c.fmtStockCount)(C,e,H.counts[e.key]??0)}`).join(' \xb7 ')}):null,B&&new Date(B).toDateString()===I.toDateString()?(0,j.jsx)(i.Badge,{kind:"ok",label:"Opened today \u2713"}):null]})]}),n?(0,j.jsxs)(d.default,{style:{padding:12,paddingTop:0,gap:10},children:[K?(0,j.jsxs)(i.Muted,{children:["Next delivery if you order now: ",(0,b.niceDay)(K),"."]}):null,e.reminder?(0,j.jsxs)(i.Muted,{children:["Reminder on ",e.orderDays.map(e=>b.DAYS[e]).join(', '),": ",e.reminder]}):null,e.notes?(0,j.jsx)(i.T,{size:f.font.small,colour:f.colours.muted,children:e.notes}):null,e.placeholder?(0,j.jsx)(i.Banner,{kind:"warn",title:"Still to be set up",children:"Add the supplier, how to order and delivery days in Managers \u203a Settings \u203a Supplier order sheets."}):null,e.items.map(e=>(0,j.jsxs)(d.default,{style:{gap:6},children:[(0,j.jsxs)(i.T,{children:[e.name,e.unit?(0,j.jsxs)(i.T,{size:f.font.small,colour:f.colours.muted,children:[" (",(0,l.quantityUnit)(C,e),")"]}):null]}),(0,j.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone less':'Less'} ${e.name}`,onPress:()=>Y(e,-1),style:{minWidth:44,minHeight:44}}),(0,j.jsx)(d.default,{accessible:!0,accessibilityLabel:(0,l.fishQtySpeech)(C,e,L[e.id]||0),children:(0,j.jsx)(i.T,{weight:"bold",size:20,style:{minWidth:76,textAlign:'center'},children:(0,l.fishInStone)(C,e)?(0,l.fishQtyText)(C,e,L[e.id]||0):L[e.id]||0})}),(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone more':'More'} ${e.name}`,testID:`qty-${e.id}`,onPress:()=>Y(e,1),style:{minWidth:44,minHeight:44}})]})]},e.id)),(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsx)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:"Anything else (one line each)"}),(0,j.jsx)(t.TextInput,{value:O,onChangeText:R,multiline:!0,placeholder:"e.g. 2 boxes lemons",placeholderTextColor:f.colours.muted,style:[T,{minHeight:60}]})]}),G?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['whatsapp'===e.method?'WhatsApp number':'phone'===e.method?'Phone number':'Mobile number',e.number?'':' (blank: fill in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`number-${e.id}`,value:e.number,onChangeText:t=>v(C,e.id,{number:t}),keyboardType:"phone-pad",placeholder:"07\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,'online'===e.method?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['Open Coldweb'===e.urlLabel?'Coldweb ordering link':'Website link',e.url?'':' (blank: paste it in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`url-${e.id}`,value:e.url,onChangeText:t=>v(C,e.id,{url:t.trim()}),autoCapitalize:"none",keyboardType:"url",placeholder:"https://\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,e.priceCapPerKg?(0,j.jsxs)(d.default,{style:{gap:6,padding:10,borderRadius:12,backgroundColor:f.colours.blueBg},children:[(0,j.jsxs)(i.T,{weight:"semibold",colour:"#E2C489",children:["Price cap ",(0,p.gbp)(e.priceCapPerKg),"/kg \xb7 buy from the cheapest UK seller under it"]}),(0,j.jsxs)(i.Muted,{children:["Seller: ",e.seller||'to be chosen']}),(0,j.jsxs)(i.Row,{gap:8,children:[(0,j.jsx)(i.T,{size:f.font.small,style:{flex:1},children:"Price you found (\xa3/kg)"}),(0,j.jsx)(t.TextInput,{testID:"price-found",value:A,onChangeText:e=>z((0,y.sanitiseMoneyTyping)(e)),keyboardType:"decimal-pad",inputMode:"decimal",placeholder:"e.g. 22.50",placeholderTextColor:f.colours.muted,style:[T,{width:120}]})]}),V>0?(0,j.jsx)(i.Badge,{kind:V<=e.priceCapPerKg?'ok':'red',label:V<=e.priceCapPerKg?`${(0,p.gbp)(V)}/kg is under the cap \u2713`:`${(0,p.gbp)(V)}/kg is over the ${(0,p.gbp)(e.priceCapPerKg)} cap: look for a cheaper seller`}):null]}):null,'online'!==e.method&&'tbc'!==e.method?(0,j.jsxs)(d.default,{testID:`preview-${e.id}`,style:{padding:10,borderRadius:12,borderWidth:1,borderColor:f.colours.border,backgroundColor:f.colours.surface2},children:[(0,j.jsx)(i.T,{size:12,weight:"semibold",colour:f.colours.gold,children:'phone'===e.method?'READ THIS OUT':'YOUR MESSAGE'}),(0,j.jsx)(i.T,{size:f.font.small,children:E.length?U:'Add quantities above to write the order.'})]}):null,(0,j.jsxs)(i.Row,{wrap:!0,gap:8,children:['text'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"\ud83d\udcac Open in Messages",disabled:!E.length,onPress:()=>F((0,b.smsLink)(e.number,U))}):null,'whatsapp'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"Open in WhatsApp",disabled:!E.length,onPress:()=>F((0,b.waLink)(e.number,U))}):null,'phone'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83d\udcde Call ${e.name}`,disabled:!e.number,onPress:()=>F((0,b.telLink)(e.number))}):null,'online'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83c\udf10 ${e.urlLabel??'Open website'}`,disabled:!e.url,onPress:()=>F(e.url)}):null,'online'!==e.method&&'tbc'!==e.method&&E.length?(0,j.jsx)(i.Button,{kind:"ghost",label:_?'Copied \u2713':'Copy order',onPress:async()=>{const e=await k(U);W(e),e&&setTimeout(()=>W(!1),2e3)}}):null]}),'text'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: Messages opens with the order written and asks who to send it to."}):null,'whatsapp'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: WhatsApp opens with the order written and asks who to send it to."}):null,'phone'!==e.method||e.number?null:(0,j.jsx)(i.Muted,{children:"Add the phone number above to call from here."}),'online'!==e.method||e.url?null:(0,j.jsx)(i.Muted,{children:"Add the link above and the button opens it."})]}):null]})}},1166,[812,820,943,17,362,219,385,85,777,998,942,944,851,999,804,1140,840,8]); -__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:i,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),i?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:i}):null]}):null,n||w.length||!i?null:(0,j.jsx)(l.default,{accessibilityRole:"button",onPress:i,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:i?()=>{k(!1),i()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const i=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!i.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${i.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,i.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:i.items.map((t,s)=>{const o=i.counts[t.key]??0,l=d[t.key]??0,h=Math.max(0,o-l),m=h<=0,b=m||i.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:l?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,l)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return z}}),_e.ShellfishChip=M,_e.SundayRoastChip=function(e){return(0,j.jsx)(M,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=e(_r(_d[5])),l=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(i.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:i,group:l}){const d=(0,h.useShellfish)(e,s,r,l),m='roast'===l,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const i=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,i,o):Math.max(0,Math.min(99,i+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),z=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),M=(0,o.useRef)(null);M.current||(M.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!M.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,H]=(0,o.useState)(0),F=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?z:D>0,W=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!F.length)return;const e=setInterval(()=>H(e=>e+1),600);return()=>clearInterval(e)},[R.state,F.length]);const P=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void W('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?W('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?W('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-P.current>2e4&&W('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||F.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||F.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${F.length} ${1===F.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&z&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),P.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!z,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),i?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:i}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const z=18;function M({rid:e,by:t,app:r,size:i="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(m&&'roast'===d&&(!f.items.length||!(0,u.isSundayIn)(T)))return(0,j.jsx)(R,{size:i});if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const M='m'===i?20:17,E='roast'!==d,B=E&&f.items.some(e=>(k[e.key]??0)>0),H=B?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==i&&!B;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${E&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,i=p[t.key]??0,d=Math.max(0,n-i),h=d<=0,m=h||f.isLow(t.key),b=E?k[t.key]??0:0,x=h?y.colours.red:E&&'display'!==r?y.colours.shellfishFree:m&&!E?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:B?4:6,paddingHorizontal:B?5:9,paddingVertical:3,flexShrink:0,minWidth:B?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,M-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:M-2}),(0,j.jsx)(c.T,{size:M,weight:"bold",colour:x,style:{lineHeight:M+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(l.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:z,minWidth:z,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):B?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:z,width:z,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,H)})`})}):null,!F||!(i||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':i?`${(0,u.fmtStockCount)(e,t,i)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),i=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),l=(0,f.reservedBookingsOn)(r,i,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(i))}),l.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}function R({size:e}){return(0,j.jsxs)(a.default,{testID:"roast-slot",accessible:!0,accessibilityLabel:"Sunday roast count: shown on Sundays",style:{minHeight:44,minWidth:'xs'===e?64:84,paddingHorizontal:10,borderRadius:12,borderWidth:1,borderColor:y.colours.hairline,backgroundColor:'rgba(255,255,255,0.03)',flexDirection:'row',alignItems:'center',justifyContent:'center',gap:6},children:[(0,j.jsx)(c.T,{size:'m'===e?14:12,colour:y.colours.muted,children:"Roast"}),(0,j.jsx)(c.T,{size:'m'===e?18:16,weight:"bold",colour:y.colours.muted,children:"\u2013"})]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); +__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:l,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(i.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),l?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:l}):null]}):null,n||w.length||!l?null:(0,j.jsx)(i.default,{accessibilityRole:"button",onPress:l,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:l?()=>{k(!1),l()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const l=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!l.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${l.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,l.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:l.items.map((t,s)=>{const o=l.counts[t.key]??0,i=d[t.key]??0,h=Math.max(0,o-i),m=h<=0,b=m||l.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:i?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,i)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return M}}),_e.ShellfishChip=z,_e.SundayRoastChip=function(e){return(0,j.jsx)(z,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),l=e(_r(_d[5])),i=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(l.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:l,group:i}){const d=(0,h.useShellfish)(e,s,r,i),m='roast'===i,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const l=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,l,o):Math.max(0,Math.min(99,l+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),M=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),z=(0,o.useRef)(null);z.current||(z.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!z.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,F]=(0,o.useState)(0),H=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?M:D>0,P=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!H.length)return;const e=setInterval(()=>F(e=>e+1),600);return()=>clearInterval(e)},[R.state,H.length]);const W=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void P('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?P('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?P('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-W.current>2e4&&P('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||H.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||H.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${H.length} ${1===H.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&M&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),W.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!M,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),l?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:l}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const M=18;function z({rid:e,by:t,app:r,size:l="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const z='m'===l?20:17,R='roast'!==d,E=R&&f.items.some(e=>(k[e.key]??0)>0),B=E?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==l&&!E;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${R&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,l=p[t.key]??0,d=Math.max(0,n-l),h=d<=0,m=h||f.isLow(t.key),b=R?k[t.key]??0:0,x=h?y.colours.red:R&&'display'!==r?y.colours.shellfishFree:m&&!R?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:E?4:6,paddingHorizontal:E?5:9,paddingVertical:3,flexShrink:0,minWidth:E?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,z-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:z-2}),(0,j.jsx)(c.T,{size:z,weight:"bold",colour:x,style:{lineHeight:z+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(i.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:M,minWidth:M,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):E?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:M,width:M,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,B)})`})}):null,!F||!(l||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':l?`${(0,u.fmtStockCount)(e,t,l)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),l=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),i=(0,f.reservedBookingsOn)(r,l,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(l))}),i.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"look",{enumerable:!0,get:function(){return n}}),r(d[0]);var o=r(d[1]);const b=o=>o,n={panel:{backgroundColor:'#121110',borderRadius:o.radii.xl,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',boxShadow:'0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 28px rgba(0,0,0,0.45)'},quiet:(b,n="gold")=>({minHeight:o.control.tall,borderRadius:o.radii.button,borderWidth:1,borderColor:'blue'===n?'rgba(226,196,137,0.55)':'rgba(207,164,95,0.38)',backgroundColor:b?'rgba(207,164,95,0.16)':'blue'===n?'rgba(226,196,137,0.10)':'rgba(255,255,255,0.035)',paddingHorizontal:14,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:8,boxShadow:'0 1px 0 rgba(255,255,255,0.05) inset',transition:'background-color 120ms ease'}),primary:o=>({backgroundColor:o?'#B8904F':'#CFA45F',borderWidth:1,borderColor:'rgba(255,226,170,0.55)',backgroundImage:o?'linear-gradient(180deg, #BE9552 0%, #A88143 100%)':'linear-gradient(180deg, #E0BA77 0%, #C69A55 100%)',boxShadow:o?'0 2px 8px rgba(0,0,0,0.4)':'0 1px 0 rgba(255,255,255,0.28) inset, 0 10px 24px rgba(207,164,95,0.22), 0 4px 10px rgba(0,0,0,0.45)',transition:'box-shadow 120ms ease'}),onPrimary:'#17130D',web:b}},1168,[219,811]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STOCK_ICON_IMAGES",{enumerable:!0,get:function(){return A}});const A={'\ud83e\udd9e':{uri:'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAABACAYAAACKhS4jAAAZTUlEQVR42rV6eXxcxZXud6ruvb2r1ZJarW6ttpGxZeMlZjWLbTBbgIQQZIckjxAYYHgEQjIJPDKZkc2E/DIhCZM3GSCQeQSSEAaxOazBBmwcbGyQF+IN28KLrM3ae1N331t15o/uNrItOWbycn+/+2vLt27VV+d+56tzThXwV1zPAJLzt2BAtgDiBM2p0JYKt2BAFh8yQADwy1Co7s9V0cc3RaI/uwehYOGZOGlQYzoXJ2oz3v9PNAGa4M9iP28DBgCsKQ9/h+samGsbuCsSe/2HgUD5RP0a41mTAJXvd0ILggB+uaJiXgTG5QlwdYCw/eVk/Pnlo6NdLYBYDuhi+xaAlgP0UlnF1xpM4yof4BtmdPRp5wnq738HAPUVxhti1Z5VyhGAjlrmpdfB91+bE8GrluFQdhlANBGu4uz+saRkyoGq6t92RKK/bgL8Y61V/BprKyvvGqmpTXDdJOa6Bua6Bu6sim17vLx8Go1pV/xdHw4v59p65tp6TsZqmOsaOB6rTb8cLF9UaCcB4I4ylPTFqj/WNXWcjdVkubaet4Yjj4xpQ+PyFwDu94VmdkWrP+K6Bk7GavhmT8kZxYkxIAjAy6GKK9LVtcw19by3MvrS2nDk/uForJ3rJ/HOyuhzCwCDAVE0xu8rKqbGq2tSo7G6dFtF5bf/3Rc6bXck9iTXNXB7VfTxIrDiBNrCkfu4po6zsVrbrq51cjV1vDkc+fpYeh1lcQJwg9tduz8S28G19czVtU4iVnPgSkS9Y/0AAPVEY6u5toG3lEf+pUi9p4LBuSPR6s5MrDb7pLd0duEdEwB+H6q4hWsb+EA0+svimHdY/qZkdW1yqLpu4wLAXaCjyYB4saysaShW06er6zhTXeNwTZ3uj1Z3/UswOInBdIT/BVDyDsC1NxJdwbX1nInVZLiugbdWRp8stDGaC1a5ze+fnohVp/tj1W0AXBLAvvp6NwDsicQe5LoGfjUU/k7hPQsAuiOxR+zaOn4jHL6mMJ4BgHLVtR8djFZ3zwdixzJhdyTyBNfWc7a61snFamyuqecPw1WPjqWYQN7q6vNl4ZsnmebnHK0cQSRZawit13DeSZxnClz7fiAw1SsNz66s8woBWQcw3j9wwGZA7HCyq3Na43yPaxYAoKkJAFBlmmVJzc5rqVR7weGYADYBxYBMAbS2LhjaXFn1zN5I1WMA8LGt/5DTGhIQIBIazNWmsfTRUGiGKLwnCFB3+P3hWS7zOwIEzSCTyBhQamilSr5HAD8cCDQ2FOgRgfQJIgRN2sMArQbQnAejX8rldmY0RnNANQBgxwwFAP3slEogU+/SQwDQWpCyEa21JMJWYEhn3XPnuF3NUyzX371fEb3pssG+V1JadUkiYoAUsy6TsuR8y7qzIDcsAOAmr/eLFdKoz7HWRFSgE3307aHUnl2V0R8vDZavfjlc9XUA6NO2SzMjTNQDgBcWLAkAP/P7B0uEGBphXQkgALRqALA1mwDBHnUfpRTrnNFlCVbfB5Ae1bompbQNZl1r0M0AnC7Nq0ACAGsAAsxcLYzmB4PBBgK0aAGMkJBX5CdYAEIChxz7zR8EAp9pNI3vhgixMikXAUAf86t/SCWufUDrdQX9LOo52tJpx4EeFQwXCs5a4OZR2ry98Pdn+wafnd7d/SgAKAVIgqGYOSDknMeCFbMrhHxRg0H5L0s2sw4YRuhCy70EAER9IDCp1DBmQ2sigMBMAKPOEG03+nxXCSEYrPWI1mEArlmHD/d+YXDwuZ/29qaKiyQVnGfRyMhon+P0uwCPHxDGGNAMCIeZjpXnbQWnNoXs1wzNzMorhetyj7Hw/w3G/zzoOFmDhKGLfTGjxjCv+VEoFBSmlNOV0lWaCAyQIBJZrfBSJnPYQ3JyYVEQLkLoPMDL+RXTOHax4E9WXzaBirsDgdCRJRaCLUL6glJ3GgCWFZovAdSO/GoON0ELQDNAIIJN8szNlMuRED1UWNEZEApgizB7qsR8caU7MCUopam0VgAgiSjNnFqRydjDmo9ImIfIf4HH4yWAl50gfChOwiiEEQBMm+F1E2Xmu1z2se2bC6+cZtBhi5DTgMHMcDRPnupySQmMgrlIP9Jaa78Q7jmm91yRgKoTeasfuRymzA5HZASxCwAcgEulKPlKWZm3YDmaMHQs9vHJP4M2uAxgjjvOccHVssLv8+n0cL+jMxYJIs2IkpjkSguvDyIFoiN2YQKYCCOaZ4oBrfOyRgWdYYYL7LvYizIH5DAAh1mbRCWnELnHDjgBfE3Hf4yJgjwsL/jMTSMjAyOsD4EImw3F73tVWaBGPL3eyjU5+dCzMHESlMc4WSjm0NiRHYA9Qri/nPXmgowDxAQ3Q+eYrd+m05GCTh9redb5zjPdSnWUGIbrK75gyfjR8PFM0/k2I0EhOkYFY6tl6/2GokmWNbOEyVPgxVH9lAoKGx4SJWDOO2ve8HAkoasS9/QL1VgnbMRsIKwkBSCnA1jVfAIkDqAMIRAtUO6kruZmgdZWFRSi19KEq0ZNOCzgAasSkFBjgIv8goUKkpXCR6KqOC0GYBBoBBraIz+XtDB9vWljn9SCBOEit9VYGGxCHLLweR0QMyB8gCBoaAaPJMX49GltBQB8mM12EAPlLDhiavhZSOcTxz+Kh1KQMBJadYGMOjAzAaQAhLXARSlD28QkQeTTeREkiGhhsHFANBPQCgjuBQhusCgsYDmLyDWoVN8/xDtH6QQ82q3UnrmKQackBOqTwAcVQNzKB8s8BjiAUa3TIkccP17uGOVMokoJCiuCCSIQYVA71QDcMg+KJlCbJMA4JHR8RVnZ1y4zPNM0I+Vo6NaCph9n+MLvGYbY4RhOVkZSJH0OU00SUOIof2eABRG6lXNIBA3ZUVgCjrKmDcCm/K3zKy8MoOYrXm9In0g+mEyHGSnbvvFSt+/RR8tLn/QTxZjgYIL8thnQBODBdLprEHo/iAgKmiwFSF3Qo09GYCKkmTqFcnhjRisWRMfpdfHOOzKjQsiSezye4Phaf5gAoJZEvwChyXLfKQlmrWk2Bg0jlGF2Lh5TLThmLNbNkI+kUocHcliFnFEkwDjGYSYQSki0iTdTmXWjzH1Gnll6gs7JYYZHCHmay+8ZX+uTxACFpEwIMBzmHAPIMds678BiJZDTn2jD0YtVaz4C2zRkPZ4alhouGCyOZgMDLImQUk7uY5V9W/xnauijuHI2Ix9V6hPpsQJEO7N3vIdtBQs6di6UBSCYhcgnMobQihslZneGQhcWYhQ5zmKl+Z8hbrAPtu0bMB/I9VmMETeDCUxgDWhmtqUQchj6lYv6+98QbYC9x7F/o/IDjf+l8jOmDLPMaT1yrOUZEKejzd4QCEx902t84wshPz/kt4RghsGglZbBPyh1+dsD/kdfDgYnFzIhMc5ySwAw0GF8mFsXtnlfQDA5bDKRRSQsKa0ux974Qjb7DQE4BgNEAwOteyrNpae43VfllLLzcn9UYYgFCeqwc0/P6O3eXkgN9Vj3aAKsqMf74O/9wdgbhqXJpcXfp21oVvi5zyNWWl7VKey6uzP2/70AI1cf+5U5P6azJhy+/TOW9QuPozW7mIXpoXgqnRgF+hPgt3+UiH/vP1Op3hZAGMvyK2vuhWT8lhuk8VzYkPN1PqpzSEASiEgzA4xuZe8ZI7WqaHUC1MqKyptiLuuz52RHna1CG19K27A0Q4Fwvq2wTyrZlM2oetO84p5QxbU01P80FwpcHwAmAfZDvkjlTNP4Rz9JONMnwYiUaZgemezrX/2//7jq9hVAR7HasbygUChYkm+Bv+K7lYEfl5tySUhIH2wHjnbApsGGkJR01MirdvbCpf39m7cD5oy89fQNXm/lj0tDG8LarCNWOmlq4dcCDuVnmSWgQwg0KEeZwpBddu7td3u6L2vGPAbaFAH6X2vLY9dpz89qtV6qJtUqOWOa1NmcI1yWGEylnyt/qnUJNzVZ2LHDLlbNBMYE+o8i2d94uPvGjY594dpM+vbhmuh2MWcm5BmzQbObnIDLDFaxvJoAngnkCHAI0Hf5/ddVklGnqtPKrrSFR0nkCqRTyFegGh0FQEiltS4Rcr6rvPw8QptNgLG2vPLLfzdqrKl19FJbSk3RKkLOtgUgoFm829f1JgOidcYMNbbcZ4yRw3wW09ws6NlnN4J5455FCxtKS/1NyOYcGELi4EGeMZT42lC0unxn1u7MGMaGJ3h4e1nWuhhTs0zX90EeMqGeCEPYMl9jKwyVI4LIE137pXRNt6wl71VXp2tse3nU471EVJTDKfEr6fNAlAQkpBTDjpPsGRh47KF9vb++mkjr1tYTFW/HOFBzs3z8QPuCr0+f9iakhHYcjZ4+EgNDhNE0kEghnbOzI6T3WVkrWn5+Jqg/P8ximyTnmYpCyjx+piUAZICUth0jEC51oekUrf1BFoI0LJfZOzi0JeXYT7b1DLy/5N13//RJQHm0kxtjS80E8P1z5oR9LnkqtbauB/DWzMrK754SLLktaFmTRU0UOhaxoRUjnSFXT48R7eiZBlJgJw2xi0i3eYCsBNx6XN0l5DMhr1I+rijTas5MW5oGCa0NkJCd/X2t169Zf8dbhw/3Fl6xPvjsZXeWel03diRTNy56fdV7RYc9orWrWxZIAFhcWXHx/5o5Y23X0i8++/CcObPPfPn1nzy8fdPZu4aG707ncrYwTVNYLkuUBk05a6ZE06lQpAC3DfTmwANmnuQTJloEKAXl8UDMO03IgN+EIY1hrdNth/tbalpXXL+6r68XAH4ya9bc7iXXvDqvvuYBtzQOVcNoZ2YqJvDHFfl/MmtWeOmpU35dW1l+eWIkMbJnaPjn9/1p14MrRg4M/+6COY3nVNR+UxrG+W4gCMNQPJywQ1u2TTbP6DOpLAe1vgo8XJgAjw+etIbyuPTwrOkH06bVy05u/av7Ov/tG5s3Hyjm+xsuvfjmpkjFj2AI2j8wcO9pK17/eSFXOlKjP7Z8QQRwGPCvvOLS+6aFy7/lcrvRNxzfuS858pQWcm93Iq3jyp5UJq2QbRiZUDzuO7ej5zZzbp+PqjJQmyrAXT7AHJ82DLABUJLV6Nra6l/ud7s+rresnnK35ZJSWtlczpxSErw+GiyZ3x2Pv7Hq4MG7r39349Z8PEYYqzY03naNyM8Qqy684PJpFeX3VZeFTocs1PUFAVoDjgMQMTIZ0m+9D0zphGhMQ20PgveWTggeAKA1yOOBvOAswO8f4wz5F4ZG4iP7h4fv/cxLrz8MAG8vWGAsWrPmuHKLMV54ekQyW1tf+1p9/frbZ56yRGsx2dY6k7RtV9rRpW5BpSUuy/BLjtc7zjWlCXcpjDSTxyHWdKL9LjaEoCGt+nd2dDw35HB/1nGSlhBDAbeRnRoqH25tP7Dprra2g4IIT197rVzU2uqcxD7X0Vdhxs79MydF/N6y2QvDFdOrykrr+0Yz9YZGXZlp1JX7vSHxwTZTDXRDnD4M7vJCHygBTDUh59m2YUarkJh5arpnNNWeZT5Y4Q/sGU2lO984eHDzrXPPeAeLF+tlS5bw8hNEuhOCf6a5WS5tbVW/Pe+8BVdMqn4q6PXGII18ocJ28pVRzYMH7dxH1tad1ZGe4TrHK5gU04lMoiXYzDD1B717c2fNOVRtuuaCEITLBQgBKBvdA0Mvndn64tIO5syxPD8Z8MTMaCSy3lnyhXeiodCZB/r7V0Y87j+39fTvefHQga1rO3o+vmtqQ1mksuniUyObbq3amZzu7PVA+BWNW2oqpGSckNqckqGBM6ztyZ75j61o/3D3mr6hxI1TpsQW1EZnOIRrS0sCMzZ2HHrwrFfe+DY3N0tqbVUnDb74wrqLL7z1nMkNj+zvH1g56bkVlxSfv7V48aVTQv5rQl7XVQGrNKp9+5WqfovEyoDgLb582d8s7OQeSYoJsAHRmAV/vp9l8lSgbyHF7SFYmjf1ZJIrt/WPPL96f+f+e+efsarc7z9t9d7dNy9atfZXRfr+RfAMkCTif5o+veyOWU3rQ1533SMf7rqgOmDFG/zBr9b4PM3lPt+p8HqRjo8c3tk3vA4i6Ztz4XsLpVubue0ejTYPyW6LOG0cSYSpPAealwafnmI2CatWVT2Z6m5ad0Vj6YVDo8750WBJDNDY0tlz47q+wVXXTZ/ynt8wgu8c6Lh88VvvrOWWFkHLl+sTqg0WLJB6zRpnQXXll8rLS6fu7Tz846fa23tfuHTRB+Gy8jCyWfSn0zuHhwYfWtfdO3JOrPqWxlDFeTq1Cyz7YTZlhT4lw2JIgvtcQJqAcgWqzAJBAKMECYMWls9bMgR37pvvrVr26O6Bnr1XXDHFF/T++7RI5WP7U5m5T2zbtviGWXM2TA1XPPP3kchsLF/ex8dsIh+filVWMgB4TJHe19P7dOOLf/g/v1o4/6ZwqCzc2Xd408pDHV+e+ftnz4in7fQXpzb+R2O04rz9vc5LIzl+lbwSWkFJDxMmOaCzE6BFcdBpaaBMgxWzcDONZnVqNMsHomW+mx8+//KdHV+8+v43e3o+3HKg62YBnT03Fv7dtzZvb9/U1XVtfDT73pRIZFyn/UtFUDw+e3bp1TOmrrNMs/6VPXvOXbLu/S17r77qZ1NikW/F44mR7UO9P5z/yuoH1txuXTNvCj/ji0tW3ZYQ/Zp0wgRBAD4bVMrQZaRkbFTuGdTrp96vPrfukgWnR0pCd02uKL90V3fvL6avePmODZcv/ocz6+t/sqXj4H1zX1nZcsJ69EQPPrhlnjkveqVa/afVlyyc3PDart7DD03/w2u3L54cqvuvsy/aKpi6frNzz5fv3LJlqyDgiel1TdcEU+94M1Tu1DOLEpswZACDdj7ZA6BHpTJcJJPMvwm8O3R9kbrDX126gcHV33/rtRn/0ZUY7l56zYaAx33app4dNee/trl/Irmc8FTHvOiVipYv58ZI5U2jOVuv7u3+Nwbo/qnzGi3LFWyPj/zizi1btvKCBW7FoMZc8pBdFu/j8xLAZ0e0WJwALU5AzEhCTItDTIvDmDUENA5jtDTd1QIIvnKelwDno4GBp0rcnshXP3PeQgLUnsHENw8lU+/GPJOKuwbjXsaEgWves2lHIn44AOPu2zZs2XMbgE6ff7LfMKjG7dndAghUVtpg4GwaSGyaJdvnZtU02m2AXQIYApAeEwoDpA3GRie7bzmgr4rBZgAdfcMvzKyK/KDcZV7GwHMXrFz5LoCLMF70eBKWL34ivuSlP955zkuv/JSfeUYCQEcmPW0oHs8s/dPq9uWARmurxhIIQHDMoj/D0JADOabOHCidA1wMuAB2MeBmshV4a49vNwB8PNSmuaVFXPvBBwe6E4k19cGSK/mWW0xuaRF8EmV94y8eHGLWWLZMYPt2BoCQaTWZhuxc0ztysChdhT1GHE7znkjOBT1iEo+aQLZgG8EgjwKV2GQGM9lFdakObAWam45YVu0dTP6rMl3fXL17p/fWtrYRPgkx+YvgC5zTxc72jqSeP5hOpgv5ZL7+3JoHsWar5+OGgDcTcMGl3DkWZTZBaEATdMLS6PCLgXZv1yFyDwKHgOVgwnIGgMveeuttABtagEwxuv2rwY/hHQPAFW+//djYikNxj4oBejiW2qFnpOIwUEmjxOSIfH3dUJA1KcAPZA/J0bVrgg4XJ37kC4OkoPRyPhnCnDz4o2fS0iKwYwcVg6XCF9EE8GudwQVGVpaqlMWM/L4OlAAsBS2YDDfD5U/7SuoHQzSIeOHoiirk5FwoxJ80esJfcRVKfboJ8P8uUnXvVJjf8UhhqanDLEMZIsv5pKBtG1CDbsbuEh6wse1DZ/R7Fw/1v1KkI30K0H81+CLw35aW1i8wPb+q8RmLUZ9k+6AX5tm9BL+T314pgjcBJA3Y70TZjGYoMSLtnYfxwFkjPS0CcCaq25/oEv9D4CQA/ZuysprLvZ7nagz3YieYttE4DGFq0j3eQhXz6Ju7vRBMpKYN6EBlRpzp9nxvcyTy5EzAVzxv+TcFXxzg5lAoeJFlPV1mWvOytnZE0DFhMVEoC+7xHJ+MMKB7vKCKDKRfC0Va2KydOS73dY+FI/fTCTbp/r+BX52PVPhL0lwaNVzn2ko7gsjIn3UCqCoNHnYBg678sTdF+UMpg27wsAtUkyxYgIgBqZnVDNO89Y/h8LmFeqn8m4FfiBbNAM02zcUAazCDhAanDSBHoFAGVJKDs7UcHDcBD4OTJpzNZaDyDKhyFMgBnLQgiMlhzT4p3SGIyz4tFuPTM345AIgyw/TlT0+BIAH0u4CUwfDZipoGBLdVCr02CoSywLALMDSoqU9pg4kGLcEDLqBwrkUTdIq57JjQ5G9CGwFAt+dyXRBCAHC0YHYyBuv2EoIgQ1TYwpjfqziWUmwLxdUJZZzTo0WZLYUthfqoVGlbsILWBNICEGGiDz4tJuPT0ya/qm5IZX8akHRepTSngTVgAalOr7PXSr9QNTkzI+JzmowzBvJ2JGA0AySS2JjbEvTUDPlOy9d1BIHI2pfLrbqnL/NiQQzUyWKR/wPSMABxZ260bxbRHy2iQELr4GGlDrSz889n7Rr5np21Xq23eEdC8b59Q9iWc+jtPYfNh776of6n5O7S5ysCjm/EUSU9Sn/Yo9SvfjiavPfZXHzwhAedx7n+G1W4GfQ2sVDSAAAAAElFTkSuQmCC',w:47,h:64},'\ud83e\udd80':{uri:'data:image/png;base64,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',w:64,h:45}}},1169,[]); __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.StockScreen=function({initial:e="levels"}){const[t,i]=(0,l.useState)(e);return(0,y.jsxs)(r.default,{style:{gap:12},children:[(0,y.jsx)(p.Seg,{value:t,onChange:i,options:[{id:'levels',label:'Stock levels'},{id:'take',label:'Stock take'},{id:'deliveries',label:'Deliveries in'}]}),'levels'===t?(0,y.jsx)(j,{}):'take'===t?(0,y.jsx)(f,{}):(0,y.jsx)(v,{})]})};var t=_r(_d[0]),i=_r(_d[1]),n=_r(_d[2]),s=_r(_d[3]),l=_r(_d[4]),d=e(_r(_d[5])),r=e(_r(_d[6])),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]);function j(){const{k:e,rid:t}=(0,p.useChef)(),d=(0,c.useOwner)(e=>e.suppliers),b=(0,i.useSheets)(t),[x,j]=(0,l.useState)('all'),f=e.ingredients.filter(e=>e.onHand<=0),v=e.ingredients.filter(e=>(0,p.isLow)(e.onHand,e.par)),k='alerts'===x?[...f,...v]:e.ingredients,S=[...new Set(k.map(e=>e.supplierId))].map(e=>{const t=d.find(t=>t.id===e),i=b.find(t=>t.id===e);return{id:e,name:t?.name||i?.name||'Supplier not linked',category:t?.category||i?.goods||'Stock'}});return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsxs)(o.Row,{wrap:!0,gap:10,children:[(0,y.jsx)(p.Tile,{label:"Stock value (at cost)",value:(0,u.gbp)((0,p.stockValue)(e.ingredients)),sub:`${e.ingredients.length} ingredients`}),(0,y.jsx)(p.Tile,{label:"Low or out",value:`${v.length+f.length}`,sub:`${f.length} out \xb7 ${v.length} below half par`,tone:f.length?'red':v.length?'amber':'ok',onPress:()=>j('alerts')})]}),f.length?(0,y.jsxs)(o.Banner,{kind:"danger",title:"Out of stock",children:[f.map(e=>e.name).join(', '),". Mark the dishes that need it as sold out (Kitchen \u203a Live tickets \u203a Sold out), or order now."]}):null,(0,y.jsx)(p.Seg,{value:x,onChange:j,options:[{id:'all',label:'All'},{id:'alerts',label:'Alerts only'}]}),e.ingredients.length?null:(0,y.jsx)(o.Muted,{children:"No stock items yet. Add your real ingredients to start counting."}),S.map(e=>(0,y.jsxs)(o.Card,{children:[(0,y.jsxs)(o.T,{weight:"semibold",children:[e.category," \xb7 ",e.name]}),k.filter(t=>t.supplierId===e.id).map(e=>{const i=e.onHand<=0?'out':(0,p.isLow)(e.onHand,e.par)?'low':'ok';return(0,y.jsxs)(r.default,{style:{gap:4,paddingVertical:4},accessible:!0,accessibilityLabel:`${e.name} ${(0,n.ingredientSpeech)(t,e,e.onHand)} of par ${(0,n.ingredientSpeech)(t,e,e.par)}`,children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},children:e.name}),'out'===i?(0,y.jsx)(o.Badge,{kind:"red",label:"OUT"}):'low'===i?(0,y.jsx)(o.Badge,{kind:"amber",label:"LOW"}):null,(0,y.jsxs)(o.T,{size:13,colour:h.colours.muted,children:[(0,n.ingredientQty)(t,e,e.onHand)," / par ",(0,n.ingredientQty)(t,e,e.par)]})]}),(0,y.jsx)(p.Bar,{pct:e.onHand/e.par*100,colour:'out'===i?h.colours.red:'low'===i?h.colours.amber:h.colours.gold}),(0,y.jsxs)(o.Muted,{children:[(0,u.gbp)(Math.round((0,s.displayedCost)(t,e,e.cost)))," per ",(0,s.quantityUnit)(t,e)," \xb7 value ",(0,u.gbp)(Math.round(e.onHand*e.cost))]})]},e.id)})]},e.id))]})}function f(){const{k:e,me:i,rid:d}=(0,p.useChef)(),c=(0,b.useKitchen)(e=>e.saveStockTake),[x,j]=(0,l.useState)({}),[f,v]=(0,l.useState)(''),k=e.ingredients.map(e=>{const t=x[e.id],i=void 0===t||''===t?void 0:Number(t.replace(',','.')),n=void 0!==i&&Number.isFinite(i)&&i>=0&&(!(0,s.fishInStone)(d,e)||2*i===Math.round(2*i))?(0,s.inputQuantity)(d,e,i):void 0,l=void 0===n||Number.isNaN(n)?void 0:n-e.onHand;return{i:e,counted:n,variance:l,cost:void 0===l?0:Math.round(l*e.cost)}}),S=k.filter(e=>void 0!==e.variance),w=S.reduce((e,t)=>e+t.cost,0);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Count what's on the shelves. Expected = last count + deliveries \u2212 waste. Fish is entered in stone, in half-stone steps. Variance shows what's unexplained (portioning, theft, missed waste)."}),e.stockTakes[0]?(0,y.jsxs)(o.Muted,{children:["Last stock take ",new Date(e.stockTakes[0].at).toLocaleDateString('en-GB')," by ",e.stockTakes[0].by,": variance ",(0,u.gbp)(Math.round(e.stockTakes[0].lines.reduce((e,t)=>e+(t.counted-t.expected)*t.cost,0))),"."]}):null,(0,y.jsx)(o.Card,{children:k.map(({i:e,variance:i,cost:l})=>(0,y.jsxs)(r.default,{style:{gap:6,paddingVertical:8},children:[(0,y.jsxs)(r.default,{accessible:!0,accessibilityLabel:`${e.name}, expected ${(0,n.ingredientSpeech)(d,e,e.onHand)}`,children:[(0,y.jsx)(o.T,{size:16,children:e.name}),(0,y.jsxs)(o.Muted,{children:["Expected ",(0,n.ingredientQty)(d,e,e.onHand)]})]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,y.jsx)(t.TextInput,{accessibilityLabel:`Count ${e.name} in ${(0,s.quantityUnit)(d,e)}`,accessibilityValue:{text:x[e.id]?(0,n.ingredientSpeech)(d,e,(0,s.inputQuantity)(d,e,Number(x[e.id]))):'Not counted'},keyboardType:"decimal-pad",placeholder:(0,s.quantityUnit)(d,e),placeholderTextColor:h.colours.muted,value:x[e.id]??'',onChangeText:t=>j(i=>({...i,[e.id]:t})),style:{minHeight:44,width:80,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:8,paddingVertical:6,color:h.colours.text,textAlign:'right'}}),(0,s.fishInStone)(d,e)?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Half a stone less ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String(Math.max(0,(0,s.halfStone)(Number(t[e.id])||0)-.5))}))}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Half a stone more ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String((0,s.halfStone)(Number(t[e.id])||0)+.5)}))})]}):null,(0,y.jsx)(r.default,{style:{minWidth:86,alignItems:'flex-end'},accessible:!0,accessibilityLabel:void 0===i?'No variance yet':`${(0,n.ingredientSpeech)(d,e,i)} variance, ${(0,u.gbp)(l)}`,children:void 0===i?(0,y.jsx)(o.Muted,{children:"\u2014"}):(0,y.jsxs)(o.T,{size:14,colour:Math.abs(i)<.001?h.colours.ok:i<0?h.colours.red:h.colours.amber,children:[i>0?'+':'',(0,n.ingredientQty)(d,e,i),'\n',(0,u.gbp)(l)]})})]})]},e.id))}),(0,y.jsxs)(o.Banner,{kind:w<0?'warn':'info',title:`Variance so far: ${(0,u.gbp)(w)}`,children:[S.length," of ",e.ingredients.length," counted."]}),(0,y.jsx)(o.Button,{label:"Save stock take",disabled:!S.length,onPress:()=>{const e={};S.forEach(t=>{e[t.i.id]=t.counted}),c(e,i),j({}),v(`Saved: ${S.length} items, variance ${(0,u.gbp)(w)}. Stock levels updated.`)}}),f?(0,y.jsx)(o.Banner,{kind:"success",title:"Stock take saved",children:f}):null]})}function v(){const{k:e,me:t}=(0,p.useChef)(),i=(0,c.useOwner)(e=>e.suppliers),[n,s]=(0,l.useState)(e.deliveries.find(e=>'expected'===e.status)?.id??null);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Check each delivery against the order: count it in, check the invoice price, flag shorts and price changes. Accepting adds it to stock and updates costs (and GP)."}),e.deliveries.map(e=>{const l=i.find(t=>t.id===e.supplierId);return(0,y.jsxs)(o.Card,{highlight:n===e.id?h.colours.gold:void 0,children:[(0,y.jsx)(d.default,{accessibilityRole:"button",accessibilityLabel:`Delivery from ${l?.name}`,onPress:()=>s(n===e.id?null:e.id),children:(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(o.T,{weight:"semibold",children:l?.name??'Supplier'}),(0,y.jsx)(o.Muted,{children:'expected'===e.status?`Due ${e.due} \xb7 ${e.lines.length} lines`:`Accepted by ${e.checkedBy} ${e.at?new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`})]}),(0,y.jsx)(o.Badge,{kind:'expected'===e.status?'amber':'ok',label:'expected'===e.status?'TO CHECK':'ACCEPTED'})]})}),n===e.id?(0,y.jsx)(k,{id:e.id,me:t}):null]},e.id)})]})}function k({id:e,me:i}){const{k:d,rid:c}=(0,p.useChef)(),b=d.deliveries.find(t=>t.id===e),[j,f]=(0,l.useState)(b.lines.map(e=>({...e}))),v=(e,t)=>f(i=>i.map(i=>i.ing===e?{...i,...t}:i)),k='expected'!==b.status,S=(0,l.useMemo)(()=>j.map(e=>{const t=d.ingredients.find(t=>t.id===e.ing),i=e.receivede.short>0),$=S.filter(e=>Math.abs(e.pct)>=.5),C=j.reduce((e,t)=>e+t.received*t.price,0);return(0,y.jsxs)(r.default,{style:{gap:8,marginTop:8},children:[S.map(({l:e,i:i,short:l,pct:d})=>(0,y.jsxs)(r.default,{style:{gap:4,borderTopWidth:1,borderColor:h.colours.border,paddingTop:6},children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},weight:"medium",children:i.name}),l?(0,y.jsx)(o.Badge,{kind:"red",label:`SHORT ${(0,n.ingredientQty)(c,i,l)}`}):null,Math.abs(d)>=.5?(0,y.jsx)(o.Badge,{kind:"amber",label:`PRICE ${d>0?'+':''}${d.toFixed(0)}%`}):null]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,y.jsxs)(o.Muted,{children:["Ordered ",(0,n.ingredientQty)(c,i,e.ordered)]}),(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Received (",(0,s.quantityUnit)(c,i),")"]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Received ${i.name} in ${(0,s.quantityUnit)(c,i)}`,accessibilityValue:{text:(0,n.ingredientSpeech)(c,i,e.received)},keyboardType:"decimal-pad",value:String((0,s.fishInStone)(c,i)?(0,s.halfStone)((0,s.toStone)(e.received,i.unit)):e.received),onChangeText:t=>v(e.ing,{received:(0,s.inputQuantity)(c,i,Number(t.replace(',','.'))||0)}),style:{minHeight:44,width:60,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]}),(0,s.fishInStone)(c,i)&&!k?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Receive half a stone less ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,-1)})}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Receive half a stone more ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,1)})})]}):null,(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Invoice \xa3/",(0,s.quantityUnit)(c,i)]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Invoice price ${i.name}`,keyboardType:"decimal-pad",inputMode:"decimal",value:((0,s.displayedCost)(c,i,e.price)/100).toFixed(2),onChangeText:t=>v(e.ing,{price:100*((0,x.parseMoneyInput)(t)??0)/((0,s.fishInStone)(c,i)?(0,s.fromStone)(1,i.unit):1)}),style:{minHeight:44,width:70,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]})]}),(0,y.jsxs)(o.Muted,{children:["Last cost ",(0,u.gbp)(Math.round((0,s.displayedCost)(c,i,i.cost)))," per ",(0,s.quantityUnit)(c,i)]})]},e.ing)),(0,y.jsxs)(o.T,{weight:"semibold",children:["Invoice total ",(0,u.gbp)(Math.round(C))]}),w.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Shorts to chase",children:[w.map(e=>`${e.i.name}: ${(0,n.ingredientQty)(c,e.i,e.short)} short`).join(' \xb7 '),". Ask the supplier for a credit note."]}):null,$.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Price changes",children:[$.map(e=>`${e.i.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%`).join(' \xb7 '),". Check GP \u203a Price changes once accepted."]}):null,k?(0,y.jsx)(o.Muted,{children:b.note?`Noted: ${b.note}.`:'No issues noted.'}):(0,y.jsx)(o.Button,{label:"Accept delivery into stock",testID:"accept-delivery",onPress:()=>d.acceptDelivery(e,j,i,[w.length?`${w.length} short`:'',$.length?`${$.length} price changes`:''].filter(Boolean).join(', '))})]})}},1170,[812,998,1148,943,17,385,85,777,876,851,804,1140,1000,840,8]); @@ -1413,7 +1413,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}},1330,[812,843,17,85,777,845,851,1150,1331,858,804,8]); __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})},1331,[892,946,1150]); __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]})}},1332,[13,17,856,1333,1407,8]); -__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'center'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1333,[1051,779,805,806,1334,813,1335,1092,843,1137,1336,1337,1338,1089,1118,1339,1340,1345,1346,1205,1347,856,1352,1353,1354,1111,1110,966,1355,1149,938,1102,1356,17,1070,1181,1016,1085,1357,1209,1359,378,363,385,278,85,409,19,777,1233,1237,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1360,1106,1361,1368,1370,1373,1378,1372,1379,1382,1383,1113,1093,1094,862,1388,1222,1389,1232,1224,993,1394,1399,1400,1052,1050,1115,1402,1403,1404,1069,1168,1405,1167,1158,853,1348,1406,8]); +__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'flex-start'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{testID:"display-header-time",style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1333,[1051,779,805,806,1334,813,1335,1092,843,1137,1336,1337,1338,1089,1118,1339,1340,1345,1346,1205,1347,856,1352,1353,1354,1111,1110,966,1355,1149,938,1102,1356,17,1070,1181,1016,1085,1357,1209,1359,378,363,385,278,85,409,19,777,1233,1237,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1360,1106,1361,1368,1370,1373,1378,1372,1379,1382,1383,1113,1093,1094,862,1388,1222,1389,1232,1224,993,1394,1399,1400,1052,1050,1115,1402,1403,1404,1069,1168,1405,1167,1158,853,1348,1406,8]); __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},1336,[]); @@ -1480,7 +1480,7 @@ __d(function(g,r,i,_a,m,e,_d){"use strict";function t(t,o){if(t.title.trim().len __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STEP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"addDays",{enumerable:!0,get:function(){return u}}),_e.fmt12=i,_e.rangeText=c,_e.openWindow=function(r,o){const a=(0,e.kitchenHoursOn)(r,(0,t.parseYmd)(o));if(!a)return null;let s=(0,t.toMins)(a[1]);for(const e of(0,n.regularEventsOf)(r))(0,n.occursOn)(e,o)&&e.time&&(s=Math.max(s,Math.min(1425,(0,t.toMins)(e.time)+180)));return{from:(0,t.toMins)(a[0]),to:s}},_e.servicesOn=l,_e.serviceOf=function(e,n,r,o){const a=l(e,n,o),s=(0,t.toMins)(r);return a.lunch&&s>=a.lunch.from&&s=a.dinner.from&&s=a.dinner.to?'dinner':a.lunch&&s=e?n:e);if('none'===r.kind||!o||o=h)break}return s},_e.repeatText=function(e,t){if('none'===e.kind)return;const n=t?` until ${p(t)}`:'';return'weekly'===e.kind?`Every ${[...e.days].sort().map(e=>a[e]).join(', ')}${n}`:`Last ${o[e.weekday]} of the month${n}`},Object.defineProperty(_e,"longDate",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"monthLabel",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"scopeText",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"whatText",{enumerable:!0,get:function(){return M}}),_e.confirmLine=function(e){const t=e.dates.length?1===e.dates.length?e.dates[0]===e.today?'today':p(e.dates[0]):e.repeat?`on ${e.dates.length} dates (${e.repeat})`:`${p(e.dates[0])} to ${p(e.dates[e.dates.length-1])}`:'no dates';return`Block ${c(e.from,e.to,e.wholeDay)} ${t}, ${y(e)}`},_e.bookingsInWindow=function(e,n,r,o,a,s){const u=new Set(n),i=(0,t.toMins)(r),c=(0,t.toMins)(o);return e.filter(e=>{if(!u.has(e.date)||!['confirmed','pending','seated'].includes(e.status))return!1;const n=(0,t.toMins)(e.time);if(n=c)return!1;const r=(e.table??'').split(/[^A-Za-z0-9]+/).filter(Boolean);return a.tables?.length?r.some(e=>a.tables.includes(e)):!a.areaId||r.some(e=>s?.(e)===a.areaId)})},_e.groupByMonth=function(e,n,r,o){const a=e.filter(e=>e.rid===n&&!e.removedAt&&(e.date>r||e.date===r&&(0,t.toMins)(e.to)>(0,t.toMins)(o))).sort((e,n)=>e.date===n.date?(0,t.toMins)(e.from)-(0,t.toMins)(n.from):e.date{const r=(0,t.parseYmd)(e);return r.setDate(r.getDate()+n),(0,t.ymd)(r)};function i(e){const n=(0,t.toMins)(e),r=Math.floor(n/60)%24;return`${r%12==0?12:r%12}:${String(n%60).padStart(2,'0')}${r<12?'am':'pm'}`}function c(e,t,n){if(n)return'all day';const r=i(e),o=i(t);return r.slice(-2)===o.slice(-2)?`${r.slice(0,-2)}\u2013${o}`:`${r}\u2013${o}`}function l(n,r,o){const a=(0,e.kitchenHoursOn)(n,(0,t.parseYmd)(r));if(!a)return{lunch:null,dinner:null};const s=(0,t.toMins)(a[0]),u=(0,t.toMins)(a[1]),i=1020,c=(e,n)=>{if(!e)return n;const r=Math.max(s,(0,t.toMins)(e[0])),o=Math.min(u,(0,t.toMins)(e[1]));return o>r?{from:r,to:o}:null};return{lunch:c(o?.lunch,si?{from:Math.max(i,s),to:u}:null)}}const d=e=>Math.ceil(e/r)*r;function f(e,t){const n=[];let r=e;for(;r<=t&&n.length<366;)n.push(r),r=u(r,1);return n}const m=(e,n)=>{const r=(0,t.parseYmd)(e);if(r.getDay()!==n)return!1;const o=new Date(r);return o.setDate(r.getDate()+7),o.getMonth()!==r.getMonth()},h=104;const p=e=>{const n=(0,t.parseYmd)(e);return`${o[n.getDay()]} ${n.getDate()} ${s[n.getMonth()]}`},g=e=>{const n=(0,t.parseYmd)(e);return`${s[n.getMonth()]} ${n.getFullYear()}`},y=e=>e.tables?.length?`table${e.tables.length>1?'s':''} ${e.tables.join(', ')}`:e.areaId?e.areaName??'one area':'all areas',M=e=>{const t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)}},1397,[862,863,861]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"wixBlockPushOn",{enumerable:!0,get:function(){return o}}),e.pushBlocksToWix=function(t,n,c){if(!o(t)||!n.length)return;const l=u.useSync.getState();if(!l.venueId||'guest'===l.kind)return;setTimeout(()=>{(0,s.getSupabase)().functions.invoke('wix-blocks-push',{body:{venue_id:l.venueId,block_ids:n.slice(0,120),action:c}}).catch(()=>{})},4e3)},Object.defineProperty(e,"websiteBlockStatus",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),u=r(d[3]);const o=s=>!t.IS_ISOLATED_VENUE&&!['souters','kirkmichael','wildings'].includes(s)&&!!n.useFloor.getState().settings[s]?.wixBlockPushOn;const c=t=>(t??'awaiting venue sync').replace(/\bWix\b/gi,'Website bookings')},1398,[805,996,892,946]); __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,"DAY_GRAPH_CHROME",{enumerable:!0,get:function(){return j}}),_e.DayGraph=function({todays:e,open:j,close:T,now:b,turnBase:v,blocks:w=[],height:M=150,forecastNote:k,emptyText:D,past:L,closed:I,compact:$=!1,dense:C=!1,bare:A=!1,fill:z=!1,fit:O=!1,tight:_=!1,live:H=!1,onChrome:S}){const[F,P]=(0,t.useState)(0),[E,R]=(0,t.useState)(0),[N,B]=(0,t.useState)(0),[W,X]=(0,t.useState)(0);s.default.useEffect(()=>{S&&O&&W&&S(Math.ceil((A?4:C?2:10)+N+W+(A?2:6)+2))},[S,O,N,W,A,C]);const U=j.getTime()-18e5,G=T.getTime()+36e5,Y=(0,t.useMemo)(()=>(0,f.coverCurve)(e,new Date(U),new Date(G),v),[e,U,G,v]),V=60*j.getHours()+j.getMinutes(),K=60*T.getHours()+T.getMinutes(),Z=(0,t.useMemo)(()=>(0,p.chartBands)(w,V,K),[w,V,K]),q=new Date(j);q.setHours(0,0,0,0);const J=e=>q.getTime()+6e4*e,Q=Math.max(8,...Y.map(e=>e.covers)),ee=Y.reduce((e,t)=>!t.covers||(0,p.minuteInsideVenueBlock)(60*new Date(t.t).getHours()+new Date(t.t).getMinutes(),Z)?e:!e||t.covers>e.covers?{t:t.t,covers:t.covers}:e,null),te=O&&E?Math.max(24,Math.floor(E)):Math.max(48,M-m.AXIS_BAND),se=m.CHART_PAD_L,ie=m.CHART_PAD_R,oe=C?18:22,ne=Math.max(10,F-se-ie),le=Math.max(10,te-oe-14),re=e=>se+(e-U)/(G-U)*ne,ae=e=>oe+le-e/(1.15*Q)*le,he=(0,m.yTicks)(Q),de=(0,m.fitYTicks)(he,ae,te,13),ue=(0,m.nowLineVisible)({now:b,open:j,close:T,live:H,past:L,closed:I}),ce=b.getTime(),ge=ue&&Y.length?(0,m.splitCurve)(Y,ce):{before:Y,after:[]},xe=e=>e.map((e,t)=>`${t?'L':'M'}${re(e.t).toFixed(1)},${ae(e.covers).toFixed(1)}`).join(' '),me=[];for(let e=new Date(U);e.getTime()<=G;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=U&&t.getTime()<=G&&me.push(t.getTime())}const pe=H?(0,m.seatedNowCovers)(e,e[0]?.date??''):0,fe=Math.min(G,Math.max(U,b.getTime())),ye=I?null:H?{t:fe,covers:pe,text:(0,m.seatedNowText)(pe)}:ee,je=F?(0,m.layoutChart)({width:F,height:te,t0:U,t1:G,hours:me,busiest:ye}):{hours:[],busiest:null},Te=xe(Y),be=ue?xe(ge.before):Te,ve=ue?xe(ge.after):'',we=z&&Te&&Y.length>1?`${Te} L${re(Y[Y.length-1].t).toFixed(1)},${ae(0).toFixed(1)} L${re(Y[0].t).toFixed(1)},${ae(0).toFixed(1)} Z`:'',Me=(0,i.coversFour)(e,e[0]?.date??''),ke=`Total ${Me.total} ${1===Me.total?'Cover':'Covers'}`,De=e.filter(e=>!['cancelled','noshow'].includes(e.status)).length,Le=je.busiest?.text??(I?'':H?(0,m.seatedNowText)(pe):ee?(0,m.busiestText)(ee.t,ee.covers):''),Ie=Z.map(e=>e.spoken).join('. '),$e=ue&&T.getTime()>j.getTime()?Math.max(0,Math.min(100,Math.round((ce-j.getTime())/(T.getTime()-j.getTime())*100))):null,Ce=!I&&ee&&ee.covers?(0,m.peakOccupancyText)(ee.t,ee.covers):'',Ae=`Covers through the day. Open ${(0,u.hm)(j)}. Close ${(0,u.hm)(T)}.${Ce?` ${Ce}.`:''}${Le?` ${Le}.`:''}${ue?` It is ${(0,u.hm)(b)}. About ${$e} percent of the way through the day.`:''}${Ie?` ${Ie}.`:''}`,ze=(0,u.hm)(b),Oe=Math.max(44,12*ze.length*.7+16),He=Math.max(se+2,Math.min(Math.max(0,F-ie-Oe),re(ce)-Oe/2)),Se=Math.max(2,Math.min(te-22,oe+le-22)),Fe=s.default.useId().replace(/:/g,'');return(0,y.jsxs)(o.default,{testID:"day-graph",style:[d.look.panel,O?{flex:1,minHeight:0}:null,{overflow:'visible',paddingTop:A?4:C?2:10,paddingBottom:A?2:6,backgroundColor:c.colours.bg}],children:[(0,y.jsxs)(o.default,{testID:"day-graph-head",onLayout:e=>B(e.nativeEvent.layout.height),children:[A?null:$?(0,y.jsxs)(o.default,{style:{alignItems:'center',gap:4,paddingHorizontal:14},children:[(0,y.jsx)(h.T,{center:!0,size:18,weight:"semibold",children:"Covers through the day"}),(0,y.jsx)(h.T,{center:!0,size:14,colour:c.colours.muted,testID:"day-graph-parties",children:ke}),Ce?(0,y.jsx)(h.T,{center:!0,size:13,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,children:Ce}):null]}):(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8},children:[(0,y.jsx)(h.T,{size:C?14:15,weight:"semibold",style:{flexShrink:1},children:"Covers through the day"}),(0,y.jsx)(h.T,{size:12,colour:c.colours.muted,testID:"day-graph-parties",children:ke})]}),A||_?null:I?k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:2,children:k}):null:(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8,paddingTop:2},children:[(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Open ",(0,u.hm)(j)]}),Ce&&!$?(0,y.jsx)(h.T,{size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,center:!0,style:{flex:1,minWidth:0},children:Ce}):k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",numberOfLines:1,style:{flex:1,textAlign:'center'},children:k}):(0,y.jsx)(o.default,{style:{flex:1}}),(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Close ",(0,u.hm)(T)]})]}),A||_||$||!k||!Ce?null:(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:1,style:{paddingHorizontal:14},children:k}),A||!_||!Ce||$?null:(0,y.jsx)(h.T,{center:!0,size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,style:{paddingHorizontal:14},children:Ce})]}),(0,y.jsxs)(o.default,{testID:"day-graph-plot",accessible:!0,accessibilityLabel:Ae,onLayout:e=>{P(e.nativeEvent.layout.width),O&&R(e.nativeEvent.layout.height)},style:O?{flexGrow:1,flexShrink:1,flexBasis:Math.max(48,M-m.AXIS_BAND),minHeight:24,overflow:'hidden',position:'relative'}:{height:te,minHeight:te,position:'relative',overflow:'hidden'},children:[F?(0,y.jsxs)(l.default,{width:F,height:te,children:[(0,y.jsxs)(n.Defs,{children:[(0,y.jsxs)(n.Pattern,{id:`${Fe}-venue`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"1.4"})]}),(0,y.jsxs)(n.Pattern,{id:`${Fe}-area`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622",fillOpacity:"0.35"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"0.8"})]})]}),Z.map((e,t)=>(0,y.jsx)(n.Rect,{x:re(J(e.fromMin)),y:oe,width:Math.max(3,re(J(e.toMin))-re(J(e.fromMin))),height:le,fill:`url(#${Fe}-${e.strength})`},`${e.fromMin}-${t}`)),he.map(e=>(0,y.jsx)(n.Line,{x1:se,x2:se+ne,y1:ae(e),y2:ae(e),stroke:c.colours.muted,strokeWidth:1,opacity:.28},`grid-${e}`)),ue?(0,y.jsx)(n.Rect,{testID:"day-graph-elapsed",x:re(j.getTime()),y:oe,width:Math.max(0,re(ce)-re(j.getTime())),height:le,fill:c.colours.gold,opacity:.12}):null,we?(0,y.jsx)(n.Path,{d:we,fill:"#3A2F1E",stroke:"none"}):null,be?(0,y.jsx)(n.Path,{d:be,stroke:c.colours.gold,strokeWidth:2.5,fill:"none"}):null,ve?(0,y.jsx)(n.Path,{d:ve,stroke:c.colours.gold,strokeWidth:2.5,fill:"none",opacity:.38}):null,I?null:[j,T].map((e,t)=>(0,y.jsx)(n.Line,{x1:re(e.getTime()),x2:re(e.getTime()),y1:oe,y2:oe+le,stroke:c.colours.goldLight,strokeWidth:1.5,strokeDasharray:"4,4"},`service-${t}`)),ue?(0,y.jsx)(n.Line,{testID:"day-graph-now",x1:re(ce),x2:re(ce),y1:oe,y2:oe+le,stroke:c.colours.gold,strokeWidth:2}):null,je.busiest?(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:je.busiest.x+je.busiest.w/2,y:je.busiest.y+je.busiest.h-2,fill:c.colours.gold,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:je.busiest.text}):null,De?null:(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:se+ne/2,y:oe+le/2,fill:c.colours.muted,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:D??'No bookings yet today'})]}):null,F?de.map(e=>(0,y.jsx)(o.default,{testID:"day-graph-ytick",pointerEvents:"none",style:{position:'absolute',left:0,width:se-4,top:e.top,alignItems:'flex-end',justifyContent:'flex-start'},children:(0,y.jsx)(h.T,{size:e.font,numberOfLines:1,colour:c.colours.muted,style:{textAlign:'right'},children:String(e.value)})},`yt-${e.value}`)):null,F&&ue&&te>=m.YTICK_MIN_PLOT?(0,y.jsx)(o.default,{testID:"day-graph-now-label",pointerEvents:"none",style:{position:'absolute',left:He,top:Se,minWidth:Oe,height:20,paddingHorizontal:8,borderRadius:10,backgroundColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:12,weight:"semibold",colour:c.colours.bg,center:!0,numberOfLines:1,children:ze})}):null]}),(0,y.jsxs)(o.default,{testID:"day-graph-axis",onLayout:e=>X(e.nativeEvent.layout.height),style:{minHeight:m.AXIS_BAND,flexShrink:0,position:'relative',justifyContent:'center',paddingBottom:2},children:[(0,y.jsx)(o.default,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{opacity:0,alignSelf:'flex-start'},children:(0,y.jsx)(h.T,{size:m.AXIS_FONT,numberOfLines:1,children:"20"})}),je.hours.map(e=>{const t=Math.min(Math.max(e.w,40),Math.max(e.w,F)),s=e.x+e.w/2-t/2,i=Math.max(0,Math.min(Math.max(0,F-t),s));return(0,y.jsx)(o.default,{pointerEvents:"none",style:{position:'absolute',left:i,width:t,top:0,bottom:0,alignItems:i>s+.5?'flex-start':in.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1400,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.seasonClosedAreaIds=s,e.chartBands=function(t,a,c){const u=s(t,a,c),f=[];for(const s of t){if(s.removedAt)continue;if(s.areaId&&u.has(s.areaId))continue;if(s.areaId||s.tables?.length)continue;const t=s.wholeDay?0:n(s.from),l=s.wholeDay?1440:n(s.to);if(null==t||null==l)continue;const h=Math.max(t,a),M=Math.min(l,c);if(M<=h)continue;const m=o(s,h,M);f.push({fromMin:h,toMin:M,strength:m.strength,spoken:m.spoken})}f.sort((n,t)=>n.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1400,[]); __d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.coverCurve=function(s,c,n,a){const u=s.filter(t=>!['cancelled','noshow'].includes(t.status)).map(o=>{const s=(0,t.startOf)(o).getTime();return{s:s,e:s+6e4*(0,t.durOf)(o,a),n:o.partySize}}),f=[];for(let t=c.getTime();t<=n.getTime();t+=o)f.push({t:t,covers:u.reduce((o,s)=>t>=s.s&&tt.covers));if(!o)return[];const s=[];return t.forEach((c,n)=>{const a=t.slice(Math.max(0,n-3),n+4);c.covers<.6*o||c.coverst.covers))||s.some(t=>Math.abs(t.from-c.t)<36e5)||s.push({from:c.t,to:c.t,covers:c.covers})}),s.slice(0,3)},e.quietOf=function(t,o,s){const c=Math.max(0,...t.map(t=>t.covers)),n=Math.max(2,.25*c),a=[];let u=null;const f=t.filter(t=>t.t>=o&&t.t<=s);return f.forEach((t,o)=>{const s=t.covers<=n;s&&null===u&&(u=t.t);const c=o===f.length-1;if((!s||c)&&null!==u){const o=t.t;o-u>=18e5&&a.push({from:u,to:o}),u=null}}),a.sort((t,o)=>o.to-o.from-(t.to-t.from)).slice(0,3).sort((t,o)=>t.from-o.from)};var t=r(d[0]);const o=9e5},1401,[1074]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CANCEL_TINT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"CANCEL_BORDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"CANCEL_INK",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"CANCEL_MUTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"cancelWhen",{enumerable:!0,get:function(){return d}}),e.cancelledBy=u,e.cancelItem=b,e.cancellationsFor=function(n,t,o){return n.filter(n=>n.date===t&&('cancelled'===n.status||'noshow'===n.status)).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name)).map(n=>b(n,o(n)))},Object.defineProperty(e,"cancellationsHeading",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"cancellationsEmpty",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"cancellationsCounts",{enumerable:!0,get:function(){return f}});var n=r(_d[0]),t=r(_d[1]);const o=n=>n?n.split('+').map(n=>n.trim()).filter(Boolean):[],i='#17140F',a='#6B5A35',l='#F3E7CC',c='#B8AA8A',s={online:'Website',phone:'Phone','in-person':'In person','walk-in':'Walk-in',email:'Email','third-party':'Third party'},d=(n,t)=>{if(!n)return null;const o=new Date(n);if(Number.isNaN(o.getTime()))return null;const i=o.toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'});return o.toLocaleDateString('en-CA',{timeZone:'Europe/London'})===t?i:`${o.toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'Europe/London'})}, ${i}`};function u(n){const t=n;if('noshow'===n.status)return t.cancelled?.by?`Marked no-show by ${t.cancelled.by}`:'Marked no-show';if(t.cancelled?.by)return t.cancelled.by;const o=!!t.wix?.status&&/CANCEL|DECLIN/i.test(t.wix.status);return o&&t.wix?.archived?'Cancelled and archived in Website bookings':o?'Cancelled in Website bookings':(n.tags??[]).some(n=>n.endsWith(': deposit not paid'))||'PAYMENT_INFORMATION_PENDING'===t.wix?.status?'Website booking not finished (deposit not paid)':t.wix?.archived?'Archived in Website bookings':'Not recorded'}function b(i,a){const l=i,c=o(i.table??l.cancelled?.table??void 0),b=c.length?`Table ${(0,n.tableNumbers)(c.join('+'))}`:'No table',p=`${i.partySize} ${1===i.partySize?'person':'people'}`,h=d(l.cancelled?.at??(l.wix?l.wix.updatedDate:null),i.date),f=u(i),w=i.walkIn?'Walk-in':s[i.source??'']??(l.wix?'Website':'Not recorded'),y=(0,t.allergyLine)(i),C='noshow'===i.status,N=`${C?'No-show':'Cancelled'}: ${a}, ${y?`allergy noted: ${y}, `:''}${p}, was ${i.time}, ${b.toLowerCase()}. ${f}${h?` at ${h}`:''}.`;return{id:i.id,date:i.date,name:a,people:p,time:i.time,table:b,tables:c,walkIn:!!i.walkIn,by:f,when:h,source:w,notes:(i.notes??'').trim(),allergy:y,spoken:N,kind:C?'noshow':'cancelled'}}const p=n=>`Cancellations & no-shows ${n}`,h=(n="today")=>`No cancellations or no-shows ${n}.`,f=n=>{const t=n.filter(n=>'noshow'===n.kind).length,o=n.length-t;return`${o} ${1===o?'cancellation':'cancellations'} \xb7 ${t} ${1===t?'no-show':'no-shows'}`}},1402,[843,1380]); __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.CancellationsSection=function({items:e,dayWord:b="today",testID:y="display-cancellations"}){const[p,C]=(0,l.useState)(null),j=(0,s.cancellationsHeading)(e.length);return(0,u.jsxs)(o.default,{testID:y,style:{marginTop:14,borderRadius:12,backgroundColor:s.CANCEL_TINT,borderWidth:1,borderColor:s.CANCEL_BORDER,padding:10,gap:6},children:[(0,u.jsxs)(o.default,{accessible:!0,accessibilityRole:"header",accessibilityLabel:e.length?`${j}: ${(0,s.cancellationsCounts)(e)}. Not counted in Covers.`:`Cancellations and no-shows: none ${b}.`,style:{alignItems:'center',gap:2},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:c.colours.gold,center:!0,testID:"cancellations-head",children:j}),e.length?(0,u.jsx)(n.T,{size:14,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-counts",children:(0,s.cancellationsCounts)(e)}):null]}),e.length?e.map(e=>(0,u.jsxs)(t.default,{testID:`cancel-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.spoken,accessibilityHint:"Opens the details. Read only.",onPress:()=>C(e),dataSet:{centreExempt:'list-row'},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:'rgba(214,180,106,0.18)',backgroundColor:e?'#241F16':'transparent'}),children:[(0,u.jsxs)(o.default,{style:{flexDirection:'row',gap:10,alignItems:'flex-start'},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{width:58,textDecorationLine:'line-through'},children:e.time}),(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:e.name}),(0,u.jsx)(o.default,{testID:`cancel-kind-${e.id}`,style:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:'noshow'===e.kind?c.colours.amber:s.CANCEL_BORDER},children:(0,u.jsx)(n.T,{size:13,weight:"semibold",colour:'noshow'===e.kind?c.colours.amber:s.CANCEL_MUTED,children:'noshow'===e.kind?'No-show':'Cancelled'})}),e.allergy?(0,u.jsx)(o.default,{style:{paddingTop:1},children:(0,u.jsx)(h.AllergyIcon,{text:e.allergy,size:20,colour:"#D6A23A",ink:"#17140F",testID:`cancel-allergy-${e.id}`})}):null]}),(0,u.jsxs)(n.T,{size:15,colour:s.CANCEL_MUTED,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[e.people," \xb7 ",e.table," \xb7 ",e.by,e.when?` \xb7 ${e.when}`:'']})]},e.id)):(0,u.jsx)(n.T,{size:15,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-empty",children:(0,s.cancellationsEmpty)(b)}),p?(0,u.jsx)(x,{c:p,onClose:()=>C(null)}):null]})},_e.CancelDetail=x;var l=r(d[0]),t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]);function b({k:e,v:l}){return(0,u.jsxs)(o.default,{accessible:!0,accessibilityLabel:`${e}: ${l}`,style:{flexDirection:'row',gap:10,paddingVertical:6,borderBottomWidth:1,borderColor:c.colours.hairline},children:[(0,u.jsx)(n.T,{size:16,colour:c.colours.muted,style:{width:130},children:e}),(0,u.jsx)(n.T,{size:16,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l})]})}function x({c:e,onClose:l}){return(0,u.jsxs)(n.Sheet,{visible:!0,onClose:l,title:`${'noshow'===e.kind?'No-show':'Cancelled'} \xb7 ${e.name}`,maxWidth:560,testID:"cancel-detail",children:[(0,u.jsxs)(o.default,{testID:"cancel-detail-body",style:{gap:2},children:[(0,u.jsx)(b,{k:"Name",v:e.name}),(0,u.jsx)(b,{k:"Party",v:e.people}),e.allergy?(0,u.jsx)(b,{k:"Allergies",v:e.allergy}):null,(0,u.jsx)(b,{k:"Was booked for",v:`${e.date?`${new Date(`${e.date}T12:00:00`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})}, `:''}${e.time}`}),(0,u.jsx)(b,{k:"Table",v:e.table}),(0,u.jsx)(b,{k:'noshow'===e.kind?'No-show':'Cancelled by',v:e.by}),(0,u.jsx)(b,{k:"When",v:e.when??'Not recorded'}),(0,u.jsx)(b,{k:"Booked by",v:e.source}),(0,u.jsx)(b,{k:"Notes",v:e.notes||'None'})]}),(0,u.jsx)(n.T,{size:14,colour:c.colours.muted,center:!0,children:"Read only. Not counted in Covers. Phone numbers stay in the Managers app."})]})}},1403,[17,385,85,777,1402,804,1359,8]); diff --git a/owner-desktop/index.html b/owner-desktop/index.html index fe7b0da34cba013ce6c0fea7bf6ade57a57d67f5..2ce70298647ec3114d25e0fa6f7ce9582c285268 100644 --- a/owner-desktop/index.html +++ b/owner-desktop/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-desktop/owner.html b/owner-desktop/owner.html index ec0a71f196c83f5b0b81a0639b2ec634fdc269f4..cd3967d18f5568c29ca65c5f4752640ed6966aee 100644 --- a/owner-desktop/owner.html +++ b/owner-desktop/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-desktop/sw.js b/owner-desktop/sw.js index 53b8d62fac508e27cdcda1d46acb640f05a7e874..614f97f7e9701b692e3a264c872fa295b701d519 100644 --- a/owner-desktop/sw.js +++ b/owner-desktop/sw.js @@ -1,7 +1,7 @@ // Anchorage owners desktop service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-desk-2bb5c124ae"; +const V = "cc-desk-97df25f49b"; const BASE = "/owner-desktop/"; -const PRECACHE = ["/owner-desktop/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-desktop/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-desktop/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-desktop/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-desktop/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-desktop/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-desktop/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-desktop/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-desktop/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-desktop/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-desktop/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-desktop/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-desktop/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-desktop/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-desktop/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-desktop/favicon.ico", "/owner-desktop/index.html", "/owner-desktop/_expo/static/js/web/bundle.js?v=2bb5c124ae07c7de69ed4b9c0feb4d0206d7f2ebba9d21f2e15d4a3158965665"]; +const PRECACHE = ["/owner-desktop/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-desktop/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-desktop/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-desktop/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-desktop/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-desktop/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-desktop/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-desktop/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-desktop/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-desktop/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-desktop/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-desktop/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-desktop/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-desktop/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-desktop/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-desktop/favicon.ico", "/owner-desktop/index.html", "/owner-desktop/_expo/static/js/web/bundle.js?v=97df25f49b01d1de4a331fa87b17022cf167c47173286e37f0d9797eece928f9"]; // 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/_expo/static/js/web/bundle.js b/staff-app/_expo/static/js/web/bundle.js index ac4daaa04ce31e10e4447e3db2bb089a41a23e89..eaa94b48cb92f924fbe49dfa7f9b8a4c0c379e9c 100644 --- a/staff-app/_expo/static/js/web/bundle.js +++ b/staff-app/_expo/static/js/web/bundle.js @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__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.201'},979,[]); +__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.202'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1247,7 +1247,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,"FOH_ROLE_BADGES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"KITCHEN_ROLE_BADGES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ROLE_BADGES",{enumerable:!0,get:function(){return o}}),e.cleanBadge=c,Object.defineProperty(e,"isKitchenBadge",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isFohBadge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"badgeSpoken",{enumerable:!0,get:function(){return f}}),e.assignShiftBadge=b,e.assignKitchenShiftBadge=function(n,t,o){const s=String(o??'').trim();return s&&!u(s)?n:b(n,t,s?c(s):void 0)},e.applyLiveKitchenBadge=function(n,t,o){const s=String(o??'').trim();if(s&&!u(s))return n;const f=s?c(s):void 0;return n.map(n=>n.id===t?{...n,badge:f}:n)};const n=['Bar','Floor'],t=['Upstairs KP','Downstairs KP','Sauce','Larder'],o=[...n,...t];function c(n){const t=String(n??'').trim().toLowerCase();return o.find(n=>n.toLowerCase()===t)}const u=n=>{const o=c(n);return!!o&&t.includes(o)},s=t=>{const o=c(t);return!!o&&n.includes(o)},f=n=>c(n)?`, on ${c(n)}`:'';function b(n,t,o){const u=c(o);return n.map(n=>n.id===t?{...n,badge:u,changed:!!n.published||n.changed}:n)}},1164,[]); __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.useSuggestions=j,_e.OrdersScreen=function({focus:e}={}){const[s,t]=(0,n.useState)('sheets');return(0,x.jsxs)(l.default,{style:{gap:12},children:[(0,x.jsx)(y.Seg,{value:s,onChange:t,options:[{id:'sheets',label:'Order sheets'},{id:'suggested',label:'Suggested orders'},{id:'history',label:'Order history'}]}),'sheets'===s?(0,x.jsx)(m.OrderSheets,{focus:e}):'suggested'===s?(0,x.jsx)(w,{}):(0,x.jsx)($,{})]})};var s=r(_d[0]),t=r(_d[1]),n=r(_d[2]),i=e(r(_d[3])),l=e(r(_d[4])),d=r(_d[5]),o=r(_d[6]),u=r(_d[7]),c=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),f=r(_d[12]),m=r(_d[13]),x=r(_d[14]);const b=(e,s)=>'kg'===s?Math.ceil(2*e)/2:Math.ceil(e);function j(){const{k:e,now:s,rid:n}=(0,y.useChef)(6e4),{pct:i}=(0,y.useForecast)(),l=(0,u.supplierView)('chef',(0,o.useOwner)(e=>e.suppliers)).filter(e=>!e.archived),d=1+Math.max(0,i)/100;return l.map(i=>{const l=e.ingredients.filter(e=>e.supplierId===i.id).map(e=>({i:e,qty:(0,t.fishInStone)(n,e)?(0,t.fromStone)(Math.ceil(2*(0,t.toStone)(Math.max(0,e.par*d-e.onHand),e.unit))/2,e.unit):b(Math.max(0,e.par*d-e.onHand),e.unit)})).filter(e=>e.qty>0),o=(0,p.weekday)(s),u=i.orderDays.includes(o),[c,h]=(i.cutoff||'23:59').split(':').map(Number),y=new Date(s);y.setHours(c,h,0,0);const f=e.orders.some(e=>e.supplierId===i.id&&new Date(e.at).toDateString()===s.toDateString()),m=[1,2,3,4,5,6,7].map(e=>(o+e)%7).find(e=>i.orderDays.includes(e));return{s:i,lines:l,ordersToday:u,cutPassed:s>y,placedToday:f,nextDay:m,total:Math.round(l.reduce((e,s)=>e+s.qty*s.i.cost,0))}}).filter(e=>e.lines.length||e.ordersToday)}function w(){const{me:e,rid:o}=(0,y.useChef)(),{label:u,covers:m,enough:b,booked:w}=(0,y.useForecast)(),$=(0,f.useKitchen)(e=>e.addOrder),S=j(),[C,M]=(0,n.useState)({}),[O,k]=(0,n.useState)('');return(0,x.jsxs)(l.default,{style:{gap:10},children:[(0,x.jsxs)(d.Muted,{children:[b?`Built from par levels and today's forecast (${m} Covers, ${u} vs a typical day).`:`Built from par levels (no forecast yet: not enough history; ${w} Covers booked so far).`," Adjust, then call the supplier or use their ordering website. Nothing is sent by CoverCharge."]}),O?(0,x.jsx)(d.Banner,{kind:"success",title:"Saved to order history",children:O}):null,S.map(({s:n,lines:u,ordersToday:y,cutPassed:f,placedToday:m,nextDay:b,total:j})=>{const w=u.map(e=>({...e,q:C[`${n.id}:${e.i.id}`]??e.qty})),S=Math.round(w.reduce((e,s)=>e+s.q*s.i.cost,0)),O=s=>{$({supplierId:n.id,by:e,status:s,lines:w.filter(e=>e.q>0).map(e=>({ing:e.i.id,qty:e.q,cost:e.i.cost})),total:S}),k(`${n.name}: ${(0,c.gbp)(S)} (${s}).`)};return(0,x.jsxs)(d.Card,{highlight:!y||m||f?void 0:h.colours.gold,children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{weight:"semibold",children:n.name}),(0,x.jsxs)(d.Muted,{children:[n.category," \xb7 min order ",(0,c.gbp)(n.minOrder)]})]}),m?(0,x.jsx)(d.Badge,{kind:"ok",label:"ORDERED TODAY"}):y?(0,x.jsx)(d.Badge,{kind:f?'red':'amber',label:f?`CUT-OFF ${n.cutoff} PASSED`:`ORDER BY ${n.cutoff}`}):(0,x.jsx)(d.Badge,{label:`NEXT ${null!=b?p.DAY3[b].toUpperCase():'\u2014'}`})]}),w.length?w.map(e=>(0,x.jsxs)(d.Row,{wrap:!0,style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.default,{style:{flex:1},children:[(0,x.jsx)(d.T,{size:14,children:e.i.name}),(0,x.jsxs)(d.Muted,{children:["On hand ",(0,s.ingredientQty)(o,e.i,e.i.onHand)," \xb7 par ",(0,s.ingredientQty)(o,e.i,e.i.par)]})]}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"Less",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone less':'Less'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,-1)}))}),(0,x.jsx)(l.default,{accessible:!0,accessibilityLabel:(0,s.ingredientSpeech)(o,e.i,e.q),children:(0,x.jsx)(d.T,{size:16,style:{minWidth:76,textAlign:'center'},children:(0,s.ingredientQty)(o,e.i,e.q)})}),(0,x.jsx)(d.Button,{small:!0,kind:"ghost",label:"More",accessibilityLabel:`${(0,t.fishInStone)(o,e.i)?'Half a stone more':'More'} ${e.i.name}`,onPress:()=>M(s=>({...s,[`${n.id}:${e.i.id}`]:(0,t.stepQuantity)(o,e.i,e.q,1)}))})]},e.i.id)):(0,x.jsx)(d.Muted,{children:"Everything is at par."}),w.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(d.T,{weight:"semibold",children:["Estimated ",(0,c.gbp)(S)]}),S{i.default.openURL(`tel:${n.phones[0].replace(/\s/g,'')}`).catch(()=>{}),O('placed (by phone)')}}):null,n.website?(0,x.jsx)(d.Button,{small:!0,kind:"secondary",label:"Open website",onPress:()=>{i.default.openURL(n.website).catch(()=>{}),O('placed (on website)')}}):null]})]}):null,void 0]},n.id)})]})}function $(){const{k:e,rid:t}=(0,y.useChef)(),n=(0,o.useOwner)(e=>e.suppliers);return(0,x.jsx)(l.default,{style:{gap:8},children:e.orders.map(i=>(0,x.jsxs)(d.Card,{children:[(0,x.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(d.T,{weight:"semibold",style:{flex:1},children:n.find(e=>e.id===i.supplierId)?.name}),(0,x.jsx)(d.Badge,{kind:"neutral",label:i.status.toUpperCase()})]}),(0,x.jsxs)(d.Muted,{children:[new Date(i.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",i.by,i.total?` \xb7 ${(0,c.gbp)(i.total)}`:'']}),i.lines.length?(0,x.jsx)(d.Muted,{children:i.lines.map(n=>{const i=e.ingredients.find(e=>e.id===n.ing);return`${(0,s.ingredientQty)(t,i??{name:n.ing,unit:''},n.qty)} ${i?.name??n.ing}`}).join(', ')}):null]},i.id))})}},1165,[1148,943,17,362,85,777,876,955,851,804,1055,1140,1000,1166,8]); __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.openLink=w,_e.useSheetReminders=C,_e.OrderSheets=function({focus:e}){const{rid:t,now:l}=(0,x.useChef)(3e4),o=(0,u.useSheets)(t).filter(e=>(0,n.chefCanSee)(t,e)&&!e.placeholder),[h,c]=(0,s.useState)(e??null),p=C(),f=(0,b.wd)(l);return(0,j.jsxs)(d.default,{style:{gap:10},testID:"order-sheets",children:[(0,j.jsx)(i.Banner,{kind:"info",title:"Nothing is sent for you",children:"Text, WhatsApp and phone orders open your phone\u2019s own app with the order already written. Check it, then press Send yourself."}),p.map(e=>(0,j.jsx)(r.default,{accessibilityRole:"button",onPress:()=>c(e.supplierId),children:(0,j.jsxs)(i.Banner,{kind:'red'===e.tone?'danger':'warn',title:`\u23f0 ${e.text}`,children:["Tap to open the ",e.name," order sheet."]})},e.supplierId)),(0,j.jsxs)(i.Muted,{children:["Today is ",b.DAYS[f],". Edit suppliers in Managers \u203a Settings \u203a Supplier order sheets."]}),o.map(e=>(0,j.jsx)($,{s:e,open:h===e.id,onToggle:()=>c(h===e.id?null:e.id)},e.id)),o.length?null:(0,j.jsx)(i.Muted,{children:"No order sheets yet. Add suppliers in Managers \u203a Settings \u203a Supplier order sheets."})]})};var t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),s=_r(_d[3]),o=e(_r(_d[4]));_r(_d[5]);var r=e(_r(_d[6])),d=e(_r(_d[7])),i=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),b=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),j=_r(_d[17]);function w(e){if('undefined'!=typeof window){const t=window;return'function'==typeof t.__ccOpenLink?void t.__ccOpenLink(e):void(/^https?:/.test(e)?window.open(e,'_blank','noopener'):window.location.href=e)}o.default.openURL(e).catch(()=>{})}async function k(e){try{const t='undefined'!=typeof navigator?navigator:null;if(t?.clipboard?.writeText)return await t.clipboard.writeText(e),!0}catch{}return!1}const S={online:'\ud83c\udf10',phone:'\ud83d\udcde',text:'\ud83d\udcac',whatsapp:'\u2706',tbc:'\ud83d\udd8a\ufe0f'},T={borderWidth:1,borderColor:f.colours.border,borderRadius:10,paddingHorizontal:12,paddingVertical:10,color:f.colours.text,backgroundColor:f.colours.surface2,fontSize:f.font.body};function C(){const{rid:e,now:t}=(0,x.useChef)(6e4),l=(0,u.useSheets)(e).filter(t=>(0,n.chefCanSee)(e,t)&&!t.placeholder),s=(0,u.useOrderSheets)(e=>e.opened),o=(0,h.useShellfish)(e,'','chef'),r=(0,b.remindersFor)(l,t,s);for(const n of l){const l=o.items.filter(e=>(e.supplierId===n.id||!e.supplierId&&n.shellfish)&&o.isLow(e.key));!l.length||s[n.id]&&new Date(s[n.id]).toDateString()===t.toDateString()||r.push({supplierId:n.id,name:n.name,text:`${'text'===n.method||'whatsapp'===n.method?'Text':'Order from'} ${n.contact||n.name}: ${l.map(t=>`${(0,c.fmtStockCount)(e,t,o.counts[t.key]??0)} ${t.plural.toLowerCase()}`).join(' and ')} left`,tone:'amber',cutoffPassed:!1})}return r}function $({s:e,open:n,onToggle:o}){const{rid:C,r:$,me:D,now:I}=(0,x.useChef)(3e4),v=(0,u.useOrderSheets)(e=>e.patch),M=(0,u.useOrderSheets)(e=>e.markOpened),B=(0,u.useOrderSheets)(t=>t.opened[e.id]),[L,P]=(0,s.useState)({}),[O,R]=(0,s.useState)(''),[A,z]=(0,s.useState)(''),[_,W]=(0,s.useState)(!1),H=(0,h.useShellfish)(C,D,'chef'),K=(0,b.nextDelivery)(e,I),E=(0,b.orderLines)(e,L,O,C),N=($.address??$.location??'').split(',').map(e=>e.trim()).filter(Boolean),q=N.length>=3?N[1]:N[0]??'',U=(0,b.orderMessage)(e,$.name,q,E,D.split(' ')[0],I),Q=e.orderDays.includes((0,b.wd)(I)),Y=(e,t)=>P(n=>({...n,[e.id]:(0,l.stepQuantity)(C,e,n[e.id]||0,t)})),F=t=>{M(e.id,I.toISOString()),w(t)},G='text'===e.method||'whatsapp'===e.method||'phone'===e.method,V=Math.round(100*((0,y.parseMoneyInput)(A)??NaN)),J=H.items.filter(t=>t.supplierId===e.id||!t.supplierId&&e.shellfish),X=J.filter(e=>H.isLow(e.key));return(0,j.jsxs)(d.default,{testID:`sheet-${e.id}`,style:{borderRadius:14,borderWidth:1.5,borderColor:Q||X.length?f.colours.amber:n?f.colours.gold:f.colours.border,backgroundColor:f.colours.surface,overflow:'hidden'},children:[(0,j.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.name} order sheet`,onPress:o,style:{padding:12,gap:4},children:[(0,j.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(i.T,{weight:"semibold",size:f.font.large,style:{flex:1},children:[S[e.method]," ",e.name]}),(0,j.jsx)(i.Badge,{kind:e.placeholder?'amber':'gold',label:e.placeholder?'To fill in':b.METHOD_LABEL[e.method]})]}),(0,j.jsx)(i.Muted,{children:e.goods}),(0,j.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.deliveryDays.length?(0,j.jsx)(i.Badge,{kind:"neutral",label:`Delivers ${(0,b.dayRange)(e.deliveryDays)}`}):null,e.orderDays.length?(0,j.jsx)(i.Badge,{kind:Q?'amber':'neutral',label:`Order ${(0,b.dayRange)(e.orderDays)}${e.cutoff?` by ${e.cutoff}`:''}`}):null,e.frequency?(0,j.jsx)(i.Badge,{kind:"neutral",label:e.frequency}):null,e.priceCapPerKg?(0,j.jsx)(i.Badge,{kind:"blue",label:`Cap ${(0,p.gbp)(e.priceCapPerKg)}/kg`}):null,J.length?(0,j.jsx)(i.Badge,{kind:X.length?'amber':'ok',label:J.map(e=>`${e.icon} ${(0,c.fmtStockCount)(C,e,H.counts[e.key]??0)}`).join(' \xb7 ')}):null,B&&new Date(B).toDateString()===I.toDateString()?(0,j.jsx)(i.Badge,{kind:"ok",label:"Opened today \u2713"}):null]})]}),n?(0,j.jsxs)(d.default,{style:{padding:12,paddingTop:0,gap:10},children:[K?(0,j.jsxs)(i.Muted,{children:["Next delivery if you order now: ",(0,b.niceDay)(K),"."]}):null,e.reminder?(0,j.jsxs)(i.Muted,{children:["Reminder on ",e.orderDays.map(e=>b.DAYS[e]).join(', '),": ",e.reminder]}):null,e.notes?(0,j.jsx)(i.T,{size:f.font.small,colour:f.colours.muted,children:e.notes}):null,e.placeholder?(0,j.jsx)(i.Banner,{kind:"warn",title:"Still to be set up",children:"Add the supplier, how to order and delivery days in Managers \u203a Settings \u203a Supplier order sheets."}):null,e.items.map(e=>(0,j.jsxs)(d.default,{style:{gap:6},children:[(0,j.jsxs)(i.T,{children:[e.name,e.unit?(0,j.jsxs)(i.T,{size:f.font.small,colour:f.colours.muted,children:[" (",(0,l.quantityUnit)(C,e),")"]}):null]}),(0,j.jsxs)(i.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone less':'Less'} ${e.name}`,onPress:()=>Y(e,-1),style:{minWidth:44,minHeight:44}}),(0,j.jsx)(d.default,{accessible:!0,accessibilityLabel:(0,l.fishQtySpeech)(C,e,L[e.id]||0),children:(0,j.jsx)(i.T,{weight:"bold",size:20,style:{minWidth:76,textAlign:'center'},children:(0,l.fishInStone)(C,e)?(0,l.fishQtyText)(C,e,L[e.id]||0):L[e.id]||0})}),(0,j.jsx)(i.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`${(0,l.fishInStone)(C,e)?'Half a stone more':'More'} ${e.name}`,testID:`qty-${e.id}`,onPress:()=>Y(e,1),style:{minWidth:44,minHeight:44}})]})]},e.id)),(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsx)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:"Anything else (one line each)"}),(0,j.jsx)(t.TextInput,{value:O,onChangeText:R,multiline:!0,placeholder:"e.g. 2 boxes lemons",placeholderTextColor:f.colours.muted,style:[T,{minHeight:60}]})]}),G?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['whatsapp'===e.method?'WhatsApp number':'phone'===e.method?'Phone number':'Mobile number',e.number?'':' (blank: fill in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`number-${e.id}`,value:e.number,onChangeText:t=>v(C,e.id,{number:t}),keyboardType:"phone-pad",placeholder:"07\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,'online'===e.method?(0,j.jsxs)(d.default,{style:{gap:4},children:[(0,j.jsxs)(i.T,{size:f.font.small,weight:"medium",colour:f.colours.muted,children:['Open Coldweb'===e.urlLabel?'Coldweb ordering link':'Website link',e.url?'':' (blank: paste it in once, it is saved)']}),(0,j.jsx)(t.TextInput,{testID:`url-${e.id}`,value:e.url,onChangeText:t=>v(C,e.id,{url:t.trim()}),autoCapitalize:"none",keyboardType:"url",placeholder:"https://\u2026",placeholderTextColor:f.colours.muted,style:T})]}):null,e.priceCapPerKg?(0,j.jsxs)(d.default,{style:{gap:6,padding:10,borderRadius:12,backgroundColor:f.colours.blueBg},children:[(0,j.jsxs)(i.T,{weight:"semibold",colour:"#E2C489",children:["Price cap ",(0,p.gbp)(e.priceCapPerKg),"/kg \xb7 buy from the cheapest UK seller under it"]}),(0,j.jsxs)(i.Muted,{children:["Seller: ",e.seller||'to be chosen']}),(0,j.jsxs)(i.Row,{gap:8,children:[(0,j.jsx)(i.T,{size:f.font.small,style:{flex:1},children:"Price you found (\xa3/kg)"}),(0,j.jsx)(t.TextInput,{testID:"price-found",value:A,onChangeText:e=>z((0,y.sanitiseMoneyTyping)(e)),keyboardType:"decimal-pad",inputMode:"decimal",placeholder:"e.g. 22.50",placeholderTextColor:f.colours.muted,style:[T,{width:120}]})]}),V>0?(0,j.jsx)(i.Badge,{kind:V<=e.priceCapPerKg?'ok':'red',label:V<=e.priceCapPerKg?`${(0,p.gbp)(V)}/kg is under the cap \u2713`:`${(0,p.gbp)(V)}/kg is over the ${(0,p.gbp)(e.priceCapPerKg)} cap: look for a cheaper seller`}):null]}):null,'online'!==e.method&&'tbc'!==e.method?(0,j.jsxs)(d.default,{testID:`preview-${e.id}`,style:{padding:10,borderRadius:12,borderWidth:1,borderColor:f.colours.border,backgroundColor:f.colours.surface2},children:[(0,j.jsx)(i.T,{size:12,weight:"semibold",colour:f.colours.gold,children:'phone'===e.method?'READ THIS OUT':'YOUR MESSAGE'}),(0,j.jsx)(i.T,{size:f.font.small,children:E.length?U:'Add quantities above to write the order.'})]}):null,(0,j.jsxs)(i.Row,{wrap:!0,gap:8,children:['text'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"\ud83d\udcac Open in Messages",disabled:!E.length,onPress:()=>F((0,b.smsLink)(e.number,U))}):null,'whatsapp'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:"Open in WhatsApp",disabled:!E.length,onPress:()=>F((0,b.waLink)(e.number,U))}):null,'phone'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83d\udcde Call ${e.name}`,disabled:!e.number,onPress:()=>F((0,b.telLink)(e.number))}):null,'online'===e.method?(0,j.jsx)(i.Button,{testID:`send-${e.id}`,kind:"success",label:`\ud83c\udf10 ${e.urlLabel??'Open website'}`,disabled:!e.url,onPress:()=>F(e.url)}):null,'online'!==e.method&&'tbc'!==e.method&&E.length?(0,j.jsx)(i.Button,{kind:"ghost",label:_?'Copied \u2713':'Copy order',onPress:async()=>{const e=await k(U);W(e),e&&setTimeout(()=>W(!1),2e3)}}):null]}),'text'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: Messages opens with the order written and asks who to send it to."}):null,'whatsapp'===e.method&&!e.number&&E.length?(0,j.jsx)(i.Muted,{children:"No number saved: WhatsApp opens with the order written and asks who to send it to."}):null,'phone'!==e.method||e.number?null:(0,j.jsx)(i.Muted,{children:"Add the phone number above to call from here."}),'online'!==e.method||e.url?null:(0,j.jsx)(i.Muted,{children:"Add the link above and the button opens it."})]}):null]})}},1166,[812,820,943,17,362,219,385,85,777,998,942,944,851,999,804,1140,840,8]); -__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:i,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),i?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:i}):null]}):null,n||w.length||!i?null:(0,j.jsx)(l.default,{accessibilityRole:"button",onPress:i,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:i?()=>{k(!1),i()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const i=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!i.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${i.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,i.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:i.items.map((t,s)=>{const o=i.counts[t.key]??0,l=d[t.key]??0,h=Math.max(0,o-l),m=h<=0,b=m||i.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:l?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,l)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return z}}),_e.ShellfishChip=M,_e.SundayRoastChip=function(e){return(0,j.jsx)(M,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),i=e(_r(_d[5])),l=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(i.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:i,group:l}){const d=(0,h.useShellfish)(e,s,r,l),m='roast'===l,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const i=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,i,o):Math.max(0,Math.min(99,i+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),z=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),M=(0,o.useRef)(null);M.current||(M.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!M.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,H]=(0,o.useState)(0),F=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?z:D>0,W=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!F.length)return;const e=setInterval(()=>H(e=>e+1),600);return()=>clearInterval(e)},[R.state,F.length]);const P=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void W('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?W('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?W('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-P.current>2e4&&W('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||F.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||F.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${F.length} ${1===F.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&z&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),P.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!z,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),i?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:i}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const z=18;function M({rid:e,by:t,app:r,size:i="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(m&&'roast'===d&&(!f.items.length||!(0,u.isSundayIn)(T)))return(0,j.jsx)(R,{size:i});if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const M='m'===i?20:17,E='roast'!==d,B=E&&f.items.some(e=>(k[e.key]??0)>0),H=B?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==i&&!B;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${E&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,i=p[t.key]??0,d=Math.max(0,n-i),h=d<=0,m=h||f.isLow(t.key),b=E?k[t.key]??0:0,x=h?y.colours.red:E&&'display'!==r?y.colours.shellfishFree:m&&!E?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:B?4:6,paddingHorizontal:B?5:9,paddingVertical:3,flexShrink:0,minWidth:B?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,M-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:M-2}),(0,j.jsx)(c.T,{size:M,weight:"bold",colour:x,style:{lineHeight:M+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(l.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:z,minWidth:z,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):B?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:z,width:z,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,H)})`})}):null,!F||!(i||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':i?`${(0,u.fmtStockCount)(e,t,i)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),i=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),l=(0,f.reservedBookingsOn)(r,i,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(i))}),l.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}function R({size:e}){return(0,j.jsxs)(a.default,{testID:"roast-slot",accessible:!0,accessibilityLabel:"Sunday roast count: shown on Sundays",style:{minHeight:44,minWidth:'xs'===e?64:84,paddingHorizontal:10,borderRadius:12,borderWidth:1,borderColor:y.colours.hairline,backgroundColor:'rgba(255,255,255,0.03)',flexDirection:'row',alignItems:'center',justifyContent:'center',gap:6},children:[(0,j.jsx)(c.T,{size:'m'===e?14:12,colour:y.colours.muted,children:"Roast"}),(0,j.jsx)(c.T,{size:'m'===e?18:16,weight:"bold",colour:y.colours.muted,children:"\u2013"})]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); +__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,"isTextIcon",{enumerable:!0,get:function(){return v}}),_e.StockIcon=w,_e.useReservedToday=$,_e.useReservedTomorrow=L,_e.ShellfishTile=function({rid:e,by:t,app:s,big:n,onOrder:l,style:d,readOnly:m=!1}){const b=(0,h.useShellfish)(e,t,s),f=$(e),[p,k]=(0,o.useState)(!1),x=T(e,b.items.find(e=>e.supplierId)?.supplierId),v=(0,r.useLiveState)();if('ready'!==v)return(0,j.jsx)(r.LiveWait,{state:v,title:"Lobsters & crabs",testID:"shellfish-wait"});if(!b.items.length)return null;const w=b.items.filter(e=>b.isLow(e.key)),C=b.items.length<=3?b.items.map(e=>e.plural.toUpperCase()).join(' & '):'LIVE STOCK';return(0,j.jsxs)(a.default,{testID:"shellfish-tile",style:[{borderRadius:16,borderWidth:1.5,borderColor:w.length?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface,padding:n?10:12,gap:6},d],children:[(0,j.jsxs)(i.default,{accessibilityRole:"button",accessibilityLabel:`${b.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)}`).join(', ')}${m?'':'. Tap to update'}`,onPress:()=>{m||k(!0)},disabled:m,style:{gap:4,flex:n?1:void 0},children:[(0,j.jsxs)(c.Row,{wrap:!0,gap:6,style:{justifyContent:'space-between'},children:[(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:["LIVE \xb7 ",C]}),m?null:(0,j.jsx)(c.T,{size:12,colour:y.colours.muted,children:"Tap to update \u203a"})]}),(0,j.jsx)(c.Row,{gap:n?14:18,style:{flex:n?1:void 0,alignItems:'center'},children:b.items.map(t=>{const s=b.counts[t.key]??0,o=b.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,s)}`,style:{flex:1,alignItems:'center'},children:[(0,j.jsx)(c.T,{size:n?42:34,weight:"bold",colour:s<=0?y.colours.red:o?y.colours.amber:y.colours.text,style:{lineHeight:n?50:42},children:(0,u.fmtStockCount)(e,t,s)}),(0,j.jsxs)(c.T,{size:13,colour:o?y.colours.amber:y.colours.muted,children:[S(t),s<=0?' \xb7 out':o?' \xb7 low':'']}),f[t.key]?(0,j.jsxs)(c.T,{size:12,weight:"semibold",colour:y.colours.goldLight,children:["Reserved: ",(0,u.fmtStockCount)(e,t,f[t.key])," \xb7 free ",(0,u.fmtStockCount)(e,t,Math.max(0,s-f[t.key]))]}):null]},t.key)})})]}),!n&&w.length?(0,j.jsxs)(a.default,{testID:"shellfish-low",style:{backgroundColor:y.colours.amberBg,borderRadius:10,padding:8,gap:6},children:[(0,j.jsxs)(c.T,{size:13,weight:"semibold",colour:"#FFE2A8",children:["Low stock: ",w.map(t=>`${(0,u.fmtStockCount)(e,t,b.counts[t.key]??0)} ${t.plural.toLowerCase()} (warns at ${(0,u.fmtStockCount)(e,t,t.lowAt)})`).join(', ')]}),l?(0,j.jsx)(c.Button,{small:!0,label:x?`Order from ${x} \u203a`:'Order sheets \u203a',testID:"shellfish-order",onPress:l}):null]}):null,n||w.length||!l?null:(0,j.jsx)(i.default,{accessibilityRole:"button",onPress:l,style:{minHeight:44,justifyContent:'center'},children:(0,j.jsx)(c.T,{size:13,colour:y.colours.gold,children:x?`${x} order sheet \u203a`:'Order sheets \u203a'})}),p?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>k(!1),onOrder:l?()=>{k(!1),l()}:void 0}):null]})},_e.ShellfishStrip=function({rid:e,by:t,app:s,height:r=76}){const l=(0,h.useShellfish)(e,t,s),d=$(e),[m,b]=(0,o.useState)(!1);if(!l.items.length)return null;const f=r>=80,p=Math.max(28,Math.min(52,Math.round(.6*r))),k=Math.max(22,Math.min(34,Math.round(.42*r)));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:"shellfish-tile",accessibilityRole:"button",accessibilityLabel:`${l.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,l.counts[t.key]??0)}`).join(', ')}. Tap to update`,onPress:()=>b(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'stretch',height:r,backgroundColor:e?'#181612':'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...n.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.07) 0%, rgba(207,164,95,0.015) 100%)',cursor:'pointer'})}),children:l.items.map((t,s)=>{const o=l.counts[t.key]??0,i=d[t.key]??0,h=Math.max(0,o-i),m=h<=0,b=m||l.isLow(t.key);return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,h)}`,style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:f?16:12,borderLeftWidth:s?1:0,borderLeftColor:'rgba(207,164,95,0.16)',backgroundColor:b?'rgba(255,107,94,0.07)':'transparent',...n.look.web(b?{backgroundImage:'linear-gradient(180deg, rgba(255,107,94,0.11) 0%, rgba(255,107,94,0.035) 100%)'}:{})},children:[v(t.icon)?null:(0,j.jsx)(w,{icon:t.icon,size:k}),(0,j.jsx)(c.T,{size:p,weight:"bold",colour:b?'#FF8E82':y.colours.text,style:{lineHeight:Math.round(1.15*p),letterSpacing:-.5,minWidth:Math.round(.85*p),textAlign:'center'},children:(0,u.fmtStockCount)(e,t,h)}),(0,j.jsxs)(a.default,{style:{gap:0},children:[(0,j.jsx)(c.T,{size:f?15:13,weight:"semibold",colour:b?'#FFB3AA':y.colours.goldLight,style:{letterSpacing:2},children:t.plural.toUpperCase()}),b&&r>=60?(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"#FF8E82",style:{letterSpacing:1.5},children:m?'NONE LEFT':`LOW \xb7 WARNS AT ${(0,u.fmtStockCount)(e,t,t.lowAt)}`}):null,(0,j.jsxs)(c.T,{size:f?14:12,weight:"semibold",colour:i?y.colours.goldLight:'#857D6E',style:{letterSpacing:.5},children:["Reserved: ",(0,u.fmtStockCount)(e,t,i)]})]})]},t.key)})}),m?(0,j.jsx)(D,{rid:e,by:t,app:s,onClose:()=>b(!1)}):null]})},_e.ShellfishPanel=D,Object.defineProperty(_e,"SHELLFISH_CHIP_N_SLOT",{enumerable:!0,get:function(){return M}}),_e.ShellfishChip=z,_e.SundayRoastChip=function(e){return(0,j.jsx)(z,{...e,group:"roast"})};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),r=_r(_d[3]),n=_r(_d[4]),l=e(_r(_d[5])),i=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),m=_r(_d[12]),y=_r(_d[13]),b=_r(_d[14]),f=_r(_d[15]),p=_r(_d[16]),k=_r(_d[17]),x=_r(_d[18]),j=_r(_d[19]);const v=e=>!!e&&/[A-Za-z]{2,}/.test(e);function w({icon:e,size:t}){const s=e?d.STOCK_ICON_IMAGES[e.trim()]:void 0;if(!s)return(0,j.jsx)(c.T,{size:t,children:e});const o=Math.round(1.25*t),r=o/Math.max(s.w,s.h);return(0,j.jsx)(a.default,{testID:"stock-icon-img",style:{width:o,height:o,alignItems:'center',justifyContent:'center',flexShrink:0},children:(0,j.jsx)(l.default,{source:{uri:s.uri},accessible:!1,style:{width:Math.round(s.w*r),height:Math.round(s.h*r)},resizeMode:"contain"})})}const S=e=>v(e.icon)&&e.icon.trim().toLowerCase()===e.plural.trim().toLowerCase()?e.plural:`${e.icon??''} ${e.plural}`.trim(),C=e=>new Date(e).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'});function $(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=(0,p.venueYmd)((0,b.useNow)(6e4));return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}const I=(e,t)=>{const[s,o,r]=e.split('-').map(Number),n=new Date(Date.UTC(s,o-1,r+t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,'0')}-${String(n.getUTCDate()).padStart(2,'0')}`};function L(e){const t=(0,b.useBookings)(e),s=(0,b.useRestaurant)(e),o=I((0,p.venueYmd)((0,b.useNow)(6e4)),1);return(0,f.reservedOn)(t,o,(0,f.reservablesOf)(s))}function T(e,t){const s=(0,m.useSheets)(e);return t?s.find(e=>e.id===t)?.name:void 0}function D({rid:e,by:s,app:r,onClose:n,onOrder:l,group:i}){const d=(0,h.useShellfish)(e,s,r,i),m='roast'===i,[b,f]=(0,o.useState)({}),p=m?Object.fromEntries(d.items.map(e=>[e.key,b[e.key]??Math.max(0,Math.round(d.counts[e.key]??0))])):b,[v,w]=(0,o.useState)(null),$=T(e,d.items.find(e=>e.supplierId)?.supplierId),I=(s,o)=>{const r=d.itemOf(s);r&&f(n=>{const l=n[s]??(m?Math.max(0,Math.round(d.counts[s]??0)):0);return{...n,[s]:(0,t.fishInStone)(e,r)?(0,t.stepQuantity)(e,r,l,o):Math.max(0,Math.min(99,l+o))}})},L=(e,t=!1)=>{const s=d.itemOf(e);d.sell(e,t)&&w(('kg'===s?.unit?`Half a stone ${s.name.toLowerCase()}`:t?`Half ${s?.name.toLowerCase()}`:`1 ${s?.name.toLowerCase()}`)+" sold.")},D=Object.values(p).reduce((e,t)=>e+t,0),M=m&&d.items.some(e=>null!=b[e.key]&&b[e.key]!==Math.round(d.counts[e.key]??0)),z=(0,o.useRef)(null);z.current||(z.current=new Set(d.events.map(e=>e.id)));const O=d.events.filter(e=>!z.current.has(e.id)),[R,E]=(0,o.useState)({state:'idle'}),[B,F]=(0,o.useState)(0),H=O.filter(e=>'saved'!==(0,x.stockEventStatus)(e.id).state),A=m?M:D>0,P=(e,t)=>{E({state:e,text:t}),(0,k.announce)(t)};(0,o.useEffect)(()=>{if('saving'!==R.state&&!H.length)return;const e=setInterval(()=>F(e=>e+1),600);return()=>clearInterval(e)},[R.state,H.length]);const W=(0,o.useRef)(0);(0,o.useEffect)(()=>{if('saving'!==R.state)return;const e=O.map(e=>e.id).map(e=>(0,x.stockEventStatus)(e)),t=e.find(e=>'refused'===e.state);if(t)return void P('error',`Not saved. ${t.why.charAt(0).toUpperCase()}${t.why.slice(1)}.`);const s=(0,x.stockSaveBlocker)();s&&e.some(e=>'saved'!==e.state)?P('error',`Not saved yet: ${s}.`):e.every(e=>'saved'===e.state)?P('saved',m?'Saved. Every screen now shows this roast count.':'Saved. Every screen now shows this count.'):Date.now()-W.current>2e4&&P('error','Not saved yet: the shared system has not answered. Check the connection, then press Save changes again.')},[R.state,B,O.length]);const N='saving'!==R.state&&(A||H.length>0),_='saving'===R.state?'Saving\u2026':'saved'!==R.state||A||H.length?'error'===R.state?R.text:N?A?'You have changes to save.':`${H.length} ${1===H.length?'change':'changes'} not confirmed yet.`:'Nothing to save: no changes since you opened this.':R.text,U=(0,j.jsxs)(a.default,{testID:m?'roast-save-box':'shellfish-save-box',style:{gap:6,alignItems:'center',alignSelf:'stretch'},children:[(0,j.jsx)(c.Button,{testID:m?'roast-save':'shellfish-save',kind:"primary",label:'saving'===R.state?'Saving\u2026':'Save changes',disabled:!N,accessibilityLabel:'saving'===R.state?'Saving':N?'Save changes':'Save changes, nothing to save',onPress:()=>{m&&M&&(d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({})),!m&&D&&(d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),f({})),W.current=Date.now(),E({state:'saving',text:'Saving\u2026'}),(0,k.announce)('Saving'),setTimeout(()=>{(0,x.saveStockEventsNow)()},50)},style:{minHeight:56,alignSelf:'stretch'}}),(0,j.jsx)(a.default,{testID:m?'roast-save-status':'shellfish-save-status',accessibilityLiveRegion:"polite",style:{alignSelf:'stretch'},children:(0,j.jsx)(c.T,{center:!0,size:14,colour:'error'===R.state?'#FFB3AA':'saved'===R.state?y.colours.goldLight:y.colours.muted,children:_})})]});return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:n,title:m?`Sunday roast: ${d.items.map(e=>e.plural).join(' & ')}`:d.items.map(e=>e.plural).join(' & ')||'Tracked stock',maxWidth:620,testID:m?'roast-panel':'shellfish-panel',footer:U,children:[(0,j.jsx)(c.Row,{gap:10,wrap:!0,style:{alignItems:'stretch'},children:d.items.map(s=>{const o=d.counts[s.key]??0;return(0,j.jsxs)(a.default,{style:{flex:1,minWidth:160,gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:d.isLow(s.key)?y.colours.amber:y.colours.border,backgroundColor:y.colours.surface2},children:[(0,j.jsx)(c.T,{center:!0,size:13,colour:y.colours.muted,children:S(s)}),(0,j.jsx)(c.T,{center:!0,size:48,weight:"bold",colour:d.isLow(s.key)?y.colours.amber:y.colours.text,style:{lineHeight:56},children:(0,u.fmtStockCount)(e,s,o)}),(0,j.jsx)(c.Button,{label:(0,t.fishInStone)(e,s)?`Sold half a stone ${s.name.toLowerCase()}`:`Sold 1 ${s.name.toLowerCase()} \u22121`,testID:`sell-${s.key}`,disabled:o<((0,t.fishInStone)(e,s)?t.HALF_STONE_KG:1),onPress:()=>L(s.key),style:{minHeight:56}}),'half'===s.unit?(0,j.jsx)(c.Button,{kind:"secondary",label:"Sold a half \u2212\xbd",testID:`sell-${s.key}-half`,disabled:o<.5,onPress:()=>L(s.key,!0),style:{minHeight:52}}):(0,j.jsx)(a.default,{style:{minHeight:52}})]},s.key)})}),(0,j.jsx)(c.Button,{kind:"ghost",label:d.undoable?`\u21b6 Undo: ${(0,u.describe)(d.undoable,d.itemOf(d.undoable.kind))}`:'\u21b6 Nothing to undo',testID:m?'roast-undo':'shellfish-undo',disabled:!d.undoable,onPress:()=>{const e=d.undoable;d.undoLast(),e&&w(`Undone: ${(0,u.describe)(e,d.itemOf(e.kind))}.`)}}),v?(0,j.jsx)(c.Banner,{kind:"success",title:v}):null,(0,j.jsxs)(a.default,{testID:m?'roast-load':'delivery-in',style:{gap:8,padding:10,borderRadius:14,borderWidth:1,borderColor:y.colours.gold,backgroundColor:y.colours.goldTint},children:[(0,j.jsx)(c.T,{weight:"semibold",colour:y.colours.goldLight,children:m?'Count before service':'Delivery in'}),d.items.map(s=>(0,j.jsxs)(c.Row,{gap:10,children:[(0,j.jsx)(c.T,{style:{flex:1},children:S(s)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:m?`One less ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone less':'Fewer'} ${s.plural.toLowerCase()} in`,testID:`in-minus-${s.key}`,onPress:()=>I(s.key,-1),style:{minWidth:48,minHeight:48}}),(0,j.jsx)(c.T,{size:24,weight:"bold",style:{minWidth:76,textAlign:'center'},children:(0,u.fmtStockCount)(e,s,p[s.key]||0)}),(0,j.jsx)(c.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:m?`One more ${s.name.toLowerCase()}, now ${p[s.key]||0}`:`${(0,t.fishInStone)(e,s)?'Half a stone more':'More'} ${s.plural.toLowerCase()} in`,testID:`in-plus-${s.key}`,onPress:()=>I(s.key,1),style:{minWidth:48,minHeight:48}}),(0,t.fishInStone)(e,s)?null:(0,j.jsx)(c.Button,{small:!0,kind:"ghost",label:"Add five",onPress:()=>I(s.key,5)})]},s.key)),m?(0,j.jsx)(c.Button,{kind:"success",label:`Set today\u2019s count: ${d.items.map(e=>`${p[e.key]||0} ${e.name.toLowerCase()}`).join(' and ')}`,testID:"roast-set",disabled:!M,onPress:()=>{d.items.forEach(e=>{null!=b[e.key]&&d.recount(e.key,Math.max(0,Math.round(b[e.key])))}),f({}),w('Today\u2019s roast count is set.')},style:{minHeight:54}}):(0,j.jsx)(c.Button,{kind:"success",label:D?`Add to stock: ${d.items.filter(e=>p[e.key]).map(t=>`${(0,u.fmtStockCount)(e,t,p[t.key])} ${(1===p[t.key]?t.name:t.plural).toLowerCase()}`).join(' and ')}`:'Add to stock',testID:"delivery-add",disabled:!D,onPress:()=>{d.items.forEach(e=>d.deliver(e.key,p[e.key]??0)),w('Delivery added to the count.'),f({})},style:{minHeight:54}})]}),l?(0,j.jsx)(c.Button,{kind:"secondary",label:$?`${$} order sheet \u203a`:'Order sheets \u203a',onPress:l}):null,(0,j.jsxs)(a.default,{style:{gap:2},children:[(0,j.jsx)(c.T,{size:12,weight:"semibold",colour:y.colours.gold,children:"RECENT"}),d.events.slice(0,6).map(e=>(0,j.jsxs)(c.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(c.T,{size:13,style:{flex:1},children:(0,u.describe)(e,d.itemOf(e.kind))}),(0,j.jsxs)(c.Muted,{children:[C(e.at)," \xb7 ",e.by.replace(' (example)','')]})]},e.id))]}),(0,j.jsx)(c.Row,{wrap:!0,gap:6,children:d.synced?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"ok",label:"Shared live"}),(0,j.jsx)(c.Muted,{children:"Every paired device sees the same count."})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.Badge,{kind:"neutral",label:"Saved on this device"}),(0,j.jsx)(c.Muted,{children:"Not connected to the shared venue yet."})]})})]})}const M=18;function z({rid:e,by:t,app:r,size:l="m",group:d,slot:m=!1}){const f=(0,h.useShellfish)(e,t,r,d),p=$(e),k=L(e),[x,S]=(0,o.useState)(!1),[C,I]=(0,o.useState)(null),T=(0,b.useNow)(3e4);if(!f.items.length)return null;if('roast'===d&&!(0,u.isSundayIn)(T))return null;const z='m'===l?20:17,R='roast'!==d,E=R&&f.items.some(e=>(k[e.key]??0)>0),B=E?Math.max(0,...f.items.map(e=>k[e.key]??0)):0,F='xs'!==l&&!E;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{testID:'roast'===d?'roast-tile':'shellfish-tile',accessibilityRole:"button",accessibilityLabel:`${'roast'===d?'Sunday roast: ':''}${f.items.map(t=>`${t.plural} ${(0,u.fmtStockCount)(e,t,Math.max(0,(f.counts[t.key]??0)-(p[t.key]??0)))} available${R&&k[t.key]?`, ${k[t.key]} reserved tomorrow`:''}`).join(', ')}. Tap to update`,onPress:()=>S(!0),style:({pressed:e})=>({flexDirection:'row',alignItems:'center',justifyContent:'center',minHeight:44,borderRadius:14,borderWidth:1,borderColor:'rgba(207,164,95,0.30)',overflow:'hidden',backgroundColor:e?'#1C1913':'rgba(207,164,95,0.06)',...n.look.web({cursor:'pointer'})}),children:f.items.map((t,o)=>{const n=f.counts[t.key]??0,l=p[t.key]??0,d=Math.max(0,n-l),h=d<=0,m=h||f.isLow(t.key),b=R?k[t.key]??0:0,x=h?y.colours.red:R&&'display'!==r?y.colours.shellfishFree:m&&!R?y.colours.amber:y.colours.text,S=`(${(0,u.fmtStockCount)(e,t,b>0?b:0)})`;return(0,j.jsxs)(a.default,{testID:`count-${t.key}`,accessible:!0,accessibilityLabel:`${t.plural} ${(0,u.speakStockCount)(e,t,d)}${b?`, ${b} reserved tomorrow`:''}`,style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:E?4:6,paddingHorizontal:E?5:9,paddingVertical:3,flexShrink:0,minWidth:E?62:void 0,borderLeftWidth:o?1:0,borderLeftColor:'rgba(207,164,95,0.18)',backgroundColor:m?'rgba(255,107,94,0.10)':'transparent'},children:[v(t.icon)?(0,j.jsx)(c.T,{size:Math.max(11,z-7),weight:"semibold",colour:y.colours.goldLight,numberOfLines:1,center:!0,style:{flexShrink:0},children:t.icon}):(0,j.jsx)(w,{icon:t.icon,size:z-2}),(0,j.jsx)(c.T,{size:z,weight:"bold",colour:x,style:{lineHeight:z+4},children:(0,u.fmtStockCount)(e,t,d)}),b>0?(0,j.jsx)(i.default,{testID:`reserved-tomorrow-${t.key}`,accessibilityRole:"button",accessibilityLabel:`${b} ${t.plural} reserved tomorrow. Opens the list of bookings.`,onPress:e=>{e?.stopPropagation?.(),I(t.key)},hitSlop:12,style:{flexShrink:0,justifyContent:'center',alignItems:'center',width:M,minWidth:M,overflow:'hidden'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:y.colours.red,center:!0,children:S})}):E?(0,j.jsx)(a.default,{testID:`reserved-tomorrow-slot-${t.key}`,accessible:!1,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:{minWidth:M,width:M,flexShrink:0,overflow:'hidden',justifyContent:'center',alignItems:'center'},children:(0,j.jsx)(c.T,{size:11,weight:"semibold",colour:"transparent",center:!0,children:`(${(0,u.fmtStockCount)(e,t,B)})`})}):null,!F||!(l||h||m)||h&&s.IS_CAR?null:(0,j.jsx)(c.T,{size:10,weight:"semibold",colour:h||m?'#FFB3AA':y.colours.goldLight,children:h?'none left':l?`${(0,u.fmtStockCount)(e,t,l)} res`:'low'})]},t.key)})}),x?(0,j.jsx)(D,{rid:e,by:t,app:r,group:d,onClose:()=>S(!1)}):null,C?(0,j.jsx)(O,{rid:e,stockKey:C,label:f.items.find(e=>e.key===C)?.plural??C,onClose:()=>I(null)}):null]})}function O({rid:e,stockKey:t,label:s,onClose:o}){const r=(0,b.useBookings)(e),n=(0,b.useRestaurant)(e),l=I((0,p.venueYmd)((0,b.useNow)(6e4)),1),i=(0,f.reservedBookingsOn)(r,l,(0,f.reservablesOf)(n),t),d=s.charAt(0).toUpperCase()+s.slice(1);return(0,j.jsxs)(c.Sheet,{visible:!0,onClose:o,title:`${d} reserved tomorrow`,testID:`reserved-tomorrow-sheet-${t}`,children:[(0,j.jsx)(c.T,{size:16,colour:y.colours.muted,children:(0,p.niceDateYear)((0,p.parseYmd)(l))}),i.map(({booking:e,qty:t})=>(0,j.jsxs)(a.default,{testID:`reserved-tomorrow-row-${e.id}`,style:{paddingVertical:10,borderTopWidth:1,borderColor:y.colours.hairline,gap:4},children:[(0,j.jsx)(c.T,{size:18,weight:"semibold",children:e.name}),(0,j.jsxs)(c.T,{size:15,colour:y.colours.muted,children:[(e.time||'').slice(0,5)," \xb7 ",e.partySize," ",1===e.partySize?'cover':'covers']}),(0,j.jsxs)(c.T,{size:15,weight:"semibold",colour:y.colours.red,children:[t," reserved"]})]},e.id))]})}},1167,[943,856,17,945,1168,319,385,85,1169,777,944,942,998,804,858,1053,863,1095,946,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"look",{enumerable:!0,get:function(){return n}}),r(d[0]);var o=r(d[1]);const b=o=>o,n={panel:{backgroundColor:'#121110',borderRadius:o.radii.xl,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',boxShadow:'0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 28px rgba(0,0,0,0.45)'},quiet:(b,n="gold")=>({minHeight:o.control.tall,borderRadius:o.radii.button,borderWidth:1,borderColor:'blue'===n?'rgba(226,196,137,0.55)':'rgba(207,164,95,0.38)',backgroundColor:b?'rgba(207,164,95,0.16)':'blue'===n?'rgba(226,196,137,0.10)':'rgba(255,255,255,0.035)',paddingHorizontal:14,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:8,boxShadow:'0 1px 0 rgba(255,255,255,0.05) inset',transition:'background-color 120ms ease'}),primary:o=>({backgroundColor:o?'#B8904F':'#CFA45F',borderWidth:1,borderColor:'rgba(255,226,170,0.55)',backgroundImage:o?'linear-gradient(180deg, #BE9552 0%, #A88143 100%)':'linear-gradient(180deg, #E0BA77 0%, #C69A55 100%)',boxShadow:o?'0 2px 8px rgba(0,0,0,0.4)':'0 1px 0 rgba(255,255,255,0.28) inset, 0 10px 24px rgba(207,164,95,0.22), 0 4px 10px rgba(0,0,0,0.45)',transition:'box-shadow 120ms ease'}),onPrimary:'#17130D',web:b}},1168,[219,811]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STOCK_ICON_IMAGES",{enumerable:!0,get:function(){return A}});const A={'\ud83e\udd9e':{uri:'data:image/png;base64,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',w:47,h:64},'\ud83e\udd80':{uri:'data:image/png;base64,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',w:64,h:45}}},1169,[]); __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.StockScreen=function({initial:e="levels"}){const[t,i]=(0,l.useState)(e);return(0,y.jsxs)(r.default,{style:{gap:12},children:[(0,y.jsx)(p.Seg,{value:t,onChange:i,options:[{id:'levels',label:'Stock levels'},{id:'take',label:'Stock take'},{id:'deliveries',label:'Deliveries in'}]}),'levels'===t?(0,y.jsx)(j,{}):'take'===t?(0,y.jsx)(f,{}):(0,y.jsx)(v,{})]})};var t=_r(_d[0]),i=_r(_d[1]),n=_r(_d[2]),s=_r(_d[3]),l=_r(_d[4]),d=e(_r(_d[5])),r=e(_r(_d[6])),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]);function j(){const{k:e,rid:t}=(0,p.useChef)(),d=(0,c.useOwner)(e=>e.suppliers),b=(0,i.useSheets)(t),[x,j]=(0,l.useState)('all'),f=e.ingredients.filter(e=>e.onHand<=0),v=e.ingredients.filter(e=>(0,p.isLow)(e.onHand,e.par)),k='alerts'===x?[...f,...v]:e.ingredients,S=[...new Set(k.map(e=>e.supplierId))].map(e=>{const t=d.find(t=>t.id===e),i=b.find(t=>t.id===e);return{id:e,name:t?.name||i?.name||'Supplier not linked',category:t?.category||i?.goods||'Stock'}});return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsxs)(o.Row,{wrap:!0,gap:10,children:[(0,y.jsx)(p.Tile,{label:"Stock value (at cost)",value:(0,u.gbp)((0,p.stockValue)(e.ingredients)),sub:`${e.ingredients.length} ingredients`}),(0,y.jsx)(p.Tile,{label:"Low or out",value:`${v.length+f.length}`,sub:`${f.length} out \xb7 ${v.length} below half par`,tone:f.length?'red':v.length?'amber':'ok',onPress:()=>j('alerts')})]}),f.length?(0,y.jsxs)(o.Banner,{kind:"danger",title:"Out of stock",children:[f.map(e=>e.name).join(', '),". Mark the dishes that need it as sold out (Kitchen \u203a Live tickets \u203a Sold out), or order now."]}):null,(0,y.jsx)(p.Seg,{value:x,onChange:j,options:[{id:'all',label:'All'},{id:'alerts',label:'Alerts only'}]}),e.ingredients.length?null:(0,y.jsx)(o.Muted,{children:"No stock items yet. Add your real ingredients to start counting."}),S.map(e=>(0,y.jsxs)(o.Card,{children:[(0,y.jsxs)(o.T,{weight:"semibold",children:[e.category," \xb7 ",e.name]}),k.filter(t=>t.supplierId===e.id).map(e=>{const i=e.onHand<=0?'out':(0,p.isLow)(e.onHand,e.par)?'low':'ok';return(0,y.jsxs)(r.default,{style:{gap:4,paddingVertical:4},accessible:!0,accessibilityLabel:`${e.name} ${(0,n.ingredientSpeech)(t,e,e.onHand)} of par ${(0,n.ingredientSpeech)(t,e,e.par)}`,children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},children:e.name}),'out'===i?(0,y.jsx)(o.Badge,{kind:"red",label:"OUT"}):'low'===i?(0,y.jsx)(o.Badge,{kind:"amber",label:"LOW"}):null,(0,y.jsxs)(o.T,{size:13,colour:h.colours.muted,children:[(0,n.ingredientQty)(t,e,e.onHand)," / par ",(0,n.ingredientQty)(t,e,e.par)]})]}),(0,y.jsx)(p.Bar,{pct:e.onHand/e.par*100,colour:'out'===i?h.colours.red:'low'===i?h.colours.amber:h.colours.gold}),(0,y.jsxs)(o.Muted,{children:[(0,u.gbp)(Math.round((0,s.displayedCost)(t,e,e.cost)))," per ",(0,s.quantityUnit)(t,e)," \xb7 value ",(0,u.gbp)(Math.round(e.onHand*e.cost))]})]},e.id)})]},e.id))]})}function f(){const{k:e,me:i,rid:d}=(0,p.useChef)(),c=(0,b.useKitchen)(e=>e.saveStockTake),[x,j]=(0,l.useState)({}),[f,v]=(0,l.useState)(''),k=e.ingredients.map(e=>{const t=x[e.id],i=void 0===t||''===t?void 0:Number(t.replace(',','.')),n=void 0!==i&&Number.isFinite(i)&&i>=0&&(!(0,s.fishInStone)(d,e)||2*i===Math.round(2*i))?(0,s.inputQuantity)(d,e,i):void 0,l=void 0===n||Number.isNaN(n)?void 0:n-e.onHand;return{i:e,counted:n,variance:l,cost:void 0===l?0:Math.round(l*e.cost)}}),S=k.filter(e=>void 0!==e.variance),w=S.reduce((e,t)=>e+t.cost,0);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Count what's on the shelves. Expected = last count + deliveries \u2212 waste. Fish is entered in stone, in half-stone steps. Variance shows what's unexplained (portioning, theft, missed waste)."}),e.stockTakes[0]?(0,y.jsxs)(o.Muted,{children:["Last stock take ",new Date(e.stockTakes[0].at).toLocaleDateString('en-GB')," by ",e.stockTakes[0].by,": variance ",(0,u.gbp)(Math.round(e.stockTakes[0].lines.reduce((e,t)=>e+(t.counted-t.expected)*t.cost,0))),"."]}):null,(0,y.jsx)(o.Card,{children:k.map(({i:e,variance:i,cost:l})=>(0,y.jsxs)(r.default,{style:{gap:6,paddingVertical:8},children:[(0,y.jsxs)(r.default,{accessible:!0,accessibilityLabel:`${e.name}, expected ${(0,n.ingredientSpeech)(d,e,e.onHand)}`,children:[(0,y.jsx)(o.T,{size:16,children:e.name}),(0,y.jsxs)(o.Muted,{children:["Expected ",(0,n.ingredientQty)(d,e,e.onHand)]})]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,style:{justifyContent:'space-between'},children:[(0,y.jsx)(t.TextInput,{accessibilityLabel:`Count ${e.name} in ${(0,s.quantityUnit)(d,e)}`,accessibilityValue:{text:x[e.id]?(0,n.ingredientSpeech)(d,e,(0,s.inputQuantity)(d,e,Number(x[e.id]))):'Not counted'},keyboardType:"decimal-pad",placeholder:(0,s.quantityUnit)(d,e),placeholderTextColor:h.colours.muted,value:x[e.id]??'',onChangeText:t=>j(i=>({...i,[e.id]:t})),style:{minHeight:44,width:80,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:8,paddingVertical:6,color:h.colours.text,textAlign:'right'}}),(0,s.fishInStone)(d,e)?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Half a stone less ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String(Math.max(0,(0,s.halfStone)(Number(t[e.id])||0)-.5))}))}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Half a stone more ${e.name}`,onPress:()=>j(t=>({...t,[e.id]:String((0,s.halfStone)(Number(t[e.id])||0)+.5)}))})]}):null,(0,y.jsx)(r.default,{style:{minWidth:86,alignItems:'flex-end'},accessible:!0,accessibilityLabel:void 0===i?'No variance yet':`${(0,n.ingredientSpeech)(d,e,i)} variance, ${(0,u.gbp)(l)}`,children:void 0===i?(0,y.jsx)(o.Muted,{children:"\u2014"}):(0,y.jsxs)(o.T,{size:14,colour:Math.abs(i)<.001?h.colours.ok:i<0?h.colours.red:h.colours.amber,children:[i>0?'+':'',(0,n.ingredientQty)(d,e,i),'\n',(0,u.gbp)(l)]})})]})]},e.id))}),(0,y.jsxs)(o.Banner,{kind:w<0?'warn':'info',title:`Variance so far: ${(0,u.gbp)(w)}`,children:[S.length," of ",e.ingredients.length," counted."]}),(0,y.jsx)(o.Button,{label:"Save stock take",disabled:!S.length,onPress:()=>{const e={};S.forEach(t=>{e[t.i.id]=t.counted}),c(e,i),j({}),v(`Saved: ${S.length} items, variance ${(0,u.gbp)(w)}. Stock levels updated.`)}}),f?(0,y.jsx)(o.Banner,{kind:"success",title:"Stock take saved",children:f}):null]})}function v(){const{k:e,me:t}=(0,p.useChef)(),i=(0,c.useOwner)(e=>e.suppliers),[n,s]=(0,l.useState)(e.deliveries.find(e=>'expected'===e.status)?.id??null);return(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(o.Muted,{children:"Check each delivery against the order: count it in, check the invoice price, flag shorts and price changes. Accepting adds it to stock and updates costs (and GP)."}),e.deliveries.map(e=>{const l=i.find(t=>t.id===e.supplierId);return(0,y.jsxs)(o.Card,{highlight:n===e.id?h.colours.gold:void 0,children:[(0,y.jsx)(d.default,{accessibilityRole:"button",accessibilityLabel:`Delivery from ${l?.name}`,onPress:()=>s(n===e.id?null:e.id),children:(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(o.T,{weight:"semibold",children:l?.name??'Supplier'}),(0,y.jsx)(o.Muted,{children:'expected'===e.status?`Due ${e.due} \xb7 ${e.lines.length} lines`:`Accepted by ${e.checkedBy} ${e.at?new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`})]}),(0,y.jsx)(o.Badge,{kind:'expected'===e.status?'amber':'ok',label:'expected'===e.status?'TO CHECK':'ACCEPTED'})]})}),n===e.id?(0,y.jsx)(k,{id:e.id,me:t}):null]},e.id)})]})}function k({id:e,me:i}){const{k:d,rid:c}=(0,p.useChef)(),b=d.deliveries.find(t=>t.id===e),[j,f]=(0,l.useState)(b.lines.map(e=>({...e}))),v=(e,t)=>f(i=>i.map(i=>i.ing===e?{...i,...t}:i)),k='expected'!==b.status,S=(0,l.useMemo)(()=>j.map(e=>{const t=d.ingredients.find(t=>t.id===e.ing),i=e.receivede.short>0),$=S.filter(e=>Math.abs(e.pct)>=.5),C=j.reduce((e,t)=>e+t.received*t.price,0);return(0,y.jsxs)(r.default,{style:{gap:8,marginTop:8},children:[S.map(({l:e,i:i,short:l,pct:d})=>(0,y.jsxs)(r.default,{style:{gap:4,borderTopWidth:1,borderColor:h.colours.border,paddingTop:6},children:[(0,y.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(o.T,{style:{flex:1},weight:"medium",children:i.name}),l?(0,y.jsx)(o.Badge,{kind:"red",label:`SHORT ${(0,n.ingredientQty)(c,i,l)}`}):null,Math.abs(d)>=.5?(0,y.jsx)(o.Badge,{kind:"amber",label:`PRICE ${d>0?'+':''}${d.toFixed(0)}%`}):null]}),(0,y.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,y.jsxs)(o.Muted,{children:["Ordered ",(0,n.ingredientQty)(c,i,e.ordered)]}),(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Received (",(0,s.quantityUnit)(c,i),")"]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Received ${i.name} in ${(0,s.quantityUnit)(c,i)}`,accessibilityValue:{text:(0,n.ingredientSpeech)(c,i,e.received)},keyboardType:"decimal-pad",value:String((0,s.fishInStone)(c,i)?(0,s.halfStone)((0,s.toStone)(e.received,i.unit)):e.received),onChangeText:t=>v(e.ing,{received:(0,s.inputQuantity)(c,i,Number(t.replace(',','.'))||0)}),style:{minHeight:44,width:60,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]}),(0,s.fishInStone)(c,i)&&!k?(0,y.jsxs)(o.Row,{children:[(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"Less",accessibilityLabel:`Receive half a stone less ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,-1)})}),(0,y.jsx)(o.Button,{small:!0,kind:"secondary",label:"More",accessibilityLabel:`Receive half a stone more ${i.name}`,onPress:()=>v(e.ing,{received:(0,s.stepQuantity)(c,i,e.received,1)})})]}):null,(0,y.jsxs)(o.Row,{gap:4,children:[(0,y.jsxs)(o.Muted,{children:["Invoice \xa3/",(0,s.quantityUnit)(c,i)]}),(0,y.jsx)(t.TextInput,{editable:!k,accessibilityLabel:`Invoice price ${i.name}`,keyboardType:"decimal-pad",inputMode:"decimal",value:((0,s.displayedCost)(c,i,e.price)/100).toFixed(2),onChangeText:t=>v(e.ing,{price:100*((0,x.parseMoneyInput)(t)??0)/((0,s.fishInStone)(c,i)?(0,s.fromStone)(1,i.unit):1)}),style:{minHeight:44,width:70,borderWidth:1,borderColor:h.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:h.colours.text,textAlign:'right'}})]})]}),(0,y.jsxs)(o.Muted,{children:["Last cost ",(0,u.gbp)(Math.round((0,s.displayedCost)(c,i,i.cost)))," per ",(0,s.quantityUnit)(c,i)]})]},e.ing)),(0,y.jsxs)(o.T,{weight:"semibold",children:["Invoice total ",(0,u.gbp)(Math.round(C))]}),w.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Shorts to chase",children:[w.map(e=>`${e.i.name}: ${(0,n.ingredientQty)(c,e.i,e.short)} short`).join(' \xb7 '),". Ask the supplier for a credit note."]}):null,$.length?(0,y.jsxs)(o.Banner,{kind:"warn",title:"Price changes",children:[$.map(e=>`${e.i.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%`).join(' \xb7 '),". Check GP \u203a Price changes once accepted."]}):null,k?(0,y.jsx)(o.Muted,{children:b.note?`Noted: ${b.note}.`:'No issues noted.'}):(0,y.jsx)(o.Button,{label:"Accept delivery into stock",testID:"accept-delivery",onPress:()=>d.acceptDelivery(e,j,i,[w.length?`${w.length} short`:'',$.length?`${$.length} price changes`:''].filter(Boolean).join(', '))})]})}},1170,[812,998,1148,943,17,385,85,777,876,851,804,1140,1000,840,8]); @@ -1407,7 +1407,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}},1324,[812,843,17,85,777,845,851,1150,1325,858,804,8]); __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})},1325,[892,946,1150]); __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]})}},1326,[13,17,856,1327,1401,8]); -__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'center'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1327,[1051,779,805,806,1328,813,1329,1092,843,1137,1330,1331,1332,1089,1118,1333,1334,1339,1340,1199,1341,856,1346,1347,1348,1111,1110,966,1349,1149,938,1102,1350,17,1070,1175,1016,1085,1351,1203,1353,378,363,385,278,85,409,19,777,1223,1227,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1354,1106,1355,1362,1364,1367,1372,1366,1373,1376,1377,1113,1093,1094,862,1382,1212,1383,1222,1214,993,1388,1393,1394,1052,1050,1115,1396,1397,1398,1069,1168,1399,1167,1158,853,1342,1400,8]); +__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 Ze}}),_e2.DisplayBoard=function(e={}){const t=(0,oe.useOwner)(e=>e.site);return(0,le.useRestaurant)(t)?(0,Qe.jsx)(dt,{...e}):(0,Qe.jsx)(q.default,{testID:"display-venue-loading",style:{flex:1,backgroundColor:ie.colours.bg,alignItems:'center',justifyContent:'center',padding:24},children:(0,Qe.jsx)(J.Muted,{center:!0,children:"Loading your venue\u2026"})})};var t=_r(_d[0]),s=_r(_d[1]),l=_r(_d[2]),i=_r(_d[3]),n=_r(_d[4]),o=_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]),f=_r(_d[16]),x=_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=_r(_d[24]),C=_r(_d[25]),T=_r(_d[26]),R=_r(_d[27]),$=_r(_d[28]),B=_r(_d[29]),W=_r(_d[30]),L=_r(_d[31]),z=_r(_d[32]),H=_r(_d[33]),P=e(H),M=_r(_d[34]),A=_r(_d[35]),E=_r(_d[36]),O=_r(_d[37]),N=_r(_d[38]),_=_r(_d[39]),G=_r(_d[40]),F=e(_r(_d[41])),V=e(_r(_d[42])),U=e(_r(_d[43])),K=e(_r(_d[44])),q=e(_r(_d[45])),Y=e(_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]),se=_r(_d[53]),le=_r(_d[54]),ie=_r(_d[55]),ne=_r(_d[56]),oe=_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]),fe=_r(_d[68]),xe=_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]),Re=_r(_d[80]),$e=_r(_d[81]),Be=_r(_d[82]),We=_r(_d[83]),Le=_r(_d[84]),ze=_r(_d[85]),He=_r(_d[86]),Pe=_r(_d[87]),Me=_r(_d[88]),Ae=_r(_d[89]),Ee=_r(_d[90]),Oe=_r(_d[91]),Ne=_r(_d[92]),_e=_r(_d[93]),Ge=_r(_d[94]),Fe=_r(_d[95]),Ve=_r(_d[96]),Ue=_r(_d[97]),Ke=_r(_d[98]),qe=_r(_d[99]),Ye=_r(_d[100]),Qe=_r(_d[101]);const Je='#221C12',Xe='#2E2618',Ze=12e4,et={paddingHorizontal:12,paddingTop:2,paddingBottom:2,alignItems:'center'},tt={flexDirection:'row',flexWrap:'nowrap',justifyContent:'center',alignItems:'center',gap:10,alignSelf:'stretch'},st={width:I.IS_CAR?560:400,maxWidth:'100%',flexShrink:0},lt=e=>(e??'').replace(' (example)',''),it=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),nt=e=>e.slotTime?(0,se.hm)(new Date(e.slotTime)):'ASAP';function ot({items:e,tight:t,phone:s,split:l,inline:i,splitOnly:n}){return(0,Qe.jsxs)(q.default,{style:{borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden',alignSelf:n?'center':'stretch',maxWidth:n?560:void 0,width:n?'100%':void 0,flexDirection:i?'row':'column',alignItems:'center'},children:[n?null:(0,Qe.jsx)(q.default,{style:{flexDirection:'row',flexWrap:s?'wrap':'nowrap',justifyContent:'center',alignItems:'center',flexShrink:i?0:void 0},children:e.map((e,l)=>{const i=(0,Qe.jsxs)(q.default,{testID:e.testID,style:{flex:s?1:void 0,minWidth:s?148:void 0,flexBasis:s?148:void 0,flexDirection:s?'column':'row',alignItems:s?'center':'baseline',justifyContent:s?'center':void 0,gap:6,minHeight:44,paddingHorizontal:t?10:14,paddingVertical:6,borderLeftWidth:l?1:0,borderLeftColor:'rgba(255,255,255,0.07)',backgroundColor:e.alert?'rgba(232,168,56,0.14)':'transparent',...s?{minHeight:76}:{}},children:[(0,Qe.jsx)(J.T,{size:s?24:19,weight:"semibold",colour:e.alert?ie.colours.amber:ie.colours.text,children:e.value}),(0,Qe.jsx)(J.T,{size:s?14:12,colour:ie.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,style:s?{flex:1,minWidth:148,flexBasis:148}:void 0,children:i},e.testID):(0,Qe.jsx)(P.default.Fragment,{children:i},e.testID)})}),l?(0,Qe.jsx)(q.default,{testID:"covers-split",accessible:!0,accessibilityLabel:l.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||n?0:1,borderLeftWidth:i?1:0,borderTopColor:'rgba(207,164,95,0.35)',borderLeftColor:'rgba(207,164,95,0.35)'},children:l.empty?(0,Qe.jsx)(J.T,{size:14,colour:ie.colours.muted,children:"No Covers yet"}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',justifyContent:'center',gap:i?12:18,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",colour:ie.colours.gold,children:`Walk-ins ${l.walkIns} \xb7 ${l.walkInPct}%`}),(0,Qe.jsx)(J.T,{size:i?13:14,weight:"semibold",children:`Bookings ${l.bookings} \xb7 ${l.bookingPct}%`})]}),(0,Qe.jsxs)(q.default,{style:{width:'100%',maxWidth:i?280:420,height:6,borderRadius:3,overflow:'hidden',flexDirection:'row',backgroundColor:'#0B0B0B',borderWidth:1,borderColor:ie.colours.gold},children:[(0,Qe.jsx)(q.default,{style:{width:`${l.walkInPct}%`,backgroundColor:ie.colours.gold}}),(0,Qe.jsx)(q.default,{style:{flex:1,backgroundColor:'#0B0B0B'}})]})]})}):null]})}function at({chipId:e,label:t,sub:s,selected:l,onPress:i,colour:n,compact:o}){return(0,Qe.jsxs)(U.default,{testID:`area-chip-${e}`,accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:`${t}${s?`, ${s}`:''}${l?', selected':''}`,'aria-pressed':l,onPress:i,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',flexShrink:0,gap:o?4:7,minHeight:44,paddingHorizontal:o?6:14,borderRadius:999,borderWidth:1,borderColor:l?'rgba(207,164,95,0.75)':'rgba(255,255,255,0.08)',backgroundColor:l?'rgba(207,164,95,0.16)':e?'rgba(255,255,255,0.06)':'rgba(255,255,255,0.03)'}),children:[n?(0,Qe.jsx)(q.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:n}}):null,(0,Qe.jsx)(J.T,{size:o?12:14,weight:l?'semibold':'medium',colour:l?ie.colours.goldLight:'#CFC8BA',numberOfLines:1,center:!1,children:t}),s?(0,Qe.jsx)(J.T,{size:12,colour:ie.colours.muted,children:s}):null]})}function rt({list:e,me:t,compact:s,bookings:l}){const i=(e,t)=>(0,Ke.statusBlock)(e,t,(0,Ke.linkedBooking)(e,l));return e.length?(0,Qe.jsx)(q.default,{style:{gap:8},children:e.map(e=>(0,Qe.jsxs)(q.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:ie.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?ie.colours.ok:e.allergies.length?ie.colours.red:ie.colours.gold},children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:s?16:18,weight:"bold",children:[nt(e)," \xb7 ",lt(e.customerName)]}),(0,Qe.jsx)(J.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,Qe.jsxs)(J.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,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,te.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Qe.jsx)(Ue.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Qe.jsxs)(J.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Qe.jsx)(J.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>le.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Qe.jsx)(J.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Qe.jsx)(J.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>le.repo.orders.setStatus(e.id,'collected',t)}):null,(0,Qe.jsx)(Re.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,Qe.jsx)(J.Muted,{children:"No takeaway orders right now."})}function dt({embedded:e=!1,boardW:b,headerExtra:te,subHeader:Ue,noVoice:Ke=!1}={}){const nt=(0,Y.default)(),dt=b??nt.width,ut=nt.height,ht=dt<700,gt=dt>=ut,bt=!ht&>&&dt>=600,yt=bt,pt=Math.round(Math.min(520,Math.max(dt>=1e3?448:280,.3*dt))),ft=P.default.useRef(null),xt=P.default.useRef(0),[mt,jt]=(0,H.useState)({w:0,h:0}),wt=(0,oe.useOwner)(e=>e.site),kt=(0,le.useRestaurant)(wt);(0,Be.useAlertWatcher)(wt,{enabled:!e});const It=(0,le.useOrders)(wt),Dt=(0,le.useBookings)(wt),vt=(0,le.useEvents)(wt),St=(0,le.useStore)(e=>e.skipMinutes),Ct=(0,le.useStore)(e=>e.clock.mode),Tt=(0,le.useNow)(5e3),Rt=(0,oe.useOwner)(e=>e.staff),$t=(0,oe.useOwner)(e=>e.attendance),Bt=(0,oe.useOwner)(e=>e.shifts),Wt=(0,oe.useOwner)(e=>e.leave),Lt=P.default.useMemo(()=>(0,_e.workingShifts)(Bt,Wt),[Bt,Wt]);P.default.useEffect(()=>{(0,re.ensureAttendance)((0,se.ymd)(Tt),Tt)},[(0,se.ymd)(Tt)]);const zt=(0,R.useSession)(e=>e.meId),Ht=(0,D.displayActionBy)({isCar:I.IS_CAR,isDisplayApp:'display'===I.APP_VARIANT&&!e,personName:lt(Rt.find(e=>e.id===zt)?.name)}),Pt=I.IS_CAR?'Car':'Display';(0,W.useSoldOutLink)(!1,e?void 0:Pt,!0);const Mt=(0,se.ymd)(Tt),At=(0,A.useTravelDay)('display',Mt),Et=(0,ae.useFrontDoor)(Mt,gt),Ot=(0,de.useDisplaySettings)(wt),Nt=Ot.privacy,_t=(0,xe.useSaverSync)(),Gt=(0,de.usePlan)(wt),Ft=(0,de.useFloor)(e=>e.live[wt]),Vt=(0,We.useBlocks)(e=>e.blocks),[Ut,Kt]=(0,H.useState)('plan'),[qt,Yt]=(0,H.useState)(!1),[Qt,Jt]=(0,H.useState)('all'),[Xt,Zt]=(0,H.useState)(null),[es,ts]=(0,H.useState)(null),[ss,ls]=(0,H.useState)(null),[is,ns]=(0,H.useState)(!1),[os,as]=(0,H.useState)(!1),[rs,ds]=(0,H.useState)(null),[cs,us]=(0,H.useState)(!1),[hs,gs]=(0,H.useState)(!1),[bs,ys]=(0,H.useState)(!1),[ps,fs]=(0,H.useState)(!1),[xs,ms]=(0,H.useState)(null),[js,ws]=(0,H.useState)(null),[ks,Is]=(0,H.useState)(null),[Ds,vs]=(0,H.useState)(!1),Ss=P.default.useRef(0),Cs=e=>{Ss.current=Date.now(),Is(e)};P.default.useEffect(()=>{if(!ks)return;const e=setInterval(()=>{Date.now()-Ss.current>=Pe.DAY_IDLE_MS&&Is(null)},5e3);return()=>clearInterval(e)},[ks]);const Ts=(0,le.useWaitlist)(wt),Rs=(0,le.useStore)(e=>e.walkIns[wt]??0),[$s,Bs]=(0,H.useState)(!1),[Ws,Ls]=(0,H.useState)(!1),[zs,Hs]=(0,H.useState)(!1),[Ps,Ms]=(0,H.useState)(!1);(0,Z.useReviewAlerts)(wt);const[As,Es]=(0,H.useState)({view:0,content:0}),[Os,Ns]=(0,H.useState)(null);P.default.useEffect(()=>{Os&&((0,L.notify)({id:`floor-note:${Date.now()}`,title:Os,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ns(null))},[Os]),P.default.useEffect(()=>{if(!e)return(0,E.setDisplaySilent)(!0),()=>(0,E.setDisplaySilent)(!1)},[e]);const[_s,Gs]=(0,H.useState)(null),Fs=P.default.useRef(0),[Vs,Us]=(0,H.useState)(null);P.default.useEffect(()=>{if(!_s)return;Fs.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Fs.current;if(e>=Ze)return Gs(null),void Ns('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Us(e>=105e3?Math.ceil((Ze-e)/1e3):null)},1e3);return()=>clearInterval(e)},[_s]);const Ks=e=>e.date!==Mt?ls({title:`Guest details \xb7 ${(0,Pe.dayWord)(e.date,Mt)} ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[!e.walkIn&&e.date>Mt?(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${(0,Pe.dayWord)(e.date,Mt)}, ${e.time}`,disabled:!Ii.ok,accessibilityHint:Ii.hint,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}):null,(0,Ce.bookingDetails)(e)]})}):ls({title:`Guest details \xb7 ${e.time}`,body:(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(ct,{rid:wt,id:e.id,turnBase:kt.settings.turnMins}),e.walkIn?null:(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{ls(null),ds(e.id)},style:{minHeight:56}}),e.walkIn?(0,Qe.jsx)(Ie.CancelWalkInButton,{rid:wt,b:e,big:!0,onDone:e=>{ls(null),Ns(e)}}):null,e.walkIn?(0,Qe.jsx)(Ie.ReinstateWalkInButton,{rid:wt,b:e,today:Mt,onDone:e=>{ls(null),Ns(e)}}):null,(0,Ce.bookingDetails)(e)]})}),qs=Dt.filter(e=>e.date===Mt).sort((e,t)=>e.time.localeCompare(t.time)),Ys=qs.filter(e=>!['cancelled','noshow'].includes(e.status)),Qs=It.filter(it).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Js=(0,H.useMemo)(()=>(0,c.forecastToday)(kt,Dt,It,vt,Tt),[kt,Dt,It,vt,Tt.getTime()/6e4|0]),Xs=(0,We.closedAreasAt)(Vt,wt,Mt,(0,se.hm)(Tt)),Zs=[...Xs].join(','),el=(0,H.useMemo)(()=>(0,ce.floorView)(Gt,Dt,It,Ft??{},Tt,kt.settings.turnMins,Xs),[Gt,Dt,It,Ft,Tt.getTime(),Zs]),tl=(0,Se.hoursFor)(kt,Tt),sl=tl?.open??new Date(`${Mt}T12:00:00`),ll=tl?.close??new Date(`${Mt}T21:00:00`),il=(0,se.addMins)(sl,-sl.getMinutes()),nl=(0,se.addMins)(ll,30),ol=e=>new Date(`${Mt}T${e}:00`),al=(0,We.blocksOn)(Vt,wt,Mt).map(e=>({from:ol(e.from),to:ol(e.to),label:e.reason??'Paused'})).concat((0,n.queuedServicePauses)(kt,Tt,Mt)),rl=Object.keys(el).filter(e=>'blocked'===el[e]?.status),dl=ks&&ks!==Mt?ks:Mt,cl=dl!==Mt,ul=(0,Pe.dayWord)(dl,Mt),hl=/^(Today|Yesterday|Tomorrow)$/.test(ul),gl=cl?(0,Pe.bookingsForDay)(Dt,dl,Mt).sort((e,t)=>e.time.localeCompare(t.time)):qs,bl=(0,se.parseYmd)(dl);bl.setHours(12);const yl=cl?(0,Se.hoursFor)(kt,bl):tl,pl=yl?.open??new Date(`${dl}T12:00:00`),fl=yl?.close??new Date(`${dl}T21:00:00`),xl=e=>new Date(`${dl}T${e}:00`),ml=[...cl?(0,We.blocksOn)(Vt,wt,dl).map(e=>({from:xl(e.from),to:xl(e.to),label:e.reason??'Paused'})):al,...cl?(0,n.queuedServicePauses)(kt,bl,dl):[]],jl=(0,n.queuedServiceSessions)(kt,bl),wl=l.IS_QUEUED_VENUE&&(void 0===jl||!jl.length),kl=(0,Qe.jsxs)(q.default,{testID:"queued-hours-gate",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:void 0===jl?'Opening and kitchen hours: to confirm':'Kitchen closed this day'}),(0,Qe.jsx)(J.Muted,{children:i.queuedVenues[wt]?.hours.note})]}),Il=cl?yl||gl.length?dlcl?(0,ce.dayFloorView)(Gt,gl,dl):el,[cl,Gt,gl,dl,el]),[vl,Sl]=(0,H.useState)(null),[Cl,Tl]=(0,H.useState)(null),[Rl,$l]=(0,H.useState)(!1),[Bl,Wl]=(0,H.useState)(null),Ll=cl?gl.filter(e=>!['cancelled','noshow'].includes(e.status)):Ys,zl=Ll.reduce((e,t)=>e+t.partySize,0),Hl=(0,u.coversSplit)(Ll,dl),Pl=(0,Ae.cancelledDayTally)(Dt,dl),Ml=(0,Ee.cancellationsFor)(Dt,dl,e=>e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)','')),Al=(0,Ae.cancelledTallyWords)(Pl,hl?ul.toLowerCase():cl?`on ${ul}`:'today'),El=Vt.filter(e=>e.rid===wt&&e.date===dl&&!e.removedAt),Ol=60*pl.getHours()+pl.getMinutes(),Nl=60*fl.getHours()+fl.getMinutes(),_l=(0,He.chartBands)(El,Ol,Nl),Gl=(0,He.seasonClosedAreaIds)(El,Ol,Nl),Fl=Gl.size?{...Gt,areas:Gt.areas.filter(e=>!Gl.has(e.id)),tables:Gt.tables.filter(e=>!Gl.has(e.areaId))}:Gt,Vl=cl?[]:rl.filter(e=>!Gl.has(Gt.tables.find(t=>t.name===e)?.areaId??'')),Ul=new Set((0,He.blockedHours)(_l)),Kl=Tt.getHours()+(Tt.getMinutes()>=30?1:0),ql=Js.hours.filter(e=>e.hour>=Kl&&!Ul.has(e.hour)),Yl=ql.reduce((e,t)=>e+t.coversHigh,0),Ql=ql.reduce((e,t)=>e+t.coversLow,0),Jl=Math.round((Ql+Yl)/2),Xl=!Js.example&&Js.open&&Js.enough&&Yl>0?`Usually ${(0,c.coversRange)(Jl,Jl)} more`:void 0,Zl=async(e,t)=>{const s=el[e]?.booking;if(!s||e===t)return;const l=el[t]?.status;if(l&&!['free','soon'].includes(l))return void Ns('dirty'===l?`${(0,d.tableNumbers)(t)} needs clearing first.`:`${(0,d.tableNumbers)(t)} is ${ce.STATUS[l].label.toLowerCase()}. Pick a free table.`);if(!(0,De.guardBookingChange)(Ns,{b:s,tables:[t]}))return;await le.repo.bookings.update(s.id,{table:t});const i=Ft?.[e]?.stage;de.useFloor.getState().setLive(wt,t,{stage:i??'seated',dirty:!1}),de.useFloor.getState().setLive(wt,e,{stage:void 0,dirty:!0}),Ns(`Saving: ${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}\u2026`),(0,De.reportBookingSave)(s.id,`${(0,me.privName)(s,Nt)} moved ${(0,d.tableNumbers)(e)} \u2192 ${t}. ${(0,d.tableNumbers)(e)} needs clearing.`,`${(0,me.privName)(s,Nt)} to ${(0,d.tableNumbers)(t)}`,Ns)},ei=e=>{if(js)return Tl(null),void ws(t=>t?{...t,tables:(0,ve.toggleTable)(t.tables,e)}:t);cl?Sl(e):es?(e!==es&&Zl(es,e),ts(null)):Zt(e)},ti=js?Dt.find(e=>e.id===js.id):void 0,si=js&&ti?(()=>{const e=ti.walkIn?(0,me.privName)(ti,Nt):lt(ti.name),t=(0,ve.seatsOf)(Gt,js.tables).total,s=(0,ve.seatLine)(t,ti.partySize),l=(0,ve.pickClashes)(ti,js.tables,Dt.filter(e=>e.date===ti.date),kt.settings.turnMins),i=(0,ve.tableKey)(js.tables)!==(0,ve.tableKey)((0,de.tablesOf)(ti.table));return(0,Qe.jsxs)(q.default,{testID:"plan-pick-bar",style:{gap:6,backgroundColor:ie.colours.goldTint,borderRadius:12,borderWidth:1,borderColor:ie.colours.gold,padding:10},children:[(0,Qe.jsxs)(q.default,{accessible:!0,accessibilityLabel:`Picking tables for ${e}, ${(0,Pe.dayWord)(ti.date,Mt)} ${ti.time}. Tap tables on the plan to add or take them off. ${(0,ve.tablesWords)(js.tables)}. ${s.text}.${l.length?` ${l.length} clash${1===l.length?'':'es'} with other bookings.`:''}`,children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.goldLight,children:["Tap tables for ",e," \xb7 ",(0,Pe.dayWord)(ti.date,Mt)," ",ti.time]}),(0,Qe.jsxs)(J.T,{size:16,colour:ie.colours.text,children:[(0,ve.tablesWords)(js.tables)," \xb7 ",s.text,l.length?` \xb7 ${[...new Set(l.map(e=>(0,d.tableNumbers)(e.table)))].join(', ')} booked then`:'']})]}),Cl?(0,Qe.jsx)(q.default,{testID:"plan-pick-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Cl,style:{padding:10,borderRadius:10,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:(0,Qe.jsx)(J.T,{size:16,weight:"semibold",center:!0,colour:"#FFE2A8",children:Cl})}):null,Rl&&ti&&js.tables.length?(0,Qe.jsx)(C.RestoreSeatedConfirm,{prompt:(0,T.restoreSeatedPrompt)(e,js.tables.join('+')),onYes:()=>{$l(!1),(async()=>{if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,s,e,t,Ns)})()},onNo:()=>$l(!1)}):null,(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:Cl?'plan-pick-overcap-yes':'plan-pick-save',label:Cl?'Use it anyway':l.length?'Save anyway':'Save tables',disabled:!i,style:{minHeight:56},accessibilityLabel:`${Cl?'Use it anyway':l.length?'Save anyway':'Save'}, ${(0,ve.tablesWords)(js.tables)} for ${e}. ${s.text}.`,onPress:async()=>{if(!ti)return void ws(null);if(!(0,De.guardBookingChange)(Ns,{b:ti,tables:js.tables}))return Tl(null),void ws(null);const s=(0,ve.overCapacityAsk)(js.tables,t,ti.partySize);if(s&&!Cl)return void Tl(s);if('finished'===ti.status&&js.tables.length&&!Rl)return void $l(!0);Tl(null),$l(!1);const l=js.tables;ws(null),await(0,De.saveTablesReported)(wt,ti,l,e,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"plan-pick-cancel",kind:"ghost",label:"Cancel",accessibilityLabel:"Cancel, keep the tables as they were",style:{minHeight:56},onPress:()=>{Tl(null),ws(null)}})]})]})})():null,li=Fl.areas.filter(e=>Fl.tables.some(t=>t.areaId===e.id)),ii=e=>{const t=Gt.tables.filter(t=>t.areaId===e);return cl?`${t.filter(e=>!Dl[e.name]?.dayBookings).length}/${t.length} unbooked`:`${t.filter(e=>['free','soon'].includes(el[e.name]?.status??'free')).length}/${t.length} free`},ni='all'===Qt||li.some(e=>e.id===Qt)?Qt:'all',oi=e=>(0,Qe.jsx)(ue.FloorCanvas,{plan:Fl,areaId:e,mode:"live",fit:"contain",crop:!0,fill:bt,big:!0,view:Dl,privacy:Nt,turnBase:kt.settings.turnMins,highlight:js?js.tables:es?[es]:void 0,onTap:e=>ei(e.name),onDrop:(e,t)=>js||cl?void 0:Zl(e.name,t.name)}),ai=ht?1:gt||li.length>2?2:1,ri=e=>{const t=Gt.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const s=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)/s},di=[];for(let e=0;e{const t=(0,ue.areaBounds)(Gt,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,ue.minReadableScale)(Gt,e.id)}}),mt.w,mt.h):null,ui=e=>(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',height:he.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:ii(e.id)})]}),hi=(0,Qe.jsx)(q.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout;(Math.abs(t-mt.w)>1||Math.abs(s-mt.h)>1)&&jt({w:t,h:s})},children:ci?(0,Qe.jsx)(K.default,{style:{flex:1},scrollEnabled:ci.scroll,showsVerticalScrollIndicator:ci.scroll,contentContainerStyle:{gap:he.GRID_GAP},children:ci.rows.map((e,t)=>(0,Qe.jsx)(q.default,{style:{height:ci.rowHeights[t],flexDirection:'row',gap:he.GRID_GAP},children:e.map(e=>{const t=li.find(t=>t.id===e);return(0,Qe.jsxs)(q.default,{testID:`area-cell-${e}`,style:{width:ci.cellW,gap:2},children:[ui(t),(0,Qe.jsx)(q.default,{style:{flex:1},children:oi(e)})]},e)})},t))}):null}),gi=(0,Qe.jsxs)(q.default,{testID:"venue-plan",style:{flex:ht?void 0:1,gap:10,minWidth:0},children:[(0,Qe.jsx)(r.TableNumberWarning,{plan:Gt}),Gt.tables.length?null:(0,Qe.jsxs)(q.default,{testID:"venue-plan-pending",style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,padding:24},children:[(0,Qe.jsx)(J.T,{size:24,weight:"semibold",children:"No table plan yet"}),(0,Qe.jsx)(J.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,Qe.jsx)(J.Muted,{center:!0,testID:"display-venue-hours",children:(l.IS_WILDINGS?a.WILDINGS_GUIDE:l.IS_KIRKMICHAEL?a.KIRKMICHAEL_GUIDE:a.SOUTERS_GUIDE).hoursLines.join(' \xb7 ')}):null]}),(()=>{const e=[(0,Qe.jsx)(at,{chipId:"all",compact:!ht,label:"Whole venue",selected:'all'===ni,onPress:()=>Jt('all')},"__all"),...li.map(e=>(0,Qe.jsx)(at,{chipId:e.id,compact:!ht,label:`${e.name}${(0,ge.areaMarks)(e)}`,colour:(0,ie.brandColour)(e.colour),sub:ht?Xs.has(e.id)?'closed':ni===e.id?ii(e.id):void 0:void 0,selected:ni===e.id,onPress:()=>Jt(e.id)},e.id))];return ht?(0,Qe.jsx)(q.default,{testID:"area-chips",style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:8,maxWidth:'100%'},children:e}):(0,Qe.jsx)(K.default,{horizontal:!0,testID:"area-chips",showsHorizontalScrollIndicator:!1,onLayout:e=>{const t=e.nativeEvent.layout.width;Es(e=>e.view===t?e:{...e,view:t})},onContentSizeChange:e=>Es(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:As.view>0&&As.content>0&&As.content<=As.view+1?'center':'flex-start',gap:4,paddingRight:4,minWidth:As.view>0&&As.content<=As.view+1?'100%':void 0},children:e})})(),(0,Qe.jsx)(g.FloorLegend,{}),si,es?(0,Qe.jsxs)(J.Row,{gap:8,style:{backgroundColor:ie.colours.goldTint,borderRadius:10,padding:8},children:[(0,Qe.jsxs)(J.T,{weight:"semibold",colour:ie.colours.goldLight,style:{flex:1},children:["Moving the party from ",(0,d.tableNumbers)(es),": tap the new table."]}),(0,Qe.jsx)(J.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ts(null)})]}):null,'all'===ni&&bt?hi:'all'===ni?(0,Qe.jsx)(q.default,{style:{flex:ht?void 0:1,gap:12,minHeight:yt?void 0:360},children:di.map((e,t)=>(0,Qe.jsxs)(q.default,{style:{flex:ht?void 0:Math.max(.3,...e.map(e=>ri(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Qe.jsxs)(q.default,{style:{flex:1,gap:2},children:[ht?(0,Qe.jsxs)(q.default,{style:{alignItems:'center',gap:4},children:[(0,Qe.jsxs)(J.T,{center:!0,size:18,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{center:!0,size:14,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{center:!0,children:ii(e.id)})]}):(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between'},children:[(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:(0,ie.brandColour)(e.colour),children:[e.name,(0,ge.areaMarks)(e)]}),Xs.has(e.id)?(0,Qe.jsx)(J.T,{size:13,weight:"semibold",colour:ie.colours.blue,children:"Closed for weather"}):(0,Qe.jsx)(J.Muted,{children:ii(e.id)})]}),(0,Qe.jsx)(q.default,{style:ht?{height:Math.max(280,Math.round((dt-40)*ri(e.id)))}:{flex:1},children:oi(e.id)})]},e.id)),e.length{if(cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},dl)}),yi='timeline'===Ut,pi=qt?(0,Qe.jsx)(F.default,{visible:!0,transparent:!1,animationType:"fade",onRequestClose:()=>Yt(!1),supportedOrientations:['landscape','portrait'],children:(0,Qe.jsxs)(q.default,{testID:"timeline-full",accessibilityViewIsModal:!0,style:{flex:1,backgroundColor:ie.colours.bg,paddingHorizontal:10,paddingTop:6,paddingBottom:6,gap:4},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:12,minHeight:64},children:[(0,Qe.jsx)(U.default,{testID:"timeline-back",accessibilityRole:"button",accessibilityLabel:"Back to the table plan",onPress:()=>Yt(!1),style:{minHeight:64,minWidth:dt<600?120:180,paddingHorizontal:dt<600?14:22,borderRadius:16,borderWidth:2,borderColor:ie.colours.goldLight,backgroundColor:ie.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:22,weight:"bold",colour:"#16120B",center:!0,children:"\u2039 Back"})}),(0,Qe.jsx)(q.default,{style:{flex:1,alignItems:'center',minWidth:0},children:(0,Qe.jsx)(J.T,{size:22,weight:"semibold",colour:ie.colours.goldLight,center:!0,numberOfLines:1,accessibilityRole:"header",children:`Timeline \xb7 ${cl?(0,Pe.dayLong)(dl):'Today'}`})}),dt<600?null:(0,Qe.jsx)(q.default,{style:{minWidth:180}})]}),wl?kl:(0,Qe.jsx)(q.default,{style:{flex:1,minHeight:0},children:(0,Qe.jsx)(pe.Timeline,{hideNow:!0,fit:!0,plan:Fl,bookings:cl?gl:qs,now:cl?pl:Tt,privacy:Nt,turnBase:kt.settings.turnMins,t0:cl?(0,se.addMins)(pl,-pl.getMinutes()):il,t1:cl?(0,se.addMins)(fl,30):nl,pauses:cl?ml:al,blockedTables:Vl,onOpen:e=>{if(Yt(!1),cl)return void ms(e.id);const t=(0,de.tablesOf)(e.table)[0];t&&el[t]?Zt(t):Ks(e)}},`full-${dl}`)})]})}):null,fi=cl?(0,Qe.jsxs)(q.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:ie.colours.gold,backgroundColor:ie.colours.goldTint},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,style:{flex:1},accessibilityRole:"header",children:hl?`Showing ${ul} \xb7 ${(0,se.niceDate)((0,se.parseYmd)(dl))}`:`Showing ${(0,Pe.dayWord)(dl,Mt)}`}),(0,Qe.jsx)(q.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:`${Al}. Showing ${(0,Pe.dayLong)(dl)}. Guests, table plan, Timeline and Covers are for that day.`,style:{position:'absolute',width:1,height:1,overflow:'hidden'}}),(0,Qe.jsx)(J.Button,{testID:"back-to-today",label:"Back to today",accessibilityLabel:"Back to today",onPress:()=>{ws(null),Cs(null)},style:{minHeight:44}})]}):null,xi=(0,Qe.jsx)(q.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:ht?'stretch':'flex-start'},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,s])=>{const i='timeline'===e===(yi||qt);return(0,Qe.jsx)(U.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?(Kt('plan'),Yt(!0)):(Yt(!1),Kt('plan'))},style:{flex:ht?1:void 0,minHeight:ht?48:44,minWidth:88,paddingHorizontal:12,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:i?ie.colours.gold:'transparent',...Ge.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,Qe.jsx)(J.T,{size:ht?16:13,weight:"semibold",colour:i?'#16120B':'#BDB5A6',children:t})},e)})}),mi='display'===I.APP_VARIANT&&!e,ji='display'===I.APP_VARIANT&&!e,wi=!e&&!I.IS_CAR&&!ht,ki=mi?(0,Qe.jsxs)(q.default,{testID:"display-view-row",style:{flexDirection:ht?'column':'row',flexWrap:ht||wi?'nowrap':'wrap',gap:6,alignItems:ht||wi?'stretch':'center'},children:[xi,(0,Qe.jsx)(k.DisplayRotaKitchenButtons,{phone:ht,fill:wi,shifts:Bt,staff:Rt,today:Mt,leave:Wt})]}):xi,Ii=(0,h.useBookingWrite)(),Di=e=>(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Walk-in",onPress:Et.openWalkIn,testID:"add-walkin",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"New booking",onPress:Et.openBooking,testID:"add-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint}),(0,Qe.jsx)(Fe.BigAction,{premium:!0,label:"Edit booking",onPress:()=>as(!0),testID:"display-edit-booking",block:e,size:"s",disabled:!Ii.ok,accessibilityHint:Ii.hint})]});(0,Ye.useDisplayNotices)(wt,!e);const vi=!e&&!I.IS_CAR&&!ht,Si=ht?180:202,[Ci,Ti]=(0,H.useState)(ht?180:168),Ri=P.default.useRef(ht?180:168),$i=P.default.useRef(null),Bi=P.default.useRef(null),Wi=P.default.useRef(null),Li=P.default.useRef(!1),[zi,Hi]=(0,H.useState)(!1),Pi=!ht&&ut<=800,Mi=ze.DAY_GRAPH_CHROME+(Pi?24:8),Ai=P.default.useRef(0),[Ei,Oi]=(0,H.useState)(Mi),[Ni,Gi]=(0,H.useState)(!0),[Fi,Vi]=(0,H.useState)(!1);P.default.useEffect(()=>{Vi(!1)},[dt,ut]);const Ui=P.default.useRef(()=>{}),Ki=P.default.useCallback(e=>{Math.abs(e-Ai.current)>=2&&(Ai.current=e,setTimeout(()=>Ui.current(),0))},[]),qi=()=>{const e=$i.current,t=Bi.current;if(!e?.measureInWindow||!t?.measureInWindow)return;const s=(e,t,s,l,i=0)=>{const n=t>Ri.current?Math.ceil(t-Ri.current):0,o=vi?Math.max(Mi,Ai.current):Math.max(Mi,n);vi&&o!==Ei&&Oi(o);const a=!ht&&ut>=700?140:70,r=Math.floor(s-4-e)-o-l,d=i>0&&r-i>=a;vi&&d!==Ni&&Gi(d),vi&&!Fi&&r<48&&Vi(!0);const c=r-(d?i:0),u=Math.min(Si,c>=a?Math.max(a,c):Math.max(0,c));Math.abs(Ri.current-u)>=2&&(Ri.current=u,Ti(u))},l=44+(ut<820?4:8),i=46+(ut<820?4:8);e.measureInWindow((e,n,o,a)=>{t.measureInWindow((e,t)=>{const o=Wi.current;vi&&o?.measureInWindow?o.measureInWindow((e,l,o,r)=>{const d=ut<820?4:8;s(n,a,t,Math.max(i,d+Math.round(r||0)),Li.current?44+d:0)}):s(n,a,t,vi?i:l)})})};Ui.current=qi,P.default.useEffect(()=>{const e=setTimeout(()=>Ui.current(),60),t=setTimeout(()=>Ui.current(),450);return()=>{clearTimeout(e),clearTimeout(t)}},[dt,ut,dl]);const Yi=(0,Qe.jsxs)(q.default,{ref:Bi,testID:"display-tools",accessibilityLabel:"Display tools",onLayout:t=>{e||x.useDisplayToolsH.setState({h:Math.round(t.nativeEvent.layout.height)}),qi()},style:{flexDirection:'row',flexWrap:dt>=900?'nowrap':'wrap',gap:8,paddingHorizontal:14,paddingVertical:ht?12:Pi?2:6,justifyContent:ht?'center':void 0,borderTopWidth:1,borderTopColor:ie.colours.hairline,backgroundColor:(0,o.soutersSurface)('#0D0D0C')},children:[e?null:(0,Qe.jsx)(qe.DisplayClockButton,{}),(0,Qe.jsx)(ye.HoldToEdit,{quiet:!0,onUnlock:()=>{Us(null),Gs({at:Date.now()})},onHint:()=>Ns('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,Qe.jsx)(Le.BlockBookingsButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,display:!0,day:dl}),Gt.areas.some(e=>e.outdoor)?(0,Qe.jsx)(Le.CloseGardenButton,{rid:wt,r:kt,now:Tt,by:Ht,quiet:!0,short:!0}):null,(0,Qe.jsx)(U.default,{testID:"display-add-soldout",accessibilityRole:"button",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Ms(!0),style:({pressed:e})=>({...Ge.look.quiet(e),flexGrow:1,flexShrink:1,minWidth:0}),children:(0,Qe.jsx)(J.T,{size:15,weight:"semibold",colour:ie.colours.goldLight,style:{textAlign:'center'},children:"Add sold out"})}),I.IS_CAR||I.IS_OWNER_DESKTOP?null:(0,Qe.jsx)(f.GiftQrButton,{rid:wt,venue:kt.name})]}),Qi=Qs.length?(0,Qe.jsxs)(q.default,{testID:"takeaway-panel",style:[Ge.look.panel,{overflow:'hidden'}],children:[(0,Qe.jsxs)(J.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Qe.jsx)(J.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Qe.jsxs)(J.T,{size:12,colour:ie.colours.muted,children:[Qs.length," live"]})]}),(0,Qe.jsx)(q.default,{style:{padding:10},children:(0,Qe.jsx)(rt,{list:Qs,me:Ht,compact:!0,bookings:Dt})})]}):null,Ji=(Ne.DueToday,kt.settings.turnMins||90),Xi=cl?gl:(0,v.todaysGuestList)(qs,Tt,Ji),Zi=cl?[]:(0,v.todaysFinishedList)(qs,Tt,Ji),en=cl?hl?`${ul}\u2019s guests`:`Guests ${ul}`:'Today\u2019s guests',tn=(0,Qe.jsxs)(Qe.Fragment,{children:[0===Xi.length?(0,Qe.jsx)(J.Muted,{children:cl?dl{const t=(0,v.isLeftEarly)(e,Tt,Ji),s=(0,ne.isSeatedHighlight)(e.status,{otherDay:cl})&&!t,l=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),seated:s,leftEarly:t,tableWord:!0}),i=ie.colours.text,n=s?ie.colours.goldLight:ie.colours.muted,o=ie.colours.gold,a=l.depositWarn?ie.colours.amber:ie.colours.goldLight;return(0,Qe.jsxs)(U.default,{testID:`display-guest-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:l.a11y,accessibilityHint:cl?'Opens assign table':'Opens seat, finished, no-show and assign table',onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>s?{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,...(0,ne.seatedHighlightStyle)({backgroundColor:e?Xe:Je,borderColor:ie.colours.gold,borderLeftColor:ie.colours.gold,borderBottomWidth:1.5})}:{minHeight:64,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderBottomWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:o,style:{width:58},children:l.time}),(0,Qe.jsx)(J.T,{size:18,weight:"semibold",colour:i,testID:"guest-row-name",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l.name}),l.allergy?(0,Qe.jsx)(q.default,{style:{paddingTop:2},children:(0,Qe.jsx)(G.AllergyIcon,{text:l.allergy,size:22,colour:ie.colours.amber,ink:ie.colours.bg,testID:`display-allergy-${e.id}`})}):null]}),(0,Qe.jsxs)(J.T,{size:16,testID:"guest-row-detail",style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[(0,Qe.jsx)(J.T,{size:16,colour:i,children:l.people}),l.deposit?(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}):null,l.deposit?(0,Qe.jsx)(J.T,{size:16,weight:"semibold",colour:a,testID:`display-deposit-${e.id}`,children:l.deposit}):null,(0,Qe.jsx)(J.T,{size:16,colour:n,children:" \xb7 "}),(0,Qe.jsx)(J.T,{size:16,weight:s?'semibold':'regular',colour:'No table yet'===l.table?n:i,children:l.table}),l.dog?(0,Qe.jsx)(J.T,{size:16,children:" "}):null,l.dog?(0,Qe.jsx)(q.default,{style:{width:18,height:18,transform:[{translateY:3}]},children:(0,Qe.jsx)(we.DogIcon,{size:18,testID:`display-dog-${e.id}`})}):null]}),l.guestChange?(0,Qe.jsx)(J.T,{size:15,colour:ie.colours.amber,testID:`display-guest-change-${e.id}`,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:l.guestChange}):null]},e.id)}),Zi.length?(0,Qe.jsxs)(q.default,{testID:"display-finished-section",style:{marginTop:14,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,padding:8,gap:4},children:[(0,Qe.jsxs)(U.default,{testID:"display-finished-toggle",accessibilityRole:"button",accessibilityLabel:`Finished, ${Zi.length}${ps?', expanded':', collapsed'}`,accessibilityState:{expanded:ps},onPress:()=>fs(e=>!e),style:({pressed:e})=>({minHeight:48,paddingHorizontal:8,paddingVertical:6,borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'space-between',backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(J.T,{size:16,weight:"semibold",colour:ie.colours.goldLight,children:["Finished (",Zi.length,")"]}),(0,Qe.jsx)(J.T,{size:16,colour:ie.colours.muted,children:ps?'\u25be':'\u25b8'})]}),ps?Zi.map(e=>{const t=(0,je.guestRowText)(e,{name:e.walkIn?(0,me.privName)(e,Nt):(e.name??'').replace(' (example)',''),finished:!0,tableWord:!0});return(0,Qe.jsxs)(U.default,{testID:`display-finished-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:t.a11y,accessibilityHint:"Opens the booking",onPress:()=>{ys(!1),ms(e.id)},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:ie.colours.hairline,backgroundColor:e?ie.colours.tilePressed:'transparent'}),children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'flex-start',gap:10},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{width:58},children:t.time}),(0,Qe.jsx)(J.T,{size:17,weight:"semibold",style:{flex:1,minWidth:0,flexWrap:'wrap'},children:t.name})]}),(0,Qe.jsxs)(J.T,{size:15,colour:ie.colours.muted,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[t.people," \xb7 ",t.table]}),(0,Qe.jsx)(q.default,{style:{marginLeft:68,marginTop:4,alignItems:'flex-start'},children:(0,Qe.jsx)(S.BookingUndo,{b:e,rid:wt,today:Mt,who:t.name,allowed:Ii.ok})})]},e.id)}):null]}):null,(0,Qe.jsx)(Oe.CancellationsSection,{items:Ml,dayWord:cl?hl?ul.toLowerCase():`on ${ul}`:'today'})]}),sn=(0,Qe.jsx)(K.default,{testID:"display-guest-list",accessibilityLabel:en,style:{flex:1},contentContainerStyle:{padding:12,gap:4},children:tn}),ln=V.default.create({onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>12&&Math.abs(t.dx)>Math.abs(t.dy),onPanResponderRelease:(e,t)=>{t.dx<-40&&ys(!1)}}),nn=(0,Qe.jsxs)(U.default,{testID:"guests-handle",accessibilityRole:"button",accessibilityLabel:`${en}, ${Xi.length}`,accessibilityState:{expanded:bs},'aria-expanded':bs,dataSet:{centreExempt:'count-and-turned-label-centred-as-a-group'},onPress:()=>ys(e=>!e),style:({pressed:e})=>({width:44,alignSelf:'stretch',borderRadius:12,borderWidth:1,borderColor:bs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',gap:8,backgroundColor:e?ie.colours.tilePressed:bs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:[(0,Qe.jsx)(J.T,{size:16,weight:"bold",colour:ie.colours.gold,children:Xi.length}),(0,Qe.jsx)(q.default,{style:{width:44,height:150,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(q.default,{style:{position:'absolute',width:150,height:44,left:-53,top:53,alignItems:'center',justifyContent:'center',transform:[{rotate:'-90deg'}]},children:(0,Qe.jsxs)(J.T,{size:13,weight:"semibold",colour:ie.colours.goldLight,numberOfLines:1,children:[en," ",bs?'\u2039':'\u203a']})})})]}),on=bs?(0,Qe.jsxs)(q.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:40,flexDirection:'row'},children:[(0,Qe.jsxs)(q.default,{testID:"guests-drawer",...ln.panHandlers,accessibilityViewIsModal:!0,style:{width:Math.min(560,Math.max(320,.44*dt)),backgroundColor:ie.colours.surface,borderRightWidth:1,borderColor:ie.colours.gold,borderRadius:14,...Ge.look.web({boxShadow:'6px 0 24px rgba(0,0,0,0.5)'})},children:[(0,Qe.jsxs)(q.default,{testID:"guests-head",style:{paddingHorizontal:12,paddingTop:8},children:[(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",colour:ie.colours.gold,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:[en.toUpperCase()," (",Xi.length,")"]}),(0,Qe.jsx)(s.GoldClose,{testID:"guests-close",label:`Close ${en}`,onPress:()=>ys(!1),style:{marginRight:-6}})]}),Pl.count?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,testID:"cancelled-day-tally-guests",children:Al}):null,(0,Qe.jsx)(q.default,{testID:"guests-tools",style:{flexDirection:'row',gap:8,marginTop:6,justifyContent:'center'},children:(0,Qe.jsx)(U.default,{testID:"guest-key-button",accessibilityRole:"button",accessibilityLabel:"Guest key",accessibilityState:{expanded:hs},'aria-expanded':hs,onPress:()=>gs(e=>!e),style:({pressed:e})=>({minHeight:44,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:hs?ie.colours.gold:ie.colours.hairline,alignItems:'center',justifyContent:'center',backgroundColor:e?ie.colours.tilePressed:hs?ie.colours.goldTint:'rgba(255,255,255,0.03)'}),children:(0,Qe.jsxs)(J.T,{size:14,weight:"semibold",colour:ie.colours.goldLight,children:["Guest key ",hs?'\u25b4':'\u25be']})})}),hs?(0,Qe.jsx)(q.default,{testID:"guest-key",accessible:!0,accessibilityLabel:"Guest key: warning sign allergy, star VIP, heart regular, cake birthday, heart with ribbon anniversary",style:{marginTop:6,padding:10,borderRadius:12,borderWidth:1,borderColor:ie.colours.hairline,flexDirection:'row',flexWrap:'wrap',justifyContent:'center',columnGap:16,rowGap:6},children:[['\u26a0','allergy'],['\u2605','VIP'],['\u2665','regular'],['\ud83c\udf82','birthday'],['\ud83d\udc9d','anniversary']].map(([e,t])=>(0,Qe.jsxs)(q.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,Qe.jsx)(J.T,{size:16,children:e}),(0,Qe.jsx)(J.T,{size:14,children:t})]},t))}):null]}),sn]}),(0,Qe.jsx)(U.default,{testID:"guests-backdrop",accessibilityLabel:`Close ${en}`,accessibilityRole:"button",onPress:()=>ys(!1),style:{flex:1}})]}):null,an=wl?kl:l.IS_KIRKTON&&!Object.values(kt.kitchenHours??{}).some(Boolean)?(0,Qe.jsxs)(q.default,{testID:"kirkton-hours-to-confirm",style:[Ge.look.panel,{padding:14,gap:8}],children:[(0,Qe.jsx)(J.T,{weight:"semibold",children:"Opening and kitchen hours: to confirm"}),(0,Qe.jsx)(J.Muted,{children:"No service hours have been set for this venue."})]}):(0,Qe.jsx)(ze.DayGraph,{busyThreshold:(0,t.venueBusy)(kt,Dt,Tt).busy,todays:gl,open:pl,close:fl,now:Tt,turnBase:kt.settings.turnMins,blocks:El,pauses:ml,compact:ht,dense:!ht,fit:bt,tight:bt&&ut<=600,height:bt?Ci:Si,forecastNote:cl?void 0:Xl,emptyText:Il,past:dl{Ss.current=Date.now(),vs(!0)},shortDay:!ht&&dt<1100}),cn=(0,Qe.jsx)(Me.DisplayCalendar,{visible:Ds,today:Mt,day:dl,bookings:Dt,restaurant:kt,now:Tt,onDay:Cs,onClose:()=>vs(!1)}),un=()=>{cl?ys(!0):Yt(!0)},hn=(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',padding:Pi?4:ut<820?8:12,paddingTop:Pi?vi?2:4:ut<820?vi?4:6:vi?8:10,gap:Pi?8:12,minHeight:0,overflow:'hidden'},children:[At?null:nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[At?null:fi,At?(0,Qe.jsx)(K.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"})}):yi?bi:gi,pi,on]}),(0,Qe.jsxs)(q.default,{testID:"display-side",style:{width:pt,gap:ut<820?4:8,minHeight:0},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexShrink:0,flexWrap:'wrap',flexDirection:'row',gap:8},children:Di(!1)}),(0,Qe.jsx)(q.default,{style:{flexShrink:0},children:ki}),At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",onLayout:qi,style:vi&&!Fi?{flexGrow:1,flexShrink:0,minHeight:0}:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:ut<820,snug:ut<820,tight:ut<800,fill:vi&&!Fi,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{ref:$i,testID:"day-graph-slot",onLayout:qi,style:{flexGrow:0,flexShrink:vi?0:1,flexBasis:(ht?Si:Ci)+(vi?Ei:Mi),height:(ht?Si:Ci)+(vi?Ei:Mi),minHeight:ut<=600?90:Math.min((ht?Si:Ci)+ze.DAY_GRAPH_CHROME,!ht&&ut>=768?140+ze.DAY_GRAPH_CHROME:120),overflow:'visible'},children:rn}),vi&&!At?(0,Qe.jsx)(q.default,{ref:Wi,testID:"display-side-split",onLayout:qi,style:{flexShrink:0,alignItems:'center'},children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})}):null,(0,Qe.jsxs)(K.default,{testID:"display-side-scroll",style:vi?{flexGrow:0,flexShrink:1,minHeight:zi&&Ni?44:0}:{flexGrow:1,flexShrink:1,flexBasis:44,minHeight:44},contentContainerStyle:{gap:10,paddingBottom:6},onContentSizeChange:(e,t)=>{const s=t>10;s!==Li.current&&(Li.current=s,Hi(s),setTimeout(qi,0))},children:[vi||ji?null:(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:44,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),Qi,(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht})]})]})]});return(0,Qe.jsxs)(Q.SafeAreaView,{style:{flex:1,backgroundColor:ie.colours.bg},onTouchStart:()=>{Ss.current=Date.now()},onMouseDown:()=>{Ss.current=Date.now()},children:[ht?(0,Qe.jsxs)(q.default,{style:{flex:1},children:[(0,Qe.jsxs)(K.default,{ref:ft,testID:"phone-dashboard-scroll",style:{flex:1},contentContainerStyle:{padding:12,gap:16,paddingBottom:24,width:'100%',maxWidth:700,alignSelf:'center'},children:[(0,Qe.jsxs)(q.default,{testID:"display-header",style:{alignItems:'center',gap:8,paddingVertical:12,position:'relative'},children:[e?null:(0,Qe.jsx)(q.default,{style:{position:'absolute',top:4,right:4,zIndex:2},children:(0,Qe.jsx)(j.ExitButton,{})}),(0,Qe.jsx)(ee.RestaurantLogo,{rid:wt,size:64}),(0,Qe.jsx)(J.T,{center:!0,size:24,weight:"bold",accessibilityRole:"header",children:kt.name}),(0,Qe.jsx)(ee.PoweredBy,{}),(0,Qe.jsx)(z.AppBadge,{label:e?'RESTAURANT DASHBOARD':'DISPLAY'}),(0,Qe.jsx)(q.default,{accessible:!0,accessibilityLabel:`Current time ${(0,se.hm)(Tt)}`,children:(0,Qe.jsx)(J.T,{center:!0,size:30,weight:"semibold",colour:ie.colours.goldLight,children:(0,se.hm)(Tt)})}),(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:"m"}),(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",size:"m"}),te]}),Ue,I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt}),dn,(0,Qe.jsx)(q.default,{testID:"phone-glance",style:{width:'100%'},children:(0,Qe.jsx)(ot,{phone:!0,split:Hl,items:[{label:`Tables \xb7 ${ul}`,value:Ll.length,testID:'badge-tables'},{label:`Covers \xb7 ${ul}`,value:zl,testID:'badge-covers'},{label:'Takeaway',value:Qs.length,alert:Qs.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>ns(!0)}]})}),(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{gap:8},children:Di(!0)}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),ki,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{width:'100%',minWidth:0},children:[yi?bi:gi,pi]}),(0,Qe.jsxs)(q.default,{onLayout:e=>{xt.current=e.nativeEvent.layout.y},testID:"phone-guests-section",style:[Ge.look.panel,{width:'100%',padding:12,gap:8}],children:[(0,Qe.jsxs)(J.T,{center:!0,size:20,weight:"semibold",colour:ie.colours.goldLight,accessibilityRole:"header",children:[en," (",Xi.length,")"]}),(0,Qe.jsx)(q.default,{testID:"display-guest-list",accessibilityLabel:en,style:{gap:4},children:tn})]}),Qi,rn,(0,Qe.jsx)(q.default,{testID:"covers-dock",children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,compact:!0,sound:(0,E.flapSoundOn)(),onPress:()=>ft.current?.scrollTo({y:xt.current,animated:!0})})}),(0,Qe.jsxs)(q.default,{testID:"phone-display-settings",style:{gap:8,alignItems:'center'},children:[(0,Qe.jsx)(J.T,{center:!0,size:14,colour:Nt?ie.colours.muted:ie.colours.amber,children:Nt?'Privacy: names shown as initials on tables':'Privacy off: names shown on tables'}),(0,Qe.jsx)(J.Button,{testID:"colour-key-help",kind:"secondary",label:"Table colours & symbols",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Bs(!0),style:{minHeight:48,alignSelf:'stretch'}}),ji?null:(0,Qe.jsx)(J.Button,{testID:"display-reviews",kind:"secondary",label:"Reviews",accessibilityLabel:"Reviews",onPress:()=>Ls(!0),style:{minHeight:48,alignSelf:'stretch'}})]}),Yi]}),e||Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(q.default,{testID:"phone-voice-footer",style:{alignItems:'center',paddingVertical:6,borderTopWidth:1,borderColor:ie.colours.hairline},children:(0,Qe.jsx)(N.VoiceSlot,{size:56})})]}):(0,Qe.jsxs)(Qe.Fragment,{children:[vi?(0,Qe.jsxs)(q.default,{testID:"display-whos-on-top",style:{flexShrink:0,width:'100%',maxWidth:'100%',flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,minHeight:44,maxHeight:44,overflow:'hidden',backgroundColor:(0,o.soutersSurface)('#0D0D0C'),borderBottomWidth:1,borderBottomColor:ie.colours.hairline},children:[(0,Qe.jsx)(q.default,{style:{flex:1,minWidth:0,maxHeight:44,overflow:'hidden',justifyContent:'center'},children:(0,Qe.jsx)(w.WhosOnShift,{compact:!0,marquee:!0})}),(0,Qe.jsx)(q.default,{style:{width:8,flexShrink:0}}),e?null:(0,Qe.jsx)(j.ExitButton,{})]}):null,(0,Qe.jsxs)(q.default,{testID:"display-header",style:{flexDirection:'row',alignItems:'center',paddingHorizontal:dt>=1e3?18:14,paddingVertical:Pi?2:ut<820?4:8,gap:8,minHeight:Pi&&vi?44:52,backgroundColor:(0,o.soutersSurface)('#0D0D0C'),...Ge.look.web({backgroundImage:l.IS_SOUTERS?'none':'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-left",style:{flex:1,flexDirection:'row',alignItems:'center',gap:vi?16:8,minWidth:0,overflow:'hidden',...vi?{justifyContent:'flex-start'}:null},children:[(0,Qe.jsx)(q.default,{testID:"display-header-brand",style:vi?{flexShrink:1,minWidth:96,maxWidth:280}:{flex:1,flexShrink:1,minWidth:96,maxWidth:280},children:(0,Qe.jsx)(ee.RestaurantBrand,{rid:kt.id,size:dt<900?32:40,beside:!0,noLogo:vi})}),(0,Qe.jsxs)(q.default,{testID:"display-header-time",style:{flexDirection:'row',alignItems:'baseline',gap:8,flexShrink:0},children:[(0,Qe.jsx)(J.T,{size:dt<900?18:21,weight:"semibold",colour:ie.colours.goldLight,style:{letterSpacing:.4,lineHeight:26,fontVariant:['tabular-nums']},children:(0,se.hm)(Tt)}),dt>=900?(0,Qe.jsx)(J.T,{size:13,colour:ie.colours.muted,children:(0,se.niceDate)(Tt)}):null]})]}),At?(0,Qe.jsx)(q.default,{style:{width:220}}):(0,Qe.jsx)(q.default,{testID:"display-day-centre",style:{alignItems:'center',justifyContent:'center'},children:dn}),(0,Qe.jsxs)(q.default,{style:{flex:1,flexDirection:'row',alignItems:'center',justifyContent:'flex-end',gap:8,minWidth:0,flexShrink:0},children:[(0,Qe.jsxs)(q.default,{testID:"display-header-chips",style:{flexDirection:dt>=1400||vi?'row':'column',alignItems:dt>=1400||vi?'center':'flex-end',justifyContent:'center',gap:6,flexShrink:0},children:[(0,Qe.jsx)(Ve.ShellfishChip,{rid:wt,by:Ht,app:"display",size:dt<1240?'xs':dt<1280||ut<700?'s':'m'}),At?null:(0,Qe.jsx)(Ve.SundayRoastChip,{rid:wt,by:Ht,app:"display",slot:vi,size:dt<1340?'xs':dt<1400||ut<700?'s':'m'})]}),'simulated'===Ct?(0,Qe.jsx)(U.default,{accessibilityRole:"button",accessibilityLabel:"Skip 15 minutes",onPress:()=>St(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,Qe.jsx)(J.T,{size:11,colour:ie.colours.muted,children:"+15"})}):null,e||vi?null:(0,Qe.jsx)(j.ExitButton,{}),te,Ke||!(0,_.voiceDisplayOn)(wt)?null:(0,Qe.jsx)(N.VoiceSlot,{size:44})]})]}),Ue,I.IS_CAR||!At||vi?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(De.BookingSaveBanner,{rid:wt,margin:{marginHorizontal:12,marginTop:6}}),At||vi?null:(0,Qe.jsx)(q.default,{testID:"display-day-stats",style:et,children:(0,Qe.jsxs)(q.default,{style:tt,children:[I.IS_CAR?null:(0,Qe.jsx)(w.WhosOnShift,{compact:!0}),(0,Qe.jsx)(q.default,{style:st,children:(0,Qe.jsx)(ot,{splitOnly:!0,split:Hl,items:[]})})]})}),bt?hn:(gn=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)(q.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Qe.jsx)(q.default,{testID:"primary-actions",style:{flexWrap:'wrap',flexDirection:'row',gap:12},children:Di(!1)}),ki]}),(0,Qe.jsx)(Le.BlocksBanner,{rid:wt,now:Tt,big:!0,by:Ht}),At?(0,Qe.jsx)(A.DayView,{rid:wt,day:At,today:Mt,app:"display"}):(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsxs)(q.default,{style:{flexGrow:1,flexShrink:1,flexBasis:0,minHeight:140,flexDirection:'row',gap:10},children:[nn,(0,Qe.jsxs)(q.default,{testID:"display-main",style:{flex:1,minWidth:0},children:[fi,yi?bi:gi,pi,on]})]})}),Qi,At?null:(0,Qe.jsx)(q.default,{testID:"covers-dock",style:{flexShrink:0},children:(0,Qe.jsx)(M.CoversToday,{rid:wt,day:dl,sound:(0,E.flapSoundOn)(),onPress:un})}),At?null:(0,Qe.jsx)(q.default,{testID:"day-graph-slot",style:{flexShrink:0,overflow:'visible',minHeight:Si+ze.DAY_GRAPH_CHROME},children:rn})]}),(0,Qe.jsx)(K.default,{testID:"display-wrap-scroll",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1,padding:12,paddingTop:10,gap:10},children:gn})),Yi]}),(0,Qe.jsx)($.SoldOutStrip,{rid:wt,by:Pt,onOpen:()=>Ms(!0)}),(0,Qe.jsx)(B.SoldOutSheet,{visible:Ps,onClose:()=>Ms(!1),rid:wt,by:Pt,hideLinks:!0,testID:"display-soldout-sheet"}),(0,Qe.jsx)(p.TableOrderCue,{rid:wt}),Et.elements,os?(0,Qe.jsx)(y.EditBookingPicker,{rid:wt,today:Mt,who:Ht,onClose:()=>as(!1)}):null,rs?(0,Qe.jsx)(y.EditBookingSheet,{rid:wt,id:rs,who:Ht,onClose:()=>ds(null)}):null,Xt?(0,Qe.jsx)(Ce.TableSheet,{rid:wt,name:Xt,view:el,plan:Gt,todays:qs,now:Tt,privacy:Nt,turnBase:kt.settings.turnMins,onClose:()=>Zt(null),onWalkIn:e=>Et.openWalkInAt(e),onMove:e=>ts(e),onDetails:Ks}):null,vl?(()=>{const e=Dl[vl],t=e?.dayBookings??[];return(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>{Wl(null),Sl(null)},title:`${(0,d.tableNumbersA11y)(vl)} \xb7 ${hl?ul:(0,Pe.dayLong)(dl)}`,maxWidth:560,testID:"day-table-sheet",children:[(0,Qe.jsxs)(J.T,{size:16,center:!0,colour:ie.colours.text,children:[e?`${e.table.maxSeats} seats. `:'',t.length?`${t.length} ${1===t.length?'booking':'bookings'} on this table ${hl?ul.toLowerCase():'that day'}. Tap one to change its tables.`:`No bookings on this table ${hl?ul.toLowerCase():'that day'}.`]}),t.map(e=>{const t=e.walkIn?(0,me.privName)(e,Nt):lt(e.name);return(0,Qe.jsx)(J.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,ve.tablesWords)((0,de.tablesOf)(e.table))}. Opens assign table.`,onPress:()=>{Sl(null),ms(e.id)},style:{minHeight:56}},e.id)}),dl>=Mt?(()=>{const t=e?.table.maxSeats??0,s=Dt.filter(e=>e.date===dl&&!e.walkIn&&!['cancelled','noshow','finished'].includes(e.status)&&!(0,de.tablesOf)(e.table).includes(vl)).sort((e,t)=>e.time.localeCompare(t.time));return s.length?(0,Qe.jsxs)(q.default,{testID:"day-table-put",style:{gap:8,alignItems:'stretch'},children:[(0,Qe.jsxs)(J.T,{size:17,weight:"semibold",center:!0,colour:ie.colours.goldLight,children:["Put a booking on ",(0,d.tableNumbersA11y)(vl)]}),Bl?(0,Qe.jsxs)(q.default,{testID:"day-table-overcap",accessible:!0,accessibilityRole:"alert",accessibilityLiveRegion:"assertive",accessibilityLabel:Bl.ask,style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:ie.colours.amber,backgroundColor:ie.colours.amberBg},children:[(0,Qe.jsx)(J.T,{size:17,weight:"semibold",center:!0,colour:"#FFE2A8",children:Bl.ask}),(0,Qe.jsxs)(J.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-yes",label:"Use it anyway",disabled:!Ii.ok,accessibilityHint:Ii.hint,style:{minHeight:56,flexGrow:1},onPress:async()=>{const e=Dt.find(e=>e.id===Bl.id);if(Wl(null),!e)return;const s=lt(e.name);Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns)}}),(0,Qe.jsx)(J.Button,{testID:"day-table-overcap-no",kind:"secondary",label:"Pick another",style:{minHeight:56},onPress:()=>Wl(null)})]})]}):null,Bl?null:s.slice(0,12).map(e=>{const s=lt(e.name),l=e.partySize>t;return(0,Qe.jsx)(J.Button,{kind:"secondary",testID:`day-table-put-${e.id}`,label:`${e.time} \xb7 ${s} \xb7 ${e.partySize} Covers`,sub:l?`Bigger than this table (${t} seats)`:e.table?`Now ${(0,d.tableNumbersA11y)(e.table)}`:'No table yet',disabled:!Ii.ok,accessibilityHint:Ii.hint,accessibilityLabel:`Put ${s}, ${e.time}, ${e.partySize} Covers, on ${(0,d.tableNumbersA11y)(vl)}${l?`. This table seats ${t}`:''}`,onPress:async()=>{if(!(0,De.guardBookingChange)(Ns,{b:e,tables:[vl]}))return;const l=(0,ve.overCapacityAsk)([vl],t,e.partySize);l?Wl({id:e.id,ask:l}):(Sl(null),await(0,De.saveTablesReported)(wt,e,[vl],s,t,Ns))},style:{minHeight:56}},e.id)})]}):null})():null,(0,Qe.jsx)(J.Button,{kind:"ghost",label:"Close",accessibilityLabel:"Close",onPress:()=>{Wl(null),Sl(null)},style:{minHeight:56}})]})})():null,xs?(()=>{const e=Dt.find(e=>e.id===xs);return e?(0,Qe.jsx)(ke.GuestActionsSheet,{rid:wt,b:e,name:e.walkIn?(0,me.privName)(e,Nt):lt(e.name),view:el,now:Tt,otherDay:e.date!==Mt,turnBase:kt.settings.turnMins,onClose:()=>ms(null),onDetails:Ks,onDone:Ns,onEdit:e=>{ms(null),ds(e.id)},onPickOnPlan:(e,t)=>{ys(!1),Kt('plan'),Jt('all'),ws({id:e.id,tables:t})}}):null})():null,ss?(0,Qe.jsx)(Ce.DetailsPanel,{title:ss.title,onClose:()=>ls(null),children:ss.body}):null,cn,cs?(0,Qe.jsx)(Ce.ServiceSummary,{r:kt,todays:qs,orders:It,waitlistAll:Ts,walkInCount:Rs,onClose:()=>us(!1)}):null,$s?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Bs(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Qe.jsx)(g.FloorLegend,{}),(0,Qe.jsx)(J.T,{center:!0,size:14,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Bs(!1)})]}):null,zs?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Hs(!1),title:"More",maxWidth:480,testID:"display-more-sheet",children:[(0,Qe.jsx)(U.default,{testID:"display-reviews",accessibilityRole:"button",accessibilityLabel:"Reviews",onPress:()=>{Hs(!1),Ls(!0)},style:{minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:12,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:(0,Qe.jsx)(J.T,{center:!0,weight:"semibold",children:"Reviews"})}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Hs(!1)})]}):null,Ws?(0,Qe.jsxs)(J.Sheet,{visible:!0,onClose:()=>Ls(!1),title:"Reviews",maxWidth:640,testID:"display-reviews-sheet",children:[(0,Qe.jsx)(X.ReviewsSection,{rid:wt,mode:"read",venueName:kt.name}),(0,Qe.jsx)(J.Button,{kind:"secondary",label:"Close",onPress:()=>Ls(!1)})]}):null,is?(0,Qe.jsxs)(Ce.DetailsPanel,{title:"Takeaway",onClose:()=>ns(!1),children:[(0,Qe.jsx)(J.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Qe.jsx)(rt,{list:Qs,me:Ht,bookings:Dt})]}):null,_s?(0,Qe.jsx)(q.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:ie.colours.bg},children:(0,Qe.jsx)(be.PlanDesigner,{initial:Gt,venue:kt.name,mode:"display",startStep:"arrange",onActivity:()=>{Fs.current=Date.now(),null!==Vs&&Us(null)},notice:null!==Vs?`Locking again in ${Vs} s \xb7 touch to keep editing`:null,onSave:e=>{de.useFloor.getState().setPlan(wt,e),Gs(null),Ns('Table plan saved for every screen. Editing is locked again.')},onLiveChange:e=>{de.useFloor.getState().setPlan(wt,e),Ns('Live seating plan updated on every screen.')},onCancel:()=>{Gs(null),Ns('No changes kept. Editing is locked again.')}},_s.at)}):null,e?null:(0,Qe.jsx)(fe.Screensaver,{rid:wt,idleMins:Ot.idleMins,pinOn:Ot.pinOn,wake:Ot,tonightCards:Ot.tonightCards,cfg:_t}),e?null:(0,Qe.jsx)(Re.PrintHost,{rid:wt}),e?null:(0,Qe.jsx)(Te.AlertHost,{variant:"display",rid:wt,skipTakeaway:!0}),e?null:(0,Qe.jsx)(O.SeatAllergenReminder,{rid:wt}),e?null:(0,Qe.jsx)($e.TakeawayTakeover,{rid:wt,me:Ht})]});var gn}function ct({rid:e,id:t,turnBase:s}){const l=(0,le.useBookings)(e).find(e=>e.id===t);return l?(0,Qe.jsx)(b.BookingTableButton,{rid:e,booking:l,turnBase:s}):null}},1327,[1051,779,805,806,1328,813,1329,1092,843,1137,1330,1331,1332,1089,1118,1333,1334,1339,1340,1199,1341,856,1346,1347,1348,1111,1110,966,1349,1149,938,1102,1350,17,1070,1175,1016,1085,1351,1203,1353,378,363,385,278,85,409,19,777,1223,1227,857,845,863,858,804,1088,876,1096,1055,996,1074,1107,1354,1106,1355,1362,1364,1367,1372,1366,1373,1376,1377,1113,1093,1094,862,1382,1212,1383,1222,1214,993,1388,1393,1394,1052,1050,1115,1396,1397,1398,1069,1168,1399,1167,1158,853,1342,1400,8]); __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},1330,[]); @@ -1474,7 +1474,7 @@ __d(function(g,r,i,_a,m,e,_d){"use strict";function t(t,o){if(t.title.trim().len __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STEP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"addDays",{enumerable:!0,get:function(){return u}}),_e.fmt12=i,_e.rangeText=c,_e.openWindow=function(r,o){const a=(0,e.kitchenHoursOn)(r,(0,t.parseYmd)(o));if(!a)return null;let s=(0,t.toMins)(a[1]);for(const e of(0,n.regularEventsOf)(r))(0,n.occursOn)(e,o)&&e.time&&(s=Math.max(s,Math.min(1425,(0,t.toMins)(e.time)+180)));return{from:(0,t.toMins)(a[0]),to:s}},_e.servicesOn=l,_e.serviceOf=function(e,n,r,o){const a=l(e,n,o),s=(0,t.toMins)(r);return a.lunch&&s>=a.lunch.from&&s=a.dinner.from&&s=a.dinner.to?'dinner':a.lunch&&s=e?n:e);if('none'===r.kind||!o||o=h)break}return s},_e.repeatText=function(e,t){if('none'===e.kind)return;const n=t?` until ${p(t)}`:'';return'weekly'===e.kind?`Every ${[...e.days].sort().map(e=>a[e]).join(', ')}${n}`:`Last ${o[e.weekday]} of the month${n}`},Object.defineProperty(_e,"longDate",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"monthLabel",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"scopeText",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"whatText",{enumerable:!0,get:function(){return M}}),_e.confirmLine=function(e){const t=e.dates.length?1===e.dates.length?e.dates[0]===e.today?'today':p(e.dates[0]):e.repeat?`on ${e.dates.length} dates (${e.repeat})`:`${p(e.dates[0])} to ${p(e.dates[e.dates.length-1])}`:'no dates';return`Block ${c(e.from,e.to,e.wholeDay)} ${t}, ${y(e)}`},_e.bookingsInWindow=function(e,n,r,o,a,s){const u=new Set(n),i=(0,t.toMins)(r),c=(0,t.toMins)(o);return e.filter(e=>{if(!u.has(e.date)||!['confirmed','pending','seated'].includes(e.status))return!1;const n=(0,t.toMins)(e.time);if(n=c)return!1;const r=(e.table??'').split(/[^A-Za-z0-9]+/).filter(Boolean);return a.tables?.length?r.some(e=>a.tables.includes(e)):!a.areaId||r.some(e=>s?.(e)===a.areaId)})},_e.groupByMonth=function(e,n,r,o){const a=e.filter(e=>e.rid===n&&!e.removedAt&&(e.date>r||e.date===r&&(0,t.toMins)(e.to)>(0,t.toMins)(o))).sort((e,n)=>e.date===n.date?(0,t.toMins)(e.from)-(0,t.toMins)(n.from):e.date{const r=(0,t.parseYmd)(e);return r.setDate(r.getDate()+n),(0,t.ymd)(r)};function i(e){const n=(0,t.toMins)(e),r=Math.floor(n/60)%24;return`${r%12==0?12:r%12}:${String(n%60).padStart(2,'0')}${r<12?'am':'pm'}`}function c(e,t,n){if(n)return'all day';const r=i(e),o=i(t);return r.slice(-2)===o.slice(-2)?`${r.slice(0,-2)}\u2013${o}`:`${r}\u2013${o}`}function l(n,r,o){const a=(0,e.kitchenHoursOn)(n,(0,t.parseYmd)(r));if(!a)return{lunch:null,dinner:null};const s=(0,t.toMins)(a[0]),u=(0,t.toMins)(a[1]),i=1020,c=(e,n)=>{if(!e)return n;const r=Math.max(s,(0,t.toMins)(e[0])),o=Math.min(u,(0,t.toMins)(e[1]));return o>r?{from:r,to:o}:null};return{lunch:c(o?.lunch,si?{from:Math.max(i,s),to:u}:null)}}const d=e=>Math.ceil(e/r)*r;function f(e,t){const n=[];let r=e;for(;r<=t&&n.length<366;)n.push(r),r=u(r,1);return n}const m=(e,n)=>{const r=(0,t.parseYmd)(e);if(r.getDay()!==n)return!1;const o=new Date(r);return o.setDate(r.getDate()+7),o.getMonth()!==r.getMonth()},h=104;const p=e=>{const n=(0,t.parseYmd)(e);return`${o[n.getDay()]} ${n.getDate()} ${s[n.getMonth()]}`},g=e=>{const n=(0,t.parseYmd)(e);return`${s[n.getMonth()]} ${n.getFullYear()}`},y=e=>e.tables?.length?`table${e.tables.length>1?'s':''} ${e.tables.join(', ')}`:e.areaId?e.areaName??'one area':'all areas',M=e=>{const t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)}},1391,[862,863,861]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"wixBlockPushOn",{enumerable:!0,get:function(){return o}}),e.pushBlocksToWix=function(t,n,c){if(!o(t)||!n.length)return;const l=u.useSync.getState();if(!l.venueId||'guest'===l.kind)return;setTimeout(()=>{(0,s.getSupabase)().functions.invoke('wix-blocks-push',{body:{venue_id:l.venueId,block_ids:n.slice(0,120),action:c}}).catch(()=>{})},4e3)},Object.defineProperty(e,"websiteBlockStatus",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),u=r(d[3]);const o=s=>!t.IS_ISOLATED_VENUE&&!['souters','kirkmichael','wildings'].includes(s)&&!!n.useFloor.getState().settings[s]?.wixBlockPushOn;const c=t=>(t??'awaiting venue sync').replace(/\bWix\b/gi,'Website bookings')},1392,[805,996,892,946]); __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,"DAY_GRAPH_CHROME",{enumerable:!0,get:function(){return j}}),_e.DayGraph=function({todays:e,open:j,close:T,now:b,turnBase:v,blocks:w=[],height:M=150,forecastNote:k,emptyText:D,past:L,closed:I,compact:$=!1,dense:C=!1,bare:A=!1,fill:z=!1,fit:O=!1,tight:_=!1,live:H=!1,onChrome:S}){const[F,P]=(0,t.useState)(0),[E,R]=(0,t.useState)(0),[N,B]=(0,t.useState)(0),[W,X]=(0,t.useState)(0);s.default.useEffect(()=>{S&&O&&W&&S(Math.ceil((A?4:C?2:10)+N+W+(A?2:6)+2))},[S,O,N,W,A,C]);const U=j.getTime()-18e5,G=T.getTime()+36e5,Y=(0,t.useMemo)(()=>(0,f.coverCurve)(e,new Date(U),new Date(G),v),[e,U,G,v]),V=60*j.getHours()+j.getMinutes(),K=60*T.getHours()+T.getMinutes(),Z=(0,t.useMemo)(()=>(0,p.chartBands)(w,V,K),[w,V,K]),q=new Date(j);q.setHours(0,0,0,0);const J=e=>q.getTime()+6e4*e,Q=Math.max(8,...Y.map(e=>e.covers)),ee=Y.reduce((e,t)=>!t.covers||(0,p.minuteInsideVenueBlock)(60*new Date(t.t).getHours()+new Date(t.t).getMinutes(),Z)?e:!e||t.covers>e.covers?{t:t.t,covers:t.covers}:e,null),te=O&&E?Math.max(24,Math.floor(E)):Math.max(48,M-m.AXIS_BAND),se=m.CHART_PAD_L,ie=m.CHART_PAD_R,oe=C?18:22,ne=Math.max(10,F-se-ie),le=Math.max(10,te-oe-14),re=e=>se+(e-U)/(G-U)*ne,ae=e=>oe+le-e/(1.15*Q)*le,he=(0,m.yTicks)(Q),de=(0,m.fitYTicks)(he,ae,te,13),ue=(0,m.nowLineVisible)({now:b,open:j,close:T,live:H,past:L,closed:I}),ce=b.getTime(),ge=ue&&Y.length?(0,m.splitCurve)(Y,ce):{before:Y,after:[]},xe=e=>e.map((e,t)=>`${t?'L':'M'}${re(e.t).toFixed(1)},${ae(e.covers).toFixed(1)}`).join(' '),me=[];for(let e=new Date(U);e.getTime()<=G;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=U&&t.getTime()<=G&&me.push(t.getTime())}const pe=H?(0,m.seatedNowCovers)(e,e[0]?.date??''):0,fe=Math.min(G,Math.max(U,b.getTime())),ye=I?null:H?{t:fe,covers:pe,text:(0,m.seatedNowText)(pe)}:ee,je=F?(0,m.layoutChart)({width:F,height:te,t0:U,t1:G,hours:me,busiest:ye}):{hours:[],busiest:null},Te=xe(Y),be=ue?xe(ge.before):Te,ve=ue?xe(ge.after):'',we=z&&Te&&Y.length>1?`${Te} L${re(Y[Y.length-1].t).toFixed(1)},${ae(0).toFixed(1)} L${re(Y[0].t).toFixed(1)},${ae(0).toFixed(1)} Z`:'',Me=(0,i.coversFour)(e,e[0]?.date??''),ke=`Total ${Me.total} ${1===Me.total?'Cover':'Covers'}`,De=e.filter(e=>!['cancelled','noshow'].includes(e.status)).length,Le=je.busiest?.text??(I?'':H?(0,m.seatedNowText)(pe):ee?(0,m.busiestText)(ee.t,ee.covers):''),Ie=Z.map(e=>e.spoken).join('. '),$e=ue&&T.getTime()>j.getTime()?Math.max(0,Math.min(100,Math.round((ce-j.getTime())/(T.getTime()-j.getTime())*100))):null,Ce=!I&&ee&&ee.covers?(0,m.peakOccupancyText)(ee.t,ee.covers):'',Ae=`Covers through the day. Open ${(0,u.hm)(j)}. Close ${(0,u.hm)(T)}.${Ce?` ${Ce}.`:''}${Le?` ${Le}.`:''}${ue?` It is ${(0,u.hm)(b)}. About ${$e} percent of the way through the day.`:''}${Ie?` ${Ie}.`:''}`,ze=(0,u.hm)(b),Oe=Math.max(44,12*ze.length*.7+16),He=Math.max(se+2,Math.min(Math.max(0,F-ie-Oe),re(ce)-Oe/2)),Se=Math.max(2,Math.min(te-22,oe+le-22)),Fe=s.default.useId().replace(/:/g,'');return(0,y.jsxs)(o.default,{testID:"day-graph",style:[d.look.panel,O?{flex:1,minHeight:0}:null,{overflow:'visible',paddingTop:A?4:C?2:10,paddingBottom:A?2:6,backgroundColor:c.colours.bg}],children:[(0,y.jsxs)(o.default,{testID:"day-graph-head",onLayout:e=>B(e.nativeEvent.layout.height),children:[A?null:$?(0,y.jsxs)(o.default,{style:{alignItems:'center',gap:4,paddingHorizontal:14},children:[(0,y.jsx)(h.T,{center:!0,size:18,weight:"semibold",children:"Covers through the day"}),(0,y.jsx)(h.T,{center:!0,size:14,colour:c.colours.muted,testID:"day-graph-parties",children:ke}),Ce?(0,y.jsx)(h.T,{center:!0,size:13,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,children:Ce}):null]}):(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8},children:[(0,y.jsx)(h.T,{size:C?14:15,weight:"semibold",style:{flexShrink:1},children:"Covers through the day"}),(0,y.jsx)(h.T,{size:12,colour:c.colours.muted,testID:"day-graph-parties",children:ke})]}),A||_?null:I?k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:2,children:k}):null:(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'center',paddingHorizontal:14,gap:8,paddingTop:2},children:[(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Open ",(0,u.hm)(j)]}),Ce&&!$?(0,y.jsx)(h.T,{size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,center:!0,style:{flex:1,minWidth:0},children:Ce}):k?(0,y.jsx)(h.T,{size:11,colour:"#8C8477",numberOfLines:1,style:{flex:1,textAlign:'center'},children:k}):(0,y.jsx)(o.default,{style:{flex:1}}),(0,y.jsxs)(h.T,{size:12,colour:c.colours.goldLight,children:["Close ",(0,u.hm)(T)]})]}),A||_||$||!k||!Ce?null:(0,y.jsx)(h.T,{size:11,colour:"#8C8477",center:!0,numberOfLines:1,style:{paddingHorizontal:14},children:k}),A||!_||!Ce||$?null:(0,y.jsx)(h.T,{center:!0,size:12,colour:c.colours.goldLight,testID:"day-graph-peak",numberOfLines:1,style:{paddingHorizontal:14},children:Ce})]}),(0,y.jsxs)(o.default,{testID:"day-graph-plot",accessible:!0,accessibilityLabel:Ae,onLayout:e=>{P(e.nativeEvent.layout.width),O&&R(e.nativeEvent.layout.height)},style:O?{flexGrow:1,flexShrink:1,flexBasis:Math.max(48,M-m.AXIS_BAND),minHeight:24,overflow:'hidden',position:'relative'}:{height:te,minHeight:te,position:'relative',overflow:'hidden'},children:[F?(0,y.jsxs)(l.default,{width:F,height:te,children:[(0,y.jsxs)(n.Defs,{children:[(0,y.jsxs)(n.Pattern,{id:`${Fe}-venue`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"1.4"})]}),(0,y.jsxs)(n.Pattern,{id:`${Fe}-area`,patternUnits:"userSpaceOnUse",width:"8",height:"8",children:[(0,y.jsx)(n.Rect,{width:"8",height:"8",fill:"#2A2622",fillOpacity:"0.35"}),(0,y.jsx)(n.Line,{x1:"0",y1:"8",x2:"8",y2:"0",stroke:"#6A6258",strokeWidth:"0.8"})]})]}),Z.map((e,t)=>(0,y.jsx)(n.Rect,{x:re(J(e.fromMin)),y:oe,width:Math.max(3,re(J(e.toMin))-re(J(e.fromMin))),height:le,fill:`url(#${Fe}-${e.strength})`},`${e.fromMin}-${t}`)),he.map(e=>(0,y.jsx)(n.Line,{x1:se,x2:se+ne,y1:ae(e),y2:ae(e),stroke:c.colours.muted,strokeWidth:1,opacity:.28},`grid-${e}`)),ue?(0,y.jsx)(n.Rect,{testID:"day-graph-elapsed",x:re(j.getTime()),y:oe,width:Math.max(0,re(ce)-re(j.getTime())),height:le,fill:c.colours.gold,opacity:.12}):null,we?(0,y.jsx)(n.Path,{d:we,fill:"#3A2F1E",stroke:"none"}):null,be?(0,y.jsx)(n.Path,{d:be,stroke:c.colours.gold,strokeWidth:2.5,fill:"none"}):null,ve?(0,y.jsx)(n.Path,{d:ve,stroke:c.colours.gold,strokeWidth:2.5,fill:"none",opacity:.38}):null,I?null:[j,T].map((e,t)=>(0,y.jsx)(n.Line,{x1:re(e.getTime()),x2:re(e.getTime()),y1:oe,y2:oe+le,stroke:c.colours.goldLight,strokeWidth:1.5,strokeDasharray:"4,4"},`service-${t}`)),ue?(0,y.jsx)(n.Line,{testID:"day-graph-now",x1:re(ce),x2:re(ce),y1:oe,y2:oe+le,stroke:c.colours.gold,strokeWidth:2}):null,je.busiest?(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:je.busiest.x+je.busiest.w/2,y:je.busiest.y+je.busiest.h-2,fill:c.colours.gold,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:je.busiest.text}):null,De?null:(0,y.jsx)(n.Text,{fontFamily:"Poppins_500Medium",x:se+ne/2,y:oe+le/2,fill:c.colours.muted,fontSize:(0,x.soutersFont)(13),textAnchor:"middle",children:D??'No bookings yet today'})]}):null,F?de.map(e=>(0,y.jsx)(o.default,{testID:"day-graph-ytick",pointerEvents:"none",style:{position:'absolute',left:0,width:se-4,top:e.top,alignItems:'flex-end',justifyContent:'flex-start'},children:(0,y.jsx)(h.T,{size:e.font,numberOfLines:1,colour:c.colours.muted,style:{textAlign:'right'},children:String(e.value)})},`yt-${e.value}`)):null,F&&ue&&te>=m.YTICK_MIN_PLOT?(0,y.jsx)(o.default,{testID:"day-graph-now-label",pointerEvents:"none",style:{position:'absolute',left:He,top:Se,minWidth:Oe,height:20,paddingHorizontal:8,borderRadius:10,backgroundColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:12,weight:"semibold",colour:c.colours.bg,center:!0,numberOfLines:1,children:ze})}):null]}),(0,y.jsxs)(o.default,{testID:"day-graph-axis",onLayout:e=>X(e.nativeEvent.layout.height),style:{minHeight:m.AXIS_BAND,flexShrink:0,position:'relative',justifyContent:'center',paddingBottom:2},children:[(0,y.jsx)(o.default,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{opacity:0,alignSelf:'flex-start'},children:(0,y.jsx)(h.T,{size:m.AXIS_FONT,numberOfLines:1,children:"20"})}),je.hours.map(e=>{const t=Math.min(Math.max(e.w,40),Math.max(e.w,F)),s=e.x+e.w/2-t/2,i=Math.max(0,Math.min(Math.max(0,F-t),s));return(0,y.jsx)(o.default,{pointerEvents:"none",style:{position:'absolute',left:i,width:t,top:0,bottom:0,alignItems:i>s+.5?'flex-start':in.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1394,[]); +__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.seasonClosedAreaIds=s,e.chartBands=function(t,a,c){const u=s(t,a,c),f=[];for(const s of t){if(s.removedAt)continue;if(s.areaId&&u.has(s.areaId))continue;if(s.areaId||s.tables?.length)continue;const t=s.wholeDay?0:n(s.from),l=s.wholeDay?1440:n(s.to);if(null==t||null==l)continue;const h=Math.max(t,a),M=Math.min(l,c);if(M<=h)continue;const m=o(s,h,M);f.push({fromMin:h,toMin:M,strength:m.strength,spoken:m.spoken})}f.sort((n,t)=>n.fromMin-t.fromMin||n.toMin-t.toMin||(n.strength===t.strength?0:'area'===n.strength?-1:1));const l=[];for(const n of f){const t=l[l.length-1];t&&t.strength===n.strength&&n.fromMin<=t.toMin?(t.toMin=Math.max(t.toMin,n.toMin),t.spoken.includes(n.spoken)||(t.spoken=`${t.spoken}. ${n.spoken}`)):l.push({...n})}return l},e.blockedHours=function(n){const t=new Set;for(const o of n)if('venue'===o.strength)for(let n=Math.floor(o.fromMin/60);60*n=30&&t.add(n)}return[...t].sort((n,t)=>n-t)},e.minuteInsideVenueBlock=function(n,t){return t.some(t=>'venue'===t.strength&&n>=t.fromMin&&n{const t=/^(\d{1,2}):(\d{2})/.exec(n);return t?60*Number(t[1])+Number(t[2]):null},t=n=>`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`;function o(n,o,s){const a=`${t(o)} to ${t(s)}`,c=n.privateFunction?.title?.trim();if(!n.areaId&&!n.tables?.length){const n=`Bookings blocked ${a}`;return{strength:'venue',spoken:c?`${n}, ${c}`:n}}const u=`${n.areaName?.trim()||(n.tables?.length?'Tables':'Area')} blocked ${a}`;return{strength:'area',spoken:c?`${c}, ${u}`:u}}function s(t,o,s){const a=new Set;for(const c of t){if(c.removedAt||!c.areaId)continue;const t=c.wholeDay?0:n(c.from),u=c.wholeDay?1440:n(c.to);null!=t&&null!=u&&(t<=o&&u>=s&&a.add(c.areaId))}return a}},1394,[]); __d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.coverCurve=function(s,c,n,a){const u=s.filter(t=>!['cancelled','noshow'].includes(t.status)).map(o=>{const s=(0,t.startOf)(o).getTime();return{s:s,e:s+6e4*(0,t.durOf)(o,a),n:o.partySize}}),f=[];for(let t=c.getTime();t<=n.getTime();t+=o)f.push({t:t,covers:u.reduce((o,s)=>t>=s.s&&tt.covers));if(!o)return[];const s=[];return t.forEach((c,n)=>{const a=t.slice(Math.max(0,n-3),n+4);c.covers<.6*o||c.coverst.covers))||s.some(t=>Math.abs(t.from-c.t)<36e5)||s.push({from:c.t,to:c.t,covers:c.covers})}),s.slice(0,3)},e.quietOf=function(t,o,s){const c=Math.max(0,...t.map(t=>t.covers)),n=Math.max(2,.25*c),a=[];let u=null;const f=t.filter(t=>t.t>=o&&t.t<=s);return f.forEach((t,o)=>{const s=t.covers<=n;s&&null===u&&(u=t.t);const c=o===f.length-1;if((!s||c)&&null!==u){const o=t.t;o-u>=18e5&&a.push({from:u,to:o}),u=null}}),a.sort((t,o)=>o.to-o.from-(t.to-t.from)).slice(0,3).sort((t,o)=>t.from-o.from)};var t=r(d[0]);const o=9e5},1395,[1074]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CANCEL_TINT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"CANCEL_BORDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"CANCEL_INK",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"CANCEL_MUTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"cancelWhen",{enumerable:!0,get:function(){return d}}),e.cancelledBy=u,e.cancelItem=b,e.cancellationsFor=function(n,t,o){return n.filter(n=>n.date===t&&('cancelled'===n.status||'noshow'===n.status)).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name)).map(n=>b(n,o(n)))},Object.defineProperty(e,"cancellationsHeading",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"cancellationsEmpty",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"cancellationsCounts",{enumerable:!0,get:function(){return f}});var n=r(_d[0]),t=r(_d[1]);const o=n=>n?n.split('+').map(n=>n.trim()).filter(Boolean):[],i='#17140F',a='#6B5A35',l='#F3E7CC',c='#B8AA8A',s={online:'Website',phone:'Phone','in-person':'In person','walk-in':'Walk-in',email:'Email','third-party':'Third party'},d=(n,t)=>{if(!n)return null;const o=new Date(n);if(Number.isNaN(o.getTime()))return null;const i=o.toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'});return o.toLocaleDateString('en-CA',{timeZone:'Europe/London'})===t?i:`${o.toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short',timeZone:'Europe/London'})}, ${i}`};function u(n){const t=n;if('noshow'===n.status)return t.cancelled?.by?`Marked no-show by ${t.cancelled.by}`:'Marked no-show';if(t.cancelled?.by)return t.cancelled.by;const o=!!t.wix?.status&&/CANCEL|DECLIN/i.test(t.wix.status);return o&&t.wix?.archived?'Cancelled and archived in Website bookings':o?'Cancelled in Website bookings':(n.tags??[]).some(n=>n.endsWith(': deposit not paid'))||'PAYMENT_INFORMATION_PENDING'===t.wix?.status?'Website booking not finished (deposit not paid)':t.wix?.archived?'Archived in Website bookings':'Not recorded'}function b(i,a){const l=i,c=o(i.table??l.cancelled?.table??void 0),b=c.length?`Table ${(0,n.tableNumbers)(c.join('+'))}`:'No table',p=`${i.partySize} ${1===i.partySize?'person':'people'}`,h=d(l.cancelled?.at??(l.wix?l.wix.updatedDate:null),i.date),f=u(i),w=i.walkIn?'Walk-in':s[i.source??'']??(l.wix?'Website':'Not recorded'),y=(0,t.allergyLine)(i),C='noshow'===i.status,N=`${C?'No-show':'Cancelled'}: ${a}, ${y?`allergy noted: ${y}, `:''}${p}, was ${i.time}, ${b.toLowerCase()}. ${f}${h?` at ${h}`:''}.`;return{id:i.id,date:i.date,name:a,people:p,time:i.time,table:b,tables:c,walkIn:!!i.walkIn,by:f,when:h,source:w,notes:(i.notes??'').trim(),allergy:y,spoken:N,kind:C?'noshow':'cancelled'}}const p=n=>`Cancellations & no-shows ${n}`,h=(n="today")=>`No cancellations or no-shows ${n}.`,f=n=>{const t=n.filter(n=>'noshow'===n.kind).length,o=n.length-t;return`${o} ${1===o?'cancellation':'cancellations'} \xb7 ${t} ${1===t?'no-show':'no-shows'}`}},1396,[843,1374]); __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.CancellationsSection=function({items:e,dayWord:b="today",testID:y="display-cancellations"}){const[p,C]=(0,l.useState)(null),j=(0,s.cancellationsHeading)(e.length);return(0,u.jsxs)(o.default,{testID:y,style:{marginTop:14,borderRadius:12,backgroundColor:s.CANCEL_TINT,borderWidth:1,borderColor:s.CANCEL_BORDER,padding:10,gap:6},children:[(0,u.jsxs)(o.default,{accessible:!0,accessibilityRole:"header",accessibilityLabel:e.length?`${j}: ${(0,s.cancellationsCounts)(e)}. Not counted in Covers.`:`Cancellations and no-shows: none ${b}.`,style:{alignItems:'center',gap:2},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:c.colours.gold,center:!0,testID:"cancellations-head",children:j}),e.length?(0,u.jsx)(n.T,{size:14,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-counts",children:(0,s.cancellationsCounts)(e)}):null]}),e.length?e.map(e=>(0,u.jsxs)(t.default,{testID:`cancel-row-${e.id}`,accessibilityRole:"button",accessibilityLabel:e.spoken,accessibilityHint:"Opens the details. Read only.",onPress:()=>C(e),dataSet:{centreExempt:'list-row'},style:({pressed:e})=>({minHeight:56,paddingVertical:8,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:'rgba(214,180,106,0.18)',backgroundColor:e?'#241F16':'transparent'}),children:[(0,u.jsxs)(o.default,{style:{flexDirection:'row',gap:10,alignItems:'flex-start'},children:[(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{width:58,textDecorationLine:'line-through'},children:e.time}),(0,u.jsx)(n.T,{size:17,weight:"semibold",colour:s.CANCEL_INK,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:e.name}),(0,u.jsx)(o.default,{testID:`cancel-kind-${e.id}`,style:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:'noshow'===e.kind?c.colours.amber:s.CANCEL_BORDER},children:(0,u.jsx)(n.T,{size:13,weight:"semibold",colour:'noshow'===e.kind?c.colours.amber:s.CANCEL_MUTED,children:'noshow'===e.kind?'No-show':'Cancelled'})}),e.allergy?(0,u.jsx)(o.default,{style:{paddingTop:1},children:(0,u.jsx)(h.AllergyIcon,{text:e.allergy,size:20,colour:"#D6A23A",ink:"#17140F",testID:`cancel-allergy-${e.id}`})}):null]}),(0,u.jsxs)(n.T,{size:15,colour:s.CANCEL_MUTED,style:{marginLeft:68,marginTop:2,flexWrap:'wrap'},children:[e.people," \xb7 ",e.table," \xb7 ",e.by,e.when?` \xb7 ${e.when}`:'']})]},e.id)):(0,u.jsx)(n.T,{size:15,colour:s.CANCEL_MUTED,center:!0,testID:"cancellations-empty",children:(0,s.cancellationsEmpty)(b)}),p?(0,u.jsx)(x,{c:p,onClose:()=>C(null)}):null]})},_e.CancelDetail=x;var l=r(d[0]),t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]);function b({k:e,v:l}){return(0,u.jsxs)(o.default,{accessible:!0,accessibilityLabel:`${e}: ${l}`,style:{flexDirection:'row',gap:10,paddingVertical:6,borderBottomWidth:1,borderColor:c.colours.hairline},children:[(0,u.jsx)(n.T,{size:16,colour:c.colours.muted,style:{width:130},children:e}),(0,u.jsx)(n.T,{size:16,style:{flex:1,minWidth:0,flexWrap:'wrap'},children:l})]})}function x({c:e,onClose:l}){return(0,u.jsxs)(n.Sheet,{visible:!0,onClose:l,title:`${'noshow'===e.kind?'No-show':'Cancelled'} \xb7 ${e.name}`,maxWidth:560,testID:"cancel-detail",children:[(0,u.jsxs)(o.default,{testID:"cancel-detail-body",style:{gap:2},children:[(0,u.jsx)(b,{k:"Name",v:e.name}),(0,u.jsx)(b,{k:"Party",v:e.people}),e.allergy?(0,u.jsx)(b,{k:"Allergies",v:e.allergy}):null,(0,u.jsx)(b,{k:"Was booked for",v:`${e.date?`${new Date(`${e.date}T12:00:00`).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})}, `:''}${e.time}`}),(0,u.jsx)(b,{k:"Table",v:e.table}),(0,u.jsx)(b,{k:'noshow'===e.kind?'No-show':'Cancelled by',v:e.by}),(0,u.jsx)(b,{k:"When",v:e.when??'Not recorded'}),(0,u.jsx)(b,{k:"Booked by",v:e.source}),(0,u.jsx)(b,{k:"Notes",v:e.notes||'None'})]}),(0,u.jsx)(n.T,{size:14,colour:c.colours.muted,center:!0,children:"Read only. Not counted in Covers. Phone numbers stay in the Managers app."})]})}},1397,[17,385,85,777,1396,804,1353,8]); diff --git a/staff-app/admin.html b/staff-app/admin.html index ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 bc842a5cede8e570fa668bb3895b9bb194ed6a13..a885d5f2d7e3dd3e5632c310dd700b820d943895 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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 7243708919dd2c1b5454deee0fcd482411c2bdc4..d083d5959c896190de688a33973484c5a06f948c 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-450b5154d6"; +const V = "cc-staff-116e8dcf97"; const BASE = "/staff-app/"; -const PRECACHE = ["/staff-app/apple-touch-icon.png", "/staff-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/staff-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.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=450b5154d691b05099a4697785dca6d5d31bf4dcfe3cbf95e6ef40c4a0e4152d"]; +const PRECACHE = ["/staff-app/apple-touch-icon.png", "/staff-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/staff-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.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=116e8dcf979c089e921dc7b5f429a0270790f3ff9959a70a6c542f1048e39f3f"]; // 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 ae917bab1ac3345224f8a7e1f9887689a0a0c111..022c9d77409eae7fc1bce5c4362753a5ec50faac 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); })(); - +