Spaces:
Running
Running
Cover Charge prototype v0.2.22 (part 2)
Browse files- index.html +3 -3
- owner-app/_expo/static/js/web/[did]-e4382792c51e53176e20f8028790b773.js +1 -0
- owner-app/_expo/static/js/web/[n]-a3cbb5966c741787b42d024fc2e9cb89.js +1 -0
- owner-app/_expo/static/js/web/[oid]-affd80a8b572b9c207d9b216313d29dc.js +1 -0
- owner-app/_expo/static/js/web/__common-d89b80abe4ece4560b60220088bdf6bc.js +0 -0
- owner-app/_expo/static/js/web/_layout-bd589551787e47b00fbd6b08e692ff8c.js +37 -0
- owner-app/_expo/static/js/web/basket-60d8775a5a99f77545a887d7d328b00b.js +1 -0
- owner-app/_expo/static/js/web/book-1d5b97d633d6c3f7b1fac568474b5644.js +1 -0
- owner-app/_expo/static/js/web/entry-c34dc0265950def894404e0df8b08922.js +0 -0
- owner-app/_expo/static/js/web/feedback-6dbe946e1675fb596c5c4cd508919819.js +1 -0
- owner-app/_expo/static/js/web/index-03b3d77bd2e8a210ebb2df9f2863b203.js +1 -0
- owner-app/_expo/static/js/web/index-43fb9d706c5994dd4d4a0d08ebfdc367.js +1 -0
- owner-app/_expo/static/js/web/index-e169896d6181c62b56a7fa6a62cd6b62.js +14 -0
- owner-app/_expo/static/js/web/index-eda4f3212fdf4cd939574137be84916b.js +0 -0
- owner-app/_expo/static/js/web/index-f874fe0b7bfd6e4bab8776decab3fbe6.js +2 -0
- owner-app/_expo/static/js/web/lost-e43ed901b9bdb90a961de71b16ee2e27.js +1 -0
- owner-app/_expo/static/js/web/loyalty-7281429f7496b539476c8f7c06544800.js +1 -0
- owner-app/_expo/static/js/web/merch-497952082abffc295443c32cde709c8e.js +1 -0
- owner-app/_expo/static/js/web/offers-fdb0de6863fb561ae4062365be93c480.js +1 -0
- owner-app/_expo/static/js/web/profile-e81a333ab15babc6deb5b3640c1abdd5.js +1 -0
- owner-app/_expo/static/js/web/refer-c5e13b8f8bbd4d501f3766dbb492f81e.js +1 -0
- owner-app/_expo/static/js/web/waitlist-c4a5c3353222002f31152a4671fdfe2a.js +1 -0
- owner-app/_expo/static/js/web/whatson-9c60dd15f704285737d9a99e5fabdc58.js +1 -0
- owner-app/index.html +3 -3
- owner-app/sw.js +2 -2
- staff-app/_expo/static/js/web/[did]-e4382792c51e53176e20f8028790b773.js +1 -0
- staff-app/_expo/static/js/web/[oid]-affd80a8b572b9c207d9b216313d29dc.js +1 -0
- staff-app/_expo/static/js/web/__common-6585c9ee60e461f491e13a987c63fd48.js +0 -0
- staff-app/_expo/static/js/web/_layout-f70b124d1f3c941f34aa922543bca28c.js +0 -0
- staff-app/_expo/static/js/web/basket-f625050b5378b7835c7b0531a8d87b99.js +1 -0
- staff-app/_expo/static/js/web/book-1d5b97d633d6c3f7b1fac568474b5644.js +1 -0
- staff-app/_expo/static/js/web/entry-16d24b0817222185383fdee6e11e98a3.js +0 -0
- staff-app/_expo/static/js/web/feedback-6dbe946e1675fb596c5c4cd508919819.js +1 -0
- staff-app/_expo/static/js/web/index-290443ca5d64073e7ddab8a437bbbbfb.js +3 -0
- staff-app/_expo/static/js/web/index-31f5cb0976e95a627a66d3e2c4d7279e.js +0 -0
- staff-app/_expo/static/js/web/index-3c853b36d880be5dea66261a8f87ff95.js +1 -0
- staff-app/_expo/static/js/web/index-9eb8c7acf25af76b6df08b2c1d3e0564.js +2 -0
- staff-app/_expo/static/js/web/index-f92d197c1fe113b3fa2d8402c42f163d.js +0 -0
- staff-app/_expo/static/js/web/lost-1e6398f6494d3015c150145cf234acff.js +1 -0
- staff-app/_expo/static/js/web/loyalty-1983afbe0d08f311ef01775598cdda6e.js +36 -0
- staff-app/_expo/static/js/web/merch-2b36b9e0d2fa44fb3bb28bf4475e3cff.js +1 -0
- staff-app/_expo/static/js/web/offers-0aa896051a081d579d4564f13efc078e.js +1 -0
- staff-app/_expo/static/js/web/profile-226b50adbe3252e6b78e12d966a1af30.js +1 -0
- staff-app/_expo/static/js/web/refer-e7c486c6f38735576d3772011eb2da7b.js +1 -0
- staff-app/_expo/static/js/web/waitlist-3d5fa808005b46d07073a2a5135b539a.js +1 -0
- staff-app/_expo/static/js/web/whatson-9c60dd15f704285737d9a99e5fabdc58.js +1 -0
- staff-app/index.html +3 -3
- staff-app/sw.js +2 -2
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
| 6 |
-
<title>Cover Charge: try the apps (prototype v0.2.
|
| 7 |
<meta name="description" content="Try the five Cover Charge prototype web apps: Cover Charge for Managers, Cover Charge for Staff, Cover Charge, Cover Charge for Display and Cover Charge for Head Chef. Demo data only, no real payments.">
|
| 8 |
<meta name="theme-color" content="#000000">
|
| 9 |
<link rel="icon" href="favicon.ico">
|
|
@@ -60,7 +60,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
|
|
| 60 |
<img src="assets/logo-256.png" alt="Cover Charge logo" width="112" height="112">
|
| 61 |
<p class="word"><span class="c">cover</span><span class="g">charge</span></p>
|
| 62 |
<p class="tag">All in one restaurant booking app</p>
|
| 63 |
-
<h1>Cover Charge: try the apps (prototype v0.2.
|
| 64 |
<p class="pilot">Pilot: The Anchorage, Harbour View, Dunure · demo data only, no real payments</p>
|
| 65 |
<span class="pill">Prototype · nothing is sent or charged</span>
|
| 66 |
</header>
|
|
@@ -124,7 +124,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
|
|
| 124 |
</section>
|
| 125 |
|
| 126 |
<footer>
|
| 127 |
-
<p>Cover Charge prototype v0.2.
|
| 128 |
</footer>
|
| 129 |
</main>
|
| 130 |
</body>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
| 6 |
+
<title>Cover Charge: try the apps (prototype v0.2.22)</title>
|
| 7 |
<meta name="description" content="Try the five Cover Charge prototype web apps: Cover Charge for Managers, Cover Charge for Staff, Cover Charge, Cover Charge for Display and Cover Charge for Head Chef. Demo data only, no real payments.">
|
| 8 |
<meta name="theme-color" content="#000000">
|
| 9 |
<link rel="icon" href="favicon.ico">
|
|
|
|
| 60 |
<img src="assets/logo-256.png" alt="Cover Charge logo" width="112" height="112">
|
| 61 |
<p class="word"><span class="c">cover</span><span class="g">charge</span></p>
|
| 62 |
<p class="tag">All in one restaurant booking app</p>
|
| 63 |
+
<h1>Cover Charge: try the apps (prototype v0.2.22)</h1>
|
| 64 |
<p class="pilot">Pilot: The Anchorage, Harbour View, Dunure · demo data only, no real payments</p>
|
| 65 |
<span class="pill">Prototype · nothing is sent or charged</span>
|
| 66 |
</header>
|
|
|
|
| 124 |
</section>
|
| 125 |
|
| 126 |
<footer>
|
| 127 |
+
<p>Cover Charge prototype v0.2.22 · Demo data only. No real payments, messages or location tracking.</p>
|
| 128 |
</footer>
|
| 129 |
</main>
|
| 130 |
</body>
|
owner-app/_expo/static/js/web/[did]-e4382792c51e53176e20f8028790b773.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=_r(_d[0]),n=_r(_d[1]),l=e(_r(_d[2])),s=e(_r(_d[3])),r=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]);function f(){const{rid:e,did:f}=(0,t.useLocalSearchParams)(),b=(0,u.useRestaurant)(e),j=(0,u.useMenu)(e).find(e=>e.id===f),x=(0,u.useCustomer)(),m=(0,u.useRecipeCards)(e).find(e=>e.id===j?.recipeCardId),y=m?.signOff&&m.photo?(0,h.recipeCards)().photoSource(m.photo):null,k=(0,u.useStore)(e=>e.addLine),[v,w]=(0,n.useState)(()=>(j?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[S,C]=(0,n.useState)(1),[B,$]=(0,n.useState)(''),[I,P]=(0,n.useState)(!1),[L,T]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>j?(0,d.effectiveAllergens)(j,v):{},[j,v]);if(!b||!j)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Dish not found."})});const q=(0,d.conflictsFor)(R,x.allergies),_=(j.price??0)+(j.optionGroups??[]).flatMap(e=>e.choices).filter(e=>v.includes(e.id)).reduce((e,t)=>e+t.priceDelta,0),N=j.soldOut||!j.signOff||null===j.price,G=(e,t)=>{const n=j.optionGroups.find(t=>t.id===e);w(e=>{const l=n.choices.map(e=>e.id);return n.multi?e.includes(t)?e.filter(e=>e!==t):[...e,t]:e.includes(t)&&!n.required?e.filter(e=>e!==t):[...e.filter(e=>!l.includes(e)),t]})},z=e=>{u.useStore.getState().basket.restaurantId!==b.id&&u.useStore.getState().startBasket(b.id,'takeaway'),k({itemId:j.id,qty:S,choiceIds:v,notes:B,override:e?{allergens:q.contains,at:(new Date).toISOString()}:void 0}),P(!1),M(!0)};return(0,p.jsxs)(o.Screen,{title:j.name,subtitle:b.name,right:(0,p.jsx)(a.BasketButton,{}),children:[y?(0,p.jsx)(l.default,{testID:"dish-photo",source:y,accessibilityLabel:`${j.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===j.price?j.priceNote:(0,c.gbp)(_)}),j.dietary.map(e=>(0,p.jsx)(o.Badge,{kind:"green",label:e},e))]}),(0,p.jsx)(o.T,{children:j.description}),q.contains.length?(0,p.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,q.may.length?(0,p.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${q.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(j.optionGroups??[]).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(t=>(0,p.jsx)(o.Chip,{label:t.label,sub:t.priceDelta?`+${(0,c.gbp)(t.priceDelta)}`:void 0,selected:v.includes(t.id),onPress:()=>G(e.id,t.id)},t.id))})]},e.id)),(0,p.jsx)(o.Card,{children:(0,p.jsx)(r.AllergenPanel,{item:j,map:R,declared:x.allergies})}),b.fictional?null:(0,p.jsx)(o.ExampleAllergenNotice,{}),(0,p.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:B,onChangeText:$}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,p.jsx)(o.Stepper,{value:S,onChange:C,label:"quantity"})]}),A?(0,p.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:q.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,N?(0,p.jsx)(o.Banner,{kind:"warn",children:j.soldOut?'Sold out today.':j.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):q.contains.length?(0,p.jsxs)(s.default,{style:{gap:8},children:[(0,p.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,p.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{T(!1),O(!1),P(!0)},testID:"override-open"})]}):(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{style:{flex:1},label:`Add ${S} to basket \xb7 ${(0,c.gbp)(_*S)}`,onPress:()=>z(!1),testID:"add-to-basket"}),A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,p.jsxs)(o.Sheet,{visible:I,onClose:()=>P(!1),title:"Allergy override",children:[(0,p.jsx)(o.Banner,{kind:"danger",title:`${j.name} contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,p.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:L,onChange:T}),(0,p.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:D,onChange:O}),(0,p.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,p.jsx)(o.Button,{kind:"danger",disabled:!L||!D,label:"Confirm override and add",onPress:()=>z(!0),testID:"override-confirm"})]})]})}},760,[785,12,178,109,807,808,791,792,794,797,809,799,6]);
|
owner-app/_expo/static/js/web/[n]-a3cbb5966c741787b42d024fc2e9cb89.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=_r(d[0]),r=_r(d[1]),u=_r(d[2]),n=_r(d[3]),s=_r(d[4]);function c(){const{n:c,r:o}=(0,t.useLocalSearchParams)(),f=(0,u.useStore)(t=>t.startBasket),[l,b]=(0,r.useState)(!1),_=o??n.VENUE_RID,S=(0,u.useOrderAtTable)(_);return(0,r.useEffect)(()=>{S&&f(_,'table',String(c)),b(!0)},[_,c,S]),l?(0,s.jsx)(t.Redirect,{href:`/customer/${_}`}):null}},776,[785,12,797,821,6]);
|
owner-app/_expo/static/js/web/[oid]-affd80a8b572b9c207d9b216313d29dc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return w}});var e,t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=(e=l)&&e.__esModule?e:{default:e},n=_r(d[3]),o=_r(d[4]),i=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),p=_r(d[9]),b=_r(d[10]),y=_r(d[11]);const j=[['new','Placed'],['acknowledged','Accepted'],['preparing','Cooking'],['ready','Ready to collect'],['collected','Collected']],x=[['new','Sent'],['acknowledged','Accepted'],['preparing','Cooking'],['served','Food out'],['closed','Paid']];function w(){const{oid:e}=(0,t.useLocalSearchParams)(),l=(0,p.useOrder)(e),w=(0,p.useRestaurant)(l?.restaurantId),[f,T]=(0,s.useState)(0),[C,S]=(0,s.useState)(''),[k,v]=(0,s.useState)(!1),[P,M]=(0,s.useState)(!1),[$,R]=(0,s.useState)(1),[A,I]=(0,s.useState)(0),[O,B]=(0,s.useState)(l?.split?.ways??1);if(!l||!w)return(0,y.jsx)(i.Screen,{title:"Order",children:(0,y.jsx)(i.T,{children:"Order not found."})});const N='takeaway'===l.type?j:x,H=Math.max(0,N.findIndex(([e])=>e===l.status)),_=Math.round(l.subtotal*A/100),D='table'===l.type?l.subtotal+(l.split?l.tip:_):l.total,F=D-l.paid,q=l.split?.ways??O,L=l.split?.paidShares??0,W=Math.ceil(D/q),Y='collected'===l.status||'closed'===l.status;return(0,y.jsxs)(i.Screen,{title:`Order ${l.ref}`,subtitle:`${w.name} \xb7 ${'table'===l.type?`Table ${l.tableNo}`:`Collection at ${l.slotTime?(0,h.hm)(new Date(l.slotTime)):'\u2014'}`}`,children:['takeaway'===l.type?(0,y.jsx)(i.Banner,{kind:"success",title:'ready'===l.status?'Your order is ready!':'Order placed and paid (demo)',children:'ready'===l.status?'Head to the bar and give your order number. Staff will check allergies with you at handover.':`Show order number ${l.ref} at the bar when you arrive.`}):null,(0,y.jsxs)(i.Card,{children:[(0,y.jsx)(i.H2,{children:"Status"}),N.map(([e,t],s)=>(0,y.jsxs)(i.Row,{gap:10,children:[(0,y.jsx)(r.default,{style:{width:22,height:22,borderRadius:11,backgroundColor:s<=H?b.colours.gold:b.colours.surface2,borderWidth:1,borderColor:b.colours.gold}}),(0,y.jsx)(i.T,{weight:s===H?'semibold':'regular',colour:s<=H?b.colours.text:b.colours.muted,children:t})]},e)),l.allergyAck?(0,y.jsxs)(i.Muted,{children:["Kitchen signed off your allergies (",l.allergyAck.by,", ",(0,h.hm)(new Date(l.allergyAck.at)),")"]}):l.allergies.length?(0,y.jsx)(i.Muted,{children:"Waiting for the kitchen to sign off your allergies\u2026"}):null,'takeaway'!==l.type||Y?null:(0,y.jsxs)(i.Row,{gap:8,children:[(0,y.jsx)(i.Button,{small:!0,kind:'on-my-way'===l.customerSignal?'primary':'secondary',label:"On my way",onPress:()=>p.repo.orders.customerSignal(l.id,'on-my-way')}),(0,y.jsx)(i.Button,{small:!0,kind:'here'===l.customerSignal?'primary':'secondary',label:"I\u2019m here",onPress:()=>p.repo.orders.customerSignal(l.id,'here')})]})]}),(0,y.jsxs)(i.Card,{children:[(0,y.jsx)(i.H2,{children:"Items"}),l.lines.map((e,t)=>(0,y.jsxs)(r.default,{children:[(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(i.T,{style:{flex:1},children:[e.qty,"\xd7 ",e.name]}),(0,y.jsx)(i.T,{children:(0,u.gbp)(e.unitPrice*e.qty)})]}),e.choices.length?(0,y.jsx)(i.Muted,{children:e.choices.join(' \xb7 ')}):null,e.overridden?(0,y.jsx)(i.Badge,{kind:"red",label:`Allergy override: ${e.contains.map(c.allergenLabel).join(', ')}`}):null]},t)),(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Subtotal"}),(0,y.jsx)(i.T,{children:(0,u.gbp)(l.subtotal)})]}),l.giftCardApplied?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Of which gift card"}),(0,y.jsxs)(i.T,{colour:b.colours.green,children:["\u2212",(0,u.gbp)(l.giftCardApplied)]})]}):null,l.tip?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Tip"}),(0,y.jsx)(i.T,{children:(0,u.gbp)(l.tip)})]}):null,(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Paid (demo)"}),(0,y.jsx)(i.T,{weight:"semibold",colour:b.colours.gold,children:(0,u.gbp)(l.paid)})]})]}),'table'===l.type&&'closed'!==l.status&&'cancelled'!==l.status?(0,y.jsxs)(i.Card,{highlight:b.colours.gold,children:[(0,y.jsxs)(i.H2,{children:["Your bill \u2014 Table ",l.tableNo]}),l.split?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(i.T,{children:["Total ",(0,u.gbp)(D)," \xb7 split ",q," way",q>1?'s':''," \xb7 ",(0,u.gbp)(W)," each"]}),(0,y.jsxs)(i.T,{children:["Shares paid: ",L," of ",q," \xb7 remaining ",(0,u.gbp)(F)]}),q>1?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{children:"Shares to pay now"}),(0,y.jsx)(i.Stepper,{value:$,onChange:R,min:1,max:q-L,label:"shares"})]}):null,(0,y.jsx)(i.Button,{label:`Pay ${q>1?`${$} share${$>1?'s':''}`:'bill'} \xb7 ${(0,u.gbp)(Math.min(F,W*$))}`,onPress:()=>M(!0),testID:"pay-bill"})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Add a tip?"}),(0,y.jsx)(i.Row,{wrap:!0,children:[0,10,12.5,15].map(e=>(0,y.jsx)(i.Chip,{label:e?`${e}%`:'No tip',selected:A===e,onPress:()=>I(e)},e))}),(0,y.jsx)(i.Muted,{children:"Tips go to staff under the restaurant\u2019s tipping policy (Employment (Allocation of Tips) Act 2023)."}),(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Split evenly between"}),(0,y.jsx)(i.Stepper,{value:O,onChange:B,min:1,max:8,label:"people"})]}),(0,y.jsxs)(i.T,{children:["Total ",(0,u.gbp)(l.subtotal+_),O>1?` \xb7 ${(0,u.gbp)(Math.ceil((l.subtotal+_)/O))} each`:'']}),(0,y.jsx)(i.Button,{label:"Get the bill",onPress:()=>p.repo.orders.setSplit(l.id,O,_),testID:"get-bill"})]})]}):null,!Y||l.rated||k?null:(0,y.jsxs)(i.Card,{highlight:b.colours.gold,children:[(0,y.jsx)(i.H2,{children:"How was everything?"}),(0,y.jsxs)(i.Muted,{children:["One tap \u2014 this goes privately to ",w.name," only, never published."]}),(0,y.jsx)(o.Stars,{value:f,onChange:T}),f?(0,y.jsx)(i.Field,{label:"Anything to add? (optional)",value:C,onChangeText:S}):null,(0,y.jsx)(i.Button,{label:"Send feedback",disabled:!f,onPress:()=>{p.repo.feedback.add({restaurantId:w.id,orderId:l.id,customerId:l.customerId,customerName:l.customerName,stars:f,comment:C,context:'table'===l.type?`Table ${l.tableNo}`:`Takeaway ${l.ref}`}),v(!0)},testID:"send-rating"})]}),k||l.rated?(0,y.jsx)(i.Banner,{kind:"success",children:"Thanks \u2014 your feedback went privately to the restaurant."}):null,Y?(0,y.jsx)(i.Button,{kind:"secondary",label:"View stamp card",onPress:()=>t.router.push(`/customer/${w.id}/loyalty`)}):null,(0,y.jsx)(n.MockPay,{visible:P,onClose:()=>M(!1),amount:Math.min(F,W*$),restaurantId:w.id,title:`Pay \u2014 Table ${l.tableNo}`,onPaid:e=>{p.repo.orders.payTable(l.id,{shares:$,giftCardCode:e.giftCardCode}),M(!1),R(1)}})]})}},773,[785,12,109,790,810,791,792,794,796,797,799,6]);
|
owner-app/_expo/static/js/web/__common-d89b80abe4ece4560b60220088bdf6bc.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
owner-app/_expo/static/js/web/_layout-bd589551787e47b00fbd6b08e692ff8c.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return R}});var t=r(_d[0]),s=r(_d[1]),n=r(_d[2]),o=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,t})(r(_d[3])),u=r(_d[4]),c=r(_d[5]),l=e(r(_d[6])),d=e(r(_d[7]));r(_d[8]);var f=e(r(_d[9])),p=e(r(_d[10])),y=r(_d[11]),h=r(_d[12]),S=r(_d[13]),j=r(_d[14]),O=r(_d[15]),b=r(_d[16]),_=r(_d[17]),w=r(_d[18]),P=r(_d[19]),v=r(_d[20]);r(_d[21]);var x=r(_d[22]),E=r(_d[23]),A=r(_d[24]),k=r(_d[25]);const H=r(_d[26]),T=r(_d[27]),B=r(_d[28]),F=r(_d[29]);function R(){const[e]=(0,t.useFonts)({Poppins_400Regular:H,Poppins_500Medium:T,Poppins_600SemiBold:B,Poppins_700Bold:F}),[P,R]=(0,c.useState)(j.useStore.persist.hasHydrated()),[I,M]=(0,c.useState)(b.useOwner.persist.hasHydrated()),C=P&&I;(0,c.useEffect)(()=>{const e=j.useStore.persist.onFinishHydration(()=>R(!0)),t=b.useOwner.persist.onFinishHydration(()=>M(!0));return j.useStore.persist.hasHydrated()&&R(!0),b.useOwner.persist.hasHydrated()&&M(!0),()=>{e(),t()}},[]),(0,c.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===j.useStore.persist.getOptions().name&&j.useStore.persist.rehydrate(),e.key===O.useFloor.persist.getOptions().name&&O.useFloor.persist.rehydrate(),e.key===s.useBlocks.persist.getOptions().name&&s.useBlocks.persist.rehydrate()};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]),(0,c.useEffect)(()=>{C&&b.useOwner.getState().syncRoster()},[C]),(0,c.useEffect)(()=>{C&&(0,v.startAppSync)()},[C]);const L=e&&C,N=(0,n.usePathname)(),V=L&&!(0,h.isAllowedPath)(N||'/');return(0,c.useEffect)(()=>{if(!V)return;const e=setTimeout(()=>n.router.replace(h.ENTRY[h.APP_VARIANT]),0);return()=>clearTimeout(e)},[V,N]),(0,c.useEffect)(()=>{L&&o.hideAsync().catch(()=>{})},[L]),L?(0,k.jsxs)(S.SafeAreaProvider,{children:[(0,k.jsx)(u.StatusBar,{style:"light"}),(0,k.jsx)(n.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:_.colours.bg}}}),V?(0,k.jsx)(p.default,{style:[f.default.absoluteFill,{backgroundColor:_.colours.bg}]}):null,V?null:(0,k.jsx)(E.VoiceHost,{}),(0,k.jsx)(x.SyncBadge,{}),(0,k.jsx)(w.InviteGate,{}),V?null:(0,k.jsx)(A.SliderHost,{})]}):(0,k.jsxs)(p.default,{style:{flex:1,backgroundColor:_.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[(0,k.jsx)(d.default,{source:y.HERO_LOGOS.anchorage,accessibilityLabel:"The Anchorage logo",style:{width:180,height:180},resizeMode:"contain"}),(0,k.jsx)(l.default,{color:_.colours.gold})]})}P.START_INVITE,o.preventAutoHideAsync().catch(()=>{})},783,[958,802,785,985,549,12,228,178,104,28,109,844,787,271,797,803,812,799,900,816,798,987,988,989,836,6,990,991,992,993]);
|
| 2 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return o.useFonts}});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var o=r(d[2])},958,[959,982,984]);
|
| 3 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"FontDisplay",{enumerable:!0,get:function(){return y.FontDisplay}}),_e.isLoaded=F,_e.getLoadedFonts=function(){return t.default.getLoadedFonts()},_e.isLoading=function(e){return e in c.loadPromises},_e.loadAsync=function(e,n){const t='undefined'==typeof window;if(Array.isArray(e)){if(n)return Promise.reject(new o.CodedError("ERR_FONT_API",`No fontFamily can be used for the provided source: ${n}. The second argument of \`loadAsync()\` can only be used with a \`string\` value as the first argument.`));const s=e;if(t){(0,l.assertValidFontFamilyDefinitions)(s);for(const{fontFamily:e,fontDefinitions:o}of s){(0,l.assertValidFontFaces)(e,o);for(const n of o)(0,u.registerStaticFont)(e,(0,f.fontSourceFromFace)(n))}return Promise.resolve()}try{(0,l.assertValidFontFamilyDefinitions)(s)}catch(e){return Promise.reject(e)}return Promise.all(s.map(w)).then(()=>{})}if('object'==typeof e){if(n)return Promise.reject(new o.CodedError("ERR_FONT_API",`No fontFamily can be used for the provided source: ${n}. The second argument of \`loadAsync()\` can only be used with a \`string\` value as the first argument.`));const s=e,l=Object.keys(s);return t?(l.map(e=>(0,u.registerStaticFont)(e,s[e])),Promise.resolve()):Promise.all(l.map(e=>h(e,s[e]))).then(()=>{})}if(t)return(0,u.registerStaticFont)(e,n),Promise.resolve();return h(e,n)},_e.unloadAllAsync=async function(){if(!t.default.unloadAllAsync)throw new o.UnavailabilityError('expo-font','unloadAllAsync');if(Object.keys(c.loadPromises).length)throw new o.CodedError("ERR_UNLOAD",`Cannot unload fonts while they're still loading: ${Object.keys(c.loadPromises).join(', ')}`);(0,c.purgeCache)(),await t.default.unloadAllAsync()},_e.unloadAsync=async function(e,n){if(!t.default.unloadAsync)throw new o.UnavailabilityError('expo-font','unloadAsync');if('object'==typeof e){if(n)throw new o.CodedError("ERR_FONT_API",`No fontFamily can be used for the provided options: ${n}. The second argument of \`unloadAsync()\` can only be used with a \`string\` value as the first argument.`);const t=e,s=Object.keys(t);return void await Promise.all(s.map(e=>p(e,t[e])))}return await p(e,n)};var e,o=r(d[0]),n=r(d[1]),t=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),l=r(d[3]),f=r(d[4]),c=r(d[5]),u=r(d[6]),y=r(d[7]);function F(e){if('function'!=typeof t.default.isLoaded)throw new Error("expected ExpoFontLoader.isLoaded to be a function, was "+typeof t.default.isLoaded);return(0,c.isLoadedInCache)(e)||t.default.isLoaded(e)}async function w(e){const{fontFamily:o,fontDefinitions:n}=e;if((0,l.assertValidFontFaces)(o,n),c.loadPromises.hasOwnProperty(o))return c.loadPromises[o];F(o)||(c.loadPromises[o]=(async()=>{try{await(0,s.loadFontFamilyAsync)(o,n),(0,c.markLoaded)(o)}finally{delete c.loadPromises[o]}})(),await c.loadPromises[o])}async function h(e,n){if(!n)throw new o.CodedError("ERR_FONT_SOURCE",`Cannot load null or undefined font source: { "${e}": ${n} }. Expected asset of type \`FontSource\` for fontFamily of name: "${e}"`);if(c.loadPromises.hasOwnProperty(e))return c.loadPromises[e];if(F(e))return;const t=(0,s.getAssetForSource)(n);c.loadPromises[e]=(async()=>{try{await(0,s.loadSingleFontAsync)(e,t),(0,c.markLoaded)(e)}finally{delete c.loadPromises[e]}})(),await c.loadPromises[e]}async function p(e,n){if(F(e)){if((0,c.purgeFontFamilyFromCache)(e),!e)throw new o.CodedError("ERR_FONT_FAMILY","Cannot unload an empty name");if(!t.default.unloadAsync)throw new o.UnavailabilityError('expo-font','unloadAsync');await t.default.unloadAsync(e,n)}}},959,[283,960,963,977,978,979,980,981]);
|
| 4 |
+
__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 p}}),e._matchesFontFaceOptions=l,e._fontFaceRuleSrcMatches=f,e._createWebFontTemplate=R;var t=r(d[0]),n=r(d[1]);function s(){if('undefined'==typeof window)return null;const t=S();return t.sheet?t.sheet:null}function o(){const t=s();if(t){const n=[...t.cssRules],s=[];for(let t=0;t<n.length;t++){const o=n[t];o instanceof CSSFontFaceRule&&s.push({rule:o,index:t})}return s}return[]}function i(t){const n=t?.trim();if(!n)return'';const s=n[0];return n.length>=2&&('"'===s||"'"===s)&&n.endsWith(s)?n.slice(1,-1).replace(/\\(.)/g,'$1'):n}function u(t){if(null==t||''===t)return;if('number'==typeof t)return Number.isFinite(t)?t:void 0;const n=t.trim().toLowerCase();if('normal'===n)return 400;if('bold'===n)return 700;const s=Number(n);return Number.isFinite(s)?s:n}function l(t,n,s){return i(t.style.fontFamily)===n&&((!s?.display||s.display===t.style.fontDisplay)&&((null==s?.weight||u(s.weight)===u(t.style.fontWeight))&&(null==s?.style||s.style===t.style.fontStyle)))}function c(t,n){return o().filter(({rule:s})=>l(s,t,n))}function f(t,n){const s=t.style.getPropertyValue('src').match(/url\((['"]?)([^'")]*)\1\)/);if(!s)return!0;let o=s[2]??'';try{o=decodeURIComponent(o)}catch{}return o===String(n)}const a={async unloadAllAsync(){if('undefined'==typeof window)return;const t=document.getElementById(w);t&&t instanceof HTMLStyleElement&&document.removeChild(t)},async unloadAsync(t,n){const o=s();if(!o)return;const i=[...c(t,n)].sort((t,n)=>n.index-t.index);for(const t of i)o.deleteRule(t.index)},getServerResources:()=>(0,n.getServerResourceDescriptors)().map(t=>{switch(t.type){case'style':return`<style id="${t.id}">${t.css}</style>`;case'link':return`<link rel="${t.rel}" href="${t.href}" as="${t.as}" crossorigin="${t.crossOrigin}" />`;default:return''}}).filter(Boolean),getServerResourceDescriptors:()=>(0,n.getServerResourceDescriptors)(),getLoadedFonts(){if('undefined'==typeof window)return(0,n.getLoadedServerFonts)();const t=new Set,s=[];for(const{rule:n}of o()){const o=i(n.style.fontFamily);t.has(o)||(t.add(o),s.push(o))}return s},isLoaded:(t,s={})=>'undefined'==typeof window?(0,n.isServerFontLoaded)(t):c(t,s)?.length>0,loadAsync(s,o){if('undefined'==typeof window)return(0,n.addServerFont)({name:s,css:R(s,o),resourceId:o.uri}),Promise.resolve();if(!(document.head&&'function'==typeof document.head.appendChild))throw new t.CodedError('ERR_WEB_ENVIRONMENT',"The browser's `document.head` element doesn't support injecting fonts.");const i=S();i.isConnected||document.head.appendChild(i);if(c(s,o).some(({rule:t})=>f(t,o.uri))||b(s,o),'function'!=typeof document.fonts?.load)return Promise.resolve();let u='';return'string'==typeof o.style&&$.test(o.style)&&(u+=`${o.style} `),('number'==typeof o.weight&&Number.isFinite(o.weight)||'string'==typeof o.weight&&($.test(o.weight)||F.test(o.weight)&&!o.weight.includes(' ')))&&(u+=`${o.weight} `),h(document.fonts.load(`${u}1em ${JSON.stringify(s)}`),s)}},y=12e3;function h(n,s){let o;const i=new Promise((n,i)=>{o=setTimeout(()=>{i(new t.CodedError('ERR_DOWNLOAD',`Fetching the font family "${s}" timed out after ${y}ms. Check that the font URL is reachable and served with CORS headers.`))},y)});return Promise.race([n,i]).finally(()=>clearTimeout(o)).then(()=>{})}var p='undefined'==typeof window?a:(0,t.registerWebModule)(function(){return a},'ExpoFontLoader');const w='expo-generated-fonts';function S(){const t=document.getElementById(w);if(t&&t instanceof HTMLStyleElement)return t;const n=document.createElement('style');return n.id=w,n}const $=/^[a-zA-Z_-][\w-]*$/,F=/^(1000|[1-9]\d{0,2})( (1000|[1-9]\d{0,2}))?$/;function R(t,n){const s=[`font-family:${JSON.stringify(t)}`,`src:url(${JSON.stringify(n.uri)})`];return'string'==typeof n.display&&$.test(n.display)&&s.push(`font-display:${n.display}`),('number'==typeof n.weight&&Number.isFinite(n.weight)||'string'==typeof n.weight&&($.test(n.weight)||F.test(n.weight)))&&s.push(`font-weight:${n.weight}`),'string'==typeof n.style&&$.test(n.style)&&s.push(`font-style:${n.style}`),`@font-face{${s.join(';')}}`}function b(t,n){const s=R(t,n),o=S();if(o.styleSheet){const t=o;t.styleSheet.cssText=t.styleSheet.cssText?t.styleSheet.cssText+s:s}else if(o.sheet)o.sheet.insertRule(s,o.sheet.cssRules.length);else{const t=document.createTextNode(s);o.appendChild(t)}return o}},960,[283,961]);
|
| 5 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.withServerContext=function(n){if('undefined'!=typeof window)return n();return s().run(new Map,n)},e.addServerFont=function(n){const t=u();t.has(n.css)||t.set(n.css,n)},e.getServerResourceDescriptors=function(){const n=[...u().values()];if(!n.length)return[];const o=n.map(({css:n})=>n).join('\n'),s=[...new Set(n.map(({resourceId:n})=>n))];return[{css:o,id:t,type:'style'},...s.map(n=>({as:'font',crossOrigin:'',href:n,rel:'preload',type:'link'}))]},e.getLoadedServerFonts=function(){const n=s().getStore();if(!n)return[];return[...new Set([...n.values()].map(({name:n})=>n))]},e.isServerFontLoaded=function(n){const t=s().getStore();if(!t)return!1;for(const o of t.values())if(o.name===n)return!0;return!1};var n=r(d[0]);const t='expo-generated-fonts';let o=null;function s(){if('undefined'!=typeof window)throw new Error('expo-font server context is server-only and cannot be used in the browser.');return o||(o=new n.AsyncLocalStorage),o}function u(){const n=s().getStore();if(!n)throw new Error("expo-font server context accessed outside of withServerContext(). Wrap your server-side font usage in withServerContext(() => /* server code */).");return n}},961,[962]);
|
| 6 |
+
__d(function(g,r,i,a,m,e,d){},962,[]);
|
| 7 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getAssetForSource=p,_e.loadFontFamilyAsync=async function(t,e){await Promise.all(e.map(e=>{const o=p((0,f.fontSourceFromFace)(e));return j(t,o)}))},_e.loadSingleFontAsync=j;var t,e=r(d[0]),o=r(d[1]),n=r(d[2]),u=(t=n)&&t.__esModule?t:{default:t};r(d[3]);var f=r(d[4]);function s(t){return'string'==typeof t?t||null:'number'==typeof t?s(e.Asset.fromModule(t)):'object'==typeof t&&'number'==typeof t.uri?s(t.uri):'object'==typeof t&&(t.uri||t.localUri||t.default)||null}function c(t){if('object'==typeof t&&'display'in t)return t.display??void 0}function l(t){if('object'==typeof t&&'weight'in t)return t.weight??void 0}function y(t){if('object'==typeof t&&'style'in t)return t.style??void 0}function p(t){const e=s(t),o=c(t),n=l(t),u=y(t);return e&&'string'==typeof e||b(e),{uri:e,display:o,weight:n,style:u}}function b(t){let e=typeof t;throw'object'===e&&(e=JSON.stringify(t,null,2)),new o.CodedError("ERR_FONT_SOURCE",`Expected font asset of type \`string | FontResource | Asset\` instead got: ${e}`)}function j(t,e){return('object'!=typeof e||'string'!=typeof e.uri||e.downloadAsync)&&b(e),u.default.loadAsync(t,e)}},963,[964,283,960,977,978]);
|
| 8 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),r(d[0]);var t=r(d[1]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[2]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})},964,[965,966,976]);
|
| 9 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";var e,t=r(d[0]),s=r(d[1]),u=r(d[2]),o=(e=u)&&e.__esModule?e:{default:e};if(s.IS_ENV_WITH_LOCAL_ASSETS){(o.default.setCustomSourceTransformer||u.setCustomSourceTransformer)(function(e){try{if('fileHashes'in e.asset&&e.asset.fileHashes){const s=t.Asset.fromMetadata(e.asset);return s.uri.startsWith(t.ANDROID_EMBEDDED_URL_BASE_RESOURCE)?e.resourceIdentifierWithoutScale():e.fromSource(s.downloaded?s.localUri:s.uri)}return e.defaultAsset()}catch{return e.defaultAsset()}})}},965,[966,970,975]);
|
| 10 |
+
__d(function(g,r,i,a,m,_e,_d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}function e(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(s){if('default'!==s){var n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,n.get?n:{enumerable:!0,get:function(){return t[s]}})}}),e.default=t,e}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ANDROID_EMBEDDED_URL_BASE_RESOURCE",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"Asset",{enumerable:!0,get:function(){return w}}),r(_d[0]);var s=t(r(_d[1])),n=r(_d[2]),h=e(r(_d[3])),o=r(_d[4]),l=e(r(_d[5])),u=r(_d[6]),d=r(_d[7]),c=t(r(_d[8]));function f(t){return!!t&&'object'==typeof t&&'uri'in t&&'string'==typeof t.uri}const y='file:///android_res/';class w{static byHash={};static byUri={};hash=null;localUri=null;width=null;height=null;downloading=!1;downloaded=!1;_downloadCallbacks=[];constructor({name:t,type:e,hash:s=null,uri:n,width:o,height:l}){this.name=t,this.type=e,this.hash=s,this.uri=n,'number'==typeof o&&(this.width=o),'number'==typeof l&&(this.height=l),s&&(this.localUri=(0,u.getLocalAssetUri)(s,e),this.localUri?.startsWith(y)?(this.uri=this.localUri,this.localUri=null):this.localUri&&(this.downloaded=!0)),t||(this.name=h.getFilename(n)),e||(this.type=h.getFileExtension(n))}static loadAsync(t){const e=Array.isArray(t)?t:[t];return Promise.all(e.map(t=>w.fromModule(t).downloadAsync()))}static fromModule(t){if('string'==typeof t)return w.fromURI(t);if(f(t)){const e=h.getFileExtension(t.uri);return new w({name:'',type:e.startsWith('.')?e.substring(1):e,hash:null,uri:t.uri,width:t.width,height:t.height})}const e=s.default.getAssetByID(t);if(!e)throw new Error(`Module "${t}" is missing from the asset registry`);if(!d.IS_ENV_WITH_LOCAL_ASSETS){const{uri:s}=(0,c.default)(t),n=new w({name:e.name,type:e.type,hash:e.hash,uri:s,width:e.width,height:e.height});return w.byHash[e.hash]=n,n}return w.fromMetadata(e)}static fromMetadata(t){const e=t.hash,s=w.byHash[e];if(s)return s;const{uri:h,hash:o}=(0,n.selectAssetSource)(t),l=new w({name:t.name,type:t.type,hash:o,uri:h,width:t.width,height:t.height});return w.byHash[e]=l,l}static fromURI(t){if(w.byUri[t])return w.byUri[t];let e='';if(t.indexOf(';base64')>-1)e=t.split(';')[0]?.split('/')[1]??'';else{const s=h.getFileExtension(t);e=s.startsWith('.')?s.substring(1):s}const s=new w({name:'',type:e,hash:null,uri:t});return w.byUri[t]=s,s}async downloadAsync(){if(this.downloaded)return this;if(this.downloading)return await new Promise((t,e)=>{this._downloadCallbacks.push({resolve:t,reject:e})}),this;this.downloading=!0;try{if(l.isImageType(this.type)){const{width:t,height:e,name:s}=await l.getImageInfoAsync(this.uri);this.width=t,this.height=e,this.name=s}else this.name=h.getFilename(this.uri);this.localUri=await(0,o.downloadAsync)(this.uri,this.hash,this.type),this.downloaded=!0,this._downloadCallbacks.forEach(({resolve:t})=>t())}catch(t){throw this._downloadCallbacks.forEach(({reject:e})=>e(t)),t}finally{this.downloading=!1,this._downloadCallbacks=[]}return this}}},966,[283,214,967,971,972,973,974,970,975]);
|
| 11 |
+
__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.selectAssetSource=function(e){const t=o.default.pickScale(e.scales,s.default.get()),f=e.scales.findIndex(e=>e===t),l=e.fileHashes?.[f]??e.fileHashes?.[0]??e.hash,p=e.fileUris?e.fileUris[f]??e.fileUris[0]:e.uri;if(p)return{uri:c(p),hash:l};const U=1===t?'':`@${t}x`,v=e.type?`.${encodeURIComponent(e.type)}`:'',x=`/${encodeURIComponent(e.name)}${U}${v}`,L=new URLSearchParams({platform:"web",hash:e.hash});if(/^https?:\/\//.test(e.httpServerLocation)){return{uri:e.httpServerLocation+x+'?'+L,hash:l}}const R=(0,h.getManifest2)(),S=R?.extra?.expoGo?.developer?u(R):null;if(S){const t=new URL(e.httpServerLocation+x,S);return t.searchParams.set('platform',"web"),t.searchParams.set('hash',e.hash),{uri:t.href,hash:l}}if(n.default.ExponentKernel)return{uri:`https://classic-assets.eascdn.net/~assets/${encodeURIComponent(l)}`,hash:l};return{uri:'',hash:l}},_e.resolveUri=c,r(d[0]);var t=r(d[1]),s=e(r(d[2])),n=e(r(d[3])),o=e(r(d[4])),h=r(d[5]);function u(e){const s=(0,t.getBundleOrigin)();if(s)return s;const n=e.extra?.expoGo?.debuggerHost;if(!n)return null;return(h.manifestBaseUrl?.startsWith('https://')?'https://':'http://')+n}function c(e){return h.manifestBaseUrl?new URL(e,h.manifestBaseUrl).href:e}},967,[283,968,181,94,969,970]);
|
| 12 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"getBundleUrl",{enumerable:!0,get:function(){return t.getBundleUrl}}),e.getBundleOrigin=function(n=(0,t.getBundleUrl)()){if(!n)return null;try{const{protocol:t,origin:u}=new URL(n);return'http:'===t||'https:'===t?u:null}catch{return null}};var t=r(d[0])},968,[557]);
|
| 13 |
+
__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 n}}),r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e};function c(e){const t=n.pickScale(e.scales,s.default.get()),c=1===t?'':'@'+t+'x',o=e.type?`.${e.type}`:'';return e.httpServerLocation.replace(/\.\.\//g,'_')+'/'+e.name+c+o}class n{constructor(e,t,s){this.serverUrl=e||'https://expo.dev',this.jsbundleUrl=null,this.asset=s}isLoadedFromServer(){return!0}isLoadedFromFileSystem(){return!1}defaultAsset(){return this.assetServerURL()}assetServerURL(){const e=new URL(c(this.asset),this.serverUrl);return e.searchParams.set('platform',"web"),e.searchParams.set('hash',this.asset.hash),this.fromSource(e.toString().replace(e.origin,''))}fromSource(e){return{__packager_asset:!0,width:this.asset.width??void 0,height:this.asset.height??void 0,uri:e,scale:n.pickScale(this.asset.scales,s.default.get())}}static pickScale(e,t){for(const s of e)if(s>=t)return s;return e[e.length-1]||1}}},969,[283,181]);
|
| 14 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IS_ENV_WITH_LOCAL_ASSETS",{enumerable:!0,get:function(){return t}}),e.getLocalAssets=function(){return{}},e.getManifest2=function(){return{}},Object.defineProperty(e,"manifestBaseUrl",{enumerable:!0,get:function(){return n}});const t=!1;const n=null},970,[]);
|
| 15 |
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){const{pathname:s,searchParams:o}=new URL(t,'https://e');return n(s)}function n(t){return t.substring(t.lastIndexOf('/')+1)}Object.defineProperty(e,'__esModule',{value:!0}),e.getFilename=t,e.getFileExtension=function(n){const s=t(n),o=s.lastIndexOf('.');return o>0?s.substring(o):''},e.getManifestBaseUrl=function(t){const n=new URL(t);let s=n.protocol;'exp:'===s?s='http:':'exps:'===s&&(s='https:');n.protocol=s;const o=n.pathname.substring(0,n.pathname.lastIndexOf('/')+1);return n.pathname=o,n.search='',n.hash='',n.protocol!==s?n.href.replace(n.protocol,s):n.href}},971,[]);
|
| 16 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.downloadAsync=async function(n,t,c){return n}},972,[]);
|
| 17 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isImageType=function(n){return/^(jpeg|jpg|gif|png|bmp|webp|heic)$/i.test(n)},e.getImageInfoAsync=function(t){if('undefined'==typeof window)return Promise.resolve({name:(0,n.getFilename)(t),width:0,height:0});return new Promise((o,u)=>{const s=new Image;s.onerror=u,s.onload=()=>{o({name:(0,n.getFilename)(t),width:s.naturalWidth,height:s.naturalHeight})},s.src=t})};var n=r(d[0])},973,[971]);
|
| 18 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getLocalAssetUri=function(t,n){return null}},974,[]);
|
| 19 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}}),_e.setCustomSourceTransformer=o,Object.defineProperty(_e,"pickScale",{enumerable:!0,get:function(){return l}});var t=e(r(d[0])),n=e(r(d[1]));let u;function o(e){u=e}function c(e){if('object'==typeof e)return e;const o=t.default.getAssetByID(e);if(!o)return null;const c=new n.default('https://expo.dev',null,o);return u?u(c):c.defaultAsset()}Object.defineProperty(c,'setCustomSourceTransformer',{get:()=>o});var f=c;const{pickScale:l}=n.default},975,[214,969]);
|
| 20 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAssets=function(u){const[c,n]=(0,t.useState)(),[o,f]=(0,t.useState)();return(0,t.useEffect)(()=>{s.Asset.loadAsync(u).then(n).catch(f)},[]),[c,o]};var t=r(d[0]),s=r(d[1])},976,[12,966]);
|
| 21 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.normalizeWeight=o,e.normalizeStyle=f,e.resolveFaceWeight=l,e.resolveFaceStyle=c,e.assertValidFontFaces=function(t,s){if('string'!=typeof t||0===t.length)throw new n.CodedError("ERR_FONT_API",`Expected a non-empty string for \`fontFamily\`, instead got ${JSON.stringify(t)}. Set \`fontFamily\` to the name to use as the \`fontFamily\` style prop.`);if(!Array.isArray(s)||0===s.length)throw new n.CodedError("ERR_FONT_API",`No font faces were provided for font family "${t}". Set \`fontDefinitions\` to a non-empty array of \`FontFaceDefinition\`s.`);const y=new Set;for(const u of s){if('object'!=typeof u||null===u||null==u.path)throw new n.CodedError("ERR_FONT_API",`A face of font family "${t}" has no \`path\`. Set the face's \`path\` to a \`FontSource\`.`);const s=o(l(u)),h=f(c(u));if(void 0===s||void 0===h)continue;const F=`${s}/${h}`;if(y.has(F))throw new n.CodedError("ERR_FONT_API",`Font family "${t}" declares two faces with weight ${s} and style "${h}". Give each face a distinct weight or style so the correct face is selected at render time.`);y.add(F)}},e.assertValidFontFamilyDefinitions=function(t){const o=new Set;for(const f of t){if('object'!=typeof f||null===f||Array.isArray(f)||!('fontFamily'in f)||!('fontDefinitions'in f))throw new n.CodedError("ERR_FONT_API",`Expected an object with \`fontFamily\` and \`fontDefinitions\`, instead got ${JSON.stringify(f)}. Set each array element to \`{ fontFamily, fontDefinitions }\`.`);const{fontFamily:t}=f;if(o.has(t))throw new n.CodedError("ERR_FONT_API",`Font family "${t}" is declared more than once in this \`loadAsync\` call. Declare each \`fontFamily\` once, with all of its faces in one \`fontDefinitions\` array.`);o.add(t)}};var t=r(d[0]),n=r(d[1]);function o(t){if(null==t)return;if('number'==typeof t)return Number.isFinite(t)?t:void 0;const n=t.trim().toLowerCase();if('normal'===n)return 400;if('bold'===n)return 700;const o=Number(n);return Number.isFinite(o)?o:void 0}function f(t){if(null==t)return;const n=t.trim().toLowerCase();return'italic'===n||'oblique'===n?'italic':'normal'}function s(n){if(!(n instanceof t.Asset||'string'==typeof n||'number'==typeof n))return n}function l(t){return t.weight??s(t.path)?.weight}function c(t){return t.style??s(t.path)?.style}},977,[964,283]);
|
| 22 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fontSourceFromFace=function(n){const{path:o,display:s}=n,u=(0,l.resolveFaceWeight)(n),c=(0,l.resolveFaceStyle)(n);if(o instanceof t.Asset)return{uri:o.uri,...void 0!==u?{weight:u}:null,...void 0!==c?{style:c}:null,...void 0!==s?{display:s}:null};const y='string'==typeof o||'number'==typeof o?{uri:o}:o;return{...y,weight:u,style:c,display:s??y.display}};var t=r(d[0]),l=r(d[1])},978,[964,977]);
|
| 23 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"loadPromises",{enumerable:!0,get:function(){return o}}),_e.markLoaded=function(e){u[e]=!0},_e.isLoadedInCache=c,_e.isLoadedNative=function(e){if(c(e))return!0;{const n=t.default.getLoadedFonts();return!!n?.length&&(n.forEach(e=>{u[e]=!0}),e in u)}},_e.purgeFontFamilyFromCache=function(e){delete u[e]},_e.purgeCache=function(){u={}};var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e};const o={};let u={};function c(e){return e in u}},979,[960]);
|
| 24 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"withServerContext",{enumerable:!0,get:function(){return u.withServerContext}}),_e.getServerResources=function(){if(!n.default.getServerResources)throw new t.UnavailabilityError('expo-font','getServerResources');return n.default.getServerResources()},_e.getServerResourceDescriptors=function(){if(!n.default.getServerResourceDescriptors)throw new t.UnavailabilityError('expo-font','getServerResourceDescriptors');return n.default.getServerResourceDescriptors()},_e.registerStaticFont=function(e,o){if(!o)throw new t.CodedError("ERR_FONT_SOURCE",`Cannot load null or undefined font source: { "${e}": ${o} }. Expected asset of type \`FontSource\` for fontFamily of name: "${e}"`);const n=(0,s.getAssetForSource)(o);(0,s.loadSingleFontAsync)(e,n)};var e,t=r(d[0]),o=r(d[1]),n=(e=o)&&e.__esModule?e:{default:e},s=r(d[2]),u=r(d[3])},980,[283,960,963,961]);
|
| 25 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"FontDisplay",{enumerable:!0,get:function(){return t}});var t=(function(t){return t.AUTO="auto",t.SWAP="swap",t.BLOCK="block",t.FALLBACK="fallback",t.OPTIONAL="optional",t})({})},981,[]);
|
| 26 |
+
__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.renderToImageAsync=async function(e,l){if(!t.default)throw new o.UnavailabilityError('expo-font','ExpoFontUtils.renderToImageAsync');return await t.default.renderToImageAsync(e,{...l,color:l?.color?(0,n.default)(l.color):void 0})};var o=r(d[0]),n=e(r(d[1])),t=e(r(d[2]))},982,[283,35,983]);
|
| 27 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=r(d[0]);class n extends t.NativeModule{async renderToImageAsync(n,o){throw new t.UnavailabilityError('expo-font','renderToImageAsync')}}var o=(0,t.registerWebModule)(n,'ExpoFontUtils')},983,[283]);
|
| 28 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},984,[12,959]);
|
| 29 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},985,[986]);
|
| 30 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preventAutoHideAsync=async function(){return!1},e.setOptions=function(n){},e.hide=function(){},e.hideAsync=async function(){}},986,[]);
|
| 31 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"sharedRecipeCards",{enumerable:!0,get:function(){return l}});var c=r(d[0]),s=r(d[1]),n=r(d[2]);const o=()=>{const c=n.useSync.getState();return'live'===c.mode&&'guest'!==c.kind&&!!c.venueId};function t(c){if(o()&&!(0,n.can)(c))throw new Error('recipes.signoff'===c?'Only the head chef can sign off a recipe card.':'Only the head chef, managers and owners can change recipe cards.')}const l={mode:'shared',list:s=>c.localRecipeCards.list(s),get:s=>c.localRecipeCards.get(s),byMenuItem:s=>c.localRecipeCards.byMenuItem(s),subscribe:s=>c.localRecipeCards.subscribe(s),create:async(s,n,o)=>(t('recipes.edit'),c.localRecipeCards.create(s,n,o)),update:async(s,n,o)=>(t('recipes.edit'),c.localRecipeCards.update(s,n,o)),signOff:async(s,n)=>(t('recipes.signoff'),c.localRecipeCards.signOff(s,n)),remove:async(s,n)=>(t('recipes.edit'),c.localRecipeCards.remove(s,n)),savePhoto:async(s,n,o)=>(t('recipes.edit'),c.localRecipeCards.savePhoto(s,n,o)),photoSource:s=>c.localRecipeCards.photoSource(s)};function p(){const n=o()?l:c.localRecipeCards;(0,s.recipeCards)()!==n&&(0,s.setRecipeCardRepository)(n)}p(),n.useSync.subscribe((c,s)=>{c.mode===s.mode&&c.kind===s.kind&&c.venueId===s.venueId||p()})},987,[994,809,798]);
|
| 32 |
+
__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.SyncBadge=function(){const e=(0,c.useSync)(),[v,T]=(0,n.useState)(!1),[j,I]=(0,n.useState)(''),D=(0,n.useRef)(e.failed),[z,R]=(0,n.useState)(!1),[C,S]=(0,n.useState)(''),A=(0,u.useDisplaySettings)(p.VENUE_RID),P=(0,y.useScreensaverAsleep)(e=>e.asleep);if((0,n.useEffect)(()=>{if(e.failed>D.current){I('A change couldn\u2019t be saved to the shared system. It\u2019s kept on this device.');const n=setTimeout(()=>I(''),6e3);return D.current=e.failed,()=>clearTimeout(n)}D.current=e.failed},[e.failed]),'customer'===l.APP_VARIANT||'off'===e.mode)return null;if(P)return null;const k='live'===e.mode,w='display'===l.APP_VARIANT,N=k?e.pending?`Live \xb7 sending ${e.pending}`:'Live':'offline'===e.mode?"Offline"+(e.pending?` \xb7 ${e.pending} waiting`:''):'connecting'===e.mode?'Connecting\u2026':'unpaired'===e.mode?'Not paired':'On this device',_=k?h.colours.green:'offline'===e.mode||'connecting'===e.mode?h.colours.gold:h.colours.muted,L=k?`Shared live with ${e.venueName??'your venue'}${e.lastSyncAt?`. Last update ${new Date(e.lastSyncAt).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:''}.`:'offline'===e.mode?'No connection. Changes are saved on this device and sent when you\u2019re back online.':'signin'===e.mode?'Not connected to the shared system. Open your personal invite link once on this device to connect.':'unpaired'===e.mode?'This display isn\u2019t paired. Use a pairing code from Managers \u2192 Displays.':'connecting'===e.mode?'Connecting to the shared system\u2026':'The shared system can\u2019t be reached, so this device is using its own data.';return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(t.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:`Sync: ${N}`,onPress:()=>T(e=>!e),style:{position:'absolute',left:10,bottom:x,zIndex:900,flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:999,backgroundColor:'rgba(16,14,11,0.92)',borderWidth:1,borderColor:'rgba(255,255,255,0.14)',maxWidth:320},children:[(0,f.jsx)(o.default,{style:{width:8,height:8,borderRadius:4,backgroundColor:_}}),(0,f.jsx)(b.T,{size:12,weight:"semibold",children:N})]}),v?(0,f.jsxs)(o.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:x+34,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:'#15120E',borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,f.jsx)(b.T,{size:13,children:L}),e.failed?(0,f.jsxs)(b.T,{size:12,colour:h.colours.red,children:[e.failed," change",1===e.failed?'':'s'," not accepted by the shared system",e.lastError?` (${e.lastError.slice(0,120)})`:'',"."]}):null,e.message?(0,f.jsx)(b.T,{size:12,colour:h.colours.muted,children:e.message}):null,e.venueId&&(k||'offline'===e.mode)?z?(0,f.jsxs)(o.default,{style:{gap:6,marginTop:6},children:[(0,f.jsx)(b.T,{size:12,children:w?'Unpair this display? It goes back to the pairing screen and needs a new code from Managers \u2192 Displays.':'Disconnect this device? Your changes stay on it; open your personal invite link to connect again.'}),w&&A.pinOn?(0,f.jsx)(s.default,{testID:"unpair-pin",value:C,onChangeText:S,placeholder:"Display PIN",placeholderTextColor:h.colours.muted,secureTextEntry:!0,keyboardType:"number-pad",accessibilityLabel:"Display PIN",style:{borderWidth:1,borderColor:'rgba(255,255,255,0.2)',borderRadius:8,paddingHorizontal:10,paddingVertical:6,color:h.colours.text}}):null,(0,f.jsxs)(o.default,{style:{flexDirection:'row',gap:8},children:[(0,f.jsx)(t.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:w?'Yes, unpair':'Yes, disconnect',disabled:w&&A.pinOn&&C!==A.pin,onPress:()=>{R(!1),T(!1),S(''),w?(0,c.unpairDisplay)():(0,c.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:w&&A.pinOn&&C!==A.pin?'rgba(255,255,255,0.08)':h.colours.red},children:(0,f.jsx)(b.T,{size:12,weight:"semibold",children:w?'Yes, unpair':'Yes, disconnect'})}),(0,f.jsx)(t.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{R(!1),S('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,f.jsx)(b.T,{size:12,children:"Keep"})})]})]}):(0,f.jsx)(t.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:w?'Unpair this display':'Disconnect this device',onPress:()=>R(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,f.jsx)(b.T,{size:12,colour:h.colours.gold,children:w?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null]}):null,j?(0,f.jsx)(o.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:x+42,zIndex:950,alignItems:'center'},pointerEvents:"none",children:(0,f.jsx)(o.default,{style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:h.colours.red,maxWidth:460},children:(0,f.jsx)(b.T,{size:13,children:j})})}):null]})};var n=r(d[0]),t=e(r(d[1])),s=e(r(d[2])),o=e(r(d[3])),l=r(d[4]),c=r(d[5]),u=r(d[6]),p=r(d[7]),h=r(d[8]),b=r(d[9]),y=r(d[10]),f=r(d[11]);const x='display'===l.APP_VARIANT?10:68},988,[12,245,255,109,787,798,803,821,799,791,858,6]);
|
| 33 |
+
__d(function(_g,_r,i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.VoiceHost=function(){const e=(0,g.useVoiceTarget)(),t=(0,g.useVoiceSlot)(e=>e.rect);return e?.on&&t?(0,I.jsx)(P,{app:e.actions,ui:e.app},e.actions):null};var t=_r(d[0]),o=e(_r(d[1])),n=e(_r(d[2])),s=e(_r(d[3])),r=e(_r(d[4]));_r(d[5]);var l=e(_r(d[6])),a=e(_r(d[7])),u=e(_r(d[8])),c=e(_r(d[9])),h=e(_r(d[10])),p=_r(d[11]),g=_r(d[12]),f=_r(d[13]),w=e(f),x=_r(d[14]),m=_r(d[15]),y=_r(d[16]),b=_r(d[17]),v=_r(d[18]),j=_r(d[19]),k=_r(d[20]),R=_r(d[21]),T=_r(d[22]),S=_r(d[23]),C=_r(d[24]),I=_r(d[25]);const z=200;function A({colour:e,size:t=34}){return(0,I.jsxs)(w.default,{width:t,height:t,viewBox:"0 0 24 24",children:[(0,I.jsx)(f.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:e}),(0,I.jsx)(f.Path,{d:"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7",stroke:e,strokeWidth:2,strokeLinecap:"round",fill:"none"})]})}const H={owner:['\u201cWalk-in fridge 3 degrees\u201d','\u201cMark the lobster sold out\u201d','\u201cHow many covers tonight?\u201d','\u201cAdd blue roll to the Booker list\u201d'],staff:['\u201cMessage the team: running 10 minutes late\u201d','\u201cRead my messages\u201d','\u201cWhen\u2019s my next shift?\u201d','\u201cWhat are today\u2019s specials?\u201d','\u201cDoes the fish supper contain gluten?\u201d'],chef:['\u201cFreezer minus 19\u201d','\u201cMark the soup sold out\u201d','\u201cRead the orders\u201d','\u201cAdd onions to the Bidfood list\u201d'],display:['\u201cWalk-in fridge 3 degrees\u201d','\u201cRead the orders\u201d','\u201cAny room for 6 at 8?\u201d','\u201cRead the shift notes\u201d']};function P({app:e,ui:f}){const w=(0,x.useCtx)(6e4),P=(0,y.useOwner)(e=>e.staff),D=(0,T.useVoiceSettings)(),E=(0,R.useVoiceNav)(e=>e.go),{height:M}=(0,c.default)(),V=(0,g.useVoiceSlot)(e=>e.rect),W=V.size,B=m.ROSTER.find(e=>'chef'===e.app),_='display'===e?'Main Display':'chef'===e?P.find(e=>e.id===B?.id)?.name??'Head Chef':w.me,L='display'===e?'display':'chef'===e?B?.id??'chef':w.meId,O={rid:w.rid,today:w.today,go:(e,t)=>E?.(e,t),app:e,who:_.replace(' (example)',''),whoId:L,role:'owner'===f?w.role:e},[$,F]=(0,t.useState)('idle'),[N,U]=(0,t.useState)(''),[q,G]=(0,t.useState)(0),[X,Y]=(0,t.useState)(null),[K,J]=(0,t.useState)(!1),[Q,Z]=(0,t.useState)(''),[ee,te]=(0,t.useState)(!1),oe=(0,t.useRef)(null),ne=(0,t.useRef)(null),se=(0,t.useRef)(O);se.current=O;const re=(0,t.useRef)(X);re.current=X;const ie=(0,t.useRef)(D.speakAnswers);ie.current=D.speakAnswers;const le=(0,t.useRef)(w.now);le.current=w.now;const ae=e=>{Y(e),F('answer'),ie.current&&(0,C.canSpeak)()&&(0,C.speak)(e.pending?e.pending.preview+' Say yes or tap Confirm.':e.text)},de=ae,ue=async e=>{F('working');const t=await(0,j.runAction)(e.id,e.params,se.current,!0);(0,C.buzz)([20,40,20]),de({text:'needs_confirmation'===t.status?t.preview:t.message,tone:'error'===t.status?'warn':'ok'})},ce=()=>de({text:'Cancelled. Nothing was changed.',tone:'info'}),he=async t=>{const o=t.trim(),n=se.current;if(!o)return void ae({text:'I didn\u2019t catch that. Hold the button while you speak, then let go.',tone:'info'});const s=re.current?.pending;if(s){const e=(0,C.yesNo)(o);if('yes'===e)return void await ue(s);if('no'===e)return void ce()}F('working');const r=(0,j.matchIntent)(o,n.today,{app:e,rid:n.rid,whoId:n.whoId}),l=le.current;if(!S.voiceUsage.allowed(n.rid,'action'===r.kind?r.action.id:null,l))return void ae({heard:o,text:S.REACHED_TEXT,tone:'info'});S.voiceUsage.record(n.rid,l);const a=S.voiceUsage.get(n.rid,l),u=a.reached?S.REACHED_TEXT:a.warn?(0,S.WARN_TEXT)(a):void 0,c=e=>ae({...e,note:u});if('action'===r.kind){const e=r.action,t=e.params.filter(e=>e.required&&(void 0===r.params[e.name]||''===r.params[e.name]||'[]'===r.params[e.name]));if(t.length)return void c({heard:o,text:e.preview(r.params,n)+(/\?$/.test(e.preview(r.params,n))||/couldn|didn/.test(e.preview(r.params,n))?'':` I still need: ${t.map(e=>e.description.toLowerCase()).join('; ')}.`)+' Hold the button and try again.',tone:'warn'});const s=await(0,j.runAction)(e.id,r.params,n,!1);return void('needs_confirmation'===s.status?c({heard:o,text:s.preview,pending:{id:e.id,params:r.params,preview:s.preview}}):c({heard:o,text:s.message,tone:'error'===s.status?'warn':'ok'}))}if('help'===r.kind){const e=r.ids.map(k.helpById).filter(Boolean)[0];return void c({heard:o,text:`${e.title}. ${e.body}`,help:r.ids,tone:'info'})}c({heard:o,text:'Sorry, I can\u2019t help with that yet. Try '+H[e].slice(0,2).join(' or ')+'.',tone:'info'})};(0,t.useEffect)(()=>()=>{oe.current?.abort(),ne.current?.(),(0,C.stopSpeaking)()},[]);const pe=async()=>{if((0,C.stopSpeaking)(),!T.useVoiceSettings.getState().micExplained)return void te(!0);if(!(0,C.canListen)())return J(!0),void de({text:'This browser can\u2019t listen (some iPhones and Firefox). Type instead below.',tone:'info'});if((0,C.buzz)(35),U(''),Y(null),J(!1),F('listening'),oe.current=(0,C.listen)(U,(e,t)=>{ne.current?.(),ne.current=null,G(0),'not-allowed'!==t&&'service-not-allowed'!==t?he(e):de({text:'The microphone is blocked. Allow it in the browser\u2019s site settings, or tap the button to type instead.',tone:'warn'})}),!oe.current)return F('idle'),void J(!0);const e=await(0,C.levelMeter)(G);oe.current?ne.current=e:e()},ge=()=>{oe.current&&(F('working'),oe.current?.stop(),oe.current=null,ne.current?.(),ne.current=null,G(0))},fe=(0,t.useRef)({timer:0,holding:!1}),we=(0,t.useRef)(pe);we.current=pe;const xe=(0,t.useRef)(ge);xe.current=ge;const me=(0,t.useMemo)(()=>r.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>{const e=fe.current;e.holding=!1,e.timer=setTimeout(()=>{e.holding=!0,we.current()},z)},onPanResponderRelease:()=>{const e=fe.current;clearTimeout(e.timer),e.holding?xe.current():(J(!0),F(e=>'idle'===e?'answer':e))},onPanResponderTerminate:()=>{const e=fe.current;clearTimeout(e.timer),e.holding&&xe.current()}}),[e]),ye=(0,t.useRef)(new n.default.Value(0)).current;(0,t.useEffect)(()=>{if('listening'!==$)return ye.stopAnimation(),void ye.setValue(0);const e=n.default.loop(n.default.timing(ye,{toValue:1,duration:1100,easing:s.default.out(s.default.quad),useNativeDriver:!1}));return e.start(),()=>e.stop()},[$]);const be='listening'===$,ve='answer'===$&&(X||K)||'working'===$||be,je=()=>{(0,C.stopSpeaking)(),Y(null),J(!1),Z(''),F('idle')},ke=()=>{const e=Q.trim();e&&(Z(''),U(e),he(e))},Re='fixed',Te={top:V.y+W+8},Se=ye.interpolate({inputRange:[0,1],outputRange:[1,1.7]}),Ce=ye.interpolate({inputRange:[0,1],outputRange:[.6,0]}),Ie='warn'===X?.tone?v.colours.amber:X?.pending?v.colours.gold:v.colours.border;return(0,I.jsxs)(I.Fragment,{children:[ve?(0,I.jsx)(h.default,{testID:"voice-panel",style:[{position:Re,left:12,right:12,alignItems:'flex-end',zIndex:60},Te],pointerEvents:"box-none",children:(0,I.jsxs)(h.default,{style:{width:'100%',maxWidth:520,backgroundColor:v.colours.surface,borderRadius:16,borderWidth:2,borderColor:Ie,padding:14,gap:10,maxHeight:.6*M},children:[(0,I.jsxs)(b.Row,{style:{justifyContent:'space-between'},children:[(0,I.jsx)(b.T,{size:13,weight:"semibold",colour:v.colours.gold,children:be?'Listening\u2026 let go to send':'working'===$?'Working on it\u2026':X?.pending?'Please confirm':'Voice helper'}),(0,I.jsx)(l.default,{testID:"voice-close",accessibilityRole:"button",accessibilityLabel:"Close voice helper",hitSlop:12,onPress:je,children:(0,I.jsx)(b.T,{size:20,colour:v.colours.muted,children:"\u2715"})})]}),be?(0,I.jsxs)(h.default,{style:{gap:8},children:[(0,I.jsx)(h.default,{style:{height:10,borderRadius:5,backgroundColor:v.colours.surface2,overflow:'hidden'},children:(0,I.jsx)(h.default,{testID:"voice-level",style:{width:`${Math.round(8+92*q)}%`,height:10,backgroundColor:v.colours.green}})}),(0,I.jsx)(b.T,{size:16,children:N||'Say it now\u2026'})]}):null,'working'===$?(0,I.jsxs)(b.Row,{gap:10,children:[(0,I.jsx)(o.default,{color:v.colours.gold}),(0,I.jsx)(b.T,{size:15,colour:v.colours.muted,children:N?`\u201c${N}\u201d`:''})]}):null,'answer'===$&&X?(0,I.jsxs)(a.default,{style:{maxHeight:.36*M},contentContainerStyle:{gap:8},children:[X.heard?(0,I.jsxs)(b.T,{size:13,colour:v.colours.muted,children:["You said: \u201c",X.heard,"\u201d"]}):null,X.note?(0,I.jsx)(h.default,{testID:"voice-usage-note",children:(0,I.jsx)(b.T,{size:13,colour:v.colours.amber,children:X.note})}):null,(0,I.jsx)(h.default,{testID:"voice-answer",children:(0,I.jsx)(b.T,{size:18,weight:X.pending?'semibold':'regular',children:X.text})}),X.help&&'owner'===e&&E?X.help.slice(0,3).map(e=>{const t=(0,k.helpById)(e);return t?(0,I.jsx)(b.Button,{small:!0,kind:"secondary",label:`Open help: ${t.title}`,onPress:()=>{E('more','help'),je()}},e):null}):null]}):null,'answer'===$&&X?.pending?(0,I.jsxs)(b.Row,{gap:10,children:[(0,I.jsx)(b.Button,{testID:"voice-confirm",kind:"success",label:"Confirm",onPress:()=>{ue(X.pending)},style:{flex:1,minHeight:56}}),(0,I.jsx)(b.Button,{testID:"voice-cancel",kind:"secondary",label:"Cancel",onPress:ce,style:{flex:1,minHeight:56}})]}):null,'answer'!==$||X?.pending?null:(0,I.jsxs)(h.default,{style:{gap:6},children:[K||!(0,C.canListen)()?(0,I.jsxs)(b.Row,{gap:8,children:[(0,I.jsx)(u.default,{testID:"voice-type",value:Q,onChangeText:Z,onSubmitEditing:ke,placeholder:"Type instead\u2026",placeholderTextColor:v.colours.muted,autoFocus:!0,returnKeyType:"send",style:{flex:1,minWidth:0,width:0,minHeight:48,borderRadius:10,borderWidth:1,borderColor:v.colours.border,backgroundColor:v.colours.surface2,color:v.colours.text,paddingHorizontal:12,fontFamily:v.fonts.regular,fontSize:16}}),(0,I.jsx)(b.Button,{testID:"voice-send",kind:"success",label:"Ask",onPress:ke,disabled:!Q.trim()})]}):(0,I.jsx)(l.default,{accessibilityRole:"button",onPress:()=>J(!0),children:(0,I.jsx)(b.T,{size:14,colour:v.colours.gold,children:"Type instead"})}),X?null:(0,I.jsxs)(b.T,{size:13,colour:v.colours.muted,children:["Hold the gold button and speak, for example ",H[e].join(', '),"."]}),'owner'===f&&'owner'===e?(0,I.jsx)(l.default,{testID:"voice-open-assistant",accessibilityRole:"button",onPress:()=>{je(),p.useAssistantUi.getState().setOpen(!0)},style:{minHeight:44,justifyContent:'center'},children:(0,I.jsx)(b.T,{size:14,colour:v.colours.gold,children:"\u2726 Open the Assistant (ideas, history and longer requests) \u203a"})}):null]})]})}):null,(0,I.jsxs)(h.default,{style:{position:Re,left:V.x,top:V.y,width:W,height:W,zIndex:61},pointerEvents:"box-none",children:[be?(0,I.jsx)(n.default.View,{pointerEvents:"none",style:{position:'absolute',left:0,top:0,width:W,height:W,borderRadius:W/2,borderWidth:4,borderColor:v.colours.green,opacity:Ce,transform:[{scale:Se}]}}):null,be?(0,I.jsx)(h.default,{pointerEvents:"none",style:{position:'absolute',left:-6,top:-6,width:W+12,height:W+12,borderRadius:(W+12)/2,borderWidth:3+Math.round(7*q),borderColor:v.colours.green}}):null,(0,I.jsx)(h.default,{testID:"voice-button",accessible:!0,accessibilityRole:"button",accessibilityLabel:'owner'===f&&'owner'===e?'Voice helper and Assistant. Hold to talk, let go to send. Tap to type or open the Assistant.':'Voice helper. Hold to talk, let go to send. Tap to type instead.',...me.panHandlers,style:[{width:W,height:W,borderRadius:W/2,alignItems:'center',justifyContent:'center',backgroundColor:be?v.colours.green:v.colours.gold,borderWidth:2,borderColor:v.colours.bg},{userSelect:'none',WebkitUserSelect:'none',WebkitTouchCallout:'none',touchAction:'none',cursor:'pointer'}],children:'working'===$?(0,I.jsx)(o.default,{color:v.colours.onGold,size:"large"}):(0,I.jsx)(A,{colour:v.colours.onGold,size:Math.round(.5*W)})})]}),(0,I.jsx)(b.Sheet,{visible:ee,onClose:()=>te(!1),title:"Talk to CoverCharge",testID:"voice-explain",children:(0,I.jsxs)(h.default,{style:{gap:10},children:[(0,I.jsxs)(b.T,{children:["Hold the gold button, say what you need, then let go. For example ",H[e].slice(0,3).join(', '),"."]}),(0,I.jsx)(b.T,{children:"Your browser will now ask to use the microphone. It only listens while you hold the button."}),(0,I.jsx)(b.T,{size:14,colour:v.colours.muted,children:"Speech is turned into text by your browser\u2019s own speech service (in Chrome that\u2019s Google; on Apple devices it\u2019s Apple), so what you say while holding may be sent to them. CoverCharge doesn\u2019t record or keep the audio."}),(0,I.jsx)(b.T,{size:14,colour:v.colours.muted,children:"Anything that changes the app is read back first and needs a tap on Confirm or a spoken \u201cyes\u201d. Orders to suppliers, messages and payments are only ever saved as drafts for the owner."}),(0,I.jsx)(b.Button,{testID:"voice-allow",kind:"success",label:"Allow microphone",onPress:async()=>{T.useVoiceSettings.getState().setMicExplained(!0),te(!1);(await(0,C.levelMeter)(()=>{}))(),de({text:'Ready. Now hold the button and speak.',tone:'ok'})}}),(0,I.jsx)(b.Button,{kind:"secondary",label:"Type instead",onPress:()=>{te(!1),J(!0),F('answer')}})]})})]})}},989,[12,228,102,206,223,104,245,133,255,269,109,905,843,860,846,918,812,791,799,951,949,906,954,936,955,6]);
|
| 34 |
+
__d(function(e,o,s,p,t,n,a){"use strict";t.exports="/owner-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},990,[]);
|
| 35 |
+
__d(function(o,e,s,p,t,c,d){"use strict";t.exports="/owner-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},991,[]);
|
| 36 |
+
__d(function(o,e,s,p,t,d,f){"use strict";t.exports="/owner-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},992,[]);
|
| 37 |
+
__d(function(o,s,e,p,d,t,n){"use strict";d.exports="/owner-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},993,[]);
|
owner-app/_expo/static/js/web/basket-60d8775a5a99f77545a887d7d328b00b.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var l=_r(d[0]),t=_r(d[1]),n=e(t),s=e(_r(d[2])),o=_r(d[3]),a=_r(d[4]),r=_r(d[5]),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),m=_r(d[10]),b=_r(d[11]),y=_r(d[12]),j=_r(d[13]);function x(){const e=(0,h.useBasket)(),x=(0,h.useRestaurant)(e.restaurantId??void 0),p=(0,h.useAllMenu)(e.restaurantId??void 0),k=(0,h.useCustomer)(),f=(0,h.useOrders)(x?.id),w=(0,h.useStore)(e=>e.setLineQty),v=(0,h.useStore)(e=>e.overrideLine),C=(0,h.useStore)(e=>e.startBasket),T=(0,h.useNow)(15e3),[B,S]=(0,t.useState)(null),[P,$]=(0,t.useState)(!1),[O,I]=(0,t.useState)(''),[M,L]=(0,t.useState)(k.phone??''),[N,R]=(0,t.useState)(k.email??''),[F,z]=(0,t.useState)(!1),A=(0,h.useOrderAtTable)(e.restaurantId??void 0);n.default.useEffect(()=>{A||'table'!==e.mode||h.useStore.setState(e=>({basket:{...e.basket,mode:'takeaway',tableNo:void 0}}))},[A,e.mode]);const[D,E]=(0,t.useState)(null),[_,Y]=(0,t.useState)(!1),q=(0,t.useMemo)(()=>(0,m.linesFromBasket)(e,p,k.allergies),[e,p,k.allergies]);if(!x||!e.lines.length)return(0,j.jsxs)(a.Screen,{title:"Your basket",children:[(0,j.jsx)(a.Muted,{children:"Your basket is empty."}),(0,j.jsx)(a.Button,{label:"Browse restaurants",onPress:()=>l.router.replace('/customer')})]});const H=A&&'table'===e.mode,K=(0,u.takeawaySlots)(x,f,T),Q=q.reduce((e,l)=>e+l.unitPrice*l.qty,0),W=q.some(e=>e.contains.length&&!e.overridden),G=e.lines.filter(e=>{const l=p.find(l=>l.id===e.itemId);return!l||l.soldOut||!l.signOff}),J=!H&&!B,U=!H&&x.settings.takeawayPaused,V=(0,y.ukPhone)(M),X=!W&&!G.length&&P&&!J&&!U&&(H||V.ok&&(0,y.emailOk)(N)),Z=async e=>{const t=await h.repo.orders.placeFromBasket({slotTime:H?void 0:B,tip:0,giftCardCode:e?.giftCardCode,notes:O,paidNow:!H,phone:H?void 0:V.pretty,email:H?void 0:N.trim()||void 0});z(!1),l.router.replace(`/customer/order/${t.id}`)},ee=e.lines.find(e=>e.key===D),le=ee?q[e.lines.indexOf(ee)]:void 0;return(0,j.jsxs)(a.Screen,{title:"Your basket",subtitle:`${x.name} \xb7 ${H?`Table ${e.tableNo} (order at table)`:'Takeaway \u2014 collection'}`,footer:(0,j.jsxs)(s.default,{style:{gap:8},children:[(0,j.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(a.T,{weight:"semibold",children:"Subtotal"}),(0,j.jsx)(a.T,{weight:"bold",size:20,colour:b.colours.gold,children:(0,i.gbp)(Q)})]}),W?(0,j.jsx)(a.T,{size:14,colour:b.colours.red,children:"Resolve the blocked allergy item(s) before continuing."}):P?J&&!U?(0,j.jsx)(a.T,{size:14,colour:b.colours.amber,children:"Choose a collection time."}):null:(0,j.jsx)(a.T,{size:14,colour:b.colours.amber,children:"Confirm your allergies to continue."}),H?(0,j.jsx)(a.Button,{label:"Send order to the kitchen",disabled:!X,onPress:()=>Z(),testID:"send-table-order"}):(0,j.jsx)(a.Button,{label:`Continue to payment \xb7 ${(0,i.gbp)(Q)}`,disabled:!X,onPress:()=>z(!0),testID:"checkout"})]}),children:[(H||e.tableNo,null),H?(0,j.jsx)(a.Banner,{kind:"success",title:`Table ${e.tableNo}`,children:"Ordered food goes to the kitchen straight away; you pay at the end (split the bill if you like)."}):null,x.fictional?null:(0,j.jsx)(a.ExampleAllergenNotice,{}),q.map((l,t)=>{const n=e.lines[t],o=l.contains.length&&!l.overridden;return(0,j.jsxs)(a.Card,{highlight:l.contains.length?b.colours.red:l.may.length?b.colours.amber:void 0,children:[(0,j.jsxs)(a.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,j.jsxs)(s.default,{style:{flex:1,paddingRight:8},children:[(0,j.jsx)(a.T,{weight:"semibold",children:l.name}),l.choices.length?(0,j.jsx)(a.Muted,{children:l.choices.join(' \xb7 ')}):null,l.notes?(0,j.jsxs)(a.Muted,{children:["Note: ",l.notes]}):null]}),(0,j.jsx)(a.T,{weight:"semibold",children:(0,i.gbp)(l.unitPrice*l.qty)})]}),o?(0,j.jsxs)(a.Banner,{kind:"danger",title:`BLOCKED \u2014 contains ${l.contains.map(r.allergenLabel).join(', ')}`,children:[(0,j.jsx)(a.T,{size:14,colour:"#FFE3DF",children:`Conflicts with your declared ${k.allergies.filter(e=>l.contains.includes(e.allergen)).map(e=>`${(0,r.allergenLabel)(e.allergen)} (${(0,r.severityLabel)(e.severity)})`).join(', ')}.`}),(0,j.jsxs)(a.Row,{gap:8,style:{marginTop:6},children:[(0,j.jsx)(a.Button,{small:!0,kind:"secondary",label:"Remove",onPress:()=>w(n.key,0)}),(0,j.jsx)(a.Button,{small:!0,kind:"danger",label:"Override\u2026",onPress:()=>{Y(!1),E(n.key)}})]})]}):l.contains.length?(0,j.jsx)(a.Banner,{kind:"danger",title:`Allergy override recorded \u2014 contains ${l.contains.map(r.allergenLabel).join(', ')}`,children:"The kitchen will get an allergy alert that must be acknowledged, and staff will check with you at handover."}):null,l.may.length?(0,j.jsx)(a.Banner,{kind:"warn",title:`May contain ${l.may.map(r.allergenLabel).join(', ')}`,children:"Cross-contact risk (e.g. shared fryer). Please check with staff."}):null,G.includes(n)?(0,j.jsx)(a.Badge,{kind:"amber",label:"No longer available online \u2014 please remove"}):null,(0,j.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(a.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>w(n.key,0)}),(0,j.jsx)(a.Stepper,{value:n.qty,onChange:e=>w(n.key,e),min:1,label:l.name})]})]},n.key)}),(0,j.jsx)(a.Button,{kind:"ghost",label:"+ Add more items",onPress:()=>l.router.push(`/customer/${x.id}`)}),H?null:(0,j.jsxs)(a.Card,{children:[(0,j.jsxs)(a.H2,{children:["Collection time \u2014 ",(0,c.niceDate)(T)]}),U?(0,j.jsx)(a.Banner,{kind:"warn",title:"Takeaway paused",children:"The restaurant has paused takeaway slots for now. Please try again later or book a table."}):0===K.length?(0,j.jsx)(a.Banner,{kind:"warn",children:"No collection slots left today."}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(a.Muted,{children:["15-minute slots, max ",x.settings.slotCap," orders each so the kitchen isn\u2019t overloaded."]}),(0,j.jsx)(a.Row,{wrap:!0,gap:6,children:K.slice(0,16).map(e=>(0,j.jsx)(a.Chip,{label:e.label,sub:e.full?'Full':e.cap-e.taken+" left",disabled:e.full,selected:B===e.time.toISOString(),onPress:()=>S(e.time.toISOString())},e.label))})]})]}),(0,j.jsxs)(a.Card,{highlight:P?void 0:b.colours.amber,children:[(0,j.jsx)(a.H2,{children:"Confirm allergies for this order"}),(0,j.jsx)(a.Row,{wrap:!0,gap:6,children:k.allergies.length?k.allergies.map(e=>(0,j.jsx)(a.Badge,{kind:"red",label:`${(0,r.allergenLabel)(e.allergen)} \u2014 ${(0,r.severityLabel)(e.severity)}`},e.allergen)):(0,j.jsx)(a.Muted,{children:"No allergies declared on your profile."})}),(0,j.jsx)(a.Toggle,{label:k.allergies.length?'Yes, these are correct for everyone this order is for':'I confirm no one in this order has a food allergy',value:P,onChange:$}),(0,j.jsx)(a.Button,{small:!0,kind:"ghost",label:"Edit allergies in profile",onPress:()=>l.router.push('/customer/profile')})]}),H?null:(0,j.jsxs)(a.Card,{children:[(0,j.jsx)(a.H2,{children:"Your details"}),(0,j.jsx)(a.Field,{testID:"order-phone",label:"Mobile number (needed for collection)",value:M,onChangeText:L,keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),!V.ok&&M?(0,j.jsx)(a.T,{size:13,colour:b.colours.amber,children:V.error}):null,(0,j.jsx)(a.Field,{label:"Email (optional)",value:N,onChangeText:R,keyboardType:"email-address",autoCapitalize:"none",placeholder:"you@example.com"}),(0,y.emailOk)(N)?null:(0,j.jsx)(a.T,{size:13,colour:b.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,j.jsx)(a.Muted,{children:"We\u2019ll text your order confirmation and collection time. Preview mode: nothing is sent in this pilot."})]}),(0,j.jsx)(a.Field,{label:"Order notes (optional)",value:O,onChangeText:I,placeholder:"e.g. cutlery please"}),H?(0,j.jsx)(a.Button,{small:!0,kind:"ghost",label:"Switch to takeaway instead",onPress:()=>C(x.id,'takeaway')}):null,(0,j.jsx)(o.MockPay,{visible:F,onClose:()=>z(!1),amount:Q,restaurantId:x.id,onPaid:e=>Z({giftCardCode:e.giftCardCode}),title:"Pay for your takeaway"}),(0,j.jsxs)(a.Sheet,{visible:!!ee,onClose:()=>E(null),title:"Allergy override",children:[le?(0,j.jsx)(a.Banner,{kind:"danger",title:`${le.name} contains ${le.contains.map(r.allergenLabel).join(', ')}`,children:"Only continue if this item is for someone without this allergy, or you have spoken to staff."}):null,(0,j.jsx)(a.Toggle,{label:"I understand and want to add it anyway",value:_,onChange:Y}),(0,j.jsx)(a.Button,{kind:"danger",disabled:!_,label:"Confirm override",onPress:()=>{ee&&le&&v(ee.key,le.contains),E(null)}})]})]})}},771,[785,12,109,790,791,792,794,795,796,797,820,799,801,6]);
|
owner-app/_expo/static/js/web/book-1d5b97d633d6c3f7b1fac568474b5644.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return T}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),a=_r(_d[3]),n=(e=a)&&e.__esModule?e:{default:e},i=_r(_d[4]),l=_r(_d[5]),r=_r(_d[6]),d=_r(_d[7]),u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),x=_r(_d[15]),k=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),C=_r(_d[21]);function T(){const{rid:e,date:a}=(0,o.useLocalSearchParams)(),T=(0,p.useRestaurant)(e),P=(0,p.useCustomer)(),$=(0,p.useBookings)(e),D=(0,p.useEvents)(e),M=(0,p.useNow)(6e4),[A,B]=(0,s.useState)(2),[F,O]=(0,s.useState)(a??(0,h.ymd)(M)),[N,R]=(0,s.useState)(null),[z,q]=(0,s.useState)(P.name),[H,W]=(0,s.useState)(P.phone??''),[I,E]=(0,s.useState)(P.email??''),[_,L]=(0,s.useState)(!1),[Y,U]=(0,s.useState)(''),[G,Q]=(0,s.useState)(!1),[V,J]=(0,s.useState)([]),[K,X]=(0,s.useState)(!1),Z=[...P.allergies,...V.filter(e=>!P.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[ee,te]=(0,s.useState)(!1),[oe,se]=(0,s.useState)(null),ae=(0,k.useBlocks)(e=>e.blocks);(0,b.usePublicDayStore)(e=>e.n);const ne=e?(0,b.publicDay)(e,F):null,ie=ne?[...ne.bookings,...$.filter(e=>e.date!==F)]:$,le=ne?[...ae.filter(t=>t.rid!==e||t.date!==F),...ne.blocks]:ae,re=(0,j.usePlan)(e),[de,ue]=(0,s.useState)((0,w.emptyNeeds)()),ce=!0===de.dog,he=ce?de.dogs:0,me=(0,s.useMemo)(()=>{const e=[],t=new Date(M);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return a&&!e.some(e=>(0,h.ymd)(e)===a)&&e.push((0,h.parseYmd)(a)),e},[M.toDateString(),a]);if(!T)return(0,C.jsx)(l.Screen,{title:"Not found",children:(0,C.jsx)(l.T,{children:"Restaurant not found."})});const pe=T.settings,ge=(0,h.parseYmd)(F),be=(0,k.blocksOn)(le,T.id,F),fe=ie.filter(e=>e.date===F),ye=re.areas.filter(e=>e.dogs),xe=(0,S.dogSetUp)(re),ke=e=>(0,v.freeTablesAt)(re,fe,A,new Date(`${F}T${e}:00`),(0,v.turnFor)(A,pe.turnMins),pe.turnMins,{dog:!0,closed:(0,k.closedAreasAt)(le,T.id,F,e)}),je=(0,c.bookingSlots)(T,ge,e=>ie.filter(t=>t.date===F&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),A,M).map(e=>{const t=(0,k.blockAt)(le,T.id,F,e.time),o=ce&&xe&&e.available&&!t&&(!ke(e.time).length||!(0,w.dogTimeOk)(T,ie,F,e.time,he));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),ve=je.some(e=>e.available),we=A>=pe.depositFromParty?'deposit':A>=pe.savedCardFromParty?'saved-card':'none',Se='deposit'===we?A*pe.depositPerHead:0,Ce=D.filter(e=>e.date===F),Te=(0,x.ukPhone)(H),Pe=(0,x.emailOk)(I),$e=(0,w.needsMissing)(de,P.allergies),De=!!N&&G&&!$e.length&&z.trim().length>1&&Te.ok&&Pe,Me=async()=>{const e=(0,w.needsPatch)(de,P.allergies),t=ce&&xe?ke(N).map(e=>e.table):[],o=ce?de.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await p.repo.bookings.create({restaurantId:T.id,customerId:P.id,name:z,partySize:A,date:F,time:N,notes:Y,security:we,depositPaid:Se,phone:Te.pretty,email:I.trim()||void 0,source:'online',...e,...je.find(e=>e.time===N)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??Z,...o?{table:o}:{}});te(!1),se(s)},Ae=(0,p.useStore)(e=>oe?e.bookings.find(e=>e.id===oe.id)?.ref:void 0),Be=e=>(0,y.waMeLink)(T.settings.whatsapp,(0,y.guestWhatsAppText)({name:e.name,ref:Ae??e.ref,date:e.date,time:e.time,partySize:e.partySize},T.name));if(oe){const e='pending'===oe.status;return(0,C.jsxs)(l.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:T.name,children:[(0,C.jsx)(l.Banner,{kind:e?'info':'success',title:`Reference ${Ae??oe.ref}`,children:`${oe.partySize} people \xb7 ${(0,h.niceDateYear)((0,h.parseYmd)(oe.date))} at ${oe.time}`}),e?(0,C.jsx)(l.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. We\u2019ll text you as soon as it\u2019s confirmed."}):null,(0,C.jsxs)(l.Card,{children:[(0,C.jsxs)(l.T,{children:["Name: ",oe.name]}),(0,C.jsxs)(l.T,{children:["Mobile: ",oe.phone]}),oe.email?(0,C.jsxs)(l.T,{children:["Email: ",oe.email]}):null,(0,C.jsxs)(l.T,{children:["Allergies shared with the restaurant: ",oe.allergies.length?oe.allergies.map(e=>`${(0,r.allergenLabel)(e.allergen)} (${(0,r.severityLabel)(e.severity)})`).join(', '):'none']}),oe.notes?(0,C.jsxs)(l.T,{children:["Notes: ",oe.notes]}):null,oe.dog?(0,C.jsxs)(l.T,{children:["\ud83d\udc15 Dog coming too",oe.table?` \xb7 dog-friendly table ${oe.table}`:'']}):null,oe.holds?.length?(0,C.jsxs)(l.T,{children:["Reserved: ",oe.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(T.settings.reservables??S.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,oe.tableReq?.length?(0,C.jsxs)(l.T,{children:["Table requested: ",oe.tableReq.map(e=>`T${e}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,(0,C.jsx)(l.T,{children:'deposit'===oe.security?`Deposit paid (demo): ${(0,u.gbp)(oe.depositPaid)} \u2014 taken off your bill`:'saved-card'===oe.security?`Card saved (demo). No-show fee ${(0,u.gbp)(pe.noShowFeePerHead)} per person applies.`:'No card needed.'}),(0,C.jsxs)(l.Muted,{children:[e?'A text':'A confirmation text',oe.email?' and email':''," to ",oe.phone," ",oe.email?'and your inbox ':'',"is ready. This pilot is in preview mode, so nothing is actually sent yet."]}),(0,C.jsxs)(l.Muted,{children:["Need to change or cancel? Call ",T.phone," and quote ",Ae??oe.ref,"."]})]}),Be(oe)?(0,C.jsxs)(n.default,{style:{gap:4},children:[(0,C.jsx)(l.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Be(oe);e&&(0,y.openWhatsApp)(e)}}),(0,C.jsx)(l.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,C.jsx)(l.Button,{label:"Back to restaurant",onPress:()=>o.router.replace(`/customer/${T.id}`)})]})}return(0,C.jsxs)(l.Screen,{title:"Book a table",subtitle:T.name,footer:(0,C.jsx)(l.Button,{label:$e.length?$e[0]:'deposit'===we?`Continue \u2014 deposit ${(0,u.gbp)(Se)}`:'saved-card'===we?'Continue \u2014 save a card':A>(pe.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!De,onPress:()=>'none'===we?Me():te(!0),testID:"confirm-booking"}),children:[(0,C.jsx)(w.FirstQuestions,{rid:T.id,value:de,onChange:e=>{e.dog===de.dog&&e.dogs===de.dogs||R(null),ue(e)},party:A,audience:"guest",profile:P.allergies}),(0,C.jsxs)(l.Card,{children:[(0,C.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,C.jsx)(l.H2,{children:"Party size"}),(0,C.jsx)(l.Stepper,{value:A,onChange:e=>{B(e),R(null)},min:1,max:16,label:"party size"})]}),'none'!==we?(0,C.jsx)(l.Banner,{kind:"info",title:'deposit'===we?`Parties of ${pe.depositFromParty}+ pay a deposit`:`Parties of ${pe.savedCardFromParty}+ save a card`,children:'deposit'===we?`${(0,u.gbp)(pe.depositPerHead)} per person, taken off the final bill (demo).`:`Only charged on a no-show: ${(0,u.gbp)(pe.noShowFeePerHead)} per person (demo policy).`}):(0,C.jsxs)(l.Muted,{children:["No card needed for tables under ",pe.savedCardFromParty,"."]}),A>(pe.autoAcceptUpTo??7)?(0,C.jsxs)(l.Muted,{children:["For ",A," people the team checks the booking first, then texts you to confirm."]}):null,ce&&xe?(0,C.jsxs)(l.Muted,{children:["Dogs are welcome in the ",ye.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",T.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,C.jsxs)(l.Card,{children:[(0,C.jsx)(l.H2,{children:"Date"}),(0,C.jsx)(l.Row,{wrap:!0,gap:6,children:me.map(e=>{const t=!!(0,d.hoursFor)(T,e),o=D.some(t=>t.date===(0,h.ymd)(e));return(0,C.jsx)(l.Chip,{label:(0,h.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:F===(0,h.ymd)(e),onPress:()=>{O((0,h.ymd)(e)),R(null)}},(0,h.ymd)(e))})}),Ce.map(e=>(0,C.jsx)(l.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,C.jsxs)(l.Card,{children:[(0,C.jsx)(l.H2,{children:"Time"}),0===je.length?(0,C.jsx)(l.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,C.jsx)(l.Row,{wrap:!0,gap:6,children:je.map(e=>(0,C.jsx)(l.Chip,{label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left<A?'Full':'\u2014',disabled:!e.available,selected:N===e.time,onPress:()=>R(e.time)},e.time))}),be.length>0&&je.some(e=>e.blocked)?(0,C.jsx)(l.Banner,{kind:"info",title:ve?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${be.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,h.niceDate)(ge)}. Please give us a ring on ${T.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,t.lastFoodOn)(T,F);return e&&je.some(e=>e.drinksOnly)?(0,C.jsx)(l.Banner,{kind:"info",title:`Last food orders ${(0,t.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ce&&je.some(e=>e.noDog)?(0,C.jsx)(l.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${ye.map(e=>e.name).join(' and ')}${T.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,k.closedAreasAt)(le,T.id,F,N??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,C.jsxs)(l.Muted,{children:["Times come from covers per slot (",pe.bookingCoversPerSlot," per half hour, example) and table rules."]})]}),(0,C.jsx)(w.MoreQuestions,{rid:T.id,r:T,value:de,onChange:ue,party:A,date:F,time:N,today:(0,h.ymd)(M),bookings:ie,audience:"guest",showTables:!0}),(0,C.jsxs)(l.Card,{highlight:G?void 0:f.colours.amber,children:[(0,C.jsx)(l.Field,{label:"Anything else? (optional)",value:Y,onChangeText:U,placeholder:"e.g. high chair, celebrating a birthday"}),(0,C.jsx)(l.Toggle,{label:"I confirm the allergy information for this booking",value:G,onChange:Q}),(0,C.jsx)(l.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,C.jsxs)(l.Card,{children:[(0,C.jsx)(l.H2,{children:"Your details"}),(0,C.jsx)(l.Field,{label:"Name for the booking",value:z,onChangeText:q}),(0,C.jsx)(l.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:H,onChangeText:W,onBlur:()=>L(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Te.ok||!_&&!H?null:(0,C.jsx)(l.T,{size:13,colour:f.colours.amber,children:Te.error}),(0,C.jsx)(l.Field,{testID:"book-email",label:"Email (optional)",value:I,onChangeText:E,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Pe?null:(0,C.jsx)(l.T,{size:13,colour:f.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,C.jsxs)(l.Muted,{children:["We\u2019ll text you a confirmation",I.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,C.jsx)(i.MockPay,{visible:ee,onClose:()=>te(!1),amount:'deposit'===we?Se:0,restaurantId:T.id,allowGiftCard:!1,allowSaveCardOnly:'saved-card'===we,title:'deposit'===we?'Pay deposit':'Save a card',onPaid:()=>Me()})]})}},759,[789,785,12,109,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,6]);
|
owner-app/_expo/static/js/web/entry-c34dc0265950def894404e0df8b08922.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
owner-app/_expo/static/js/web/feedback-6dbe946e1675fb596c5c4cd508919819.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=_r(d[0]),a=_r(d[1]),s=_r(d[2]),n=_r(d[3]),r=_r(d[4]),o=_r(d[5]);const l=['Food','Service','Takeaway','Booking','Allergens','Something else'];function c(){const{rid:c}=(0,t.useLocalSearchParams)(),u=(0,r.useRestaurant)(c),h=(0,r.useCustomer)(),[p,b]=(0,a.useState)(0),[y,j]=(0,a.useState)('Food'),[x,v]=(0,a.useState)(''),[f,S]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1);return u?(0,o.jsxs)(s.Screen,{title:"Private feedback",subtitle:`Straight to the team at ${u.name}`,children:[w?(0,o.jsxs)(s.Banner,{kind:"success",title:"Thank you",children:["Your feedback went privately to ",u.name,". It is never published.",f?' They may reply by email (demo: nothing is sent).':'']}):null,w?(0,o.jsx)(s.Button,{kind:"secondary",label:"Send more feedback",onPress:()=>{k(!1),b(0),v('')}}):(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"How did we do?"}),(0,o.jsx)(n.Stars,{value:p,onChange:b}),(0,o.jsx)(s.T,{size:14,children:"What's it about?"}),(0,o.jsx)(s.Row,{wrap:!0,gap:6,children:l.map(t=>(0,o.jsx)(s.Chip,{label:t,selected:y===t,onPress:()=>j(t)},t))}),(0,o.jsx)(s.Field,{label:"Tell us more (optional)",value:x,onChangeText:v,multiline:!0,placeholder:"What went well, what could be better?"}),(0,o.jsx)(s.Chip,{label:f?'\u2713 Happy to be contacted':'Happy to be contacted?',selected:f,onPress:()=>S(!f)}),(0,o.jsx)(s.Button,{label:"Send privately",disabled:!p,onPress:()=>{r.repo.feedback.add({restaurantId:u.id,customerId:h.id,customerName:h.name,stars:p,comment:`${y}: ${x.trim()}${f?` (happy to be contacted: ${h.email})`:''}`,context:`App feedback \xb7 ${y}`}),k(!0)}})]}),(0,o.jsx)(s.Muted,{children:"Every rating, from 1 to 5 stars, goes the same way: privately to the restaurant. We never ask only happy guests to post a public review, and stamps or rewards are never given for reviews."})]}):(0,o.jsx)(s.Screen,{title:"Not found",children:(0,o.jsx)(s.T,{children:"Restaurant not found."})})}},761,[785,12,791,810,797,6]);
|
owner-app/_expo/static/js/web/index-03b3d77bd2e8a210ebb2df9f2863b203.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return P}});var l=_r(_d[0]),t=_r(_d[1]),s=e(t);_r(_d[2]);var n=e(_r(_d[3])),o=e(_r(_d[4])),r=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]),m=_r(_d[13]),f=_r(_d[14]),y=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),k=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]);const O=['book','takeaway'].includes(w.START_GO??'')?w.START_GO:null;let A=!1;const T=[{id:'main',label:'Main menu'},{id:'specials',label:'Specials'},{id:'takeaway',label:'Takeaway'}];function P(){const{rid:e}=(0,l.useLocalSearchParams)(),w=(0,h.useRestaurant)(e),P=(0,h.useMenu)(e),B=(0,h.useCustomer)(),R=(0,h.useBasket)(),C=(0,h.useStore)(e=>e.startBasket),$=(0,h.useNow)(3e4),[I,M]=(0,t.useState)('All'),[v,N]=(0,t.useState)(null),[_,D]=(0,t.useState)(!1),[H,L]=(0,t.useState)(!1),[W,F]=(0,t.useState)('takeaway'===O?'takeaway':'main');s.default.useEffect(()=>{O&&!A&&(A=!0,'book'===O?setTimeout(()=>l.router.push(`/customer/${e}/book`),0):setTimeout(()=>{try{document.querySelector('[data-testid="menu-tabs"]')?.scrollIntoView({block:'start'})}catch{}},400))},[e]);const G=(0,j.useSpecials)(l=>l.current[e]??null),E=!!G&&(0,k.isToday)(G.postedAt,$),z=(0,y.useOwner)(e=>e.offers.filter(e=>e.live).length),K=(0,h.useStore)(l=>l.stampCards.find(t=>t.restaurantId===e&&t.customerId===l.customer.id)),Q=(0,h.useOrderAtTable)(e);if(s.default.useEffect(()=>{Q||R.restaurantId!==e||'table'!==R.mode||h.useStore.setState(e=>({basket:{...e.basket,mode:'takeaway',tableNo:void 0}}))},[Q,R.mode,R.restaurantId,e]),!w)return(0,S.jsx)(d.Screen,{title:"Not found",children:(0,S.jsx)(d.T,{children:"Restaurant not found."})});const V=Q&&R.restaurantId===w.id&&'table'===R.mode,Y=w.sections.length?w.sections:Array.from(new Set(P.map(e=>e.section))),q=e=>!(e.soldOut||!e.signOff||null===e.price),J=P.filter(e=>('All'===I||e.section===I)&&('takeaway'!==W||q(e))),U=(0,b.hoursFor)(w,$),X=e=>()=>l.router.push(`/customer/${w.id}${e}`),Z=[{icon:'\ud83e\udd61',label:'Takeaway',sub:'Order to collect',on:()=>{M('All'),F('takeaway'),V&&C(w.id,'takeaway')}},...Q?[{icon:'\ud83d\udcf1',label:'Order at table',sub:'Scan the QR',on:()=>L(!0)}]:[],{icon:'\ud83d\udcc5',label:'Book a table',on:X('/book')},{icon:'\u23f3',label:'Waitlist',sub:'Walk in',on:X('/waitlist')},{icon:'\u2b50',label:'Stamp card',sub:`${K?.stamps??0} of ${w.settings.stampTarget}`,on:X('/loyalty')},{icon:'\ud83e\udd1d',label:'Bring a friend',on:X('/refer')},{icon:'\ud83c\udf81',label:'Gift cards',on:X('/gift')},{icon:'\u26a0\ufe0f',label:'My allergens',sub:B.allergies.length?`${B.allergies.length} declared`:'None declared',on:()=>l.router.push('/customer/profile')},{icon:'\ud83c\udff7\ufe0f',label:'Offers',sub:B.marketingOptIn[w.id]?'Opted in':'Opt in',on:X('/offers'),badge:z?String(z):void 0},{icon:'\ud83c\udf89',label:"What's on",on:X('/whatson')},{icon:'\ud83d\udcac',label:'Feedback',sub:'Private',on:X('/feedback')},{icon:'\ud83e\udde3',label:'Lost property',on:X('/lost')},{icon:'\ud83d\udecd\ufe0f',label:'Shop',sub:'Merch',on:X('/merch')}];return(0,S.jsxs)(d.Screen,{title:w.name,subtitle:`${w.location}${w.phone?` \xb7 ${w.phone}`:''}`,back:'customer'!==f.APP_VARIANT,right:(0,S.jsxs)(d.Row,{children:[(0,S.jsx)(i.BasketButton,{}),(0,S.jsx)(d.Button,{small:!0,kind:"ghost",label:"Account",onPress:()=>l.router.push('/customer/profile')})]}),children:[w.fictional?(0,S.jsx)(d.Banner,{kind:"warn",title:"Fictional demo restaurant",children:"Shown only to demonstrate multi-restaurant support."}):null,V?(0,S.jsx)(d.Banner,{kind:"success",title:`Ordering at Table ${R.tableNo}`,children:"Your order goes straight to the kitchen. Pay and split the bill from your order page. A member of staff is always available \u2014 tap \u201cCall staff\u201d any time."}):(0,S.jsx)(d.Card,{children:(0,S.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsxs)(o.default,{style:{flex:1},children:[(0,S.jsx)(d.T,{weight:"semibold",children:"Takeaway \u2014 collection"}),(0,S.jsxs)(d.Muted,{children:[U?`Kitchen today ${(0,b.kitchenHoursOn)(w,$)[0]}\u2013${(0,b.kitchenHoursOn)(w,$)[1]}`:'Kitchen closed today',w.settings.takeawayPaused?' \xb7 slots paused by the restaurant':'']})]}),(0,S.jsx)(d.Badge,{kind:w.settings.takeawayPaused||!U?'amber':'green',label:w.settings.takeawayPaused?'Paused':U?'Taking orders':'Closed'})]})}),w.fictional?(0,S.jsx)(d.Row,{wrap:!0,gap:8,children:Z.slice(2,7).map(e=>(0,S.jsx)(d.Button,{small:!0,kind:"secondary",label:e.label,onPress:e.on},e.label))}):(0,S.jsx)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:Z.map(e=>(0,S.jsx)(m.HubTile,{icon:e.icon,label:e.label,sub:e.sub,badge:e.badge,onPress:e.on},e.label))}),V?(0,S.jsx)(d.Button,{small:!0,kind:"danger",label:"Call staff",onPress:()=>D(!0)}):null,_?(0,S.jsx)(d.Banner,{kind:"success",children:"A member of staff is on their way to your table (demo)."}):null,w.hoursNote?(0,S.jsx)(d.Muted,{children:w.hoursNote}):null,w.fictional?null:(0,S.jsx)(d.ExampleAllergenNotice,{}),(0,S.jsxs)(d.Muted,{children:["Menu dishes and prices from ",w.name,"\u2019s menu. Items marked \u26a0 conflict with your declared allergies."]}),(0,S.jsx)(o.default,{accessibilityRole:"tablist",testID:"menu-tabs",style:{flexDirection:'row',gap:6,backgroundColor:p.colours.surface,borderRadius:14,borderWidth:1,borderColor:p.colours.border,padding:4},children:T.map(e=>{const l=W===e.id;return(0,S.jsxs)(n.default,{testID:`menu-tab-${e.id}`,accessibilityRole:"tab",accessibilityState:{selected:l},"aria-selected":l,accessibilityLabel:'specials'===e.id&&E?'Specials, updated today':e.label,onPress:()=>F(e.id),style:{flex:1,minHeight:44,borderRadius:10,alignItems:'center',justifyContent:'center',paddingHorizontal:4,backgroundColor:l?p.colours.gold:'transparent'},children:[(0,S.jsx)(d.T,{size:14,weight:"semibold",colour:l?p.colours.onGold:p.colours.text,center:!0,children:e.label}),'specials'===e.id&&E&&!l?(0,S.jsx)(o.default,{style:{position:'absolute',top:6,right:8,width:7,height:7,borderRadius:4,backgroundColor:p.colours.gold}}):null]},e.id)})}),'specials'===W?(0,S.jsx)(x.SpecialsTab,{rid:w.id,declared:B.allergies,now:$}):null,'takeaway'===W?(0,S.jsx)(d.Muted,{children:"Order to collect. Only dishes available to order online are shown; pick a collection slot at checkout."}):null,'specials'!==W?(0,S.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,S.jsx)(d.Chip,{label:"All",selected:'All'===I,onPress:()=>M('All')}),Y.map(e=>(0,S.jsx)(d.Chip,{label:e,selected:I===e,onPress:()=>M(e)},e))]}):null,'specials'!==W?Y.filter(e=>('All'===I||e===I)&&J.some(l=>l.section===e)).map(e=>(0,S.jsxs)(o.default,{style:{gap:10},children:[(0,S.jsx)(d.H2,{style:{color:p.colours.gold,marginTop:6},children:e}),J.filter(l=>l.section===e).map(e=>{const t=(0,c.conflictsFor)(e.allergens,B.allergies),s=e.soldOut||!e.signOff||null===e.price;return(0,S.jsxs)(d.Card,{highlight:t.contains.length?p.colours.red:t.may.length?p.colours.amber:void 0,children:[(0,S.jsxs)(n.default,{accessibilityRole:"button",onPress:()=>{R.restaurantId&&R.restaurantId===w.id||C(w.id,'takeaway'),l.router.push(`/customer/${w.id}/dish/${e.id}`)},children:[(0,S.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,S.jsx)(d.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,S.jsx)(d.T,{weight:"semibold",colour:p.colours.gold,children:null===e.price?e.priceNote??'\u2014':(0,u.gbp)(e.price)})]}),(0,S.jsx)(d.Muted,{numberOfLines:2,children:e.description})]}),(0,S.jsxs)(d.Row,{wrap:!0,gap:6,children:[e.dietary.map(e=>(0,S.jsx)(d.Badge,{kind:"green",label:e},e)),e.special?(0,S.jsx)(d.Badge,{kind:"gold",label:"Special"}):null,e.soldOut?(0,S.jsx)(d.Badge,{kind:"neutral",label:"Sold out"}):null,e.signOff?null:(0,S.jsx)(d.Badge,{kind:"amber",label:"Awaiting allergen sign-off"}),t.contains.length?(0,S.jsx)(d.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):t.may.length?(0,S.jsx)(d.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null]}),(0,S.jsx)(r.AllergenChips,{map:e.allergens,declared:B.allergies}),v===e.id?(0,S.jsx)(r.AllergenPanel,{item:e,map:e.allergens,declared:B.allergies}):null,(0,S.jsxs)(d.Row,{gap:8,children:[(0,S.jsx)(d.Button,{small:!0,kind:"ghost",label:v===e.id?'Hide allergen panel':'Allergen panel',onPress:()=>N(v===e.id?null:e.id)}),(0,S.jsx)(o.default,{style:{flex:1}}),(0,S.jsx)(d.Button,{small:!0,label:s?e.soldOut?'Sold out':'Not available online':'Choose',disabled:s,onPress:()=>{R.restaurantId&&R.restaurantId===w.id||C(w.id,'takeaway'),l.router.push(`/customer/${w.id}/dish/${e.id}`)}})]})]},e.id)})]},e)):null,(0,S.jsx)(d.Muted,{children:"Drinks list coming soon. Ask your server for today\u2019s drinks."}),(0,S.jsx)(d.Muted,{children:"All payments in this app are demo only: Demo, no real payment."}),(0,S.jsx)(m.LauncherLine,{}),Q?(0,S.jsxs)(d.Sheet,{visible:H,onClose:()=>L(!1),title:"Order at your table",children:[(0,S.jsx)(d.Muted,{children:"Scan the QR code on your table with your phone camera, or pick your table number (demo)."}),(0,S.jsx)(d.Row,{wrap:!0,gap:6,children:Array.from({length:12},(e,l)=>String(l+1)).map(e=>(0,S.jsx)(d.Button,{small:!0,kind:"secondary",label:`Table ${e}`,onPress:()=>{L(!1),C(w.id,'table',e)}},e))}),(0,S.jsx)(d.Muted,{children:"Orders go straight to the kitchen. You pay from your order page (Demo, no real payment)."})]}):null]})}},763,[785,12,104,245,109,807,808,791,792,794,793,797,799,811,787,812,813,814,815,816,6]);
|
owner-app/_expo/static/js/web/index-43fb9d706c5994dd4d4a0d08ebfdc367.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e=_r(d[0]);_r(d[1]);var r,s=_r(d[2]),n=(r=s)&&r.__esModule?r:{default:r},t=_r(d[3]),l=_r(d[4]),o=_r(d[5]),a=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),j=_r(d[10]),x=_r(d[11]);function f(){const r=(0,u.useStore)(e=>e.restaurants),s=(0,u.useCustomer)(),f=(0,u.useNow)(3e4);return(0,x.jsxs)(l.Screen,{title:"Restaurants",subtitle:"Book, order and pay at local restaurants",right:(0,x.jsxs)(l.Row,{children:[(0,x.jsx)(t.BasketButton,{}),(0,x.jsx)(l.Button,{small:!0,kind:"ghost",label:"Profile",onPress:()=>e.router.push('/customer/profile')})]}),children:[(0,x.jsxs)(l.Card,{onPress:()=>e.router.push('/customer/profile'),children:[(0,x.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.T,{weight:"semibold",children:["Hello, ",s.name.split(' ')[0]]}),(0,x.jsx)(l.Muted,{children:"Edit profile \u203a"})]}),(0,x.jsx)(l.Muted,{children:"Your allergies (stored once, confirmed on every order and booking):"}),(0,x.jsx)(l.Row,{wrap:!0,gap:6,children:s.allergies.length?s.allergies.map(e=>(0,x.jsx)(l.Badge,{kind:"red",label:`${(0,o.allergenLabel)(e.allergen)} \u2014 ${(0,o.severityLabel)(e.severity)}`},e.allergen)):(0,x.jsx)(l.Muted,{children:"None declared"})})]}),r.map(r=>{const s=(0,a.hoursFor)(r,f);return(0,x.jsxs)(l.Card,{onPress:()=>e.router.push(`/customer/${r.id}`),highlight:r.id===j.VENUE_RID?c.colours.gold:void 0,children:[(0,x.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(l.H2,{style:{flex:1},children:r.name}),r.fictional?(0,x.jsx)(l.Badge,{kind:"amber",label:"FICTIONAL DEMO"}):(0,x.jsx)(l.Badge,{kind:"gold",label:"PILOT"})]}),(0,x.jsx)(l.Muted,{children:r.tagline}),(0,x.jsx)(l.Muted,{children:r.location}),(0,x.jsx)(l.T,{size:14,colour:s?c.colours.green:c.colours.amber,children:s?`Kitchen today ${(0,a.kitchenHoursOn)(r,f)[0]}\u2013${(0,a.kitchenHoursOn)(r,f)[1]}`:'Kitchen closed today (hours not listed)'})]},r.id)}),(0,x.jsx)(l.Banner,{kind:"info",children:"Each restaurant has its own menu, stamp card and gift cards. The Venue and Brae Bakehouse are fictional demo venues."}),(0,x.jsx)(h.LauncherLine,{}),(0,x.jsx)(n.default,{style:{height:8}})]})}},772,[785,12,109,808,791,792,793,797,799,811,821,6]);
|
owner-app/_expo/static/js/web/index-e169896d6181c62b56a7fa6a62cd6b62.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return 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]})}},777,[785,12,787,823,835,6]);
|
| 2 |
+
__d(function(g,_r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"EDIT_IDLE_MS",{enumerable:!0,get:function(){return ee}}),_e.DisplayBoard=function(){const{width:e,height:w}=(0,b.default)(),Q=e>=w,X=Q&&e>=600,se=X,ie=Math.round(Math.min(520,Math.max(240,.3*e))),[re,de]=(0,l.useState)({w:0,h:0}),ce=(0,I.useOwner)(e=>e.site),ue=(0,T.useRestaurant)(ce);(0,N.useAlertWatcher)(ce);const ge=(0,T.useOrders)(ce),he=(0,T.useBookings)(ce),fe=(0,T.useEvents)(ce),pe=(0,T.useStore)(e=>e.skipMinutes),be=(0,T.useStore)(e=>e.clock.mode),xe=(0,T.useNow)(5e3),me=(0,I.useOwner)(e=>e.staff),ye=(0,I.useOwner)(e=>e.attendance),je=(0,I.useOwner)(e=>e.shifts);s.default.useEffect(()=>{(0,S.ensureAttendance)((0,k.ymd)(xe),xe)},[(0,k.ymd)(xe)]);const we=ye.filter(e=>e.in&&!e.out&&xe.getTime()-new Date(e.in).getTime()<72e6&&xe.getTime()>=new Date(e.in).getTime()),De=te(me.find(e=>e.id===we[0]?.staffId)?.name)||'Duty Manager',ke=(0,k.ymd)(xe),Te=(0,i.useTravelDay)('display',ke),ve=(0,C.useFrontDoor)(ke,Q),Ie=(0,M.useDisplaySettings)(ce),Ce=Ie.privacy,Se=(0,M.usePlan)(ce),Me=(0,M.useFloor)(e=>e.live[ce]),Be=(0,_.useBlocks)(e=>e.blocks),[Pe,Re]=(0,l.useState)('plan'),[ze,Ae]=(0,l.useState)('all'),[$e,He]=(0,l.useState)(null),[Le,Oe]=(0,l.useState)(null),[Ee,We]=(0,l.useState)(null),[Fe,Ge]=(0,l.useState)(!1),[Ne,Ve]=(0,l.useState)(!1),[qe,Ue]=(0,l.useState)(null);s.default.useEffect(()=>{qe&&((0,t.notify)({id:`floor-note:${Date.now()}`,title:qe,timeoutMs:4500,big:!0,testID:'floor-toast'}),Ue(null))},[qe]),s.default.useEffect(()=>((0,r.setDisplaySilent)(!0),()=>(0,r.setDisplaySilent)(!1)),[]);const[Ke,Ye]=(0,l.useState)(null),Je=s.default.useRef(0),[Qe,Xe]=(0,l.useState)(null);s.default.useEffect(()=>{if(!Ke)return;Je.current=Date.now();const e=setInterval(()=>{const e=Date.now()-Je.current;if(e>=ee)return Ye(null),void Ue('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');Xe(e>=105e3?Math.ceil((ee-e)/1e3):null)},1e3);return()=>clearInterval(e)},[Ke]);const Ze=e=>We({title:`Guest details \xb7 ${e.time}`,body:(0,W.bookingDetails)(e)}),et=he.filter(e=>e.date===ke).sort((e,t)=>e.time.localeCompare(t.time)),tt=et.filter(e=>!['cancelled','noshow'].includes(e.status)),lt=tt.reduce((e,t)=>e+t.partySize,0),st=ge.filter(le).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),at=(0,l.useMemo)(()=>(0,D.forecastToday)(ue,he,ge,fe,xe),[ue,he,ge,fe,xe.getTime()/6e4|0]),ot=(0,_.closedAreasAt)(Be,ce,ke,(0,k.hm)(xe)),nt=[...ot].join(','),it=(0,l.useMemo)(()=>(0,B.floorView)(Se,he,ge,Me??{},xe,ue.settings.turnMins,ot),[Se,he,ge,Me,xe.getTime(),nt]),rt=(0,E.hoursFor)(ue,xe),dt=rt?.open??new Date(`${ke}T12:00:00`),ct=rt?.close??new Date(`${ke}T21:00:00`),ut=(0,k.addMins)(dt,-dt.getMinutes()),gt=(0,k.addMins)(ct,90),ht=e=>new Date(`${ke}T${e}:00`),ft=(0,_.blocksOn)(Be,ce,ke).map(e=>({from:ht(e.from),to:ht(e.to),label:e.reason??'Paused'})),pt=Object.keys(it).filter(e=>'blocked'===it[e]?.status),bt=at.open&&at.restOfDay.high>0?`Estimate (faint guide only): ${at.restOfDay.low}\u2013${at.restOfDay.high} covers for the rest of today`:void 0,xt=async(e,t)=>{const l=it[e]?.booking;if(!l||e===t)return;const s=it[t]?.status;if(s&&!['free','soon'].includes(s))return void Ue('dirty'===s?`Table ${t} needs clearing first.`:`Table ${t} is ${B.STATUS[s].label.toLowerCase()}. Pick a free table.`);await T.repo.bookings.update(l.id,{table:t});const a=Me?.[e]?.stage;M.useFloor.getState().setLive(ce,t,{stage:a??'seated',dirty:!1}),M.useFloor.getState().setLive(ce,e,{stage:void 0,dirty:!0}),Ue(`${(0,O.privName)(l,Ce)} moved Table ${e} \u2192 ${t}. Table ${e} needs clearing.`)},mt=Se.areas.filter(e=>Se.tables.some(t=>t.areaId===e.id)),yt=e=>{const t=Se.tables.filter(t=>t.areaId===e);return`${t.filter(e=>['free','soon'].includes(it[e.name]?.status??'free')).length}/${t.length} free`},jt='all'===ze||mt.some(e=>e.id===ze)?ze:'all',wt=e=>(0,Z.jsx)(P.FloorCanvas,{plan:Se,areaId:e,mode:"live",fit:"contain",crop:!0,fill:X,big:!0,view:it,privacy:Ce,turnBase:ue.settings.turnMins,highlight:Le?[Le]:void 0,onTap:e=>{return t=e.name,void(Le?(t!==Le&&xt(Le,t),Oe(null)):He(t));var t},onDrop:(e,t)=>xt(e.name,t.name)}),Dt=Q||mt.length>2?2:1,kt=e=>{const t=Se.tables.filter(t=>t.areaId===e);if(!t.length)return.5;const l=Math.max(...t.map(e=>e.x+e.w))-Math.min(...t.map(e=>e.x))+92;return(Math.max(...t.map(e=>e.y+e.h))-Math.min(...t.map(e=>e.y))+92)/l},Tt=[];for(let e=0;e<mt.length;e+=Dt)Tt.push(mt.slice(e,e+Dt));const vt=X?(0,R.venueGrid)(mt.map(e=>{const t=(0,P.areaBounds)(Se,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,P.minReadableScale)(Se,e.id)}}),re.w,re.h):null,It=e=>(0,Z.jsxs)(y.Row,{style:{justifyContent:'space-between',height:R.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,Z.jsxs)(y.T,{size:14,weight:"semibold",colour:e.colour??v.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,z.areaMarks)(e)]}),ot.has(e.id)?(0,Z.jsx)(y.T,{size:13,weight:"semibold",colour:v.colours.blue,children:"Closed for weather"}):(0,Z.jsx)(y.T,{size:13,colour:v.colours.muted,children:yt(e.id)})]}),Ct=(0,Z.jsx)(p.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-re.w)>1||Math.abs(l-re.h)>1)&&de({w:t,h:l})},children:vt?(0,Z.jsx)(f.default,{style:{flex:1},scrollEnabled:vt.scroll,showsVerticalScrollIndicator:vt.scroll,contentContainerStyle:{gap:R.GRID_GAP},children:vt.rows.map((e,t)=>(0,Z.jsx)(p.default,{style:{height:vt.rowHeights[t],flexDirection:'row',gap:R.GRID_GAP},children:e.map(e=>{const t=mt.find(t=>t.id===e);return(0,Z.jsxs)(p.default,{testID:`area-cell-${e}`,style:{width:vt.cellW,gap:2},children:[It(t),(0,Z.jsx)(p.default,{style:{flex:1},children:wt(e)})]},e)})},t))}):null}),St=(0,Z.jsxs)(p.default,{testID:"venue-plan",style:{flex:1,gap:10},children:[(()=>{const t=[(0,Z.jsx)(oe,{label:"Whole venue",selected:'all'===jt,onPress:()=>Ae('all')},"__all"),...mt.map(e=>(0,Z.jsx)(oe,{label:`${e.name}${(0,z.areaMarks)(e)}`,colour:e.colour??v.colours.gold,sub:ot.has(e.id)?'closed':jt===e.id?yt(e.id):void 0,selected:jt===e.id,onPress:()=>Ae(e.id)},e.id))];return X&&w<500||!X&&e<900?(0,Z.jsx)(f.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:{flexGrow:0},contentContainerStyle:{gap:6},children:t}):(0,Z.jsx)(y.Row,{wrap:!0,gap:8,children:t})})(),Le?(0,Z.jsxs)(y.Row,{gap:8,style:{backgroundColor:v.colours.goldTint,borderRadius:10,padding:8},children:[(0,Z.jsxs)(y.T,{weight:"semibold",colour:v.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Le,": tap the new table."]}),(0,Z.jsx)(y.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Oe(null)})]}):null,'all'===jt&&X?Ct:'all'===jt?(0,Z.jsx)(p.default,{style:{flex:1,gap:12,minHeight:se?void 0:360},children:Tt.map((e,t)=>(0,Z.jsxs)(p.default,{style:{flex:Math.max(.3,...e.map(e=>kt(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,Z.jsxs)(p.default,{style:{flex:1,gap:2},children:[(0,Z.jsxs)(y.Row,{style:{justifyContent:'space-between'},children:[(0,Z.jsxs)(y.T,{size:14,weight:"semibold",colour:e.colour??v.colours.gold,children:[e.name,(0,z.areaMarks)(e)]}),ot.has(e.id)?(0,Z.jsx)(y.T,{size:13,weight:"semibold",colour:v.colours.blue,children:"Closed for weather"}):(0,Z.jsx)(y.Muted,{children:yt(e.id)})]}),(0,Z.jsx)(p.default,{style:{flex:1},children:wt(e.id)})]},e.id)),e.length<Dt?(0,Z.jsx)(p.default,{style:{flex:1}}):null]},t))}):(0,Z.jsx)(p.default,{style:{flex:1,minHeight:se?void 0:360},children:wt(jt)})]}),Mt=(0,Z.jsx)(p.default,{testID:"venue-timeline",style:{flex:1,minHeight:se?void 0:360},children:(0,Z.jsx)(H.Timeline,{plan:Se,bookings:et,now:xe,privacy:Ce,turnBase:ue.settings.turnMins,t0:ut,t1:gt,pauses:ft,blockedTables:pt,onOpen:e=>{const t=(0,M.tablesOf)(e.table)[0];t&&it[t]?He(t):Ze(e)}})}),Bt='timeline'===Pe,Pt=(0,Z.jsx)(p.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderRadius:15,padding:4,gap:4,borderWidth:1,borderColor:'rgba(255,255,255,0.08)',backgroundColor:'rgba(255,255,255,0.035)',flexGrow:1},children:[['plan','Table plan','view-floor'],['timeline','Timeline','view-timeline']].map(([e,t,l])=>{const s='timeline'===e===Bt;return(0,Z.jsx)(h.default,{testID:l,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:s},onPress:()=>Re(e),style:{flex:1,minHeight:42,paddingHorizontal:16,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:s?v.colours.gold:'transparent',...K.look.web(s?{backgroundImage:'linear-gradient(180deg, #DDB671 0%, #C29550 100%)',boxShadow:'0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 12px rgba(207,164,95,0.22)'}:{})},children:(0,Z.jsx)(y.T,{size:15,weight:"semibold",colour:s?'#16120B':'#BDB5A6',children:t})},e)})}),Rt=e=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y.BigAction,{premium:!0,label:"Walk-in",icon:"\ud83d\udeb6",onPress:ve.openWalkIn,testID:"add-walkin",block:e,size:w<500?'m':'l'}),(0,Z.jsx)(Y.BigAction,{premium:!0,label:"New booking",icon:"\ud83d\udcc5",onPress:ve.openBooking,testID:"add-booking",block:e,size:w<500?'m':'l'})]}),zt=(0,Z.jsxs)(p.default,{testID:"display-tools",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[Se.areas.some(e=>e.outdoor)?(0,Z.jsx)(V.CloseGardenButton,{rid:ce,r:ue,now:xe,by:De,quiet:!0,short:!0}):null,(0,Z.jsx)(V.BlockBookingsButton,{rid:ce,r:ue,now:xe,by:De,quiet:!0}),(0,Z.jsx)($.HoldToEdit,{quiet:!0,onUnlock:()=>{Xe(null),Ye({at:Date.now()})},onHint:()=>Ue('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')})]}),At=st.length?(0,Z.jsxs)(p.default,{testID:"takeaway-panel",style:[K.look.panel,{overflow:'hidden'}],children:[(0,Z.jsxs)(y.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,Z.jsx)(y.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,Z.jsxs)(y.T,{size:12,colour:v.colours.muted,children:[st.length," live"]})]}),(0,Z.jsx)(p.default,{style:{padding:10},children:(0,Z.jsx)(ne,{list:st,me:De,compact:!0,bookings:he})})]}):null,$t=(0,Z.jsx)(U.DueToday,{shifts:je,att:ye,staff:me,today:ke,now:xe,compact:!X}),Ht=ie>=440,Lt=(0,Z.jsxs)(p.default,{style:{flex:1,flexDirection:'row',padding:14,paddingTop:12,gap:14,minHeight:0},children:[(0,Z.jsx)(p.default,{testID:"display-main",style:{flex:1,minWidth:0},children:Te?(0,Z.jsx)(f.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,Z.jsx)(i.DayView,{rid:ce,day:Te,today:ke,app:"display"})}):Bt?Mt:St}),(0,Z.jsxs)(p.default,{testID:"display-side",style:{width:ie,gap:10,minHeight:0},children:[(0,Z.jsx)(p.default,{testID:"primary-actions",style:{flexDirection:Ht?'row':'column',gap:10},children:Rt(!Ht)}),(0,Z.jsxs)(f.default,{testID:"display-side-scroll",style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:14},children:[(0,Z.jsx)(i.DayBar,{app:"display",today:ke}),Te?null:(0,Z.jsx)(a.CoversToday,{rid:ce,sound:(0,r.flapSoundOn)(),onPress:()=>Re('timeline')}),Te?null:(0,Z.jsx)(o.LastFoodBanner,{rid:ce,now:xe,big:!0}),Te?null:(0,Z.jsx)(n.NextTableFreeCard,{rid:ce,now:xe,big:!0}),Pt,zt,(0,Z.jsx)(V.BlocksBanner,{rid:ce,now:xe,big:!0}),At,$t,(0,Z.jsx)(q.DayGraph,{todays:et,open:dt,close:ct,now:xe,turnBase:ue.settings.turnMins,pauses:ft,height:Math.round(Math.min(140,Math.max(100,.14*w))),forecastNote:bt})]})]})]}),Ot=Q?Math.round(Math.min(160,Math.max(105,.16*w))):160;return(0,Z.jsxs)(x.SafeAreaView,{style:{flex:1,backgroundColor:v.colours.bg},children:[(0,Z.jsxs)(p.default,{testID:"display-header",style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',paddingHorizontal:e>=1e3?18:14,paddingVertical:w<500?3:8,gap:e>=1e3?14:10,minHeight:w<500?46:60,backgroundColor:'#0D0D0C',...K.look.web({backgroundImage:'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,Z.jsx)(j.RestaurantBrand,{rid:ue.id,size:30}),e>=1e3?(0,Z.jsx)(p.default,{style:{width:1,height:26,backgroundColor:'rgba(255,255,255,0.08)'}}):null,(0,Z.jsxs)(p.default,{style:{flexDirection:'row',alignItems:'baseline',gap:10},children:[(0,Z.jsx)(y.T,{size:26,weight:"semibold",colour:v.colours.goldLight,style:{letterSpacing:.5,lineHeight:32},children:(0,k.hm)(xe)}),w>=500?(0,Z.jsx)(y.T,{size:14,colour:v.colours.muted,children:(0,k.niceDate)(xe)}):null]}),(0,Z.jsx)(p.default,{style:{flex:1}}),(0,Z.jsx)(ae,{tight:e<1e3,items:[{label:'tables',value:tt.length,testID:'badge-tables'},{label:'covers',value:lt,testID:'badge-covers'},{label:'takeaway',value:st.length,alert:st.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>Ge(!0)}]}),w>=500||!Ce?(0,Z.jsx)(y.T,{size:12,colour:Ce?'#A89A80':v.colours.amber,children:Ce?e>=1e3?'\ud83d\udd12 Privacy':'\ud83d\udd12':'Privacy off'}):null,(0,Z.jsx)(h.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>Ve(!0),style:({pressed:e})=>({width:34,height:34,borderRadius:17,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,Z.jsx)(y.T,{size:15,weight:"semibold",colour:v.colours.muted,children:"?"})}),'simulated'===be?(0,Z.jsx)(h.default,{accessibilityRole:"button",accessibilityLabel:"Demo: skip 15 minutes",onPress:()=>pe(15),children:(0,Z.jsx)(y.T,{size:11,colour:v.colours.muted,children:e>=1e3?'Demo +15 min':'+15'})}):null,(0,Z.jsx)(u.VoiceSlot,{size:w<500?56:e>=1e3?72:64})]}),(0,Z.jsx)(J.ShellfishStrip,{rid:ce,by:De,app:"display",height:X?w<500?48:74:86}),X?Lt:(Et=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(p.default,{testID:"front-door-bar",style:{gap:10},children:[(0,Z.jsx)(p.default,{testID:"primary-actions",style:{flexDirection:'row',gap:12},children:Rt(!1)}),(0,Z.jsxs)(p.default,{style:{flexDirection:'row',gap:10,alignItems:'center',flexWrap:e>=700?'nowrap':'wrap'},children:[(0,Z.jsx)(p.default,{style:{flexGrow:1,flexBasis:e>=700?280:'100%'},children:Pt}),(0,Z.jsx)(p.default,{style:{flexGrow:2},children:zt})]})]}),(0,Z.jsx)(V.BlocksBanner,{rid:ce,now:xe,big:!0}),(0,Z.jsx)(i.DayBar,{app:"display",today:ke}),Te?(0,Z.jsx)(i.DayView,{rid:ce,day:Te,today:ke,app:"display"}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(a.CoversToday,{rid:ce,big:e>=700,sound:(0,r.flapSoundOn)(),onPress:()=>Re('timeline')}),(0,Z.jsx)(o.LastFoodBanner,{rid:ce,now:xe,big:!0}),(0,Z.jsx)(n.NextTableFreeCard,{rid:ce,now:xe,big:!0}),(0,Z.jsx)(p.default,{style:{flex:1,minHeight:Math.max(460,.5*w)},children:Bt?Mt:St})]}),At,(0,Z.jsxs)(p.default,{style:{flexDirection:e>=700?'row':'column',gap:12,alignItems:'stretch'},children:[(0,Z.jsx)(p.default,{style:{flex:e>=700?1.4:void 0},children:(0,Z.jsx)(q.DayGraph,{todays:et,open:dt,close:ct,now:xe,turnBase:ue.settings.turnMins,pauses:ft,height:Ot,forecastNote:bt})}),(0,Z.jsx)(p.default,{style:{flex:e>=700?1:void 0},children:$t})]})]}),se?(0,Z.jsx)(p.default,{style:{flex:1,padding:14,paddingTop:12,gap:12},children:Et}):(0,Z.jsx)(f.default,{style:{flex:1},contentContainerStyle:{flexGrow:1,padding:16,paddingTop:14,gap:14},children:Et})),ve.elements,$e?(0,Z.jsx)(W.TableSheet,{rid:ce,name:$e,view:it,plan:Se,todays:et,now:xe,privacy:Ce,turnBase:ue.settings.turnMins,onClose:()=>He(null),onWalkIn:e=>ve.openWalkInAt(e),onMove:e=>Oe(e),onDetails:Ze}):null,Ee?(0,Z.jsx)(W.DetailsPanel,{title:Ee.title,onClose:()=>We(null),children:Ee.body}):null,Ne?(0,Z.jsxs)(y.Sheet,{visible:!0,onClose:()=>Ve(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,Z.jsx)(W.Legend,{}),(0,Z.jsx)(y.Button,{kind:"secondary",label:"Close",onPress:()=>Ve(!1)})]}):null,Fe?(0,Z.jsxs)(W.DetailsPanel,{title:"Takeaway",onClose:()=>Ge(!1),children:[(0,Z.jsx)(y.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,Z.jsx)(ne,{list:st,me:De,bookings:he})]}):null,Ke?(0,Z.jsx)(p.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:v.colours.bg},children:(0,Z.jsx)(A.PlanDesigner,{initial:Se,venue:ue.name,mode:"display",startStep:"arrange",onActivity:()=>{Je.current=Date.now(),null!==Qe&&Xe(null)},notice:null!==Qe?`Locking again in ${Qe} s \xb7 touch to keep editing`:null,onSave:e=>{M.useFloor.getState().setPlan(ce,e),Ye(null),Ue('Table plan saved. Editing is locked again.')},onCancel:()=>{Ye(null),Ue('No changes kept. Editing is locked again.')}},Ke.at)}):null,(0,Z.jsx)(L.Screensaver,{rid:ce,idleMins:Ie.idleMins,pinOn:Ie.pinOn,pin:Ie.pin,tonightCards:Ie.tonightCards}),(0,Z.jsx)(F.AlertHost,{variant:"display",rid:ce,skipTakeaway:!0}),(0,Z.jsx)(c.SeatAllergenReminder,{rid:ce}),(0,Z.jsx)(G.TakeawayTakeover,{rid:ce,me:De})]});var Et};var t=_r(d[0]),l=_r(d[1]),s=e(l),a=_r(d[2]),o=_r(d[3]),n=_r(d[4]),i=_r(d[5]),r=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=e(_r(d[9])),f=e(_r(d[10])),p=e(_r(d[11])),b=e(_r(d[12])),x=_r(d[13]),y=_r(d[14]),j=_r(d[15]),w=_r(d[16]),D=_r(d[17]),k=_r(d[18]),T=_r(d[19]),v=_r(d[20]),I=_r(d[21]),C=_r(d[22]),S=_r(d[23]),M=_r(d[24]),B=_r(d[25]),P=_r(d[26]),R=_r(d[27]),z=_r(d[28]),A=_r(d[29]),$=_r(d[30]),H=_r(d[31]),L=_r(d[32]),O=_r(d[33]),E=_r(d[34]),W=_r(d[35]),F=_r(d[36]),G=_r(d[37]),N=_r(d[38]),_=_r(d[39]),V=_r(d[40]),q=_r(d[41]),U=_r(d[42]),K=_r(d[43]),Y=_r(d[44]),J=_r(d[45]),Q=_r(d[46]),X=_r(d[47]),Z=_r(d[48]);const ee=12e4,te=e=>(e??'').replace(' (example)',''),le=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),se=e=>e.slotTime?(0,k.hm)(new Date(e.slotTime)):'ASAP';function ae({items:e,tight:t}){return(0,Z.jsx)(p.default,{style:{flexDirection:'row',alignItems:'center',borderRadius:14,borderWidth:1,borderColor:'rgba(255,255,255,0.07)',backgroundColor:'rgba(255,255,255,0.025)',overflow:'hidden'},children:e.map((e,l)=>{const a=(0,Z.jsxs)(p.default,{testID:e.testID,style:{flexDirection:'row',alignItems:'baseline',gap:6,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'},children:[(0,Z.jsx)(y.T,{size:19,weight:"semibold",colour:e.alert?v.colours.amber:v.colours.text,children:e.value}),(0,Z.jsx)(y.T,{size:12,colour:v.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,Z.jsx)(h.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,children:a},e.testID):(0,Z.jsx)(s.default.Fragment,{children:a},e.testID)})})}function oe({label:e,sub:t,selected:l,onPress:s,colour:a}){return(0,Z.jsxs)(h.default,{accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:e,onPress:s,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',gap:7,minHeight:38,paddingHorizontal: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:[a?(0,Z.jsx)(p.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:a}}):null,(0,Z.jsx)(y.T,{size:14,weight:l?'semibold':'medium',colour:l?v.colours.goldLight:'#CFC8BA',children:e}),t?(0,Z.jsx)(y.T,{size:12,colour:v.colours.muted,children:t}):null]})}function ne({list:e,me:t,compact:l,bookings:s}){const a=(e,t)=>(0,X.statusBlock)(e,t,(0,X.linkedBooking)(e,s));return e.length?(0,Z.jsx)(p.default,{style:{gap:8},children:e.map(e=>(0,Z.jsxs)(p.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:v.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?v.colours.green:e.allergies.length?v.colours.red:v.colours.gold},children:[(0,Z.jsxs)(y.Row,{style:{justifyContent:'space-between'},children:[(0,Z.jsxs)(y.T,{size:l?16:18,weight:"bold",children:[se(e)," \xb7 ",te(e.customerName)]}),(0,Z.jsx)(y.Badge,{kind:'ready'===e.status?'green':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,Z.jsxs)(y.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,Z.jsxs)(y.T,{size:14,weight:"semibold",colour:v.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,w.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,Z.jsx)(Q.AllergyChain,{o:e,me:t,compact:!0}):null,(0,Z.jsxs)(y.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,Z.jsx)(y.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>T.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,Z.jsx)(y.Button,{small:!0,kind:"success",label:a(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!a(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>T.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,Z.jsx)(y.Button,{small:!0,label:a(e,'collected')?'Sign-offs needed':'Collected',disabled:!!a(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>T.repo.orders.setStatus(e.id,'collected',t)}):null]})]},e.id))}):(0,Z.jsx)(y.Muted,{children:"No takeaway orders right now."})}},823,[836,12,837,838,839,840,841,842,843,245,133,109,269,271,791,844,792,818,796,797,799,812,845,846,803,804,847,824,848,849,825,826,828,827,793,830,850,851,852,802,853,831,833,854,834,855,856,857,6]);
|
| 3 |
+
__d(function(g,_r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AREA_LABEL_H",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"GRID_GAP",{enumerable:!0,get:function(){return n}}),e.venueGrid=function(r,l,o,s=n,a=t){if(!r.length||l<=0||o<=0)return null;const c=Math.max(0,...r.map(t=>t.minScale)),h=t=>{const n=[];for(let l=0;l<r.length;l+=t)n.push(r.slice(l,l+t));const c=(l-s*(t-1))/t,h=Math.min(...r.map(t=>c/t.w)),u=n.reduce((t,n)=>t+Math.max(...n.map(t=>t.h)),0),i=(o-n.length*a-s*(n.length-1))/u;return{cols:t,rows:n,cellW:c,byW:h,byH:i,sumH:u,s:Math.min(h,i)}},u=Array.from({length:r.length},(t,n)=>h(n+1));let i=u.reduce((t,n)=>n.s>t.s+1e-6?n:t),f=!1,p=i.s;if(i.s<c){const t=u.filter(t=>t.byW>=c);i=t.length?t[t.length-1]:u[0],p=Math.min(i.byW,Math.max(c,i.byH)),f=i.byH<p-1e-6}const b=i.rows.map(t=>Math.max(...t.map(t=>t.h))*p+a),y=b.reduce((t,n)=>t+n,0)+s*(i.rows.length-1),M=f?0:Math.max(0,o-y),w=b.map(t=>Math.floor(t+M*(t-a)/(i.sumH*p||1)));return{cols:i.cols,rows:i.rows.map(t=>t.map(t=>t.id)),rowHeights:w,cellW:i.cellW,scale:p,scroll:f,totalH:w.reduce((t,n)=>t+n,0)+s*(i.rows.length-1)}};const t=24,n=8},824,[]);
|
| 4 |
+
__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.HoldToEdit=function({label:e="Edit plan",ms:f=2e3,onUnlock:h,onHint:b,testID:p="view-plan",big:y,quiet:j}){const[w,x]=(0,o.useState)(0),k=(0,o.useRef)(null),v=(0,o.useRef)(null),D=(0,o.useRef)(!1),C=()=>{v.current&&clearInterval(v.current),v.current=null,k.current=null};(0,o.useEffect)(()=>C,[]);const I=w>0;return(0,c.jsxs)(t.default,{testID:p,accessibilityRole:"button",accessibilityLabel:`${e}: locked. Press and hold for 2 seconds to unlock`,accessibilityHint:"Press and hold to unlock editing",onPressIn:()=>{C(),D.current=!1,k.current=Date.now(),x(.001),v.current=setInterval(()=>{const e=Math.min(1,(Date.now()-(k.current??Date.now()))/f);x(e),e>=1&&(C(),x(0),D.current=!0,h())},40)},onPressOut:()=>{C(),x(0)},onPress:()=>{D.current||b(),D.current=!1},delayLongPress:f+1e3,style:j?{...u.look.quiet(!1),borderColor:I?l.colours.gold:'rgba(255,255,255,0.10)',backgroundColor:'rgba(255,255,255,0.025)',flexGrow:1,minWidth:130,overflow:'hidden',userSelect:'none'}:{minHeight:y?60:48,minWidth:150,borderRadius:16,borderWidth:1.5,borderColor:I?l.colours.gold:l.colours.border,overflow:'hidden',justifyContent:'center',paddingHorizontal:14,backgroundColor:l.colours.surface,userSelect:'none'},children:[(0,c.jsx)(n.default,{testID:"hold-progress",pointerEvents:"none",style:{position:'absolute',left:0,top:0,bottom:0,width:`${Math.round(100*w)}%`,backgroundColor:l.colours.gold,opacity:.85}}),(0,c.jsxs)(n.default,{pointerEvents:"none",style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:8},children:[(0,c.jsx)(s.T,{size:j?14:y?18:16,children:I?'\ud83d\udd13':'\ud83d\udd12'}),(0,c.jsxs)(n.default,{children:[(0,c.jsx)(s.T,{size:j?14:y?17:15,weight:"semibold",colour:I&&w>.5?l.colours.onGold:j?l.colours.muted:l.colours.goldLight,children:I?'Keep holding\u2026':e}),(0,c.jsx)(s.T,{size:j?10:11,colour:I&&w>.5?l.colours.onGold:j?'#857D6E':l.colours.muted,children:I?`${Math.max(0,Math.ceil((1-w)*f/1e3))} s`:'Hold 2 s to unlock'})]})]})]})};var o=r(d[0]),t=e(r(d[1])),n=e(r(d[2])),l=r(d[3]),s=r(d[4]),u=r(d[5]),c=r(d[6])},825,[12,245,109,799,791,854,6]);
|
| 5 |
+
__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return b}}),_e.Timeline=function({plan:e,bookings:p,now:y,privacy:x,onOpen:j,turnBase:k,t0:C,t1:v,height:w,pauses:M,blockedTables:T}){const R=(0,t.useMemo)(()=>[{key:'__none',area:'',name:'To assign'},...e.areas.flatMap(t=>e.tables.filter(e=>e.areaId===t.id).map(e=>({key:e.name,area:t.name,name:(0,i.tableLabel)(e)})))],[e]),z=p.filter(e=>!['cancelled','noshow'].includes(e.status)),B=(0,t.useMemo)(()=>(0,l.clashes)(z,k),[z,k]),$=Math.ceil((v.getTime()-C.getTime())/9e5),O=e=>(e.getTime()-C.getTime())/9e5*h,[_,E]=(0,t.useState)(null),L=(0,t.useRef)(null),W=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,O(y)-120);setTimeout(()=>W.current?.scrollTo({x:e,animated:!1}),50)},[]);const[I,S]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{L.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!L.current)return;const r=o.nativeEvent.pageX-L.current.x,n=o.nativeEvent.pageY-L.current.y;Math.abs(r)+Math.abs(n)>=6&&E({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=L.current;L.current=null,E(null);const a=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(a)+Math.abs(d)<6)return void('move'===t&&j(e));const c=Math.round(a/h);if('stretch'===t){const t=Math.max(30,(0,l.durOf)(e,k)+15*c);return n.repo.bookings.update(e.id,{durationMins:t}),void S(`${(0,u.privName)(e,x)} now ${t} min`)}const f=R.findIndex(t=>t.key===((0,i.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(R.length-1,f+Math.round(d/b))),p={};c&&'confirmed'===e.status&&(p.time=(0,s.hm)((0,s.addMins)((0,l.startOf)(e),15*c))),g!==f&&'__none'!==R[g].key&&(p.table=R[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),S(`${(0,u.privName)(e,x)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):c&&'confirmed'!==e.status&&S('Seated parties can move table, not time.')}}),F=O(y);return(0,c.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,c.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsxs)(d.Row,{gap:8,children:[(0,c.jsx)(d.Badge,{kind:B.size?'red':'green',label:B.size?`${B.size} bookings clash`:'No clashes'}),(0,c.jsx)(d.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})]}),(0,c.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${B.size}`,children:(0,c.jsx)(d.T,{size:13,colour:a.colours.goldLight,children:I})})]}),(0,c.jsx)(r.default,{style:{flex:w?void 0:1,height:w,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:a.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,c.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,c.jsxs)(r.default,{style:{width:f,borderRightWidth:1,borderColor:a.colours.border,backgroundColor:a.colours.surface},children:[(0,c.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:a.colours.border},children:(0,c.jsx)(d.T,{size:12,colour:a.colours.muted,children:"Table"})}),R.map((e,t)=>(0,c.jsxs)(r.default,{style:{height:b,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&R[t-1].area!==e.area?2:0,borderTopColor:a.colours.gold},children:[(0,c.jsx)(d.T,{size:14,weight:"semibold",children:'__none'===e.key||e.name!==e.key?e.name:`T${e.name}`}),!e.area||0!==t&&R[t-1].area===e.area?null:(0,c.jsx)(d.T,{size:10,colour:a.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,c.jsx)(o.default,{ref:W,horizontal:!0,style:{flex:1},children:(0,c.jsxs)(r.default,{style:{width:$*h},children:[(0,c.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:a.colours.border},children:Array.from({length:Math.ceil($/4)},(e,t)=>(0,c.jsx)(r.default,{style:{width:Math.min(4,$-4*t)*h,justifyContent:'center',borderLeftWidth:1,borderColor:a.colours.border},children:(0,c.jsx)(d.T,{size:11,colour:a.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,s.hm)((0,s.addMins)(C,60*t))})},t))}),(M??[]).map((e,t)=>{const o=Math.max(0,O(e.from)),n=Math.min($*h,O(e.to));return n<=o?null:(0,c.jsx)(r.default,{testID:"tl-pause",pointerEvents:"none",style:{position:'absolute',left:o,width:n-o,top:0,bottom:0,backgroundColor:'rgba(255,181,71,0.10)',borderLeftWidth:2,borderRightWidth:2,borderColor:'rgba(255,181,71,0.55)',zIndex:1},children:(0,c.jsx)(r.default,{style:{backgroundColor:a.colours.amber,alignSelf:'flex-start',borderBottomRightRadius:6,paddingHorizontal:5},children:(0,c.jsxs)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",numberOfLines:1,children:["\u23f8 ",e.label]})})},`pz${t}`)}),R.map((e,t)=>{return(0,c.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:b,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&R[t-1].area!==e.area?2:0,borderTopColor:'rgba(207,164,95,0.4)'},children:[Array.from({length:Math.ceil($/4)},(e,t)=>(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*h,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),T?.includes(e.key)?(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:0,right:0,top:0,bottom:0,backgroundColor:'rgba(58,58,58,0.55)',justifyContent:'center',paddingLeft:Math.max(6,F+6)},children:(0,c.jsx)(d.T,{size:11,weight:"bold",colour:"#CFCFCF",children:"Table blocked"})}):null,(o=e.key,z.filter(e=>'__none'===o?!e.table:(0,i.tablesOf)(e.table).includes(o))).map(e=>{const t=_?.id===e.id?_:null,o=O((0,l.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(h,(0,l.durOf)(e,k)/15*h+('stretch'===t?.kind?t.dx:0)),i=B.has(e.id);return(0,c.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,u.privName)(e,x)}, ${e.partySize}, ${(0,s.hm)((0,l.startOf)(e))}, ${(0,l.durOf)(e,k)} min${i?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:g(e),borderWidth:i?2.5:1,borderColor:i?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?.55:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,c.jsxs)(d.T,{size:12,weight:"semibold",colour:'confirmed'===e.status?'#EAF4FF':'#0B0B0B',numberOfLines:1,children:[i?'\u26a0 ':'',(0,s.hm)((0,l.startOf)(e))," ",e.walkIn?'Walk-in':(0,u.privName)(e,x)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,c.jsx)(r.default,{testID:`tl-stretch-${e.id}`,accessibilityLabel:"Change length",...D(e,'stretch'),style:{position:'absolute',right:0,top:0,bottom:0,width:14,borderTopRightRadius:8,borderBottomRightRadius:8,backgroundColor:'rgba(0,0,0,0.25)',cursor:'ew-resize',touchAction:'none'}})]},e.id)})]},e.key);var o}),F>=0&&F<=$*h?(0,c.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:F,top:0,bottom:0,width:2,backgroundColor:a.colours.gold,zIndex:30},children:(0,c.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:a.colours.gold,borderRadius:6},children:(0,c.jsx)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,s.hm)(y)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),i=_r(_d[5]),l=_r(_d[6]),s=_r(_d[7]),a=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]);const h=30,b=44,f=96,g=e=>'seated'===e.status?'#CFA45F':'finished'===e.status?'#3A352C':e.walkIn?'#B9925A':'#3C78B5'},826,[12,104,133,109,797,803,804,796,799,791,827,6]);
|
| 6 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initials",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"shortName",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"pv",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"privName",{enumerable:!0,get:function(){return o}});const t=t=>t.replace(' (example)','').split(/\s+/).filter(Boolean).map(t=>`${t[0].toUpperCase()}.`).join(' '),n=t=>{const n=t.replace(' (example)','').split(/\s+/).filter(Boolean);return n.length<=1?n.length?`${n[0][0].toUpperCase()}.`:'':[n[0],...n.slice(1).map(t=>`${t[0].toUpperCase()}.`)].join(' ')},l=(t,l)=>t?l?n(t):t.replace(' (example)',''):'',o=(t,n)=>t.walkIn?`Walk-in ${t.ref}`:l(t.name,n)},827,[]);
|
| 7 |
+
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Screensaver=function({rid:e,idleMins:n,pinOn:o,pin:s,tonightCards:c}){const[u,l]=(0,t.useState)(!1),[d,p]=(0,t.useState)(!1),[E,k]=(0,t.useState)(''),x=(0,t.useRef)(Date.now()),j=(0,t.useRef)(!1),_=(0,t.useRef)(0);j.current=u,(0,t.useEffect)(()=>(f.useScreensaverAsleep.getState().set(u),()=>f.useScreensaverAsleep.getState().set(!1)),[u]);const I=6e4*n;(0,t.useEffect)(()=>{if(!y)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return h.FULLSCREEN_TAP_EVENTS.includes(t.type)&&(0,h.enterFullscreen)(),j.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),_.current=n+800,j.current=!1,window.__ccWokeAt=n,l(!1),L.current&&p(!0),void(x.current=Date.now())):n<_.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(x.current=Date.now())},n=['pointerdown','pointerup','mousedown','mouseup','touchstart','touchend','click','keydown','wheel'];n.forEach(e=>window.addEventListener(e,t,{capture:!0,passive:!1}));const o=setInterval(()=>{!j.current&&!S.current&&Date.now()-x.current>=I&&(j.current=!0,l(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[I]);const L=(0,t.useRef)(o);L.current=o;const S=(0,t.useRef)(d);return S.current=d,(0,t.useEffect)(()=>{if(!y)return;let e=null;const t=async()=>{try{e=await(navigator.wakeLock?.request?.('screen')),window.__ccWakeLock=e?'on':'unsupported'}catch{window.__ccWakeLock='refused'}};t();const n=()=>{'visible'===document.visibilityState&&t()};return document.addEventListener('visibilitychange',n),()=>{document.removeEventListener('visibilitychange',n);try{e?.release?.()}catch{}}},[]),d?(0,w.jsx)(v,{pin:s,entry:E,setEntry:k,onOk:()=>{p(!1),k(''),x.current=Date.now()}}):u?(0,w.jsx)(b,{rid:e,tonightCards:c}):null};var t=r(_d[0]),n=e(r(_d[1])),o=e(r(_d[2]));r(_d[3]);var s=e(r(_d[4])),c=e(r(_d[5])),u=e(r(_d[6])),l=r(_d[7]),d=r(_d[8]),p=r(_d[9]),f=r(_d[10]),h=r(_d[11]),w=r(_d[12]);const y='undefined'!=typeof window;function v({pin:e,entry:t,setEntry:n,onOk:o}){const u=s=>{const c=(t+s).slice(0,4);n(c),4===c.length&&(c===e?o():setTimeout(()=>n(''),300))};return(0,w.jsxs)(c.default,{testID:"wake-pin",style:{position:y?'fixed':'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e5,backgroundColor:'rgba(5,5,5,0.97)',alignItems:'center',justifyContent:'center',gap:16},children:[(0,w.jsx)(p.T,{size:22,weight:"semibold",colour:l.colours.gold,children:"Enter staff PIN"}),(0,w.jsxs)(p.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(4-t.length)]}),(0,w.jsx)(c.default,{style:{flexDirection:'row',flexWrap:'wrap',width:252,gap:12,justifyContent:'center'},children:['1','2','3','4','5','6','7','8','9','0'].map(e=>(0,w.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>u(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:l.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,w.jsx)(p.T,{size:26,colour:l.colours.gold,children:e})},e))})]})}function b({rid:e}){const{width:s,height:c}=(0,u.default)(),f=(0,d.useBrand)(e),h=d.HERO_LOGOS[e]??f.logo,v=(0,t.useRef)(new n.default.Value(0)).current;(0,t.useEffect)(()=>{n.default.timing(v,{toValue:1,duration:700,useNativeDriver:!1}).start()},[]);const b=.5*Math.min(s,c);return(0,w.jsx)(n.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:y?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#000000',opacity:v,overflow:'hidden',cursor:'pointer',alignItems:'center',justifyContent:'center'},children:h?(0,w.jsx)(o.default,{source:h,style:{width:b,height:b},resizeMode:"contain",accessibilityLabel:`${f.name} logo`}):(0,w.jsx)(p.T,{size:48,weight:"bold",colour:l.colours.gold,children:f.name})})}},828,[12,102,178,104,245,109,269,799,844,791,858,829,6]);
|
| 8 |
+
__d(function(g,_r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.enterFullscreen=function(){if('undefined'==typeof document)return;try{const t=document;if(t.fullscreenElement||t.webkitFullscreenElement)return;const n=document.documentElement,c=n.requestFullscreen??n.webkitRequestFullscreen;if('function'!=typeof c)return;const u=n.requestFullscreen?n.requestFullscreen({navigationUI:'hide'}):c.call(n);u&&'function'==typeof u.catch&&u.catch(()=>{})}catch{}},Object.defineProperty(e,"FULLSCREEN_TAP_EVENTS",{enumerable:!0,get:function(){return t}}),_r(_d[0]);const t=['pointerup','touchend','click','keydown']},829,[104]);
|
| 9 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Card",{enumerable:!0,get:function(){return w}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const l=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,x.minsBetween)(t,new Date(`${e.date}T${e.time}:00`))})).filter(e=>e.m>=-20&&e.m<=60).sort((e,t)=>e.m-t.m);return(0,y.jsxs)(o.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,y.jsx)(i.T,{size:13,weight:"semibold",colour:p.colours.gold,children:"NEXT HOUR"}),(0,y.jsxs)(r.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===l.length?(0,y.jsx)(i.Muted,{children:"No arrivals due in the next hour."}):null,l.map(({b:e,m:t})=>(0,y.jsxs)(o.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?p.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?p.colours.amber:'#3C78B5'},children:[(0,y.jsx)(i.T,{size:13,weight:"semibold",children:e.time}),(0,y.jsxs)(i.T,{size:13,children:[(0,u.privName)(e,s)," \xb7 ",e.partySize]}),(0,y.jsx)(i.T,{size:12,colour:p.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,y.jsx)(i.T,{size:12,colour:t<0?p.colours.amber:p.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,y.jsx)(i.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,y.jsx)(i.T,{size:12,children:m.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,y.jsxs)(i.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(m.STATUS).map(e=>(0,y.jsxs)(i.Row,{gap:4,children:[(0,y.jsx)(o.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:m.STATUS[e].colour}}),(0,y.jsx)(i.T,{size:12,colour:p.colours.muted,children:m.STATUS[e].label})]},e)),(0,y.jsx)(i.T,{size:12,colour:p.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc8d anniversary"})]})},_e.DetailsPanel=function({title:e,children:s,onClose:l}){const[r,a]=(0,t.useState)(20);return(0,t.useEffect)(()=>{const e=Date.now(),t=()=>a(20-Math.floor((Date.now()-e)/1e3)),s=setInterval(t,1e3),l=setTimeout(t,2e4);return()=>{clearInterval(s),clearTimeout(l)}},[]),(0,t.useEffect)(()=>{r<=0&&l()},[r]),(0,y.jsxs)(i.Sheet,{visible:!0,onClose:l,title:e,maxWidth:560,testID:"private-details",children:[(0,y.jsx)(i.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),s,(0,y.jsx)(i.Button,{kind:"secondary",label:"Close now",onPress:l})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return v}}),_e.TableSheet=function({rid:e,name:s,view:r,plan:b,todays:f,now:j,privacy:w,turnBase:v,onClose:T,onWalkIn:S,onMove:k,onDetails:$}){const C=r[s],M=h.useFloor.getState(),[z,B]=(0,t.useState)(!1),[I,D]=(0,t.useState)(C?.note??''),[P,R]=(0,t.useState)(!1);if(!C)return null;const A=C.booking,N=['seated','mains','dessert','bill'].includes(C.status),O=f.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,x.minsBetween)(j,(0,m.startOf)(e)))-Math.abs((0,x.minsBetween)(j,(0,m.startOf)(t)))),W=e=>e.partySize<=C.table.maxSeats,L=(0,m.turnFor)(C.covers||C.table.maxSeats,v);return(0,y.jsxs)(i.Sheet,{visible:!0,onClose:T,title:`Table ${s} \xb7 ${m.STATUS[C.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,y.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,y.jsx)(i.Badge,{kind:"neutral",label:`${C.table.minSeats}\u2013${C.table.maxSeats} seats`}),A?(0,y.jsx)(i.Badge,{kind:"gold",label:`${(0,u.privName)(A,w)} \xb7 ${A.partySize} \xb7 ${C.seatedMins}m`}):null,A?(0,y.jsx)(i.Badge,{kind:C.seatedMins>(0,m.durOf)(A,v)?'red':'neutral',label:`Turn ~${(0,m.durOf)(A,v)} min \xb7 free ~${(0,x.hm)((0,m.endOf)(A,v))} (est.)`}):(0,y.jsx)(i.Badge,{kind:"neutral",label:`Turn estimate for ${C.table.maxSeats}: ~${L} min`}),C.next?(0,y.jsx)(i.Badge,{kind:"blue",label:`Next: ${C.next.time} ${(0,u.privName)(C.next,w)} (${C.next.partySize})`}):null,C.allergy?(0,y.jsx)(i.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),N||'blocked'===C.status?null:(0,y.jsxs)(i.Row,{gap:8,children:[(0,y.jsx)(i.Button,{label:"Seat walk-in here",onPress:()=>{T(),S(s)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,y.jsx)(i.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>R(!P),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),P?(0,y.jsxs)(o.default,{style:{gap:6},children:[0===O.length?(0,y.jsx)(i.Muted,{children:"No bookings left to seat today."}):null,O.slice(0,8).map(t=>(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,u.privName)(t,w)} ${t.time}`,onPress:async()=>{await c.repo.bookings.update(t.id,{table:s}),await c.repo.bookings.setStatus(t.id,'seated'),(0,n.resetTableLive)(e,s),T()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:W(t)?p.colours.border:p.colours.amber,backgroundColor:p.colours.surface2},children:[(0,y.jsxs)(i.T,{weight:"semibold",children:[t.time," \xb7 ",(0,u.privName)(t,w)," \xb7 ",t.partySize,t.table?` \xb7 booked T${t.table}`:'',t.allergies.length?' \xb7 \u26a0':'']}),W(t)?null:(0,y.jsxs)(i.T,{size:12,colour:p.colours.amber,children:["Bigger than this table (",C.table.maxSeats," max)"]})]},t.id))]}):null,N?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i.T,{size:14,colour:p.colours.muted,children:"Course / status"}),(0,y.jsx)(i.Row,{wrap:!0,gap:6,children:m.STAGES.map(t=>(0,y.jsx)(i.Chip,{label:m.STATUS[t].label,selected:C.status===t,onPress:()=>M.setLive(e,s,{stage:t})},t))}),(0,y.jsxs)(i.Row,{wrap:!0,gap:8,children:[A?(0,y.jsx)(i.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{T(),k(s)},testID:"move-party"}):null,(0,y.jsx)(i.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{A&&await c.repo.bookings.setStatus(A.id,'finished'),M.setLive(e,s,{stage:void 0,dirty:!0}),T()}})]})]}):null,'dirty'===C.status?(0,y.jsx)(i.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{M.setLive(e,s,{dirty:!1}),T()},testID:"mark-clean"}):null,(0,y.jsxs)(i.Row,{wrap:!0,gap:8,children:[(0,y.jsx)(i.Button,{kind:"secondary",label:'blocked'===C.status?'Unblock table':'Block table',onPress:()=>{M.setLive(e,s,{blocked:'blocked'!==C.status}),T()},testID:"block-table"}),(0,y.jsx)(i.Button,{kind:"ghost",label:C.note?'Edit note':'+ Note',onPress:()=>B(!z)}),A||C.next?(0,y.jsx)(i.Button,{kind:"ghost",label:"Guest details",onPress:()=>{T(),$(A??C.next)},testID:"guest-details"}):null]}),z?(0,y.jsxs)(i.Row,{gap:6,children:[(0,y.jsx)(a.default,{accessibilityLabel:"Table note",value:I,onChangeText:D,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[i.styles.input,{flex:1}]}),(0,y.jsx)(i.Button,{small:!0,label:"Save",onPress:()=>{M.setLive(e,s,{note:I.trim()||void 0}),B(!1)}})]}):null,w?(0,y.jsx)(i.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,b.joins.some(e=>e.tables.includes(s))?(0,y.jsxs)(i.Muted,{children:["Joins with ",b.joins.find(e=>e.tables.includes(s)).tables.filter(e=>e!==s).join(', ')," for bigger parties (book as ",b.joins.find(e=>e.tables.includes(s)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:s,plan:r,view:b,todays:j,waiting:v,now:T,privacy:S,busy:k,onToast:$}){const[C,M]=(0,t.useState)(''),[z,B]=(0,t.useState)(2),I=(0,h.useFloor)(e=>e.smsLog);return(0,y.jsxs)(w,{title:`Waitlist (${v.length})`,right:(0,y.jsxs)(i.Muted,{children:["new party ~",(0,f.estimateWait)(v.length+1,s.settings.turnMins,k)," min"]}),testID:"waitlist-panel",children:[0===v.length?(0,y.jsx)(i.Muted,{children:"Nobody waiting."}):null,v.map((t,l)=>{const a=(0,m.suggestTable)(r,j,b,t.partySize,T,(0,m.turnFor)(t.partySize,s.settings.turnMins)),w=(0,f.estimateWait)(l+1,s.settings.turnMins,k),v=Math.max(0,(0,x.minsBetween)(new Date(t.joinedAt),T)),C=I.find(s=>s.rid===e&&s.text.includes(`#${t.number} `));return(0,y.jsxs)(o.default,{style:{backgroundColor:p.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(i.T,{weight:"semibold",children:["#",t.number," ",(0,u.pv)(t.name,S)," \xb7 ",t.partySize]}),(0,y.jsxs)(i.T,{size:12,colour:v>w?p.colours.amber:p.colours.muted,children:["waited ",v,"m \xb7 quoted ~",w,"m"]})]}),a?(0,y.jsxs)(i.T,{size:12,colour:a.clashes?p.colours.amber:p.colours.green,children:["Best table: ",a.table," (",a.why,")"]}):(0,y.jsx)(i.T,{size:12,colour:p.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,y.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,y.jsx)(i.Button,{small:!0,label:C||'notified'===t.status?'Re-send (demo)':'Table ready text (demo)',testID:`sms-${t.number}`,onPress:()=>{h.useFloor.getState().logSms(e,T.toISOString(),`#${t.number} ${t.partySize}: Your table at ${s.name} is ready.`),c.repo.waitlist.setStatus(t.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${s.name} is ready."`)}}),a?(0,y.jsx)(i.Button,{small:!0,kind:"success",label:`Seat at ${a.table}`,onPress:async()=>{await c.repo.waitlist.setStatus(t.id,'seated'),await c.repo.bookings.seatWalkIn(e,t.partySize,a.table,`From waitlist #${t.number}`),(0,n.resetTableLive)(e,a.table),$(`Waitlist #${t.number} seated at ${a.table}`)}}):null,(0,y.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>c.repo.waitlist.setStatus(t.id,'removed')})]}),'notified'===t.status?(0,y.jsx)(i.Badge,{kind:"green",label:`Told table ready${C?` ${(0,x.hm)(new Date(C.at))}`:''} (demo)`}):null]},t.id)}),(0,y.jsxs)(i.Row,{gap:6,children:[(0,y.jsx)(a.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[i.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,y.jsx)(l.default,{accessibilityLabel:"Waitlist party size",onPress:()=>B(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:p.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(i.T,{weight:"bold",colour:p.colours.gold,children:z})}),(0,y.jsx)(i.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{c.repo.waitlist.join(e,C.trim(),z),M('')}})]})]})},_e.PacePanel=function({r:e,fc:t,todays:s,now:l,walkInCount:r,staffOn:a,onSummary:n}){const u=r+s.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),c=l.getHours(),h=Math.round(t.hours.filter(e=>e.hour<c).reduce((e,t)=>e+t.covers,0)+(t.hours.find(e=>e.hour===c)?.covers??0)*(l.getMinutes()/60)),b=h?u/h:1,f=b>=1.1?p.colours.amber:b>=.85?p.colours.green:p.colours.blue,j=Array.from({length:8},(e,t)=>{const r=(0,x.addMins)(l,15*(t-4)-l.getMinutes()%15),a=(0,x.addMins)(r,15),o=s.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,m.startOf)(e);return t>=r&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:r,covers:o,future:t>=4}}),v=Math.max(4,Math.round(e.settings.capacityPerHour/4)),T=Math.max(v,...j.map(e=>e.covers)),S=j.filter(e=>e.future&&e.covers>v),k=t.nextHour?.covers??0,$=Math.ceil(k/16);return(0,y.jsxs)(w,{title:"Pace & kitchen",right:(0,y.jsx)(i.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,y.jsxs)(o.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${u} vs forecast ${h}`,style:{gap:4},children:[(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{size:14,children:"Covers so far"}),(0,y.jsxs)(i.T,{weight:"bold",colour:f,children:[u," ",(0,y.jsxs)(i.T,{size:13,colour:p.colours.muted,children:["/ ~",h," forecast"]})]})]}),(0,y.jsx)(o.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,y.jsx)(o.default,{style:{width:`${Math.min(100,75*b)}%`,height:10,borderRadius:5,backgroundColor:f}})}),(0,y.jsxs)(i.Muted,{children:[b>=1.1?'Ahead of forecast':b>=.85?'On pace':'Behind forecast'," \xb7 next hour ~",t.nextHour?`${t.nextHour.coversLow}\u2013${t.nextHour.coversHigh}`:0," covers"]})]}),(0,y.jsx)(i.T,{size:13,colour:p.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,y.jsx)(o.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:j.map((e,t)=>(0,y.jsxs)(o.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,y.jsx)(i.T,{size:10,colour:p.colours.muted,children:e.covers||''}),(0,y.jsx)(o.default,{style:{width:'80%',height:Math.max(2,e.covers/T*40),borderRadius:3,backgroundColor:e.covers>v?p.colours.red:e.future?'#6B5A3A':p.colours.gold}}),(0,y.jsx)(i.T,{size:9,colour:4===t?p.colours.gold:p.colours.muted,children:(0,x.hm)(e.from)})]},t))}),S.map(e=>(0,y.jsxs)(i.T,{size:13,colour:p.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,x.hm)(e.from),"\u2013",(0,x.hm)((0,x.addMins)(e.from,15))," (pace ~",v,") \u2014 stagger seating if you can."]},e.from.getTime())),$>a?(0,y.jsxs)(i.T,{size:13,colour:p.colours.amber,children:["\u26a0 Next hour ~",k," covers with ",a," on: about ",$-a," more on the floor suggested."]}):(0,y.jsxs)(i.T,{size:13,colour:p.colours.green,children:["Staffing looks OK for the next hour (",a," on)."]}),(0,y.jsx)(i.Button,{small:!0,kind:"secondary",label:"End-of-service summary",onPress:n,testID:"eos-open"})]})},_e.ServiceSummary=function({r:e,todays:t,orders:s,waitlistAll:l,walkInCount:r,onClose:a}){const o=t.filter(e=>['seated','finished'].includes(e.status)),n=o.reduce((e,t)=>e+t.partySize,0)+r,u=t.filter(e=>e.walkIn),c=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,x.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),b=s.reduce((e,t)=>e+t.paid,0),m=(0,h.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),f=(e,t)=>(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{children:e}),(0,y.jsx)(i.T,{weight:"semibold",children:t})]},e);return(0,y.jsxs)(i.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[f('Covers served',String(n)),f('Bookings seated',`${o.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),f('Walk-ins',`${u.length} parties \xb7 ${u.reduce((e,t)=>e+t.partySize,0)+r} covers`),f('No-shows',String(t.filter(e=>'noshow'===e.status).length)),f('Average table time',c.length?`${Math.round(c.reduce((e,t)=>e+t,0)/c.length)} min`:'\u2014'),f('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),f('"Table ready" texts',`${m} (demo, none sent)`),f('Taken at the till/app',`${(0,j.gbp)(b)} (demo)`),(0,y.jsx)(i.Muted,{children:"Example data on this device. Nothing is sent anywhere."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return h.tablesOf}});var t=_r(d[0]),s=_r(d[1]);_r(d[2]);var l=e(_r(d[3])),r=e(_r(d[4])),a=e(_r(d[5])),o=e(_r(d[6])),i=_r(d[7]),n=_r(d[8]),u=_r(d[9]),c=_r(d[10]),h=_r(d[11]),b=_r(d[12]),m=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),p=_r(d[17]),y=_r(d[18]);const w=({title:e,right:t,children:s,testID:l})=>(0,y.jsxs)(o.default,{testID:l,style:{backgroundColor:p.colours.surface,borderRadius:14,borderWidth:1,borderColor:p.colours.border,padding:10,gap:6},children:[(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{weight:"semibold",colour:p.colours.gold,children:e}),t]}),s]});const v=e=>(0,y.jsxs)(o.default,{style:{gap:6},children:[(0,y.jsxs)(i.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,y.jsxs)(i.Muted,{children:[e.time," \xb7 ",e.table?`Table ${e.table}`:'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),(0,y.jsx)(s.BookingNeeds,{b:e,big:!0}),e.notes?(0,y.jsxs)(i.T,{children:["Notes: ",e.notes]}):(0,y.jsx)(i.Muted,{children:"No notes."}),e.allergies.length?(0,y.jsx)(o.default,{style:{backgroundColor:p.colours.redBg,borderRadius:8,padding:8},children:(0,y.jsxs)(i.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,b.allergenLabel)(e.allergen)} \u2014 ${(0,b.severityLabel)(e.severity)}`).join('; ')]})}):(0,y.jsx)(i.Muted,{children:"No allergies declared."}),(0,y.jsx)(i.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const T=!0},830,[12,859,104,245,133,255,109,791,845,827,797,803,792,804,796,819,794,799,6]);
|
| 10 |
+
__d(function(g,r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DayGraph=function({todays:e,open:f,close:u,now:y,turnBase:p,pauses:j,height:T=150,forecastNote:F}){const[M,b]=(0,t.useState)(0),k=f.getTime()-18e5,w=u.getTime()+36e5,v=(0,t.useMemo)(()=>(0,x.coverCurve)(e,new Date(k),new Date(w),p),[e,k,w,p]),$=Math.max(8,...v.map(e=>e.covers)),_=(0,x.peaksOf)(v),z=(0,x.quietOf)(v,f.getTime(),u.getTime()),P=34,D=22,L=Math.max(10,M-P-12),S=T-D-20,W=e=>P+(e-k)/(w-k)*L,A=e=>D+S-e/(1.15*$)*S,B=[];for(const e of _){const t=B[B.length-1];t&&W(e.from)-W(t.from)<110?(e.covers??0)>(t.covers??0)&&(B[B.length-1]=e):B.push(e)}const C=v.map((e,t)=>`${t?'L':'M'}${W(e.t).toFixed(1)},${A(e.covers).toFixed(1)}`).join(' '),R=v.length?`${C} L${W(v[v.length-1].t).toFixed(1)},${A(0)} L${W(v[0].t).toFixed(1)},${A(0)} Z`:'',O=[];for(let e=new Date(k);e.getTime()<=w;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=k&&O.push(t.getTime())}const q=y.getTime()>=k&&y.getTime()<=w,E=e.filter(e=>!['cancelled','noshow'].includes(e.status)).length;return(0,c.jsxs)(i.default,{testID:"day-graph",style:[d.look.panel,{overflow:'hidden',paddingTop:10}],children:[(0,c.jsxs)(s.Row,{style:{justifyContent:'space-between',paddingHorizontal:14},children:[(0,c.jsx)(s.T,{size:15,weight:"semibold",children:"Covers through the day"}),(0,c.jsxs)(s.T,{size:12,colour:m.colours.muted,children:[E," ",1===E?'table':'tables'," booked"]})]}),(0,c.jsx)(i.default,{onLayout:e=>b(e.nativeEvent.layout.width),style:{height:T},children:M?(0,c.jsxs)(n.default,{width:M,height:T,children:[z.map((e,t)=>(0,c.jsx)(l.Rect,{x:W(e.from),y:D,width:Math.max(2,W(e.to)-W(e.from)),height:S,fill:"rgba(123,216,143,0.08)"},`q${t}`)),j.map((e,t)=>(0,c.jsx)(l.Rect,{x:Math.max(P,W(e.from.getTime())),y:D,width:Math.max(2,Math.min(P+L,W(e.to.getTime()))-Math.max(P,W(e.from.getTime()))),height:S,fill:"rgba(255,181,71,0.16)",stroke:"rgba(255,181,71,0.6)",strokeWidth:1},`p${t}`)),O.map(e=>(0,c.jsx)(l.Line,{x1:W(e),x2:W(e),y1:D,y2:D+S,stroke:"#1E1C18",strokeWidth:1},e)),O.map(e=>(0,c.jsx)(l.Text,{fontFamily:"Poppins_500Medium",x:W(e),y:T-5,fill:m.colours.muted,fontSize:11,textAnchor:"middle",children:(0,h.hm)(new Date(e)).slice(0,2)},`l${e}`)),(0,c.jsx)(l.Line,{x1:P,x2:P+L,y1:A(0),y2:A(0),stroke:m.colours.border,strokeWidth:1}),(0,c.jsx)(l.Text,{fontFamily:"Poppins_500Medium",x:28,y:A($)+4,fill:m.colours.muted,fontSize:10,textAnchor:"end",children:$}),(0,c.jsx)(l.Text,{fontFamily:"Poppins_500Medium",x:28,y:A(0)+4,fill:m.colours.muted,fontSize:10,textAnchor:"end",children:"0"}),R?(0,c.jsx)(l.Path,{d:R,fill:"rgba(207,164,95,0.22)"}):null,C?(0,c.jsx)(l.Path,{d:C,stroke:m.colours.gold,strokeWidth:2.5,fill:"none"}):null,[{t:f.getTime(),l:`Open ${(0,h.hm)(f)}`},{t:u.getTime(),l:`Close ${(0,h.hm)(u)}`}].map(e=>(0,c.jsxs)(o.default.Fragment,{children:[(0,c.jsx)(l.Line,{x1:W(e.t),x2:W(e.t),y1:18,y2:D+S,stroke:m.colours.goldLight,strokeWidth:1.5,strokeDasharray:"4,4"}),(0,c.jsx)(l.Text,{fontFamily:"Poppins_500Medium",x:W(e.t),y:14,fill:m.colours.goldLight,fontSize:11,fontWeight:"bold",textAnchor:"middle",children:e.l})]},e.l)),z.map((e,t)=>W(e.to)-W(e.from)>70?(0,c.jsx)(l.Text,{fontFamily:"Poppins_500Medium",x:(W(e.from)+W(e.to))/2,y:A(0)-6,fill:m.colours.green,fontSize:11,textAnchor:"middle",children:"Quiet \xb7 good for breaks"},`qt${t}`):null),j.map((e,t)=>(0,c.jsxs)(l.Text,{fontFamily:"Poppins_500Medium",x:Math.max(P,W(e.from.getTime()))+4,y:34,fill:m.colours.amber,fontSize:11,fontWeight:"bold",children:["\u23f8 ",e.label]},`pt${t}`)),B.map((e,t)=>{return(0,c.jsxs)(o.default.Fragment,{children:[(0,c.jsx)(l.Rect,{x:W(e.from)-3,y:A(e.covers)-3,width:6,height:6,fill:m.colours.text}),(0,c.jsxs)(l.Text,{fontFamily:"Poppins_500Medium",x:W(e.from),y:A(e.covers)-8,fill:m.colours.text,fontSize:12,fontWeight:"bold",textAnchor:(i=W(e.from),i<84?'start':i>P+L-50?'end':'middle'),children:["Busy ",(0,h.hm)(new Date(e.from))," \xb7 ",e.covers]})]},`k${t}`);var i}),q?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.Line,{x1:W(y.getTime()),x2:W(y.getTime()),y1:18,y2:D+S,stroke:"#FFFFFF",strokeWidth:2}),(0,c.jsx)(l.Rect,{x:W(y.getTime())-20,y:D+S-2,width:40,height:16,rx:5,fill:"#FFFFFF"}),(0,c.jsx)(l.Text,{fontFamily:"Poppins_500Medium",x:W(y.getTime()),y:D+S+10,fill:"#0B0B0B",fontSize:11,fontWeight:"bold",textAnchor:"middle",children:(0,h.hm)(y)})]}):null,E?null:(0,c.jsx)(l.Text,{fontFamily:"Poppins_500Medium",x:P+L/2,y:D+S/2,fill:m.colours.muted,fontSize:13,textAnchor:"middle",children:"No bookings yet today"})]}):null}),F?(0,c.jsx)(s.T,{size:11,colour:"#6E675B",style:{paddingHorizontal:14,paddingBottom:8},children:F}):(0,c.jsx)(i.default,{style:{height:6}})]})};var t=r(_d[0]),o=e(t),i=e(r(_d[1])),l=r(_d[2]),n=e(l),s=r(_d[3]),d=r(_d[4]),h=r(_d[5]),m=r(_d[6]),x=r(_d[7]),c=r(_d[8])},831,[12,109,860,791,854,796,799,832,6]);
|
| 11 |
+
__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&&t<s.e?o+s.n:o,0)});return f},e.peaksOf=function(t){const o=Math.max(0,...t.map(t=>t.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.covers<Math.max(...a.map(t=>t.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},832,[804]);
|
| 12 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DueToday=function({shifts:e,att:t,staff:h,today:p,now:x,compact:j}){const y=60*x.getHours()+x.getMinutes(),I=e.filter(e=>e.date===p&&e.published).sort((e,t)=>e.start-t.start),b=e=>t.filter(t=>t.staffId===e&&t.date===p&&t.in).sort((e,t)=>t.in.localeCompare(e.in))[0],w=I.filter(e=>!b(e.staffId)).map(e=>({s:e,late:y>60*e.start+10})),T=I.filter(e=>{const t=b(e.staffId);return t&&!t.out}).sort((e,t)=>e.end-t.end),z=t.filter(e=>e.date===p&&e.in&&!e.out&&!I.some(t=>t.staffId===e.staffId)),D=I.filter(e=>b(e.staffId)?.out).length,$=j?4:6,S=e=>c(h.find(t=>t.id===e)?.name),M=(e,t,n,r,f)=>(0,u.jsxs)(l.default,{style:{flexDirection:'row',alignItems:'center',gap:8,paddingVertical:3},children:[(0,u.jsx)(s.StaffAvatar,{id:t,size:j?24:28,ring:!1}),(0,u.jsx)(o.T,{size:14,weight:"medium",numberOfLines:1,style:{flex:1},children:n}),(0,u.jsx)(o.T,{size:13,weight:"semibold",colour:'amber'===f?a.colours.amber:'green'===f?a.colours.green:a.colours.goldLight,children:r})]},e),_=(e,t,s,n,r,f)=>(0,u.jsxs)(l.default,{testID:r,style:{flex:1,minWidth:0,gap:2},children:[(0,u.jsxs)(l.default,{style:{flexDirection:'row',alignItems:'baseline',gap:6,marginBottom:2},children:[(0,u.jsx)(o.T,{size:11,weight:"semibold",colour:a.colours.gold,style:{letterSpacing:1.6},children:e}),t?(0,u.jsx)(o.T,{size:11,colour:a.colours.muted,children:t}):null,f?(0,u.jsxs)(o.T,{size:11,weight:"semibold",colour:a.colours.amber,children:["\xb7 ",f]}):null]}),s.length?s.slice(0,$):(0,u.jsx)(o.T,{size:13,colour:"#857D6E",children:n}),s.length>$?(0,u.jsxs)(o.T,{size:12,colour:a.colours.muted,children:["+",s.length-$," more"]}):null]});return(0,u.jsxs)(l.default,{testID:"due-today",style:[n.look.panel,{padding:12,paddingHorizontal:14,gap:8}],children:[(0,u.jsxs)(l.default,{style:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'},children:[(0,u.jsx)(o.T,{size:15,weight:"semibold",children:"Team today"}),(0,u.jsx)(o.T,{size:12,colour:a.colours.muted,children:I.length?`${T.length+z.length} on now${D?` \xb7 ${D} finished`:''}`:''})]}),I.length||z.length?(0,u.jsxs)(l.default,{style:{flexDirection:'row',gap:16},children:[_('DUE IN',w.length,w.map(({s:e,late:t})=>M(`in-${e.id}`,e.staffId,S(e.staffId),f(e.start),t?'amber':'muted')),'Everyone is in','due-in',w.some(e=>e.late)?`${w.filter(e=>e.late).length} late`:void 0),_('DUE OUT',T.length+z.length,[...T.map(e=>M(`out-${e.id}`,e.staffId,S(e.staffId),f(e.end),y>=60*e.end?'amber':'green')),...z.map(e=>M(`x-${e.id}`,e.staffId,S(e.staffId),`in ${(0,r.hm)(new Date(e.in))}`,'muted'))],'Nobody on yet','due-out')]}):(0,u.jsx)(o.T,{size:13,colour:a.colours.muted,children:"No published shifts for today. Build and publish the rota in Managers \u203a Rota to see who\u2019s due in and out here."})]})},_r(d[0]);var e,t=_r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=_r(d[2]),o=_r(d[3]),n=_r(d[4]),r=_r(d[5]),a=_r(d[6]),u=_r(d[7]);const f=e=>`${String(Math.floor(e)).padStart(2,'0')}:${String(Math.round(e%1*60)).padStart(2,'0')}`,c=e=>(e??'Staff').replace(' (example)','').split(' ')[0]},833,[12,109,861,791,854,796,799,6]);
|
| 13 |
+
__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,"ACTION_GREEN",{enumerable:!0,get:function(){return f}}),_e.BigAction=function({label:e,icon:l,onPress:u,testID:h,size:x="l",block:p,premium:y}){const{width:w}=(0,o.default)(),b='l'===x&&w>=520,j=p?{alignSelf:'stretch'}:y?{flex:1,minWidth:0}:{flexGrow:1,flexShrink:1,minWidth:0,flexBasis:b?200:150,maxWidth:b?300:260};return(0,c.jsxs)(n.default,{testID:h,accessibilityRole:"button",accessibilityLabel:e,onPress:u,style:({pressed:e})=>y?{...j,minHeight:b?78:62,borderRadius:20,alignItems:'center',justifyContent:'center',flexDirection:'row',gap:b?12:8,paddingHorizontal:b?20:10,...t.look.green(e)}:{...j,minHeight:b?76:62,borderRadius:18,backgroundColor:e?'#B8904F':f,borderWidth:2,borderColor:'#E8C98F',alignItems:'center',justifyContent:'center',flexDirection:'row',gap:b?10:6,paddingHorizontal:b?18:8,shadowColor:'#000',shadowOpacity:.35,shadowRadius:8,shadowOffset:{width:0,height:3}},children:[l?(0,c.jsx)(s.T,{size:b?y?24:26:17,children:l}):null,(0,c.jsx)(s.T,{size:b?y?25:26:18,weight:y?'semibold':'bold',colour:t.look.onPrimary,style:y?{flexShrink:1,letterSpacing:.2}:{flexShrink:1},children:e})]})},_e.FrontDoorBar=function({primary:e,left:t,right:n,oneRow:o,testID:s="front-door-bar"}){const f=(e,t)=>e?(0,c.jsx)(l.default,{style:{flex:o?1:void 0,flexDirection:'row',flexWrap:'wrap',gap:8,alignItems:'center',justifyContent:o?t?'flex-end':'flex-start':'center'},children:e}):null,u=(0,c.jsx)(l.default,{testID:"primary-actions",style:{flexDirection:'row',gap:12,justifyContent:'center',flexGrow:o?0:1,flexBasis:o?520:void 0,flexShrink:1,maxWidth:'100%'},children:e});return o?(0,c.jsxs)(l.default,{testID:s,style:{flexDirection:'row',alignItems:'center',gap:12},children:[f(t),u,f(n,!0)]}):(0,c.jsxs)(l.default,{testID:s,style:{gap:8},children:[u,t||n?(0,c.jsxs)(l.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8,justifyContent:'center',alignItems:'center'},children:[t,n]}):null]})},r(d[0]);var t=r(d[1]),n=e(r(d[2])),l=e(r(d[3])),o=e(r(d[4])),s=r(d[5]),c=r(d[6]);const f='#CFA45F'},834,[12,854,245,109,269,791,6]);
|
| 14 |
+
__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,"codeFromText",{enumerable:!0,get:function(){return h}}),_e.DisplayPairing=function(){const e=(0,n.useSync)(e=>e.mode),b=(0,n.useSync)(e=>e.message),[f,x]=(0,t.useState)(!1),[y,j]=(0,t.useState)(!1),[m,w]=(0,t.useState)(''),[C,P]=(0,t.useState)(!1),[S,z]=(0,t.useState)(''),[I,D]=(0,t.useState)(''),T=async e=>{const t=h(e);if(t.length<6)return void z('Type the code exactly as shown in Managers \u2192 Displays.');P(!0),z('');const r=await(0,n.pairWithCode)(t);P(!1),r.ok?(D(`Paired with ${r.venueName}`),x(!1),w(''),setTimeout(()=>D(''),4e3)):z(r.error)};(0,t.useEffect)(()=>{p&&(x(!0),w(p),T(p))},[]);const k=(0,c.useScreensaverAsleep)(e=>e.asleep),v='unpaired'===e,_=f||v&&!y&&!p;return(0,u.jsxs)(u.Fragment,{children:[I?(0,u.jsx)(o.default,{testID:"pair-ok",style:{position:'absolute',top:12,alignSelf:'center',zIndex:960,padding:10,borderRadius:10,backgroundColor:'#12301C',borderWidth:1,borderColor:s.colours.green},children:(0,u.jsx)(l.T,{size:14,children:I})}):null,!v||_||k?null:(0,u.jsx)(r.default,{testID:"pair-banner",onPress:()=>x(!0),style:{position:'absolute',bottom:8,right:8,zIndex:900,paddingHorizontal:12,paddingVertical:6,borderRadius:999,backgroundColor:'#2A2114',borderWidth:1,borderColor:s.colours.gold},children:(0,u.jsx)(l.T,{size:13,colour:s.colours.gold,children:"Not paired \xb7 tap to pair this display"})}),_?(0,u.jsx)(o.default,{testID:"pair-screen",style:{position:'absolute',top:0,left:0,right:0,bottom:0,zIndex:980,backgroundColor:'rgba(8,7,5,0.97)',alignItems:'center',justifyContent:'center',padding:24},children:(0,u.jsxs)(o.default,{style:{width:'100%',maxWidth:460,gap:12},children:[(0,u.jsx)(l.T,{size:26,weight:"bold",children:"Pair this display"}),(0,u.jsx)(l.Muted,{children:"In the Managers app, open Settings \u2192 Displays and make a pairing code. Type it here, or open the pairing link on this tablet. No login needed."}),b?(0,u.jsx)(l.T,{size:14,colour:s.colours.gold,children:b}):null,(0,u.jsx)(l.Field,{testID:"pair-code",label:"Pairing code (or link)",value:m,onChangeText:w,autoCapitalize:"characters",autoCorrect:!1,placeholder:"e.g. ABCDE 23456"}),S?(0,u.jsx)(o.default,{testID:"pair-error",children:(0,u.jsx)(l.T,{size:14,colour:s.colours.red,children:S})}):null,(0,u.jsx)(l.Button,{testID:"pair-go",label:C?'Pairing\u2026':'Pair',disabled:C||!m.trim(),onPress:()=>T(m)}),(0,u.jsx)(l.Button,{kind:"secondary",label:"Not now (use this tablet\u2019s own data)",onPress:()=>{x(!1),j(!0)}})]})}):null]})};var t=_r(d[0]);_r(d[1]);var r=e(_r(d[2])),o=e(_r(d[3])),n=_r(d[4]),s=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]);const p=(()=>{try{if('undefined'==typeof window||!window.location)return null;const e=new URL(window.location.href),t=e.searchParams.get('pair');return t&&(e.searchParams.delete('pair'),window.history.replaceState(null,'',e.pathname+(e.search?e.search:'')+e.hash)),t}catch{return null}})(),h=e=>{const t=e.match(/[?&#]pair=([A-Za-z0-9 -]{6,})/);return(t?t[1]:e).toUpperCase().replace(/[^A-Z0-9]/g,'')}},835,[12,104,245,109,798,799,791,858,6]);
|
owner-app/_expo/static/js/web/index-eda4f3212fdf4cd939574137be84916b.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
owner-app/_expo/static/js/web/index-f874fe0b7bfd6e4bab8776decab3fbe6.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),f=r(d[3]),u=r(d[4]);function c(){return(0,n.canShow)('staff')?(0,u.jsx)(f.StaffApp,{}):(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},781,[785,12,787,956,6]);
|
| 2 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffApp=function(){return(0,_.jsx)(b.StaffAppCtx.Provider,{value:!0,children:(0,_.jsx)(N,{})})};var s=_r(d[0]),t=_r(d[1]),i=_r(d[2]),o=e(_r(d[3])),l=e(_r(d[4])),r=e(_r(d[5])),n=e(_r(d[6])),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),f=_r(d[10]),p=_r(d[11]),y=_r(d[12]),x=_r(d[13]),j=_r(d[14]),b=_r(d[15]),w=_r(d[16]),k=_r(d[17]);_r(d[18]);var S=_r(d[19]),v=_r(d[20]),C=_r(d[21]),T=_r(d[22]),M=_r(d[23]),R=_r(d[24]),P=_r(d[25]),z=_r(d[26]),I=_r(d[27]),B=_r(d[28]),A=_r(d[29]),O=_r(d[30]),L=_r(d[31]),W=_r(d[32]),_=_r(d[33]);const H=I.ROSTER.find(e=>'chef'===e.app)?.id,V=[{id:'home',label:'Home',icon:'home'},{id:'clock',label:'Clock',icon:'clock'},{id:'rota',label:'Rota',icon:'bookings'},{id:'chat',label:'Chat',icon:'chat'},{id:'me',label:'Me',icon:'user'}],D={home:'Today',clock:'Clock in / out',rota:'Rota, swaps & leave',chat:'Staff chat',me:'Me'},E=[{id:'recipecards',title:'Recipe cards',sub:'Signed-off dishes: photo, ingredients, method and allergens (read-only)'},{id:'avatar',title:'My avatar',sub:'Your space-age avatar, or create one from a photo'},{id:'haccp',title:'Food safety checks',sub:'Record fridge, freezer, cooking and other checks (say or type)'},{id:'accidents',title:'Accident book',sub:'Report an accident or near miss; see your own entries'},{id:'mypay',title:'My hours & pay',sub:'Shifts, paid hours and estimated pay'},{id:'mytips',title:'My tips & tip goal',sub:'Your share of the tips, and a goal to save towards'},{id:'timesheets',title:'My timesheets',sub:'Your clock-ins, breaks and any changes'},{id:'suppliers',title:'Suppliers',sub:'Contacts and order days (if your manager allows)'},{id:'privacy',title:'Privacy & location',sub:'What Cover Charge for Staff stores about you'}];function N(){const{r:e,rid:P,me:z,meId:I,today:N,now:U}=(0,b.useCtx)(3e4),$=(0,b.useSignedIn)(),F=(0,p.useOwner)(e=>e.staff),J=(0,p.useOwner)(e=>e.staffCanViewSuppliers),[q,G]=(0,t.useState)('home'),[K,Q]=(0,t.useState)(null),[X,Z]=(0,t.useState)(!1),ee=(0,t.useRef)(null);(0,t.useEffect)(()=>{(0,b.ensureAttendance)(N,U),(0,x.ensureChat)(U)},[N]),globalThis.__ccNow=U.getTime();const se=(0,x.useChatUnread)().total,te=(0,t.useCallback)((e,s=null)=>{G(e),Q(s),ee.current?.scrollTo({y:0,animated:!1})},[]);(0,j.useShiftReminders)({rid:P,staffId:I,name:z,onStartBreak:()=>te('clock')});const ie=(0,t.useCallback)((e,s=null)=>'chat'===e?te('chat'):'clock'===s?te('clock'):'rota'===s?te('rota'):s&&E.some(e=>e.id===s)?te('me',s):void te('home'===e?'home':'me'),[te]);(0,t.useEffect)(()=>{const e=o.default.addEventListener('hardwareBackPress',()=>K?(Q(null),!0):'home'!==q&&(G('home'),!0));return()=>e.remove()},[q,K]);const oe='me'===q&&K?E.find(e=>e.id===K):void 0,ae=E.filter(e=>'suppliers'!==e.id||J),le=F.filter(e=>e.active&&'staff'===e.role);return(0,_.jsxs)(c.SafeAreaView,{style:{flex:1,backgroundColor:y.colours.bg},edges:['top','left','right','bottom'],children:[(0,_.jsxs)(n.default,{style:{paddingHorizontal:14,paddingTop:6,paddingBottom:8,borderBottomWidth:1,borderColor:y.colours.border,gap:6},children:[(0,_.jsx)(n.default,{style:{alignItems:'center'},children:(0,_.jsx)(l.default,{testID:"header-me",accessibilityRole:"button",accessibilityLabel:"Signed in as",onPress:()=>Z(!0),hitSlop:6,style:{borderWidth:1,borderColor:y.colours.gold,borderRadius:16,paddingHorizontal:10,paddingVertical:4,maxWidth:'86%'},children:(0,_.jsxs)(u.Row,{gap:6,children:[(0,_.jsx)(O.StaffAvatar,{id:I,size:24,ring:!1}),(0,_.jsxs)(u.T,{size:13,weight:"semibold",colour:y.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[z.replace(' (example)',''),$?'':' (preview)'," \u25be"]})]})})}),(0,_.jsxs)(u.Row,{gap:10,children:[(0,_.jsx)(h.RestaurantLogo,{rid:e.id,size:36}),(0,_.jsxs)(n.default,{style:{flex:1,minWidth:0},children:[(0,_.jsx)(u.T,{weight:"semibold",size:15,numberOfLines:1,children:e.name}),(0,_.jsxs)(u.Muted,{size:12,numberOfLines:1,children:["Staff",e.location?` \xb7 ${e.location.split(',').slice(0,2).join(',')}`:'']}),(0,_.jsx)(h.PoweredBy,{})]}),(0,_.jsx)(f.VoiceSlot,{})]})]}),(0,_.jsxs)(r.default,{ref:ee,contentContainerStyle:{padding:14,paddingBottom:60,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,_.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[oe?(0,_.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"Back",onPress:()=>Q(null),hitSlop:10,children:(0,_.jsx)(u.T,{size:15,colour:y.colours.gold,children:"\u2039 Me"})}):null,(0,_.jsx)(u.T,{size:22,weight:"bold",style:{flex:1,textAlign:oe?'right':'left'},children:oe?oe.title:D[q]})]}),'home'===q?(0,_.jsx)(Y,{go:ie}):null,'clock'===q?(0,_.jsx)(M.ClockInOut,{}):null,'rota'===q?(0,_.jsx)(M.Rota,{}):null,'chat'===q?(0,_.jsx)(x.Chat,{go:ie}):null,'me'!==q||oe?null:(0,_.jsxs)(n.default,{style:{gap:10},children:[(0,_.jsx)(n.default,{style:{borderRadius:14,borderWidth:1,borderColor:y.colours.border,backgroundColor:y.colours.surface,overflow:'hidden'},children:ae.map((e,s)=>(0,_.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>Q(e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:y.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,_.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,_.jsxs)(n.default,{style:{flex:1},children:[(0,_.jsx)(u.T,{weight:"medium",children:e.title}),(0,_.jsx)(u.Muted,{children:e.sub})]}),(0,_.jsx)(u.T,{colour:y.colours.muted,children:"\u203a"})]})},e.id))}),J?null:(0,_.jsx)(u.Muted,{children:"Suppliers are hidden: your manager hasn\u2019t shared them with staff."}),(0,_.jsxs)(u.Muted,{center:!0,children:["Staff app \xb7 ",s.APP_VERSION," \xb7 ",'live'===W.useSync.getState().mode?'shared with your team':'saved on this device until it connects']})]}),'recipecards'===oe?.id?(0,_.jsx)(i.RecipeCards,{rid:e.id,actor:{name:z,role:'staff'},mode:"read"}):null,'avatar'===oe?.id?(0,_.jsx)(L.AvatarMaker,{meId:I,me:z}):null,'haccp'===oe?.id?(0,_.jsx)(A.HaccpLog,{mode:"staff",me:z,meId:I,now:U}):null,'accidents'===oe?.id?(0,_.jsx)(B.AccidentBook,{app:"staff",me:z,meId:I,now:U,seeAll:!1}):null,'mypay'===oe?.id?(0,_.jsxs)(n.default,{style:{gap:10},children:[(0,_.jsx)(C.MyPeriods,{staffId:I}),(0,_.jsx)(v.MyHoursPay,{staffId:I})]}):null,'mytips'===oe?.id?(0,_.jsx)(R.MyTips,{}):null,'timesheets'===oe?.id?(0,_.jsxs)(n.default,{style:{gap:10},children:[(0,_.jsx)(C.MyPeriods,{staffId:I}),(0,_.jsx)(M.Timesheets,{})]}):null,'suppliers'===oe?.id?J?(0,_.jsx)(T.Suppliers,{}):(0,_.jsx)(u.Muted,{children:"Your manager hasn\u2019t shared suppliers with staff."}):null,'privacy'===oe?.id?(0,_.jsxs)(n.default,{style:{gap:8},children:[(0,_.jsx)(u.T,{size:14,children:"\u2022 Location is checked only when you tap Clock in or Clock out, never in the background."}),(0,_.jsx)(u.T,{size:14,children:"\u2022 We keep \u201cinside / outside the venue area\u201d and the time, not your coordinates."}),(0,_.jsx)(u.T,{size:14,children:"\u2022 You see only your own hours, pay estimates and tips. Managers see the team\u2019s."}),(0,_.jsxs)(u.T,{size:14,children:["\u2022 Chat messages stay within ",e.name,"\u2019s team."]}),(0,_.jsx)(u.T,{size:14,children:"\u2022 Pay figures are estimates before tax and deductions; your payslip is the official record."}),(0,_.jsx)(u.Muted,{children:"Prototype: everything is stored on this device. Nothing is sent."})]}):null]}),(0,_.jsx)(n.default,{style:{flexDirection:'row',borderTopWidth:1,borderColor:y.colours.border,backgroundColor:'#0d0d0d'},children:V.map(e=>{const s=q===e.id;return(0,_.jsxs)(l.default,{accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:e.label,onPress:()=>te(e.id),style:{flex:1,alignItems:'center',paddingVertical:8,gap:2},children:[(0,_.jsxs)(n.default,{children:[(0,_.jsx)(S.Icon,{name:e.icon,colour:s?y.colours.gold:y.colours.muted}),'chat'===e.id&&se?(0,_.jsx)(n.default,{style:{position:'absolute',right:-8,top:-4,backgroundColor:y.colours.red,borderRadius:8,minWidth:16,height:16,alignItems:'center',justifyContent:'center'},children:(0,_.jsx)(u.T,{size:10,weight:"bold",children:se})}):null]}),(0,_.jsx)(u.T,{size:11,colour:s?y.colours.gold:y.colours.muted,children:e.label})]},e.id)})}),(0,_.jsx)(u.Sheet,{visible:X,onClose:()=>Z(!1),title:"Signed in as",children:$?(0,_.jsxs)(n.default,{style:{gap:8},children:[(0,_.jsxs)(u.Row,{gap:10,children:[(0,_.jsx)(O.StaffAvatar,{id:$.id,size:48}),(0,_.jsxs)(n.default,{style:{flex:1},children:[(0,_.jsx)(u.T,{weight:"semibold",children:$.name}),(0,_.jsx)(u.Muted,{children:(0,k.levelJob)($.level??'Staff',$.job)})]})]}),(0,_.jsx)(u.Muted,{children:"Signed in with your personal link. This phone remembers you."}),'staff'!==$.role?(0,_.jsx)(u.Button,{kind:"secondary",label:"Back to Cover Charge for Managers",onPress:()=>{const e=(0,k.appUrl)('owner');e&&window.location.assign(e)}}):null,$.id===H?(0,_.jsx)(u.Button,{kind:"secondary",label:"Back to Cover Charge for Head Chef",onPress:()=>{const e=(0,k.appUrl)('chef');e&&window.location.assign(e)}}):null,(0,_.jsx)(u.Button,{kind:"ghost",label:"Not you? Sign out on this device",onPress:()=>{k.useSession.getState().signOut(),Z(!1)}})]}):(0,_.jsxs)(n.default,{style:{gap:8},children:[(0,_.jsx)(u.Muted,{children:"Not signed in: this is a preview. Open your personal link, or paste it here, to sign in as yourself."}),(0,_.jsx)(w.SignInWithLink,{}),(0,_.jsx)(u.Muted,{children:"Or preview the app as a team member:"}),le.map(e=>(0,_.jsxs)(u.Row,{gap:8,children:[(0,_.jsx)(O.StaffAvatar,{id:e.id,size:36}),(0,_.jsx)(u.Button,{kind:e.id===I?'primary':'secondary',label:`${e.name.replace(' (example)','')} \xb7 ${e.job}`,onPress:()=>{p.useOwner.setState({staffAs:e.id}),Z(!1),te('home')},style:{flex:1}})]},e.id))]})})]})}function Y({go:e}){const{rid:s,today:t}=(0,b.useCtx)(3e4),i=(0,z.useTravelDay)('staff',t);return(0,_.jsxs)(n.default,{style:{gap:10},children:[(0,_.jsx)(z.DayBar,{app:"staff",today:t}),i?(0,_.jsx)(z.DayView,{rid:s,day:i,today:t,app:"staff"}):(0,_.jsx)(P.StaffHome,{go:e})]})}},956,[921,12,937,215,245,133,109,271,791,844,843,812,799,904,957,846,900,816,104,903,933,913,919,931,932,902,840,918,939,941,861,938,798,6]);
|
owner-app/_expo/static/js/web/lost-e43ed901b9bdb90a961de71b16ee2e27.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),r=_r(d[3]),l=_r(d[4]),o=_r(d[5]);function u(){const{rid:u}=(0,t.useLocalSearchParams)(),h=(0,r.useRestaurant)(u),c=(0,r.useCustomer)(),x=(0,r.useNow)(6e4),j=(0,l.useOwner)(t=>t.lost),p=(0,l.useOwner)(t=>t.lostReports),[f,w]=(0,n.useState)(''),[y,b]=(0,n.useState)(''),[S,C]=(0,n.useState)(''),[R,O]=(0,n.useState)(!1);if(!h)return(0,o.jsx)(s.Screen,{title:"Not found",children:(0,o.jsx)(s.T,{children:"Restaurant not found."})});const T=p.filter(t=>t.contact.includes(c.email));return(0,o.jsxs)(s.Screen,{title:"Lost property",subtitle:h.name,children:[(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Recently handed in"}),j.filter(t=>'held'===t.status).map(t=>(0,o.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,o.jsx)(s.T,{style:{flex:1},children:t.item}),(0,o.jsx)(s.Muted,{children:t.foundAt.slice(0,10)})]},t.id)),j.some(t=>'held'===t.status)?null:(0,o.jsx)(s.Muted,{children:"Nothing handed in right now."}),(0,o.jsx)(s.Muted,{children:"To collect, bring ID or describe the item to staff. Items are kept for 3 months."})]}),R?(0,o.jsxs)(s.Banner,{kind:"success",children:["Report sent to ",h.name,". They'll be in touch if it turns up (demo: nothing is sent)."]}):null,(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Lost something?"}),(0,o.jsx)(s.Field,{label:"What did you lose?",value:f,onChangeText:w,placeholder:"e.g. Grey scarf"}),(0,o.jsx)(s.Field,{label:"When were you in?",value:y,onChangeText:b,placeholder:"e.g. Saturday evening"}),(0,o.jsx)(s.Field,{label:"Where were you sitting? (optional)",value:S,onChangeText:C,placeholder:"e.g. By the window"}),(0,o.jsxs)(s.Muted,{children:["We'll share your name and email (",c.email,") with ",h.name," for this report only."]}),(0,o.jsx)(s.Button,{label:"Send report",disabled:f.trim().length<2||y.trim().length<2,onPress:()=>{l.useOwner.getState().setOwner({lostReports:[{id:`lr-${Date.now()}`,item:f.trim(),when:y.trim(),where:S.trim()||'Not sure',contact:`${c.name} \xb7 ${c.email}`,at:x.toISOString(),status:'open'},...l.useOwner.getState().lostReports]}),w(''),b(''),C(''),O(!0)}})]}),T.length?(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Your reports"}),T.map(t=>(0,o.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,o.jsxs)(s.T,{style:{flex:1},children:[t.item," \xb7 ",t.when]}),(0,o.jsx)(s.Badge,{kind:'matched'===t.status?'green':'open'===t.status?'amber':'neutral',label:'matched'===t.status?'Found!':'open'===t.status?'Looking':'Closed'})]},t.id))]}):null]})}},764,[785,12,791,797,812,6]);
|
owner-app/_expo/static/js/web/loyalty-7281429f7496b539476c8f7c06544800.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var e=_r(d[0]);_r(d[1]);var r,s=_r(d[2]),t=(r=s)&&r.__esModule?r:{default:r},i=_r(d[3]),n=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]);function h(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r),h=(0,l.useCustomer)(),p=(0,l.useStampCard)(r);if(!s)return(0,u.jsx)(n.Screen,{title:"Not found",children:(0,u.jsx)(n.T,{children:"Restaurant not found."})});const f=s.settings.stampTarget,j=p?.stamps??0;return(0,u.jsxs)(n.Screen,{title:"Stamp card",subtitle:`${s.name} \u2014 this card is just for ${s.name}`,children:[(0,u.jsxs)(n.Card,{highlight:c.colours.gold,children:[(0,u.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(n.H2,{children:[j," of ",f," stamps"]}),(0,u.jsxs)(n.T,{colour:c.colours.gold,weight:"semibold",children:["Reward: ",s.settings.stampReward]})]}),(0,u.jsx)(t.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:10,justifyContent:'center',paddingVertical:8},children:Array.from({length:f}).map((e,r)=>(0,u.jsx)(t.default,{accessibilityLabel:r<j?'Stamp collected':'Empty stamp',style:{width:52,height:52,borderRadius:26,borderWidth:2,borderColor:c.colours.gold,backgroundColor:r<j?c.colours.gold:'transparent',alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(n.T,{size:22,colour:r<j?c.colours.onGold:c.colours.border,children:"\u2605"})},r))}),(0,u.jsxs)(n.Muted,{children:["One stamp per paid visit or order over ",(0,o.gbp)(s.settings.stampMinSpend)," \u2014 dine-in, table QR or takeaway. Rewards are funded by ",s.name,"."]}),p?.rewardsAvailable?(0,u.jsx)(n.Banner,{kind:"success",title:`${p.rewardsAvailable} reward${p.rewardsAvailable>1?'s':''} ready: ${s.settings.stampReward}`,children:(0,u.jsx)(n.Button,{small:!0,label:"Use reward (show staff)",onPress:()=>l.repo.loyalty.redeemReward(s.id,h.id)})}):null]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Show this to staff"}),(0,u.jsx)(n.Muted,{children:"Staff scan this on the tablet to add a stamp for dine-in visits not paid by table QR."}),(0,u.jsx)(i.QR,{value:`covercharge:stamp:${s.id}:${h.id}`,size:190}),(0,u.jsx)(n.T,{center:!0,weight:"semibold",children:h.name})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Bring a friend"}),(0,u.jsx)(n.T,{children:"Your referral code"}),(0,u.jsx)(n.T,{size:28,weight:"bold",colour:c.colours.gold,center:!0,children:h.referralCode}),(0,u.jsx)(n.Muted,{children:"When a friend completes their first qualifying paid visit or order, you both get a stamp. One referral reward per new account, phone and card; monthly cap applies."})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"History"}),(p?.history??[]).length?p.history.slice(0,10).map((e,r)=>(0,u.jsxs)(n.Muted,{children:[e.at.slice(0,10)," \xb7 ",e.source]},r)):(0,u.jsx)(n.Muted,{children:"No stamps yet."})]}),(0,u.jsx)(n.Muted,{children:"Rewards are kept on food (Scottish licensing rules restrict drinks promotions). Stamps are never given for reviews."})]})}},765,[785,12,109,817,791,794,797,799,6]);
|
owner-app/_expo/static/js/web/merch-497952082abffc295443c32cde709c8e.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e,t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),l=(e=s)&&e.__esModule?e:{default:e},r=_r(d[3]),o=_r(d[4]),c=_r(d[5]),u=_r(d[6]),m=_r(d[7]),h=_r(d[8]),j=_r(d[9]),p=_r(d[10]);function x(){const{rid:e}=(0,t.useLocalSearchParams)(),s=(0,c.useRestaurant)(e),x=(0,c.useCustomer)(),b=(0,c.useNow)(6e4),f=(0,u.useOwner)(e=>e.merch),[y,w]=(0,n.useState)({}),[k,S]=(0,n.useState)(null),[C,$]=(0,n.useState)(null);if(!s)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Restaurant not found."})});const v=f.find(e=>e.id===k),O=e=>y[e]??1;return(0,p.jsxs)(o.Screen,{title:"Shop",subtitle:`${s.name} merch \xb7 collect in the restaurant`,children:[C?(0,p.jsxs)(o.Banner,{kind:"success",title:"Order placed (demo)",children:[C," Collect it at the bar on your next visit."]}):null,f.filter(e=>e.live||0===e.stock).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(l.default,{style:{flex:1},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),(0,p.jsx)(o.T,{colour:j.colours.gold,weight:"semibold",children:(0,m.gbp)(e.price)})]}),0!==e.stock&&e.live?e.stock<8?(0,p.jsx)(o.Badge,{kind:"amber",label:`${e.stock} left`}):null:(0,p.jsx)(o.Badge,{kind:"neutral",label:"Sold out"})]}),e.live&&e.stock>0?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:O(e.id),min:1,max:Math.min(5,e.stock),onChange:t=>w({...y,[e.id]:t}),label:`${e.name} quantity`}),(0,p.jsx)(o.Button,{small:!0,label:`Buy \xb7 ${(0,m.gbp)(e.price*O(e.id))}`,onPress:()=>S(e.id)})]}):null]},e.id)),(0,p.jsxs)(o.Muted,{children:["Collection only in this prototype. Prices set by ",s.name,"."]}),v?(0,p.jsx)(r.MockPay,{visible:!0,onClose:()=>S(null),amount:v.price*O(v.id),restaurantId:s.id,allowGiftCard:!1,title:`Buy ${v.name}`,onPaid:()=>{const e=u.useOwner.getState();e.setOwner({merch:e.merch.map(e=>e.id===v.id?{...e,stock:Math.max(0,e.stock-O(v.id))}:e),merchOrders:[{id:`mo-${Date.now()}`,productId:v.id,qty:O(v.id),customer:x.name,at:(0,h.ymd)(b),status:'new'},...e.merchOrders]}),$(`${O(v.id)} \xd7 ${v.name}, ${(0,m.gbp)(v.price*O(v.id))}.`),S(null)}}):null]})}},766,[785,12,109,790,791,797,812,794,796,799,6]);
|
owner-app/_expo/static/js/web/offers-fdb0de6863fb561ae4062365be93c480.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var n=_r(d[0]);_r(d[1]);var t=_r(d[2]),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),o=_r(d[6]),c=_r(d[7]);function f(){const{rid:f}=(0,n.useLocalSearchParams)(),u=(0,s.useRestaurant)(f),h=(0,s.useCustomer)(),j=(0,r.useOwner)(n=>n.offers);if(!u)return(0,c.jsx)(t.Screen,{title:"Not found",children:(0,c.jsx)(t.T,{children:"Restaurant not found."})});const x=!!h.marketingOptIn[u.id],b=j.filter(n=>n.live),p=b.filter(n=>'special'===n.kind),y=b.filter(n=>'offer'===n.kind);return(0,c.jsxs)(t.Screen,{title:"Specials & offers",subtitle:u.name,children:[(0,c.jsxs)(t.Card,{highlight:x?o.colours.green:o.colours.gold,children:[(0,c.jsx)(t.Toggle,{label:`Send me offers from ${u.name}`,value:x,onChange:n=>s.repo.customers.update({marketingOptIn:{...h.marketingOptIn,[u.id]:n}})}),(0,c.jsx)(t.Muted,{children:x?'You can switch this off any time. We only use it for this restaurant.':'Off by default. Turn on to see member offers and get the occasional notification (max one a week). You can switch it off any time.'})]}),(0,c.jsx)(t.H2,{children:"Today's specials"}),p.length?p.map(n=>(0,c.jsxs)(t.Card,{children:[(0,c.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,c.jsx)(t.Badge,{kind:"gold",label:"Special"})]}),(0,c.jsx)(t.Muted,{children:n.body})]},n.id)):(0,c.jsx)(t.Muted,{children:"No specials on the board right now."}),(0,c.jsx)(t.H2,{children:"Member offers"}),x?y.length?y.map(n=>(0,c.jsxs)(t.Card,{children:[(0,c.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,c.jsx)(t.Badge,{kind:"green",label:"Offer"})]}),(0,c.jsx)(t.Muted,{children:n.body}),n.until?(0,c.jsxs)(t.Muted,{children:["Until ",(0,l.niceDate)((0,l.parseYmd)(n.until))]}):null]},n.id)):(0,c.jsx)(t.Muted,{children:"No offers right now."}):(0,c.jsxs)(t.Banner,{kind:"info",children:["Turn on offers above to see ",y.length," member offer",1===y.length?'':'s',"."]}),(0,c.jsxs)(t.Muted,{children:["Offers are set by ",u.name,". Drinks promotions follow Scottish licensing rules. Demo: no notifications are sent."]})]})}},767,[785,12,791,797,812,796,799,6]);
|
owner-app/_expo/static/js/web/profile-e81a333ab15babc6deb5b3640c1abdd5.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var e=_r(d[0]);_r(d[1]);var r,l=_r(d[2]),s=(r=l)&&r.__esModule?r:{default:r},t=_r(d[3]),n=_r(d[4]),a=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]);function p(){const r=(0,u.useCustomer)(),l=(0,u.useStore)((0,c.useShallow)(e=>e.orders.filter(r=>r.customerId===e.customer.id))),p=(0,u.useStore)((0,c.useShallow)(e=>e.bookings.filter(r=>r.customerId===e.customer.id))),b=(0,u.useStore)(e=>e.restaurants),y=e=>b.find(r=>r.id===e)?.name??e;return(0,h.jsxs)(t.Screen,{title:"Your account",subtitle:"One Cover Charge account for every restaurant",children:[(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.Field,{label:"Name",value:r.name,onChangeText:e=>u.repo.customers.update({name:e})}),(0,h.jsx)(t.Field,{label:"Email",value:r.email,keyboardType:"email-address",onChangeText:e=>u.repo.customers.update({email:e})}),(0,h.jsx)(t.Field,{label:"Mobile",value:r.phone,keyboardType:"phone-pad",onChangeText:e=>u.repo.customers.update({phone:e})}),(0,h.jsxs)(t.Muted,{children:["Referral code: ",r.referralCode]})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Allergies & severity"}),(0,h.jsx)(t.Muted,{children:"Stored once and shared with a restaurant only when you order or book there. You confirm them on every order, table session and booking."}),(0,h.jsx)(t.Toggle,{label:"I consent to Cover Charge storing my allergy information (health data, UK GDPR)",value:r.allergyConsent,onChange:e=>u.repo.customers.update({allergyConsent:e})}),r.allergyConsent?null:(0,h.jsx)(t.Banner,{kind:"warn",children:"Without consent your allergies won\u2019t be stored \u2014 tell staff directly."}),n.ALLERGENS.map(e=>{const l=r.allergies.find(r=>r.allergen===e.id);return(0,h.jsxs)(s.default,{style:{gap:6,paddingVertical:6},children:[(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(t.T,{weight:l?'semibold':'regular',children:e.label}),l?(0,h.jsx)(t.Badge,{kind:"red",label:"Declared"}):null]}),(0,h.jsxs)(t.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(t.Chip,{label:"None",selected:!l,onPress:()=>u.repo.customers.setAllergy(e.id,null),disabled:!r.allergyConsent&&!l}),n.SEVERITIES.map(s=>(0,h.jsx)(t.Chip,{label:s.label,selected:l?.severity===s.id,disabled:!r.allergyConsent,onPress:()=>u.repo.customers.setAllergy(e.id,s.id)},s.id))]})]},e.id)})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your orders"}),l.length?l.map(r=>(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(t.T,{style:{flex:1},children:[r.ref," \xb7 ",y(r.restaurantId)," \xb7 ",'table'===r.type?`Table ${r.tableNo}`:'Takeaway']}),(0,h.jsx)(t.Button,{small:!0,kind:"secondary",label:`${r.status} \xb7 ${(0,a.gbp)(r.subtotal+r.tip)}`,onPress:()=>e.router.push(`/customer/order/${r.id}`)})]},r.id)):(0,h.jsx)(t.Muted,{children:"No orders yet."})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your bookings"}),p.length?p.map(e=>(0,h.jsxs)(t.T,{children:[e.ref," \xb7 ",y(e.restaurantId)," \xb7 ",(0,o.niceDate)((0,o.parseYmd)(e.date))," ",e.time," \xb7 ",e.partySize," people \xb7 ",e.status]},e.id)):(0,h.jsx)(t.Muted,{children:"No bookings yet."})]}),(0,h.jsx)(t.Muted,{children:"Account deletion and data export would live here (Apple 5.1.1(v); Google web deletion link)."})]})}},774,[785,12,109,791,792,794,796,797,822,6]);
|
owner-app/_expo/static/js/web/refer-c5e13b8f8bbd4d501f3766dbb492f81e.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var r=_r(d[0]),n=_r(d[1]),s=_r(d[2]),t=_r(d[3]),l=_r(d[4]),o=_r(d[5]),u=_r(d[6]);function c(){const{rid:c}=(0,r.useLocalSearchParams)(),h=(0,t.useRestaurant)(c),f=(0,t.useCustomer)(),j=(0,l.useOwner)(r=>r.referral),x=(0,l.useOwner)(r=>r.referrals),[p,w]=(0,n.useState)(!1);if(!h)return(0,u.jsx)(s.Screen,{title:"Not found",children:(0,u.jsx)(s.T,{children:"Restaurant not found."})});const b=x.filter(r=>r.referrer===f.name);return(0,u.jsxs)(s.Screen,{title:"Bring a friend",subtitle:h.name,children:[j.active?null:(0,u.jsxs)(s.Banner,{kind:"info",children:[h.name," isn't running referrals right now."]}),(0,u.jsxs)(s.Card,{highlight:o.colours.gold,children:[(0,u.jsxs)(s.H2,{children:["You get: ",j.giverReward]}),(0,u.jsxs)(s.T,{children:["Your friend gets: ",j.friendReward]}),(0,u.jsx)(s.Muted,{children:"When your friend makes their first paid visit or order."}),(0,u.jsx)(s.T,{size:30,weight:"bold",colour:o.colours.gold,center:!0,children:f.referralCode}),(0,u.jsx)(s.Button,{label:"Share my code",disabled:!j.active,onPress:()=>w(!0)}),p?(0,u.jsx)(s.Muted,{center:!0,children:"Demo: in the real app this opens your phone's share sheet. Nothing is sent from here."}):null]}),(0,u.jsxs)(s.Card,{children:[(0,u.jsx)(s.H2,{children:"Your referrals"}),b.length?b.map(r=>(0,u.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsx)(s.T,{style:{flex:1},children:r.friend}),(0,u.jsx)(s.Badge,{kind:'rewarded'===r.status?'green':'amber',label:r.status})]},r.id)):(0,u.jsx)(s.Muted,{children:"No referrals yet."})]}),(0,u.jsx)(s.Muted,{children:"One reward per new account, phone and card. Monthly cap applies. Rewards are on food, not drinks."})]})}},768,[785,12,791,797,812,799,6]);
|
owner-app/_expo/static/js/web/waitlist-c4a5c3353222002f31152a4671fdfe2a.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return h}});var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),a=_r(d[3]),r=_r(d[4]),o=_r(d[5]),u=_r(d[6]),l=_r(d[7]),c=_r(d[8]);function h(){const{rid:h}=(0,t.useLocalSearchParams)(),j=(0,u.useRestaurant)(h),x=(0,u.useCustomer)(),b=(0,u.useWaitlist)(h),y=(0,u.useBookings)(h),f=(0,u.useOrders)(h),w=(0,u.useEvents)(h),p=(0,u.useNow)(15e3),[M,S]=(0,s.useState)(2),[v,P]=(0,s.useState)(x.name);if(!j)return(0,c.jsx)(n.Screen,{title:"Not found",children:(0,c.jsx)(n.T,{children:"Restaurant not found."})});const T=b.filter(t=>'waiting'===t.status||'notified'===t.status).sort((t,s)=>t.number-s.number),k=T.find(t=>t.customerId===x.id),B=(0,r.forecastToday)(j,y,f,w,p),C=B.nextHour?Math.min(1.6,Math.max(.8,B.nextHour.covers/(.75*j.settings.capacityPerHour))):1;if(k){const t=T.indexOf(k)+1;return(0,c.jsxs)(n.Screen,{title:"You\u2019re on the waitlist",subtitle:j.name,children:[(0,c.jsxs)(n.Card,{highlight:l.colours.gold,children:[(0,c.jsx)(n.Muted,{children:"Your queue number"}),(0,c.jsxs)(n.T,{size:56,weight:"bold",colour:l.colours.gold,children:["#",k.number]}),(0,c.jsx)(n.T,{children:1===t?'You\u2019re next':`${t-1} part${t-1==1?'y':'ies'} ahead of you`}),(0,c.jsxs)(n.T,{weight:"semibold",children:["Estimated wait: about ",(0,o.estimateWait)(t,j.settings.turnMins,C)," minutes"]}),(0,c.jsxs)(n.Muted,{children:["Estimate only \u2014 based on tables in use, typical turn times and today\u2019s forecast. Joined ",(0,a.minsBetween)(new Date(k.joinedAt),p)," min ago."]})]}),'notified'===k.status?(0,c.jsx)(n.Banner,{kind:"success",title:"Your table is ready!",children:"Please come to the door within 5 minutes to keep your table."}):(0,c.jsx)(n.Banner,{kind:"info",children:"We\u2019ll notify you when your table is ready (push/SMS simulated in this prototype)."}),(0,c.jsx)(n.Button,{kind:"secondary",label:"Leave the waitlist",onPress:()=>u.repo.waitlist.setStatus(k.id,'removed')})]})}return(0,c.jsxs)(n.Screen,{title:"Join the waitlist",subtitle:j.name,children:[(0,c.jsxs)(n.Card,{children:[(0,c.jsxs)(n.H2,{children:[T.length," part",1===T.length?'y':'ies'," waiting"]}),(0,c.jsxs)(n.Muted,{children:["Estimated wait if you join now: about ",(0,o.estimateWait)(T.length+1,j.settings.turnMins,C)," minutes (estimate)."]})]}),(0,c.jsx)(n.Field,{label:"Name",value:v,onChangeText:P}),(0,c.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(n.T,{weight:"semibold",children:"Party size"}),(0,c.jsx)(n.Stepper,{value:M,onChange:S,min:1,max:12,label:"party size"})]}),(0,c.jsx)(n.Button,{label:"Join the queue",disabled:v.trim().length<2,onPress:()=>u.repo.waitlist.join(j.id,v,M,x.id),testID:"join-waitlist"}),(0,c.jsx)(n.Muted,{children:"Waitlist messages are service messages only \u2014 no marketing."})]})}},769,[785,12,791,796,818,819,797,799,6]);
|
owner-app/_expo/static/js/web/whatson-9c60dd15f704285737d9a99e5fabdc58.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var t=_r(_d[0]),l=_r(_d[1]),n=_r(_d[2]),s=e(_r(_d[3])),o=e(_r(_d[4])),a=_r(_d[5]),r=_r(_d[6]),d=_r(_d[7]),i=_r(_d[8]),u=_r(_d[9]);const c=e=>'bank-holiday'===e.kind?(0,u.jsx)(a.Badge,{kind:"blue",label:"Scottish bank holiday"}):'school-holiday'===e.kind?(0,u.jsx)(a.Badge,{kind:"neutral",label:"School holiday"}):'occasion'===e.kind?(0,u.jsx)(a.Badge,{kind:"gold",label:"Key dining date"}):(0,u.jsx)(a.Badge,{kind:"green",label:"Restaurant event"});function h(){const{rid:e}=(0,t.useLocalSearchParams)(),h=(0,d.useRestaurant)(e),x=(0,d.useEvents)(e),y=(0,d.useNow)(6e4),[j,f]=(0,n.useState)(()=>new Date(y.getFullYear(),y.getMonth(),1)),[b,k]=(0,n.useState)(null);if(!h)return(0,u.jsx)(a.Screen,{title:"Not found",children:(0,u.jsx)(a.T,{children:"Restaurant not found."})});const p=(new Date(j).getDay()+6)%7,w=new Date(j.getFullYear(),j.getMonth()+1,0).getDate(),M=[...Array(p).fill(null),...Array.from({length:w},(e,t)=>new Date(j.getFullYear(),j.getMonth(),t+1))];for(;M.length%7;)M.push(null);const D=e=>x.filter(t=>t.date===e),v=x.filter(e=>e.date>=(0,r.ymd)(y)).sort((e,t)=>e.date.localeCompare(t.date)),S=b?D(b):v.slice(0,20);return(0,u.jsxs)(a.Screen,{title:"What\u2019s on",subtitle:`${h.name} \xb7 holidays, key dates and events`,children:[(0,u.jsxs)(a.Card,{children:[(0,u.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsx)(a.Button,{small:!0,kind:"ghost",label:"\u2039 Prev",onPress:()=>f(new Date(j.getFullYear(),j.getMonth()-1,1))}),(0,u.jsxs)(a.H2,{children:[(0,r.monthLong)(j.getMonth())," ",j.getFullYear()]}),(0,u.jsx)(a.Button,{small:!0,kind:"ghost",label:"Next \u203a",onPress:()=>f(new Date(j.getFullYear(),j.getMonth()+1,1))})]}),(0,u.jsx)(o.default,{style:{flexDirection:'row'},children:['Mon','Tue','Wed','Thu','Fri','Sat','Sun'].map(e=>(0,u.jsx)(a.T,{size:13,colour:i.colours.muted,style:{flex:1,textAlign:'center'},children:e},e))}),Array.from({length:M.length/7}).map((e,t)=>(0,u.jsx)(o.default,{style:{flexDirection:'row'},children:M.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,u.jsx)(o.default,{style:{flex:1,height:44}},t);const l=(0,r.ymd)(e),n=D(l),d=l===(0,r.ymd)(y);return(0,u.jsxs)(s.default,{accessibilityLabel:`${l}${n.length?`, ${n.length} events`:''}`,onPress:()=>k(b===l?null:l),style:{flex:1,height:44,alignItems:'center',justifyContent:'center',borderRadius:8,backgroundColor:b===l?i.colours.goldTint:'transparent',borderWidth:d?1:0,borderColor:i.colours.gold},children:[(0,u.jsx)(a.T,{size:15,colour:n.length?i.colours.text:i.colours.muted,weight:n.length?'semibold':'regular',children:e.getDate()}),(0,u.jsx)(a.Row,{gap:2,children:n.slice(0,3).map(e=>(0,u.jsx)(o.default,{style:{width:6,height:6,borderRadius:3,backgroundColor:'bank-holiday'===e.kind?i.colours.blue:'event'===e.kind?i.colours.green:i.colours.gold}},e.id))})]},t)})},t))]}),(0,u.jsx)(a.H2,{children:b?(0,r.niceDateYear)((0,r.parseYmd)(b)):'Coming up'}),0===S.length?(0,u.jsx)(a.Muted,{children:"Nothing on this day."}):S.map(e=>(0,u.jsxs)(a.Card,{children:[(0,u.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsx)(a.T,{weight:"semibold",style:{flex:1},children:(0,l.holidayName)(e.title)}),c(e)]}),(0,u.jsxs)(a.Muted,{children:[(0,r.niceDateYear)((0,r.parseYmd)(e.date)),e.source?` \xb7 source: ${e.source}`:'']}),(0,u.jsx)(a.T,{size:15,children:e.description}),e.example?(0,u.jsx)(a.Badge,{kind:"amber",label:"EXAMPLE EVENT"}):null,e.date>=(0,r.ymd)(y)?(0,u.jsx)(a.Button,{small:!0,kind:"secondary",label:"Book for this date",onPress:()=>t.router.push({pathname:'/customer/[rid]/book',params:{rid:h.id,date:e.date}})}):null]},e.id)),(0,u.jsx)(a.Muted,{children:"Bank holidays from gov.uk (Scotland division). Easter Monday is not a Scottish bank holiday; local council holidays vary."})]})}},770,[785,806,12,245,109,791,796,797,799,6]);
|
owner-app/index.html
CHANGED
|
@@ -34,8 +34,8 @@
|
|
| 34 |
<style>html,body{background:#0B0B0B}</style>
|
| 35 |
<script>(function(){var p=location.pathname;if(/\/index\.html$/.test(p))history.replaceState(null,'',p.slice(0,-10)+location.search+location.hash);})();</script>
|
| 36 |
<script>(function(){try{var r=sessionStorage.getItem('cc-redirect');if(!r)return;sessionStorage.removeItem('cc-redirect');var u=new URL(r,location.href);if(u.origin===location.origin&&u.pathname.indexOf('/owner-app/')===0&&u.pathname!==location.pathname)history.replaceState(null,'',u.pathname+u.search+u.hash);}catch(e){}})();</script>
|
| 37 |
-
<script>/* v0.2.21 update prompt: 'A new version is ready' with an Update button (posts SKIP_WAITING; the page reloads once). */
|
| 38 |
-
function ccShowUpdate(w){if(document.getElementById('cc-update'))return;var b=document.createElement('div');b.id='cc-update';b.setAttribute('role','status');b.style.cssText='position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:2147483000;max-width:520px;margin:0 auto;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:#17140F;border:1px solid rgba(207,164,95,.55);box-shadow:0 10px 30px rgba(0,0,0,.6);font:500 15px system-ui,sans-serif;color:#F5F1E8';b.innerHTML='<span style="flex:1">A new version of the app is ready.</span>';var u=document.createElement('button');u.textContent='Update';u.id='cc-update-btn';u.style.cssText='min-height:44px;padding:0 18px;border-radius:12px;border:0;background:#CFA45F;color:#17130D;font:700 15px system-ui,sans-serif;cursor:pointer';u.onclick=function(){u.textContent='Updating…';try{w.postMessage({type:'SKIP_WAITING'});}catch(e){location.reload();}setTimeout(function(){location.reload();},4000);};var l=document.createElement('button');l.textContent='Later';l.style.cssText='min-height:44px;padding:0 10px;border:0;background:transparent;color:#A89A80;font:500 14px system-ui,sans-serif;cursor:pointer';l.onclick=function(){b.remove();};b.appendChild(u);b.appendChild(l);document.body.appendChild(b);}
|
| 39 |
function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdate(r.waiting);r.addEventListener('updatefound',function(){var n=r.installing;if(!n)return;n.addEventListener('statechange',function(){if(n.state==='installed'&&navigator.serviceWorker.controller)ccShowUpdate(n);});});}</script>
|
| 40 |
<script>if('serviceWorker' in navigator){var hadSW=!!navigator.serviceWorker.controller,reloaded=false;navigator.serviceWorker.addEventListener('controllerchange',function(){if(hadSW&&!reloaded){reloaded=true;location.reload();}});window.addEventListener('load',function(){navigator.serviceWorker.register('/owner-app/sw.js',{scope:'/owner-app/',updateViaCache:'none'}).then(function(r){ccWatch(r);r.update().catch(function(){});setInterval(function(){r.update().catch(function(){});},30*60000);}).catch(function(e){console.warn('SW',e)});});}</script>
|
| 41 |
<style>html,body,#root{overflow-x:hidden;max-width:100vw;overscroll-behavior:none}body{touch-action:pan-x pan-y}</style><script>document.addEventListener("gesturestart",function(e){e.preventDefault()},{passive:false});document.addEventListener("touchmove",function(e){if(e.touches&&e.touches.length>1)e.preventDefault()},{passive:false});</script></head>
|
|
@@ -45,7 +45,7 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat
|
|
| 45 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 46 |
<!-- The root element for your Expo app. -->
|
| 47 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/owner-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 48 |
-
<script src="/owner-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/owner-app/_expo/static/js/web/__common-
|
| 49 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 50 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 51 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
|
|
|
| 34 |
<style>html,body{background:#0B0B0B}</style>
|
| 35 |
<script>(function(){var p=location.pathname;if(/\/index\.html$/.test(p))history.replaceState(null,'',p.slice(0,-10)+location.search+location.hash);})();</script>
|
| 36 |
<script>(function(){try{var r=sessionStorage.getItem('cc-redirect');if(!r)return;sessionStorage.removeItem('cc-redirect');var u=new URL(r,location.href);if(u.origin===location.origin&&u.pathname.indexOf('/owner-app/')===0&&u.pathname!==location.pathname)history.replaceState(null,'',u.pathname+u.search+u.hash);}catch(e){}})();</script>
|
| 37 |
+
<script>/* v0.2.21 update prompt: 'A new version is ready' with an Update button (posts SKIP_WAITING; the page reloads once). v0.2.22: shown through the app's shared slider (window.ccSlider) once the app has loaded, so it queues with other notices; this plain copy is the fallback before then. */
|
| 38 |
+
function ccShowUpdate(w){if(window.ccSlider){window.ccSlider({id:'app-update',title:'A new version of the app is ready.',testID:'cc-update',actions:[{label:'Update',testID:'cc-update-btn',keepOpen:true,onPress:function(){try{w.postMessage({type:'SKIP_WAITING'});}catch(e){location.reload();}setTimeout(function(){location.reload();},4000);}},{label:'Later',kind:'ghost'}]});return;}if(document.getElementById('cc-update'))return;var b=document.createElement('div');b.id='cc-update';b.setAttribute('role','status');b.style.cssText='position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:2147483000;max-width:520px;margin:0 auto;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:#17140F;border:1px solid rgba(207,164,95,.55);box-shadow:0 10px 30px rgba(0,0,0,.6);animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both;font:500 15px system-ui,sans-serif;color:#F5F1E8';b.innerHTML='<style>@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){#cc-update{animation:none!important}}</style><span style="flex:1">A new version of the app is ready.</span>';var u=document.createElement('button');u.textContent='Update';u.id='cc-update-btn';u.style.cssText='min-height:44px;padding:0 18px;border-radius:12px;border:0;background:#CFA45F;color:#17130D;font:700 15px system-ui,sans-serif;cursor:pointer';u.onclick=function(){u.textContent='Updating…';try{w.postMessage({type:'SKIP_WAITING'});}catch(e){location.reload();}setTimeout(function(){location.reload();},4000);};var l=document.createElement('button');l.textContent='Later';l.style.cssText='min-height:44px;padding:0 10px;border:0;background:transparent;color:#A89A80;font:500 14px system-ui,sans-serif;cursor:pointer';l.onclick=function(){b.remove();};b.appendChild(u);b.appendChild(l);document.body.appendChild(b);}
|
| 39 |
function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdate(r.waiting);r.addEventListener('updatefound',function(){var n=r.installing;if(!n)return;n.addEventListener('statechange',function(){if(n.state==='installed'&&navigator.serviceWorker.controller)ccShowUpdate(n);});});}</script>
|
| 40 |
<script>if('serviceWorker' in navigator){var hadSW=!!navigator.serviceWorker.controller,reloaded=false;navigator.serviceWorker.addEventListener('controllerchange',function(){if(hadSW&&!reloaded){reloaded=true;location.reload();}});window.addEventListener('load',function(){navigator.serviceWorker.register('/owner-app/sw.js',{scope:'/owner-app/',updateViaCache:'none'}).then(function(r){ccWatch(r);r.update().catch(function(){});setInterval(function(){r.update().catch(function(){});},30*60000);}).catch(function(e){console.warn('SW',e)});});}</script>
|
| 41 |
<style>html,body,#root{overflow-x:hidden;max-width:100vw;overscroll-behavior:none}body{touch-action:pan-x pan-y}</style><script>document.addEventListener("gesturestart",function(e){e.preventDefault()},{passive:false});document.addEventListener("touchmove",function(e){if(e.touches&&e.touches.length>1)e.preventDefault()},{passive:false});</script></head>
|
|
|
|
| 45 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 46 |
<!-- The root element for your Expo app. -->
|
| 47 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/owner-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 48 |
+
<script src="/owner-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/owner-app/_expo/static/js/web/__common-d89b80abe4ece4560b60220088bdf6bc.js" defer></script><script src="/owner-app/_expo/static/js/web/entry-c34dc0265950def894404e0df8b08922.js" defer></script>
|
| 49 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 50 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 51 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
owner-app/sw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
// Anchorage Manager service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
-
const V = "cc-owner-
|
| 3 |
const BASE = "/owner-app/";
|
| 4 |
-
const PRECACHE = ["/owner-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/owner-app/_expo/static/js/web/[did]-
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
|
|
|
| 1 |
// Anchorage Manager service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
+
const V = "cc-owner-7fd90ecd3c";
|
| 3 |
const BASE = "/owner-app/";
|
| 4 |
+
const PRECACHE = ["/owner-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/owner-app/_expo/static/js/web/[did]-e4382792c51e53176e20f8028790b773.js", "/owner-app/_expo/static/js/web/[n]-a3cbb5966c741787b42d024fc2e9cb89.js", "/owner-app/_expo/static/js/web/[oid]-affd80a8b572b9c207d9b216313d29dc.js", "/owner-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/owner-app/_expo/static/js/web/__common-d89b80abe4ece4560b60220088bdf6bc.js", "/owner-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js", "/owner-app/_expo/static/js/web/_layout-bd589551787e47b00fbd6b08e692ff8c.js", "/owner-app/_expo/static/js/web/basket-60d8775a5a99f77545a887d7d328b00b.js", "/owner-app/_expo/static/js/web/book-1d5b97d633d6c3f7b1fac568474b5644.js", "/owner-app/_expo/static/js/web/demo-2aeda33db335ba3a45d18733444a4df6.js", "/owner-app/_expo/static/js/web/entry-c34dc0265950def894404e0df8b08922.js", "/owner-app/_expo/static/js/web/feedback-6dbe946e1675fb596c5c4cd508919819.js", "/owner-app/_expo/static/js/web/gift-68f9ee1cd4ed0c0f9068fb93bfa60db9.js", "/owner-app/_expo/static/js/web/index-03b3d77bd2e8a210ebb2df9f2863b203.js", "/owner-app/_expo/static/js/web/index-3ce55512f207e0f4e938fcea314e34d2.js", "/owner-app/_expo/static/js/web/index-42c772ae8e6fc8ffb457607b71499331.js", "/owner-app/_expo/static/js/web/index-43fb9d706c5994dd4d4a0d08ebfdc367.js", "/owner-app/_expo/static/js/web/index-74ed5e3887809c4259d725a2965aa3f3.js", "/owner-app/_expo/static/js/web/index-e169896d6181c62b56a7fa6a62cd6b62.js", "/owner-app/_expo/static/js/web/index-e57a61ccf8b16e38bf91548a01cebbf1.js", "/owner-app/_expo/static/js/web/index-eda4f3212fdf4cd939574137be84916b.js", "/owner-app/_expo/static/js/web/index-f874fe0b7bfd6e4bab8776decab3fbe6.js", "/owner-app/_expo/static/js/web/lost-e43ed901b9bdb90a961de71b16ee2e27.js", "/owner-app/_expo/static/js/web/loyalty-7281429f7496b539476c8f7c06544800.js", "/owner-app/_expo/static/js/web/merch-497952082abffc295443c32cde709c8e.js", "/owner-app/_expo/static/js/web/offers-fdb0de6863fb561ae4062365be93c480.js", "/owner-app/_expo/static/js/web/profile-e81a333ab15babc6deb5b3640c1abdd5.js", "/owner-app/_expo/static/js/web/refer-c5e13b8f8bbd4d501f3766dbb492f81e.js", "/owner-app/_expo/static/js/web/waitlist-c4a5c3353222002f31152a4671fdfe2a.js", "/owner-app/_expo/static/js/web/whatson-9c60dd15f704285737d9a99e5fabdc58.js", "/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/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/owner-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.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"];
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
staff-app/_expo/static/js/web/[did]-e4382792c51e53176e20f8028790b773.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=_r(_d[0]),n=_r(_d[1]),l=e(_r(_d[2])),s=e(_r(_d[3])),r=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]);function f(){const{rid:e,did:f}=(0,t.useLocalSearchParams)(),b=(0,u.useRestaurant)(e),j=(0,u.useMenu)(e).find(e=>e.id===f),x=(0,u.useCustomer)(),m=(0,u.useRecipeCards)(e).find(e=>e.id===j?.recipeCardId),y=m?.signOff&&m.photo?(0,h.recipeCards)().photoSource(m.photo):null,k=(0,u.useStore)(e=>e.addLine),[v,w]=(0,n.useState)(()=>(j?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[S,C]=(0,n.useState)(1),[B,$]=(0,n.useState)(''),[I,P]=(0,n.useState)(!1),[L,T]=(0,n.useState)(!1),[D,O]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>j?(0,d.effectiveAllergens)(j,v):{},[j,v]);if(!b||!j)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Dish not found."})});const q=(0,d.conflictsFor)(R,x.allergies),_=(j.price??0)+(j.optionGroups??[]).flatMap(e=>e.choices).filter(e=>v.includes(e.id)).reduce((e,t)=>e+t.priceDelta,0),N=j.soldOut||!j.signOff||null===j.price,G=(e,t)=>{const n=j.optionGroups.find(t=>t.id===e);w(e=>{const l=n.choices.map(e=>e.id);return n.multi?e.includes(t)?e.filter(e=>e!==t):[...e,t]:e.includes(t)&&!n.required?e.filter(e=>e!==t):[...e.filter(e=>!l.includes(e)),t]})},z=e=>{u.useStore.getState().basket.restaurantId!==b.id&&u.useStore.getState().startBasket(b.id,'takeaway'),k({itemId:j.id,qty:S,choiceIds:v,notes:B,override:e?{allergens:q.contains,at:(new Date).toISOString()}:void 0}),P(!1),M(!0)};return(0,p.jsxs)(o.Screen,{title:j.name,subtitle:b.name,right:(0,p.jsx)(a.BasketButton,{}),children:[y?(0,p.jsx)(l.default,{testID:"dish-photo",source:y,accessibilityLabel:`${j.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===j.price?j.priceNote:(0,c.gbp)(_)}),j.dietary.map(e=>(0,p.jsx)(o.Badge,{kind:"green",label:e},e))]}),(0,p.jsx)(o.T,{children:j.description}),q.contains.length?(0,p.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,q.may.length?(0,p.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${q.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(j.optionGroups??[]).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(t=>(0,p.jsx)(o.Chip,{label:t.label,sub:t.priceDelta?`+${(0,c.gbp)(t.priceDelta)}`:void 0,selected:v.includes(t.id),onPress:()=>G(e.id,t.id)},t.id))})]},e.id)),(0,p.jsx)(o.Card,{children:(0,p.jsx)(r.AllergenPanel,{item:j,map:R,declared:x.allergies})}),b.fictional?null:(0,p.jsx)(o.ExampleAllergenNotice,{}),(0,p.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:B,onChangeText:$}),(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,p.jsx)(o.Stepper,{value:S,onChange:C,label:"quantity"})]}),A?(0,p.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:q.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,N?(0,p.jsx)(o.Banner,{kind:"warn",children:j.soldOut?'Sold out today.':j.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):q.contains.length?(0,p.jsxs)(s.default,{style:{gap:8},children:[(0,p.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,p.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{T(!1),O(!1),P(!0)},testID:"override-open"})]}):(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{style:{flex:1},label:`Add ${S} to basket \xb7 ${(0,c.gbp)(_*S)}`,onPress:()=>z(!1),testID:"add-to-basket"}),A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,p.jsxs)(o.Sheet,{visible:I,onClose:()=>P(!1),title:"Allergy override",children:[(0,p.jsx)(o.Banner,{kind:"danger",title:`${j.name} contains ${q.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${x.allergies.filter(e=>q.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,p.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:L,onChange:T}),(0,p.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:D,onChange:O}),(0,p.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,p.jsx)(o.Button,{kind:"danger",disabled:!L||!D,label:"Confirm override and add",onPress:()=>z(!0),testID:"override-confirm"})]})]})}},760,[785,12,178,109,807,808,791,792,794,797,809,799,6]);
|
staff-app/_expo/static/js/web/[oid]-affd80a8b572b9c207d9b216313d29dc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return w}});var e,t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=(e=l)&&e.__esModule?e:{default:e},n=_r(d[3]),o=_r(d[4]),i=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),p=_r(d[9]),b=_r(d[10]),y=_r(d[11]);const j=[['new','Placed'],['acknowledged','Accepted'],['preparing','Cooking'],['ready','Ready to collect'],['collected','Collected']],x=[['new','Sent'],['acknowledged','Accepted'],['preparing','Cooking'],['served','Food out'],['closed','Paid']];function w(){const{oid:e}=(0,t.useLocalSearchParams)(),l=(0,p.useOrder)(e),w=(0,p.useRestaurant)(l?.restaurantId),[f,T]=(0,s.useState)(0),[C,S]=(0,s.useState)(''),[k,v]=(0,s.useState)(!1),[P,M]=(0,s.useState)(!1),[$,R]=(0,s.useState)(1),[A,I]=(0,s.useState)(0),[O,B]=(0,s.useState)(l?.split?.ways??1);if(!l||!w)return(0,y.jsx)(i.Screen,{title:"Order",children:(0,y.jsx)(i.T,{children:"Order not found."})});const N='takeaway'===l.type?j:x,H=Math.max(0,N.findIndex(([e])=>e===l.status)),_=Math.round(l.subtotal*A/100),D='table'===l.type?l.subtotal+(l.split?l.tip:_):l.total,F=D-l.paid,q=l.split?.ways??O,L=l.split?.paidShares??0,W=Math.ceil(D/q),Y='collected'===l.status||'closed'===l.status;return(0,y.jsxs)(i.Screen,{title:`Order ${l.ref}`,subtitle:`${w.name} \xb7 ${'table'===l.type?`Table ${l.tableNo}`:`Collection at ${l.slotTime?(0,h.hm)(new Date(l.slotTime)):'\u2014'}`}`,children:['takeaway'===l.type?(0,y.jsx)(i.Banner,{kind:"success",title:'ready'===l.status?'Your order is ready!':'Order placed and paid (demo)',children:'ready'===l.status?'Head to the bar and give your order number. Staff will check allergies with you at handover.':`Show order number ${l.ref} at the bar when you arrive.`}):null,(0,y.jsxs)(i.Card,{children:[(0,y.jsx)(i.H2,{children:"Status"}),N.map(([e,t],s)=>(0,y.jsxs)(i.Row,{gap:10,children:[(0,y.jsx)(r.default,{style:{width:22,height:22,borderRadius:11,backgroundColor:s<=H?b.colours.gold:b.colours.surface2,borderWidth:1,borderColor:b.colours.gold}}),(0,y.jsx)(i.T,{weight:s===H?'semibold':'regular',colour:s<=H?b.colours.text:b.colours.muted,children:t})]},e)),l.allergyAck?(0,y.jsxs)(i.Muted,{children:["Kitchen signed off your allergies (",l.allergyAck.by,", ",(0,h.hm)(new Date(l.allergyAck.at)),")"]}):l.allergies.length?(0,y.jsx)(i.Muted,{children:"Waiting for the kitchen to sign off your allergies\u2026"}):null,'takeaway'!==l.type||Y?null:(0,y.jsxs)(i.Row,{gap:8,children:[(0,y.jsx)(i.Button,{small:!0,kind:'on-my-way'===l.customerSignal?'primary':'secondary',label:"On my way",onPress:()=>p.repo.orders.customerSignal(l.id,'on-my-way')}),(0,y.jsx)(i.Button,{small:!0,kind:'here'===l.customerSignal?'primary':'secondary',label:"I\u2019m here",onPress:()=>p.repo.orders.customerSignal(l.id,'here')})]})]}),(0,y.jsxs)(i.Card,{children:[(0,y.jsx)(i.H2,{children:"Items"}),l.lines.map((e,t)=>(0,y.jsxs)(r.default,{children:[(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(i.T,{style:{flex:1},children:[e.qty,"\xd7 ",e.name]}),(0,y.jsx)(i.T,{children:(0,u.gbp)(e.unitPrice*e.qty)})]}),e.choices.length?(0,y.jsx)(i.Muted,{children:e.choices.join(' \xb7 ')}):null,e.overridden?(0,y.jsx)(i.Badge,{kind:"red",label:`Allergy override: ${e.contains.map(c.allergenLabel).join(', ')}`}):null]},t)),(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Subtotal"}),(0,y.jsx)(i.T,{children:(0,u.gbp)(l.subtotal)})]}),l.giftCardApplied?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Of which gift card"}),(0,y.jsxs)(i.T,{colour:b.colours.green,children:["\u2212",(0,u.gbp)(l.giftCardApplied)]})]}):null,l.tip?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Tip"}),(0,y.jsx)(i.T,{children:(0,u.gbp)(l.tip)})]}):null,(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Paid (demo)"}),(0,y.jsx)(i.T,{weight:"semibold",colour:b.colours.gold,children:(0,u.gbp)(l.paid)})]})]}),'table'===l.type&&'closed'!==l.status&&'cancelled'!==l.status?(0,y.jsxs)(i.Card,{highlight:b.colours.gold,children:[(0,y.jsxs)(i.H2,{children:["Your bill \u2014 Table ",l.tableNo]}),l.split?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(i.T,{children:["Total ",(0,u.gbp)(D)," \xb7 split ",q," way",q>1?'s':''," \xb7 ",(0,u.gbp)(W)," each"]}),(0,y.jsxs)(i.T,{children:["Shares paid: ",L," of ",q," \xb7 remaining ",(0,u.gbp)(F)]}),q>1?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{children:"Shares to pay now"}),(0,y.jsx)(i.Stepper,{value:$,onChange:R,min:1,max:q-L,label:"shares"})]}):null,(0,y.jsx)(i.Button,{label:`Pay ${q>1?`${$} share${$>1?'s':''}`:'bill'} \xb7 ${(0,u.gbp)(Math.min(F,W*$))}`,onPress:()=>M(!0),testID:"pay-bill"})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Add a tip?"}),(0,y.jsx)(i.Row,{wrap:!0,children:[0,10,12.5,15].map(e=>(0,y.jsx)(i.Chip,{label:e?`${e}%`:'No tip',selected:A===e,onPress:()=>I(e)},e))}),(0,y.jsx)(i.Muted,{children:"Tips go to staff under the restaurant\u2019s tipping policy (Employment (Allocation of Tips) Act 2023)."}),(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Split evenly between"}),(0,y.jsx)(i.Stepper,{value:O,onChange:B,min:1,max:8,label:"people"})]}),(0,y.jsxs)(i.T,{children:["Total ",(0,u.gbp)(l.subtotal+_),O>1?` \xb7 ${(0,u.gbp)(Math.ceil((l.subtotal+_)/O))} each`:'']}),(0,y.jsx)(i.Button,{label:"Get the bill",onPress:()=>p.repo.orders.setSplit(l.id,O,_),testID:"get-bill"})]})]}):null,!Y||l.rated||k?null:(0,y.jsxs)(i.Card,{highlight:b.colours.gold,children:[(0,y.jsx)(i.H2,{children:"How was everything?"}),(0,y.jsxs)(i.Muted,{children:["One tap \u2014 this goes privately to ",w.name," only, never published."]}),(0,y.jsx)(o.Stars,{value:f,onChange:T}),f?(0,y.jsx)(i.Field,{label:"Anything to add? (optional)",value:C,onChangeText:S}):null,(0,y.jsx)(i.Button,{label:"Send feedback",disabled:!f,onPress:()=>{p.repo.feedback.add({restaurantId:w.id,orderId:l.id,customerId:l.customerId,customerName:l.customerName,stars:f,comment:C,context:'table'===l.type?`Table ${l.tableNo}`:`Takeaway ${l.ref}`}),v(!0)},testID:"send-rating"})]}),k||l.rated?(0,y.jsx)(i.Banner,{kind:"success",children:"Thanks \u2014 your feedback went privately to the restaurant."}):null,Y?(0,y.jsx)(i.Button,{kind:"secondary",label:"View stamp card",onPress:()=>t.router.push(`/customer/${w.id}/loyalty`)}):null,(0,y.jsx)(n.MockPay,{visible:P,onClose:()=>M(!1),amount:Math.min(F,W*$),restaurantId:w.id,title:`Pay \u2014 Table ${l.tableNo}`,onPaid:e=>{p.repo.orders.payTable(l.id,{shares:$,giftCardCode:e.giftCardCode}),M(!1),R(1)}})]})}},773,[785,12,109,790,810,791,792,794,796,797,799,6]);
|
staff-app/_expo/static/js/web/__common-6585c9ee60e461f491e13a987c63fd48.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/_layout-f70b124d1f3c941f34aa922543bca28c.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/basket-f625050b5378b7835c7b0531a8d87b99.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var l=_r(d[0]),t=_r(d[1]),n=e(t),s=e(_r(d[2])),o=_r(d[3]),a=_r(d[4]),r=_r(d[5]),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),m=_r(d[10]),b=_r(d[11]),y=_r(d[12]),j=_r(d[13]);function x(){const e=(0,h.useBasket)(),x=(0,h.useRestaurant)(e.restaurantId??void 0),p=(0,h.useAllMenu)(e.restaurantId??void 0),k=(0,h.useCustomer)(),f=(0,h.useOrders)(x?.id),w=(0,h.useStore)(e=>e.setLineQty),v=(0,h.useStore)(e=>e.overrideLine),C=(0,h.useStore)(e=>e.startBasket),T=(0,h.useNow)(15e3),[B,S]=(0,t.useState)(null),[P,$]=(0,t.useState)(!1),[O,I]=(0,t.useState)(''),[M,L]=(0,t.useState)(k.phone??''),[N,R]=(0,t.useState)(k.email??''),[F,z]=(0,t.useState)(!1),A=(0,h.useOrderAtTable)(e.restaurantId??void 0);n.default.useEffect(()=>{A||'table'!==e.mode||h.useStore.setState(e=>({basket:{...e.basket,mode:'takeaway',tableNo:void 0}}))},[A,e.mode]);const[D,E]=(0,t.useState)(null),[_,Y]=(0,t.useState)(!1),q=(0,t.useMemo)(()=>(0,m.linesFromBasket)(e,p,k.allergies),[e,p,k.allergies]);if(!x||!e.lines.length)return(0,j.jsxs)(a.Screen,{title:"Your basket",children:[(0,j.jsx)(a.Muted,{children:"Your basket is empty."}),(0,j.jsx)(a.Button,{label:"Browse restaurants",onPress:()=>l.router.replace('/customer')})]});const H=A&&'table'===e.mode,K=(0,u.takeawaySlots)(x,f,T),Q=q.reduce((e,l)=>e+l.unitPrice*l.qty,0),W=q.some(e=>e.contains.length&&!e.overridden),G=e.lines.filter(e=>{const l=p.find(l=>l.id===e.itemId);return!l||l.soldOut||!l.signOff}),J=!H&&!B,U=!H&&x.settings.takeawayPaused,V=(0,y.ukPhone)(M),X=!W&&!G.length&&P&&!J&&!U&&(H||V.ok&&(0,y.emailOk)(N)),Z=async e=>{const t=await h.repo.orders.placeFromBasket({slotTime:H?void 0:B,tip:0,giftCardCode:e?.giftCardCode,notes:O,paidNow:!H,phone:H?void 0:V.pretty,email:H?void 0:N.trim()||void 0});z(!1),l.router.replace(`/customer/order/${t.id}`)},ee=e.lines.find(e=>e.key===D),le=ee?q[e.lines.indexOf(ee)]:void 0;return(0,j.jsxs)(a.Screen,{title:"Your basket",subtitle:`${x.name} \xb7 ${H?`Table ${e.tableNo} (order at table)`:'Takeaway \u2014 collection'}`,footer:(0,j.jsxs)(s.default,{style:{gap:8},children:[(0,j.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(a.T,{weight:"semibold",children:"Subtotal"}),(0,j.jsx)(a.T,{weight:"bold",size:20,colour:b.colours.gold,children:(0,i.gbp)(Q)})]}),W?(0,j.jsx)(a.T,{size:14,colour:b.colours.red,children:"Resolve the blocked allergy item(s) before continuing."}):P?J&&!U?(0,j.jsx)(a.T,{size:14,colour:b.colours.amber,children:"Choose a collection time."}):null:(0,j.jsx)(a.T,{size:14,colour:b.colours.amber,children:"Confirm your allergies to continue."}),H?(0,j.jsx)(a.Button,{label:"Send order to the kitchen",disabled:!X,onPress:()=>Z(),testID:"send-table-order"}):(0,j.jsx)(a.Button,{label:`Continue to payment \xb7 ${(0,i.gbp)(Q)}`,disabled:!X,onPress:()=>z(!0),testID:"checkout"})]}),children:[(H||e.tableNo,null),H?(0,j.jsx)(a.Banner,{kind:"success",title:`Table ${e.tableNo}`,children:"Ordered food goes to the kitchen straight away; you pay at the end (split the bill if you like)."}):null,x.fictional?null:(0,j.jsx)(a.ExampleAllergenNotice,{}),q.map((l,t)=>{const n=e.lines[t],o=l.contains.length&&!l.overridden;return(0,j.jsxs)(a.Card,{highlight:l.contains.length?b.colours.red:l.may.length?b.colours.amber:void 0,children:[(0,j.jsxs)(a.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,j.jsxs)(s.default,{style:{flex:1,paddingRight:8},children:[(0,j.jsx)(a.T,{weight:"semibold",children:l.name}),l.choices.length?(0,j.jsx)(a.Muted,{children:l.choices.join(' \xb7 ')}):null,l.notes?(0,j.jsxs)(a.Muted,{children:["Note: ",l.notes]}):null]}),(0,j.jsx)(a.T,{weight:"semibold",children:(0,i.gbp)(l.unitPrice*l.qty)})]}),o?(0,j.jsxs)(a.Banner,{kind:"danger",title:`BLOCKED \u2014 contains ${l.contains.map(r.allergenLabel).join(', ')}`,children:[(0,j.jsx)(a.T,{size:14,colour:"#FFE3DF",children:`Conflicts with your declared ${k.allergies.filter(e=>l.contains.includes(e.allergen)).map(e=>`${(0,r.allergenLabel)(e.allergen)} (${(0,r.severityLabel)(e.severity)})`).join(', ')}.`}),(0,j.jsxs)(a.Row,{gap:8,style:{marginTop:6},children:[(0,j.jsx)(a.Button,{small:!0,kind:"secondary",label:"Remove",onPress:()=>w(n.key,0)}),(0,j.jsx)(a.Button,{small:!0,kind:"danger",label:"Override\u2026",onPress:()=>{Y(!1),E(n.key)}})]})]}):l.contains.length?(0,j.jsx)(a.Banner,{kind:"danger",title:`Allergy override recorded \u2014 contains ${l.contains.map(r.allergenLabel).join(', ')}`,children:"The kitchen will get an allergy alert that must be acknowledged, and staff will check with you at handover."}):null,l.may.length?(0,j.jsx)(a.Banner,{kind:"warn",title:`May contain ${l.may.map(r.allergenLabel).join(', ')}`,children:"Cross-contact risk (e.g. shared fryer). Please check with staff."}):null,G.includes(n)?(0,j.jsx)(a.Badge,{kind:"amber",label:"No longer available online \u2014 please remove"}):null,(0,j.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(a.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>w(n.key,0)}),(0,j.jsx)(a.Stepper,{value:n.qty,onChange:e=>w(n.key,e),min:1,label:l.name})]})]},n.key)}),(0,j.jsx)(a.Button,{kind:"ghost",label:"+ Add more items",onPress:()=>l.router.push(`/customer/${x.id}`)}),H?null:(0,j.jsxs)(a.Card,{children:[(0,j.jsxs)(a.H2,{children:["Collection time \u2014 ",(0,c.niceDate)(T)]}),U?(0,j.jsx)(a.Banner,{kind:"warn",title:"Takeaway paused",children:"The restaurant has paused takeaway slots for now. Please try again later or book a table."}):0===K.length?(0,j.jsx)(a.Banner,{kind:"warn",children:"No collection slots left today."}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(a.Muted,{children:["15-minute slots, max ",x.settings.slotCap," orders each so the kitchen isn\u2019t overloaded."]}),(0,j.jsx)(a.Row,{wrap:!0,gap:6,children:K.slice(0,16).map(e=>(0,j.jsx)(a.Chip,{label:e.label,sub:e.full?'Full':e.cap-e.taken+" left",disabled:e.full,selected:B===e.time.toISOString(),onPress:()=>S(e.time.toISOString())},e.label))})]})]}),(0,j.jsxs)(a.Card,{highlight:P?void 0:b.colours.amber,children:[(0,j.jsx)(a.H2,{children:"Confirm allergies for this order"}),(0,j.jsx)(a.Row,{wrap:!0,gap:6,children:k.allergies.length?k.allergies.map(e=>(0,j.jsx)(a.Badge,{kind:"red",label:`${(0,r.allergenLabel)(e.allergen)} \u2014 ${(0,r.severityLabel)(e.severity)}`},e.allergen)):(0,j.jsx)(a.Muted,{children:"No allergies declared on your profile."})}),(0,j.jsx)(a.Toggle,{label:k.allergies.length?'Yes, these are correct for everyone this order is for':'I confirm no one in this order has a food allergy',value:P,onChange:$}),(0,j.jsx)(a.Button,{small:!0,kind:"ghost",label:"Edit allergies in profile",onPress:()=>l.router.push('/customer/profile')})]}),H?null:(0,j.jsxs)(a.Card,{children:[(0,j.jsx)(a.H2,{children:"Your details"}),(0,j.jsx)(a.Field,{testID:"order-phone",label:"Mobile number (needed for collection)",value:M,onChangeText:L,keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),!V.ok&&M?(0,j.jsx)(a.T,{size:13,colour:b.colours.amber,children:V.error}):null,(0,j.jsx)(a.Field,{label:"Email (optional)",value:N,onChangeText:R,keyboardType:"email-address",autoCapitalize:"none",placeholder:"you@example.com"}),(0,y.emailOk)(N)?null:(0,j.jsx)(a.T,{size:13,colour:b.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,j.jsx)(a.Muted,{children:"We\u2019ll text your order confirmation and collection time. Preview mode: nothing is sent in this pilot."})]}),(0,j.jsx)(a.Field,{label:"Order notes (optional)",value:O,onChangeText:I,placeholder:"e.g. cutlery please"}),H?(0,j.jsx)(a.Button,{small:!0,kind:"ghost",label:"Switch to takeaway instead",onPress:()=>C(x.id,'takeaway')}):null,(0,j.jsx)(o.MockPay,{visible:F,onClose:()=>z(!1),amount:Q,restaurantId:x.id,onPaid:e=>Z({giftCardCode:e.giftCardCode}),title:"Pay for your takeaway"}),(0,j.jsxs)(a.Sheet,{visible:!!ee,onClose:()=>E(null),title:"Allergy override",children:[le?(0,j.jsx)(a.Banner,{kind:"danger",title:`${le.name} contains ${le.contains.map(r.allergenLabel).join(', ')}`,children:"Only continue if this item is for someone without this allergy, or you have spoken to staff."}):null,(0,j.jsx)(a.Toggle,{label:"I understand and want to add it anyway",value:_,onChange:Y}),(0,j.jsx)(a.Button,{kind:"danger",disabled:!_,label:"Confirm override",onPress:()=>{ee&&le&&v(ee.key,le.contains),E(null)}})]})]})}},771,[785,12,109,790,791,792,794,795,796,797,856,799,801,6]);
|
staff-app/_expo/static/js/web/book-1d5b97d633d6c3f7b1fac568474b5644.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return T}});var e,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),a=_r(_d[3]),n=(e=a)&&e.__esModule?e:{default:e},i=_r(_d[4]),l=_r(_d[5]),r=_r(_d[6]),d=_r(_d[7]),u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),x=_r(_d[15]),k=_r(_d[16]),j=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),C=_r(_d[21]);function T(){const{rid:e,date:a}=(0,o.useLocalSearchParams)(),T=(0,p.useRestaurant)(e),P=(0,p.useCustomer)(),$=(0,p.useBookings)(e),D=(0,p.useEvents)(e),M=(0,p.useNow)(6e4),[A,B]=(0,s.useState)(2),[F,O]=(0,s.useState)(a??(0,h.ymd)(M)),[N,R]=(0,s.useState)(null),[z,q]=(0,s.useState)(P.name),[H,W]=(0,s.useState)(P.phone??''),[I,E]=(0,s.useState)(P.email??''),[_,L]=(0,s.useState)(!1),[Y,U]=(0,s.useState)(''),[G,Q]=(0,s.useState)(!1),[V,J]=(0,s.useState)([]),[K,X]=(0,s.useState)(!1),Z=[...P.allergies,...V.filter(e=>!P.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[ee,te]=(0,s.useState)(!1),[oe,se]=(0,s.useState)(null),ae=(0,k.useBlocks)(e=>e.blocks);(0,b.usePublicDayStore)(e=>e.n);const ne=e?(0,b.publicDay)(e,F):null,ie=ne?[...ne.bookings,...$.filter(e=>e.date!==F)]:$,le=ne?[...ae.filter(t=>t.rid!==e||t.date!==F),...ne.blocks]:ae,re=(0,j.usePlan)(e),[de,ue]=(0,s.useState)((0,w.emptyNeeds)()),ce=!0===de.dog,he=ce?de.dogs:0,me=(0,s.useMemo)(()=>{const e=[],t=new Date(M);t.setHours(12,0,0,0);for(let o=0;o<21;o++){const s=new Date(t);s.setDate(t.getDate()+o),e.push(s)}return a&&!e.some(e=>(0,h.ymd)(e)===a)&&e.push((0,h.parseYmd)(a)),e},[M.toDateString(),a]);if(!T)return(0,C.jsx)(l.Screen,{title:"Not found",children:(0,C.jsx)(l.T,{children:"Restaurant not found."})});const pe=T.settings,ge=(0,h.parseYmd)(F),be=(0,k.blocksOn)(le,T.id,F),fe=ie.filter(e=>e.date===F),ye=re.areas.filter(e=>e.dogs),xe=(0,S.dogSetUp)(re),ke=e=>(0,v.freeTablesAt)(re,fe,A,new Date(`${F}T${e}:00`),(0,v.turnFor)(A,pe.turnMins),pe.turnMins,{dog:!0,closed:(0,k.closedAreasAt)(le,T.id,F,e)}),je=(0,c.bookingSlots)(T,ge,e=>ie.filter(t=>t.date===F&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),A,M).map(e=>{const t=(0,k.blockAt)(le,T.id,F,e.time),o=ce&&xe&&e.available&&!t&&(!ke(e.time).length||!(0,w.dogTimeOk)(T,ie,F,e.time,he));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),ve=je.some(e=>e.available),we=A>=pe.depositFromParty?'deposit':A>=pe.savedCardFromParty?'saved-card':'none',Se='deposit'===we?A*pe.depositPerHead:0,Ce=D.filter(e=>e.date===F),Te=(0,x.ukPhone)(H),Pe=(0,x.emailOk)(I),$e=(0,w.needsMissing)(de,P.allergies),De=!!N&&G&&!$e.length&&z.trim().length>1&&Te.ok&&Pe,Me=async()=>{const e=(0,w.needsPatch)(de,P.allergies),t=ce&&xe?ke(N).map(e=>e.table):[],o=ce?de.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await p.repo.bookings.create({restaurantId:T.id,customerId:P.id,name:z,partySize:A,date:F,time:N,notes:Y,security:we,depositPaid:Se,phone:Te.pretty,email:I.trim()||void 0,source:'online',...e,...je.find(e=>e.time===N)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??Z,...o?{table:o}:{}});te(!1),se(s)},Ae=(0,p.useStore)(e=>oe?e.bookings.find(e=>e.id===oe.id)?.ref:void 0),Be=e=>(0,y.waMeLink)(T.settings.whatsapp,(0,y.guestWhatsAppText)({name:e.name,ref:Ae??e.ref,date:e.date,time:e.time,partySize:e.partySize},T.name));if(oe){const e='pending'===oe.status;return(0,C.jsxs)(l.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:T.name,children:[(0,C.jsx)(l.Banner,{kind:e?'info':'success',title:`Reference ${Ae??oe.ref}`,children:`${oe.partySize} people \xb7 ${(0,h.niceDateYear)((0,h.parseYmd)(oe.date))} at ${oe.time}`}),e?(0,C.jsx)(l.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. We\u2019ll text you as soon as it\u2019s confirmed."}):null,(0,C.jsxs)(l.Card,{children:[(0,C.jsxs)(l.T,{children:["Name: ",oe.name]}),(0,C.jsxs)(l.T,{children:["Mobile: ",oe.phone]}),oe.email?(0,C.jsxs)(l.T,{children:["Email: ",oe.email]}):null,(0,C.jsxs)(l.T,{children:["Allergies shared with the restaurant: ",oe.allergies.length?oe.allergies.map(e=>`${(0,r.allergenLabel)(e.allergen)} (${(0,r.severityLabel)(e.severity)})`).join(', '):'none']}),oe.notes?(0,C.jsxs)(l.T,{children:["Notes: ",oe.notes]}):null,oe.dog?(0,C.jsxs)(l.T,{children:["\ud83d\udc15 Dog coming too",oe.table?` \xb7 dog-friendly table ${oe.table}`:'']}):null,oe.holds?.length?(0,C.jsxs)(l.T,{children:["Reserved: ",oe.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(T.settings.reservables??S.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,oe.tableReq?.length?(0,C.jsxs)(l.T,{children:["Table requested: ",oe.tableReq.map(e=>`T${e}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,(0,C.jsx)(l.T,{children:'deposit'===oe.security?`Deposit paid (demo): ${(0,u.gbp)(oe.depositPaid)} \u2014 taken off your bill`:'saved-card'===oe.security?`Card saved (demo). No-show fee ${(0,u.gbp)(pe.noShowFeePerHead)} per person applies.`:'No card needed.'}),(0,C.jsxs)(l.Muted,{children:[e?'A text':'A confirmation text',oe.email?' and email':''," to ",oe.phone," ",oe.email?'and your inbox ':'',"is ready. This pilot is in preview mode, so nothing is actually sent yet."]}),(0,C.jsxs)(l.Muted,{children:["Need to change or cancel? Call ",T.phone," and quote ",Ae??oe.ref,"."]})]}),Be(oe)?(0,C.jsxs)(n.default,{style:{gap:4},children:[(0,C.jsx)(l.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Be(oe);e&&(0,y.openWhatsApp)(e)}}),(0,C.jsx)(l.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,C.jsx)(l.Button,{label:"Back to restaurant",onPress:()=>o.router.replace(`/customer/${T.id}`)})]})}return(0,C.jsxs)(l.Screen,{title:"Book a table",subtitle:T.name,footer:(0,C.jsx)(l.Button,{label:$e.length?$e[0]:'deposit'===we?`Continue \u2014 deposit ${(0,u.gbp)(Se)}`:'saved-card'===we?'Continue \u2014 save a card':A>(pe.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!De,onPress:()=>'none'===we?Me():te(!0),testID:"confirm-booking"}),children:[(0,C.jsx)(w.FirstQuestions,{rid:T.id,value:de,onChange:e=>{e.dog===de.dog&&e.dogs===de.dogs||R(null),ue(e)},party:A,audience:"guest",profile:P.allergies}),(0,C.jsxs)(l.Card,{children:[(0,C.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,C.jsx)(l.H2,{children:"Party size"}),(0,C.jsx)(l.Stepper,{value:A,onChange:e=>{B(e),R(null)},min:1,max:16,label:"party size"})]}),'none'!==we?(0,C.jsx)(l.Banner,{kind:"info",title:'deposit'===we?`Parties of ${pe.depositFromParty}+ pay a deposit`:`Parties of ${pe.savedCardFromParty}+ save a card`,children:'deposit'===we?`${(0,u.gbp)(pe.depositPerHead)} per person, taken off the final bill (demo).`:`Only charged on a no-show: ${(0,u.gbp)(pe.noShowFeePerHead)} per person (demo policy).`}):(0,C.jsxs)(l.Muted,{children:["No card needed for tables under ",pe.savedCardFromParty,"."]}),A>(pe.autoAcceptUpTo??7)?(0,C.jsxs)(l.Muted,{children:["For ",A," people the team checks the booking first, then texts you to confirm."]}):null,ce&&xe?(0,C.jsxs)(l.Muted,{children:["Dogs are welcome in the ",ye.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",T.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,C.jsxs)(l.Card,{children:[(0,C.jsx)(l.H2,{children:"Date"}),(0,C.jsx)(l.Row,{wrap:!0,gap:6,children:me.map(e=>{const t=!!(0,d.hoursFor)(T,e),o=D.some(t=>t.date===(0,h.ymd)(e));return(0,C.jsx)(l.Chip,{label:(0,h.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:F===(0,h.ymd)(e),onPress:()=>{O((0,h.ymd)(e)),R(null)}},(0,h.ymd)(e))})}),Ce.map(e=>(0,C.jsx)(l.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,C.jsxs)(l.Card,{children:[(0,C.jsx)(l.H2,{children:"Time"}),0===je.length?(0,C.jsx)(l.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,C.jsx)(l.Row,{wrap:!0,gap:6,children:je.map(e=>(0,C.jsx)(l.Chip,{label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left<A?'Full':'\u2014',disabled:!e.available,selected:N===e.time,onPress:()=>R(e.time)},e.time))}),be.length>0&&je.some(e=>e.blocked)?(0,C.jsx)(l.Banner,{kind:"info",title:ve?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${be.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,h.niceDate)(ge)}. Please give us a ring on ${T.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,t.lastFoodOn)(T,F);return e&&je.some(e=>e.drinksOnly)?(0,C.jsx)(l.Banner,{kind:"info",title:`Last food orders ${(0,t.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ce&&je.some(e=>e.noDog)?(0,C.jsx)(l.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${ye.map(e=>e.name).join(' and ')}${T.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,k.closedAreasAt)(le,T.id,F,N??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,C.jsxs)(l.Muted,{children:["Times come from covers per slot (",pe.bookingCoversPerSlot," per half hour, example) and table rules."]})]}),(0,C.jsx)(w.MoreQuestions,{rid:T.id,r:T,value:de,onChange:ue,party:A,date:F,time:N,today:(0,h.ymd)(M),bookings:ie,audience:"guest",showTables:!0}),(0,C.jsxs)(l.Card,{highlight:G?void 0:f.colours.amber,children:[(0,C.jsx)(l.Field,{label:"Anything else? (optional)",value:Y,onChangeText:U,placeholder:"e.g. high chair, celebrating a birthday"}),(0,C.jsx)(l.Toggle,{label:"I confirm the allergy information for this booking",value:G,onChange:Q}),(0,C.jsx)(l.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,C.jsxs)(l.Card,{children:[(0,C.jsx)(l.H2,{children:"Your details"}),(0,C.jsx)(l.Field,{label:"Name for the booking",value:z,onChangeText:q}),(0,C.jsx)(l.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:H,onChangeText:W,onBlur:()=>L(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Te.ok||!_&&!H?null:(0,C.jsx)(l.T,{size:13,colour:f.colours.amber,children:Te.error}),(0,C.jsx)(l.Field,{testID:"book-email",label:"Email (optional)",value:I,onChangeText:E,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Pe?null:(0,C.jsx)(l.T,{size:13,colour:f.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,C.jsxs)(l.Muted,{children:["We\u2019ll text you a confirmation",I.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,C.jsx)(i.MockPay,{visible:ee,onClose:()=>te(!1),amount:'deposit'===we?Se:0,restaurantId:T.id,allowGiftCard:!1,allowSaveCardOnly:'saved-card'===we,title:'deposit'===we?'Pay deposit':'Save a card',onPaid:()=>Me()})]})}},759,[789,785,12,109,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,6]);
|
staff-app/_expo/static/js/web/entry-16d24b0817222185383fdee6e11e98a3.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/feedback-6dbe946e1675fb596c5c4cd508919819.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=_r(d[0]),a=_r(d[1]),s=_r(d[2]),n=_r(d[3]),r=_r(d[4]),o=_r(d[5]);const l=['Food','Service','Takeaway','Booking','Allergens','Something else'];function c(){const{rid:c}=(0,t.useLocalSearchParams)(),u=(0,r.useRestaurant)(c),h=(0,r.useCustomer)(),[p,b]=(0,a.useState)(0),[y,j]=(0,a.useState)('Food'),[x,v]=(0,a.useState)(''),[f,S]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1);return u?(0,o.jsxs)(s.Screen,{title:"Private feedback",subtitle:`Straight to the team at ${u.name}`,children:[w?(0,o.jsxs)(s.Banner,{kind:"success",title:"Thank you",children:["Your feedback went privately to ",u.name,". It is never published.",f?' They may reply by email (demo: nothing is sent).':'']}):null,w?(0,o.jsx)(s.Button,{kind:"secondary",label:"Send more feedback",onPress:()=>{k(!1),b(0),v('')}}):(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"How did we do?"}),(0,o.jsx)(n.Stars,{value:p,onChange:b}),(0,o.jsx)(s.T,{size:14,children:"What's it about?"}),(0,o.jsx)(s.Row,{wrap:!0,gap:6,children:l.map(t=>(0,o.jsx)(s.Chip,{label:t,selected:y===t,onPress:()=>j(t)},t))}),(0,o.jsx)(s.Field,{label:"Tell us more (optional)",value:x,onChangeText:v,multiline:!0,placeholder:"What went well, what could be better?"}),(0,o.jsx)(s.Chip,{label:f?'\u2713 Happy to be contacted':'Happy to be contacted?',selected:f,onPress:()=>S(!f)}),(0,o.jsx)(s.Button,{label:"Send privately",disabled:!p,onPress:()=>{r.repo.feedback.add({restaurantId:u.id,customerId:h.id,customerName:h.name,stars:p,comment:`${y}: ${x.trim()}${f?` (happy to be contacted: ${h.email})`:''}`,context:`App feedback \xb7 ${y}`}),k(!0)}})]}),(0,o.jsx)(s.Muted,{children:"Every rating, from 1 to 5 stars, goes the same way: privately to the restaurant. We never ask only happy guests to post a public review, and stamps or rewards are never given for reviews."})]}):(0,o.jsx)(s.Screen,{title:"Not found",children:(0,o.jsx)(s.T,{children:"Restaurant not found."})})}},761,[785,12,791,810,797,6]);
|
staff-app/_expo/static/js/web/index-290443ca5d64073e7ddab8a437bbbbfb.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return P}});var l=_r(_d[0]),t=_r(_d[1]),s=e(t);_r(_d[2]);var n=e(_r(_d[3])),o=e(_r(_d[4])),r=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]),m=_r(_d[13]),f=_r(_d[14]),y=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),k=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]);const O=['book','takeaway'].includes(w.START_GO??'')?w.START_GO:null;let A=!1;const T=[{id:'main',label:'Main menu'},{id:'specials',label:'Specials'},{id:'takeaway',label:'Takeaway'}];function P(){const{rid:e}=(0,l.useLocalSearchParams)(),w=(0,h.useRestaurant)(e),P=(0,h.useMenu)(e),B=(0,h.useCustomer)(),R=(0,h.useBasket)(),C=(0,h.useStore)(e=>e.startBasket),$=(0,h.useNow)(3e4),[I,M]=(0,t.useState)('All'),[v,N]=(0,t.useState)(null),[_,D]=(0,t.useState)(!1),[H,L]=(0,t.useState)(!1),[W,F]=(0,t.useState)('takeaway'===O?'takeaway':'main');s.default.useEffect(()=>{O&&!A&&(A=!0,'book'===O?setTimeout(()=>l.router.push(`/customer/${e}/book`),0):setTimeout(()=>{try{document.querySelector('[data-testid="menu-tabs"]')?.scrollIntoView({block:'start'})}catch{}},400))},[e]);const G=(0,j.useSpecials)(l=>l.current[e]??null),E=!!G&&(0,k.isToday)(G.postedAt,$),z=(0,y.useOwner)(e=>e.offers.filter(e=>e.live).length),K=(0,h.useStore)(l=>l.stampCards.find(t=>t.restaurantId===e&&t.customerId===l.customer.id)),Q=(0,h.useOrderAtTable)(e);if(s.default.useEffect(()=>{Q||R.restaurantId!==e||'table'!==R.mode||h.useStore.setState(e=>({basket:{...e.basket,mode:'takeaway',tableNo:void 0}}))},[Q,R.mode,R.restaurantId,e]),!w)return(0,S.jsx)(d.Screen,{title:"Not found",children:(0,S.jsx)(d.T,{children:"Restaurant not found."})});const V=Q&&R.restaurantId===w.id&&'table'===R.mode,Y=w.sections.length?w.sections:Array.from(new Set(P.map(e=>e.section))),q=e=>!(e.soldOut||!e.signOff||null===e.price),J=P.filter(e=>('All'===I||e.section===I)&&('takeaway'!==W||q(e))),U=(0,b.hoursFor)(w,$),X=e=>()=>l.router.push(`/customer/${w.id}${e}`),Z=[{icon:'\ud83e\udd61',label:'Takeaway',sub:'Order to collect',on:()=>{M('All'),F('takeaway'),V&&C(w.id,'takeaway')}},...Q?[{icon:'\ud83d\udcf1',label:'Order at table',sub:'Scan the QR',on:()=>L(!0)}]:[],{icon:'\ud83d\udcc5',label:'Book a table',on:X('/book')},{icon:'\u23f3',label:'Waitlist',sub:'Walk in',on:X('/waitlist')},{icon:'\u2b50',label:'Stamp card',sub:`${K?.stamps??0} of ${w.settings.stampTarget}`,on:X('/loyalty')},{icon:'\ud83e\udd1d',label:'Bring a friend',on:X('/refer')},{icon:'\ud83c\udf81',label:'Gift cards',on:X('/gift')},{icon:'\u26a0\ufe0f',label:'My allergens',sub:B.allergies.length?`${B.allergies.length} declared`:'None declared',on:()=>l.router.push('/customer/profile')},{icon:'\ud83c\udff7\ufe0f',label:'Offers',sub:B.marketingOptIn[w.id]?'Opted in':'Opt in',on:X('/offers'),badge:z?String(z):void 0},{icon:'\ud83c\udf89',label:"What's on",on:X('/whatson')},{icon:'\ud83d\udcac',label:'Feedback',sub:'Private',on:X('/feedback')},{icon:'\ud83e\udde3',label:'Lost property',on:X('/lost')},{icon:'\ud83d\udecd\ufe0f',label:'Shop',sub:'Merch',on:X('/merch')}];return(0,S.jsxs)(d.Screen,{title:w.name,subtitle:`${w.location}${w.phone?` \xb7 ${w.phone}`:''}`,back:'customer'!==f.APP_VARIANT,right:(0,S.jsxs)(d.Row,{children:[(0,S.jsx)(i.BasketButton,{}),(0,S.jsx)(d.Button,{small:!0,kind:"ghost",label:"Account",onPress:()=>l.router.push('/customer/profile')})]}),children:[w.fictional?(0,S.jsx)(d.Banner,{kind:"warn",title:"Fictional demo restaurant",children:"Shown only to demonstrate multi-restaurant support."}):null,V?(0,S.jsx)(d.Banner,{kind:"success",title:`Ordering at Table ${R.tableNo}`,children:"Your order goes straight to the kitchen. Pay and split the bill from your order page. A member of staff is always available \u2014 tap \u201cCall staff\u201d any time."}):(0,S.jsx)(d.Card,{children:(0,S.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsxs)(o.default,{style:{flex:1},children:[(0,S.jsx)(d.T,{weight:"semibold",children:"Takeaway \u2014 collection"}),(0,S.jsxs)(d.Muted,{children:[U?`Kitchen today ${(0,b.kitchenHoursOn)(w,$)[0]}\u2013${(0,b.kitchenHoursOn)(w,$)[1]}`:'Kitchen closed today',w.settings.takeawayPaused?' \xb7 slots paused by the restaurant':'']})]}),(0,S.jsx)(d.Badge,{kind:w.settings.takeawayPaused||!U?'amber':'green',label:w.settings.takeawayPaused?'Paused':U?'Taking orders':'Closed'})]})}),w.fictional?(0,S.jsx)(d.Row,{wrap:!0,gap:8,children:Z.slice(2,7).map(e=>(0,S.jsx)(d.Button,{small:!0,kind:"secondary",label:e.label,onPress:e.on},e.label))}):(0,S.jsx)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:Z.map(e=>(0,S.jsx)(m.HubTile,{icon:e.icon,label:e.label,sub:e.sub,badge:e.badge,onPress:e.on},e.label))}),V?(0,S.jsx)(d.Button,{small:!0,kind:"danger",label:"Call staff",onPress:()=>D(!0)}):null,_?(0,S.jsx)(d.Banner,{kind:"success",children:"A member of staff is on their way to your table (demo)."}):null,w.hoursNote?(0,S.jsx)(d.Muted,{children:w.hoursNote}):null,w.fictional?null:(0,S.jsx)(d.ExampleAllergenNotice,{}),(0,S.jsxs)(d.Muted,{children:["Menu dishes and prices from ",w.name,"\u2019s menu. Items marked \u26a0 conflict with your declared allergies."]}),(0,S.jsx)(o.default,{accessibilityRole:"tablist",testID:"menu-tabs",style:{flexDirection:'row',gap:6,backgroundColor:p.colours.surface,borderRadius:14,borderWidth:1,borderColor:p.colours.border,padding:4},children:T.map(e=>{const l=W===e.id;return(0,S.jsxs)(n.default,{testID:`menu-tab-${e.id}`,accessibilityRole:"tab",accessibilityState:{selected:l},"aria-selected":l,accessibilityLabel:'specials'===e.id&&E?'Specials, updated today':e.label,onPress:()=>F(e.id),style:{flex:1,minHeight:44,borderRadius:10,alignItems:'center',justifyContent:'center',paddingHorizontal:4,backgroundColor:l?p.colours.gold:'transparent'},children:[(0,S.jsx)(d.T,{size:14,weight:"semibold",colour:l?p.colours.onGold:p.colours.text,center:!0,children:e.label}),'specials'===e.id&&E&&!l?(0,S.jsx)(o.default,{style:{position:'absolute',top:6,right:8,width:7,height:7,borderRadius:4,backgroundColor:p.colours.gold}}):null]},e.id)})}),'specials'===W?(0,S.jsx)(x.SpecialsTab,{rid:w.id,declared:B.allergies,now:$}):null,'takeaway'===W?(0,S.jsx)(d.Muted,{children:"Order to collect. Only dishes available to order online are shown; pick a collection slot at checkout."}):null,'specials'!==W?(0,S.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,S.jsx)(d.Chip,{label:"All",selected:'All'===I,onPress:()=>M('All')}),Y.map(e=>(0,S.jsx)(d.Chip,{label:e,selected:I===e,onPress:()=>M(e)},e))]}):null,'specials'!==W?Y.filter(e=>('All'===I||e===I)&&J.some(l=>l.section===e)).map(e=>(0,S.jsxs)(o.default,{style:{gap:10},children:[(0,S.jsx)(d.H2,{style:{color:p.colours.gold,marginTop:6},children:e}),J.filter(l=>l.section===e).map(e=>{const t=(0,c.conflictsFor)(e.allergens,B.allergies),s=e.soldOut||!e.signOff||null===e.price;return(0,S.jsxs)(d.Card,{highlight:t.contains.length?p.colours.red:t.may.length?p.colours.amber:void 0,children:[(0,S.jsxs)(n.default,{accessibilityRole:"button",onPress:()=>{R.restaurantId&&R.restaurantId===w.id||C(w.id,'takeaway'),l.router.push(`/customer/${w.id}/dish/${e.id}`)},children:[(0,S.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,S.jsx)(d.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,S.jsx)(d.T,{weight:"semibold",colour:p.colours.gold,children:null===e.price?e.priceNote??'\u2014':(0,u.gbp)(e.price)})]}),(0,S.jsx)(d.Muted,{numberOfLines:2,children:e.description})]}),(0,S.jsxs)(d.Row,{wrap:!0,gap:6,children:[e.dietary.map(e=>(0,S.jsx)(d.Badge,{kind:"green",label:e},e)),e.special?(0,S.jsx)(d.Badge,{kind:"gold",label:"Special"}):null,e.soldOut?(0,S.jsx)(d.Badge,{kind:"neutral",label:"Sold out"}):null,e.signOff?null:(0,S.jsx)(d.Badge,{kind:"amber",label:"Awaiting allergen sign-off"}),t.contains.length?(0,S.jsx)(d.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):t.may.length?(0,S.jsx)(d.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null]}),(0,S.jsx)(r.AllergenChips,{map:e.allergens,declared:B.allergies}),v===e.id?(0,S.jsx)(r.AllergenPanel,{item:e,map:e.allergens,declared:B.allergies}):null,(0,S.jsxs)(d.Row,{gap:8,children:[(0,S.jsx)(d.Button,{small:!0,kind:"ghost",label:v===e.id?'Hide allergen panel':'Allergen panel',onPress:()=>N(v===e.id?null:e.id)}),(0,S.jsx)(o.default,{style:{flex:1}}),(0,S.jsx)(d.Button,{small:!0,label:s?e.soldOut?'Sold out':'Not available online':'Choose',disabled:s,onPress:()=>{R.restaurantId&&R.restaurantId===w.id||C(w.id,'takeaway'),l.router.push(`/customer/${w.id}/dish/${e.id}`)}})]})]},e.id)})]},e)):null,(0,S.jsx)(d.Muted,{children:"Drinks list coming soon. Ask your server for today\u2019s drinks."}),(0,S.jsx)(d.Muted,{children:"All payments in this app are demo only: Demo, no real payment."}),(0,S.jsx)(m.LauncherLine,{}),Q?(0,S.jsxs)(d.Sheet,{visible:H,onClose:()=>L(!1),title:"Order at your table",children:[(0,S.jsx)(d.Muted,{children:"Scan the QR code on your table with your phone camera, or pick your table number (demo)."}),(0,S.jsx)(d.Row,{wrap:!0,gap:6,children:Array.from({length:12},(e,l)=>String(l+1)).map(e=>(0,S.jsx)(d.Button,{small:!0,kind:"secondary",label:`Table ${e}`,onPress:()=>{L(!1),C(w.id,'table',e)}},e))}),(0,S.jsx)(d.Muted,{children:"Orders go straight to the kitchen. You pay from your order page (Demo, no real payment)."})]}):null]})}},763,[785,12,104,245,109,807,808,791,792,794,793,797,799,813,787,814,811,815,816,817,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"photoSource",{enumerable:!0,get:function(){return C}}),_e.BoardPhoto=T,_e.PhotoZoom=k,_e.SpecialRow=M,_e.SpecialsTab=function({rid:e,declared:s,now:l}){const n=(0,p.useSpecials)(t=>t.current[e]??null),[o,u]=(0,t.useState)(null);if(!n)return(0,b.jsx)(h.Card,{children:(0,b.jsxs)(c.default,{testID:"specials-empty",style:{alignItems:'center',gap:6,paddingVertical:18},children:[(0,b.jsx)(h.T,{size:34,children:"\ud83e\uddd1\u200d\ud83c\udf73"}),(0,b.jsx)(h.T,{weight:"semibold",size:18,center:!0,children:"Today\u2019s specials are on their way"}),(0,b.jsx)(h.Muted,{center:!0,children:"The kitchen posts the specials board here as soon as it\u2019s written up. Check back soon, or ask a member of staff."})]})});const f=n.allergenCheck;return(0,b.jsxs)(c.default,{style:{gap:10},testID:"specials-tab",children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsx)(c.default,{testID:"specials-updated",style:{flex:1},children:(0,b.jsx)(h.T,{weight:"semibold",colour:j.colours.goldLight,children:(0,x.freshness)(n,l)})}),(0,x.isToday)(n.postedAt,l)?(0,b.jsx)(h.Badge,{kind:"green",label:"Today"}):(0,b.jsx)(h.Badge,{kind:"amber",label:"Not updated today"})]}),(0,x.isToday)(n.postedAt,l)?null:(0,b.jsx)(h.Muted,{children:"These are the most recent specials posted. Today\u2019s may differ, so please ask."}),n.photo?(0,b.jsxs)(c.default,{style:{gap:4},children:[(0,b.jsx)(T,{photo:n.photo,testID:"specials-photo",onPress:()=>u(n.photo)}),(0,b.jsx)(h.Muted,{center:!0,children:"Tap the photo to zoom"})]}):null,n.items.map(e=>(0,b.jsx)(M,{it:e,declared:s,signedBy:f?.by},e.id)),f?(0,b.jsxs)(h.Muted,{children:["Allergens for the typed specials were checked by ",f.by.replace(' (example)','')," at ",(0,y.hm)(new Date(f.at)),". Example data in this prototype."]}):null,n.photo&&!n.items.length?(0,b.jsx)(h.Muted,{children:"For allergens in these specials, please ask a member of staff before you order."}):null,(0,b.jsx)(h.Muted,{children:"Specials are served in the restaurant while they last. Ask your server to order one."}),(0,b.jsx)(k,{photo:o,onClose:()=>u(null)})]})};var t=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),n=e(r(d[3])),o=e(r(d[4])),c=e(r(d[5])),u=r(d[6]),h=r(d[7]),p=r(d[8]),f=r(d[9]),x=r(d[10]),y=r(d[11]),j=r(d[12]),b=r(d[13]);const w=r(d[14]),C=e=>e===x.SAMPLE_PHOTO?w:{uri:e};function T({photo:e,width:l,onPress:o,testID:u,label:h="Photo of the specials board"}){const[p,f]=(0,t.useState)(.75);(0,t.useEffect)(()=>{e!==x.SAMPLE_PHOTO?s.default.getSize(e,(e,t)=>e&&t&&f(e/t),()=>{}):f(.75)},[e]);const y=(0,b.jsx)(s.default,{source:C(e),resizeMode:"contain",accessibilityLabel:h,style:{width:l??'100%',aspectRatio:p,borderRadius:12,backgroundColor:'#1b1f1d'}});return o?(0,b.jsx)(n.default,{testID:u,accessibilityRole:"button",accessibilityLabel:`${h}. Tap to zoom`,onPress:o,children:y}):(0,b.jsx)(c.default,{testID:u,children:y})}function k({photo:e,onClose:s}){const[u,p]=(0,t.useState)(!1);return(0,t.useEffect)(()=>p(!1),[e]),(0,b.jsx)(l.default,{visible:!!e,transparent:!0,animationType:"fade",onRequestClose:s,children:(0,b.jsxs)(c.default,{testID:"specials-zoom",style:{flex:1,backgroundColor:'rgba(5,5,5,0.97)'},children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between',padding:12},children:[(0,b.jsx)(h.Button,{small:!0,kind:"secondary",label:u?'Zoom out':'Zoom in',onPress:()=>p(!u)}),(0,b.jsx)(h.Button,{small:!0,label:"Close",accessibilityLabel:"Close photo",onPress:s})]}),(0,b.jsx)(o.default,{horizontal:u,contentContainerStyle:{padding:12,alignItems:'center',justifyContent:'center',flexGrow:1},children:(0,b.jsx)(o.default,{contentContainerStyle:{alignItems:'center'},children:e?(0,b.jsx)(n.default,{onPress:()=>p(!u),accessibilityLabel:u?'Zoom out':'Zoom in',children:(0,b.jsx)(T,{photo:e,width:u?820:360})}):null})})]})})}function M({it:e,declared:t,signedBy:s}){const l=(0,f.conflictsFor)(e.allergens,t);return(0,b.jsx)(h.Card,{highlight:l.contains.length?j.colours.red:l.may.length?j.colours.amber:void 0,children:(0,b.jsxs)(c.default,{testID:"special-item",style:{gap:6},children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,b.jsx)(h.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,b.jsx)(h.T,{weight:"semibold",colour:j.colours.gold,children:(0,x.priceText)(e.price)})]}),e.description?(0,b.jsx)(h.Muted,{children:e.description}):null,l.contains.length?(0,b.jsx)(h.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):l.may.length?(0,b.jsx)(h.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null,e.noAllergens&&!Object.keys(e.allergens).length?(0,b.jsx)(h.Muted,{children:"None of the 14 allergens listed"}):(0,b.jsx)(u.AllergenChips,{map:e.allergens,declared:t}),s?(0,b.jsxs)(h.Muted,{children:["Allergens checked by ",s.replace(' (example)','')]}):null]})})}},811,[12,178,238,245,133,109,807,791,815,792,816,796,799,6,812]);
|
| 3 |
+
__d(function(g,r,i,a,m,e,d){"use strict";m.exports={uri:"/staff-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg",width:900,height:1200,toString(){return this.uri}}},812,[]);
|
staff-app/_expo/static/js/web/index-31f5cb0976e95a627a66d3e2c4d7279e.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/index-3c853b36d880be5dea66261a8f87ff95.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e=_r(d[0]);_r(d[1]);var r,s=_r(d[2]),n=(r=s)&&r.__esModule?r:{default:r},t=_r(d[3]),l=_r(d[4]),o=_r(d[5]),a=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),j=_r(d[10]),x=_r(d[11]);function f(){const r=(0,u.useStore)(e=>e.restaurants),s=(0,u.useCustomer)(),f=(0,u.useNow)(3e4);return(0,x.jsxs)(l.Screen,{title:"Restaurants",subtitle:"Book, order and pay at local restaurants",right:(0,x.jsxs)(l.Row,{children:[(0,x.jsx)(t.BasketButton,{}),(0,x.jsx)(l.Button,{small:!0,kind:"ghost",label:"Profile",onPress:()=>e.router.push('/customer/profile')})]}),children:[(0,x.jsxs)(l.Card,{onPress:()=>e.router.push('/customer/profile'),children:[(0,x.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsxs)(l.T,{weight:"semibold",children:["Hello, ",s.name.split(' ')[0]]}),(0,x.jsx)(l.Muted,{children:"Edit profile \u203a"})]}),(0,x.jsx)(l.Muted,{children:"Your allergies (stored once, confirmed on every order and booking):"}),(0,x.jsx)(l.Row,{wrap:!0,gap:6,children:s.allergies.length?s.allergies.map(e=>(0,x.jsx)(l.Badge,{kind:"red",label:`${(0,o.allergenLabel)(e.allergen)} \u2014 ${(0,o.severityLabel)(e.severity)}`},e.allergen)):(0,x.jsx)(l.Muted,{children:"None declared"})})]}),r.map(r=>{const s=(0,a.hoursFor)(r,f);return(0,x.jsxs)(l.Card,{onPress:()=>e.router.push(`/customer/${r.id}`),highlight:r.id===j.VENUE_RID?c.colours.gold:void 0,children:[(0,x.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,x.jsx)(l.H2,{style:{flex:1},children:r.name}),r.fictional?(0,x.jsx)(l.Badge,{kind:"amber",label:"FICTIONAL DEMO"}):(0,x.jsx)(l.Badge,{kind:"gold",label:"PILOT"})]}),(0,x.jsx)(l.Muted,{children:r.tagline}),(0,x.jsx)(l.Muted,{children:r.location}),(0,x.jsx)(l.T,{size:14,colour:s?c.colours.green:c.colours.amber,children:s?`Kitchen today ${(0,a.kitchenHoursOn)(r,f)[0]}\u2013${(0,a.kitchenHoursOn)(r,f)[1]}`:'Kitchen closed today (hours not listed)'})]},r.id)}),(0,x.jsx)(l.Banner,{kind:"info",children:"Each restaurant has its own menu, stamp card and gift cards. The Venue and Brae Bakehouse are fictional demo venues."}),(0,x.jsx)(h.LauncherLine,{}),(0,x.jsx)(n.default,{style:{height:8}})]})}},772,[785,12,109,808,791,792,793,797,799,813,857,6]);
|
staff-app/_expo/static/js/web/index-9eb8c7acf25af76b6df08b2c1d3e0564.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return'owner'!==u.APP_VARIANT?(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]}):(0,c.jsx)(n.OwnerApp,{})}},780,[785,12,901,787,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OwnerApp=function(){return null}},901,[]);
|
staff-app/_expo/static/js/web/index-f92d197c1fe113b3fa2d8402c42f163d.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/lost-1e6398f6494d3015c150145cf234acff.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),r=_r(d[3]),l=_r(d[4]),o=_r(d[5]);function u(){const{rid:u}=(0,t.useLocalSearchParams)(),h=(0,r.useRestaurant)(u),c=(0,r.useCustomer)(),x=(0,r.useNow)(6e4),j=(0,l.useOwner)(t=>t.lost),p=(0,l.useOwner)(t=>t.lostReports),[f,w]=(0,n.useState)(''),[y,b]=(0,n.useState)(''),[S,C]=(0,n.useState)(''),[R,O]=(0,n.useState)(!1);if(!h)return(0,o.jsx)(s.Screen,{title:"Not found",children:(0,o.jsx)(s.T,{children:"Restaurant not found."})});const T=p.filter(t=>t.contact.includes(c.email));return(0,o.jsxs)(s.Screen,{title:"Lost property",subtitle:h.name,children:[(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Recently handed in"}),j.filter(t=>'held'===t.status).map(t=>(0,o.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,o.jsx)(s.T,{style:{flex:1},children:t.item}),(0,o.jsx)(s.Muted,{children:t.foundAt.slice(0,10)})]},t.id)),j.some(t=>'held'===t.status)?null:(0,o.jsx)(s.Muted,{children:"Nothing handed in right now."}),(0,o.jsx)(s.Muted,{children:"To collect, bring ID or describe the item to staff. Items are kept for 3 months."})]}),R?(0,o.jsxs)(s.Banner,{kind:"success",children:["Report sent to ",h.name,". They'll be in touch if it turns up (demo: nothing is sent)."]}):null,(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Lost something?"}),(0,o.jsx)(s.Field,{label:"What did you lose?",value:f,onChangeText:w,placeholder:"e.g. Grey scarf"}),(0,o.jsx)(s.Field,{label:"When were you in?",value:y,onChangeText:b,placeholder:"e.g. Saturday evening"}),(0,o.jsx)(s.Field,{label:"Where were you sitting? (optional)",value:S,onChangeText:C,placeholder:"e.g. By the window"}),(0,o.jsxs)(s.Muted,{children:["We'll share your name and email (",c.email,") with ",h.name," for this report only."]}),(0,o.jsx)(s.Button,{label:"Send report",disabled:f.trim().length<2||y.trim().length<2,onPress:()=>{l.useOwner.getState().setOwner({lostReports:[{id:`lr-${Date.now()}`,item:f.trim(),when:y.trim(),where:S.trim()||'Not sure',contact:`${c.name} \xb7 ${c.email}`,at:x.toISOString(),status:'open'},...l.useOwner.getState().lostReports]}),w(''),b(''),C(''),O(!0)}})]}),T.length?(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Your reports"}),T.map(t=>(0,o.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,o.jsxs)(s.T,{style:{flex:1},children:[t.item," \xb7 ",t.when]}),(0,o.jsx)(s.Badge,{kind:'matched'===t.status?'green':'open'===t.status?'amber':'neutral',label:'matched'===t.status?'Found!':'open'===t.status?'Looking':'Closed'})]},t.id))]}):null]})}},764,[785,12,791,797,814,6]);
|
staff-app/_expo/static/js/web/loyalty-1983afbe0d08f311ef01775598cdda6e.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var e=_r(d[0]);_r(d[1]);var r,s=_r(d[2]),t=(r=s)&&r.__esModule?r:{default:r},i=_r(d[3]),n=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]);function h(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r),h=(0,l.useCustomer)(),p=(0,l.useStampCard)(r);if(!s)return(0,u.jsx)(n.Screen,{title:"Not found",children:(0,u.jsx)(n.T,{children:"Restaurant not found."})});const f=s.settings.stampTarget,j=p?.stamps??0;return(0,u.jsxs)(n.Screen,{title:"Stamp card",subtitle:`${s.name} \u2014 this card is just for ${s.name}`,children:[(0,u.jsxs)(n.Card,{highlight:c.colours.gold,children:[(0,u.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(n.H2,{children:[j," of ",f," stamps"]}),(0,u.jsxs)(n.T,{colour:c.colours.gold,weight:"semibold",children:["Reward: ",s.settings.stampReward]})]}),(0,u.jsx)(t.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:10,justifyContent:'center',paddingVertical:8},children:Array.from({length:f}).map((e,r)=>(0,u.jsx)(t.default,{accessibilityLabel:r<j?'Stamp collected':'Empty stamp',style:{width:52,height:52,borderRadius:26,borderWidth:2,borderColor:c.colours.gold,backgroundColor:r<j?c.colours.gold:'transparent',alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(n.T,{size:22,colour:r<j?c.colours.onGold:c.colours.border,children:"\u2605"})},r))}),(0,u.jsxs)(n.Muted,{children:["One stamp per paid visit or order over ",(0,o.gbp)(s.settings.stampMinSpend)," \u2014 dine-in, table QR or takeaway. Rewards are funded by ",s.name,"."]}),p?.rewardsAvailable?(0,u.jsx)(n.Banner,{kind:"success",title:`${p.rewardsAvailable} reward${p.rewardsAvailable>1?'s':''} ready: ${s.settings.stampReward}`,children:(0,u.jsx)(n.Button,{small:!0,label:"Use reward (show staff)",onPress:()=>l.repo.loyalty.redeemReward(s.id,h.id)})}):null]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Show this to staff"}),(0,u.jsx)(n.Muted,{children:"Staff scan this on the tablet to add a stamp for dine-in visits not paid by table QR."}),(0,u.jsx)(i.QR,{value:`covercharge:stamp:${s.id}:${h.id}`,size:190}),(0,u.jsx)(n.T,{center:!0,weight:"semibold",children:h.name})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Bring a friend"}),(0,u.jsx)(n.T,{children:"Your referral code"}),(0,u.jsx)(n.T,{size:28,weight:"bold",colour:c.colours.gold,center:!0,children:h.referralCode}),(0,u.jsx)(n.Muted,{children:"When a friend completes their first qualifying paid visit or order, you both get a stamp. One referral reward per new account, phone and card; monthly cap applies."})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"History"}),(p?.history??[]).length?p.history.slice(0,10).map((e,r)=>(0,u.jsxs)(n.Muted,{children:[e.at.slice(0,10)," \xb7 ",e.source]},r)):(0,u.jsx)(n.Muted,{children:"No stamps yet."})]}),(0,u.jsx)(n.Muted,{children:"Rewards are kept on food (Scottish licensing rules restrict drinks promotions). Stamps are never given for reviews."})]})}},765,[785,12,109,818,791,794,797,799,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.QR=function({value:e,size:t=180}){return(0,n.jsx)(o.default,{style:{padding:12,backgroundColor:'#FFFFFF',borderRadius:12,alignSelf:'center',borderWidth:3,borderColor:u.colours.gold},children:(0,n.jsx)(l.default,{value:e,size:t,color:"#0B0B0B",backgroundColor:"#FFFFFF"})})},r(d[0]);var o=e(r(d[1])),l=e(r(d[2])),u=r(d[3]),n=r(d[4])},818,[12,109,819,799,6]);
|
| 3 |
+
__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 u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},819,[820]);
|
| 4 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function o(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e=r(d[0]),t=r(d[1]),l=o(t),s=o(r(d[2])),n=o(r(d[3])),c=o(r(d[4])),h=r(d[5]);const u=({size:o,backgroundColor:e,logo:l,logoSVG:s,logoSize:n,logoBackgroundColor:u,logoColor:x,logoMargin:f,logoBorderRadius:p,clipPathId:j})=>{const C=(o-n-2*f)/2,y=n+2*f,b=p+f/n*p,k=`clip-logo-background-${j}`,G=`clip-logo-${j}`;return(0,h.jsxs)(t.G,{x:C,y:C,children:[(0,h.jsxs)(t.Defs,{children:[(0,h.jsx)(t.ClipPath,{id:k,children:(0,h.jsx)(t.Rect,{width:y,height:y,rx:b,ry:b})}),(0,h.jsx)(t.ClipPath,{id:G,children:(0,h.jsx)(t.Rect,{width:n,height:n,rx:p,ry:p})})]}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Rect,{width:y,height:y,fill:e,clipPath:`url(#${k})`})}),(0,h.jsxs)(t.G,{x:f,y:f,clipPath:`url(#${G})`,children:[(0,h.jsx)(t.Rect,{width:y-f,height:y-f,fill:u}),s?(0,h.jsx)(c.default,{svg:s,logoSize:n,logoColor:x}):(0,h.jsx)(t.Image,{width:n,height:n,preserveAspectRatio:"xMidYMid slice",href:l,clipPath:`url(#${G})`})]})]})};var x=({value:o="this is a QR code",size:c=100,color:x="black",backgroundColor:f="white",logo:p,logoSVG:j,logoSize:C=.2*c,logoBackgroundColor:y="transparent",logoColor:b,logoMargin:k=2,logoBorderRadius:G=0,quietZone:R=0,enableLinearGradient:w=!1,gradientDirection:P=['0%','0%','100%','100%'],linearGradient:S=['rgb(255,0,0)','rgb(0,255,255)'],ecl:M="M",getRef:z,onError:v,testID:B})=>{const I=(0,e.useId)(),_=(0,e.useMemo)(()=>{try{return(0,n.default)((0,s.default)(o,M),c)}catch(o){if(!v||'function'!=typeof v)throw o;v(o)}},[o,c,M]);if(!_)return null;const{path:D,cellSize:$}=_,O=p||j;return(0,h.jsxs)(l.default,{testID:B,ref:z,viewBox:[-R,-R,c+2*R,c+2*R].join(' '),width:c,height:c,children:[(0,h.jsx)(t.Defs,{children:(0,h.jsxs)(t.LinearGradient,{id:"grad",x1:P[0],y1:P[1],x2:P[2],y2:P[3],children:[(0,h.jsx)(t.Stop,{offset:"0",stopColor:S[0],stopOpacity:"1"}),(0,h.jsx)(t.Stop,{offset:"1",stopColor:S[1],stopOpacity:"1"})]})}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Rect,{x:-R,y:-R,width:c+2*R,height:c+2*R,fill:f})}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Path,{d:D,strokeLinecap:"butt",stroke:w?'url(#grad)':x,strokeWidth:$})}),O&&u({size:c,backgroundColor:f,logo:p,logoSVG:j,logoSize:C,logoBackgroundColor:y,logoColor:b,logoMargin:k,logoBorderRadius:G,clipPathId:I})]})}},820,[12,853,821,850,851,6]);
|
| 5 |
+
__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 e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},l=(e,t)=>{const l=Array.prototype.slice.call(u.default.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(l.length);return l.reduce((e,t,u)=>(u%n===0?e.push([t]):e[e.length-1].push(t))&&e,[])}},821,[822]);
|
| 6 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]),e=r(d[2]),o=r(d[3]);function c(e,o,c,l,u){const f=[].slice.call(arguments,1),s=f.length,v='function'==typeof f[s-1];if(!v&&!t())throw new Error('Callback required as last argument');if(!v){if(s<1)throw new Error('Too few arguments provided');return 1===s?(c=o,o=l=void 0):2!==s||o.getContext||(l=c,c=o,o=void 0),new Promise(function(t,u){try{const u=n.create(c,l);t(e(u,o,l))}catch(t){u(t)}})}if(s<2)throw new Error('Too few arguments provided');2===s?(u=c,c=o,o=l=void 0):3===s&&(o.getContext&&void 0===u?(u=l,l=void 0):(u=l,l=c,c=o,o=void 0));try{const t=n.create(c,l);u(null,e(t,o,l))}catch(t){u(t)}}_e.create=n.create,_e.toCanvas=c.bind(null,e.render),_e.toDataURL=c.bind(null,e.renderToDataURL),_e.toString=c.bind(null,function(t,n,e){return o.render(t,e)})},822,[823,824,847,849]);
|
| 7 |
+
__d(function(g,r,i,a,m,e,d){m.exports=function(){return'function'==typeof Promise&&Promise.prototype&&Promise.prototype.then}},823,[]);
|
| 8 |
+
__d(function(g,_r,_i,a,m,e,d){const t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),s=_r(d[4]),i=_r(d[5]),f=_r(d[6]),c=_r(d[7]),l=_r(d[8]),u=_r(d[9]),h=_r(d[10]),w=_r(d[11]),C=_r(d[12]);function y(t,o){const n=t.size,r=i.getPositions(o);for(let o=0;o<r.length;o++){const s=r[o][0],i=r[o][1];for(let o=-1;o<=7;o++)if(!(s+o<=-1||n<=s+o))for(let r=-1;r<=7;r++)i+r<=-1||n<=i+r||(o>=0&&o<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===o||6===o)||o>=2&&o<=4&&r>=2&&r<=4?t.set(s+o,i+r,!0,!0):t.set(s+o,i+r,!1,!0))}}function S(t){const o=t.size;for(let n=8;n<o-8;n++){const o=n%2==0;t.set(n,6,o,!0),t.set(6,n,o,!0)}}function p(t,o){const n=s.getPositions(o);for(let o=0;o<n.length;o++){const r=n[o][0],s=n[o][1];for(let o=-2;o<=2;o++)for(let n=-2;n<=2;n++)-2===o||2===o||-2===n||2===n||0===o&&0===n?t.set(r+o,s+n,!0,!0):t.set(r+o,s+n,!1,!0)}}function v(t,o){const n=t.size,r=u.getEncodedBits(o);let s,i,f;for(let o=0;o<18;o++)s=Math.floor(o/3),i=o%3+n-8-3,f=1==(r>>o&1),t.set(s,i,f,!0),t.set(i,s,f,!0)}function B(t,o,n){const r=t.size,s=h.getEncodedBits(o,n);let i,f;for(i=0;i<15;i++)f=1==(s>>i&1),i<6?t.set(i,8,f,!0):i<8?t.set(i+1,8,f,!0):t.set(r-15+i,8,f,!0),i<8?t.set(8,r-i-1,f,!0):i<9?t.set(8,15-i-1+1,f,!0):t.set(8,15-i-1,f,!0);t.set(r-8,8,1,!0)}function b(t,o){const n=t.size;let r=-1,s=n-1,i=7,f=0;for(let c=n-1;c>0;c-=2)for(6===c&&c--;;){for(let n=0;n<2;n++)if(!t.isReserved(s,c-n)){let r=!1;f<o.length&&(r=1==(o[f]>>>i&1)),t.set(s,c-n,r),i--,-1===i&&(f++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function M(o,r,s){const i=new n;s.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),w.getCharCountIndicator(t.mode,o)),t.write(i)});const f=8*(t.getSymbolTotalCodewords(o)-c.getTotalCodewordsCount(o,r));for(i.getLengthInBits()+4<=f&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const l=(f-i.getLengthInBits())/8;for(let t=0;t<l;t++)i.put(t%2?17:236,8);return I(i,o,r)}function I(o,n,r){const s=t.getSymbolTotalCodewords(n),i=s-c.getTotalCodewordsCount(n,r),f=c.getBlocksCount(n,r),u=f-s%f,h=Math.floor(s/f),w=Math.floor(i/f),C=w+1,y=h-w,S=new l(y);let p=0;const v=new Array(f),B=new Array(f);let b=0;const M=new Uint8Array(o.buffer);for(let t=0;t<f;t++){const o=t<u?w:C;v[t]=M.slice(p,p+o),B[t]=S.encode(v[t]),p+=o,b=Math.max(b,o)}const I=new Uint8Array(s);let A,E,T=0;for(A=0;A<b;A++)for(E=0;E<f;E++)A<v[E].length&&(I[T++]=v[E][A]);for(A=0;A<y;A++)for(E=0;E<f;E++)I[T++]=B[E][A];return I}function A(o,n,s,i){let c;if(Array.isArray(o))c=C.fromArray(o);else{if('string'!=typeof o)throw new Error('Invalid data');{let t=n;if(!t){const n=C.rawSplit(o);t=u.getBestVersionForData(n,s)}c=C.fromString(o,t||40)}}const l=u.getBestVersionForData(c,s);if(!l)throw new Error('The amount of data is too big to be stored in a QR Code');if(n){if(n<l)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+l+'.\n')}else n=l;const h=M(n,s,c),w=t.getSymbolSize(n),I=new r(w);return y(I,n),S(I),p(I,n),B(I,s,0),n>=7&&v(I,n),b(I,h),isNaN(i)&&(i=f.getBestMask(I,B.bind(null,I,s))),f.applyMask(i,I),B(I,s,i),{modules:I,version:n,errorCorrectionLevel:s,maskPattern:i,segments:c}}e.create=function(n,r){if(void 0===n||''===n)throw new Error('No input text');let s,i,c=o.M;return void 0!==r&&(c=o.from(r.errorCorrectionLevel,o.M),s=u.from(r.version),i=f.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),A(n,s,c,i)}},824,[825,826,827,828,829,830,831,832,833,836,840,837,841]);
|
| 9 |
+
__d(function(g,r,i,a,m,e,d){let n;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return 4*n+17},e.getSymbolTotalCodewords=function(n){return o[n]},e.getBCHDigit=function(n){let o=0;for(;0!==n;)o++,n>>>=1;return o},e.setToSJISFunction=function(o){if('function'!=typeof o)throw new Error('"toSJISFunc" is not a valid function.');n=o},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(o){return n(o)}},825,[]);
|
| 10 |
+
__d(function(g,r,i,a,m,_e,d){function t(t){if('string'!=typeof t)throw new Error('Param is not a string');switch(t.toLowerCase()){case'l':case'low':return _e.L;case'm':case'medium':return _e.M;case'q':case'quartile':return _e.Q;case'h':case'high':return _e.H;default:throw new Error('Unknown EC Level: '+t)}}_e.L={bit:1},_e.M={bit:0},_e.Q={bit:3},_e.H={bit:2},_e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},_e.from=function(e,n){if(_e.isValid(e))return e;try{return t(e)}catch(t){return n}}},826,[]);
|
| 11 |
+
__d(function(g,r,_i,a,m,e,d){function t(){this.buffer=[],this.length=0}t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let h=0;h<n;h++)this.putBit(1==(t>>>n-h-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},m.exports=t},827,[]);
|
| 12 |
+
__d(function(g,r,i,a,m,e,d){function t(t){if(!t||t<1)throw new Error('BitMatrix size must be defined and greater than 0');this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}t.prototype.set=function(t,s,n,o){const h=t*this.size+s;this.data[h]=n,o&&(this.reservedBit[h]=!0)},t.prototype.get=function(t,s){return this.data[t*this.size+s]},t.prototype.xor=function(t,s,n){this.data[t*this.size+s]^=n},t.prototype.isReserved=function(t,s){return this.reservedBit[t*this.size+s]},m.exports=t},828,[]);
|
| 13 |
+
__d(function(g,r,_i,a,m,e,d){const o=r(d[0]).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,s=o(t),l=145===s?26:2*Math.ceil((s-13)/(2*n-2)),f=[s-7];for(let o=1;o<n-1;o++)f[o]=f[o-1]-l;return f.push(6),f.reverse()},e.getPositions=function(o){const t=[],n=e.getRowColCoords(o),s=n.length;for(let o=0;o<s;o++)for(let l=0;l<s;l++)0===o&&0===l||0===o&&l===s-1||o===s-1&&0===l||t.push([n[o],n[l]]);return t}},829,[825]);
|
| 14 |
+
__d(function(g,r,i,a,m,e,d){const n=r(d[0]).getSymbolSize;e.getPositions=function(t){const o=n(t);return[[0,0],[o-7,0],[0,o-7]]}},830,[825]);
|
| 15 |
+
__d(function(g,r,_i,a,m,e,d){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,s=40,l=10;function o(t,n,s){switch(t){case e.Patterns.PATTERN000:return(n+s)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return s%3==0;case e.Patterns.PATTERN011:return(n+s)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2==0;case e.Patterns.PATTERN101:return n*s%2+n*s%3==0;case e.Patterns.PATTERN110:return(n*s%2+n*s%3)%2==0;case e.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2==0;default:throw new Error('bad maskPattern:'+t)}}e.isValid=function(t){return null!=t&&''!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(n){const s=n.size;let l=0,o=0,P=0,T=null,c=null;for(let u=0;u<s;u++){o=P=0,T=c=null;for(let N=0;N<s;N++){let s=n.get(u,N);s===T?o++:(o>=5&&(l+=t+(o-5)),T=s,o=1),s=n.get(N,u),s===c?P++:(P>=5&&(l+=t+(P-5)),c=s,P=1)}o>=5&&(l+=t+(o-5)),P>=5&&(l+=t+(P-5))}return l},e.getPenaltyN2=function(t){const s=t.size;let l=0;for(let n=0;n<s-1;n++)for(let o=0;o<s-1;o++){const s=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==s&&0!==s||l++}return l*n},e.getPenaltyN3=function(t){const n=t.size;let l=0,o=0,P=0;for(let s=0;s<n;s++){o=P=0;for(let T=0;T<n;T++)o=o<<1&2047|t.get(s,T),T>=10&&(1488===o||93===o)&&l++,P=P<<1&2047|t.get(T,s),T>=10&&(1488===P||93===P)&&l++}return l*s},e.getPenaltyN4=function(t){let n=0;const s=t.data.length;for(let l=0;l<s;l++)n+=t.data[l];return Math.abs(Math.ceil(100*n/s/5)-10)*l},e.applyMask=function(t,n){const s=n.size;for(let l=0;l<s;l++)for(let P=0;P<s;P++)n.isReserved(P,l)||n.xor(P,l,o(t,P,l))},e.getBestMask=function(t,n){const s=Object.keys(e.Patterns).length;let l=0,o=1/0;for(let P=0;P<s;P++){n(P),e.applyMask(P,t);const s=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(P,t),s<o&&(o=s,l=P)}return l}},831,[]);
|
| 16 |
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],u=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(u,c){switch(c){case t.L:return n[4*(u-1)+0];case t.M:return n[4*(u-1)+1];case t.Q:return n[4*(u-1)+2];case t.H:return n[4*(u-1)+3];default:return}},e.getTotalCodewordsCount=function(n,c){switch(c){case t.L:return u[4*(n-1)+0];case t.M:return u[4*(n-1)+1];case t.Q:return u[4*(n-1)+2];case t.H:return u[4*(n-1)+3];default:return}}},832,[826]);
|
| 17 |
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error('Encoder not initialized');const o=new Uint8Array(n.length+this.degree);o.set(n);const s=t.mod(o,this.genPoly),h=this.degree-s.length;if(h>0){const t=new Uint8Array(this.degree);return t.set(s,h),t}return s},m.exports=n},833,[834]);
|
| 18 |
+
__d(function(g,r,_i,a,m,e,d){const n=r(d[0]);e.mul=function(t,l){const o=new Uint8Array(t.length+l.length-1);for(let u=0;u<t.length;u++)for(let f=0;f<l.length;f++)o[u+f]^=n.mul(t[u],l[f]);return o},e.mod=function(t,l){let o=new Uint8Array(t);for(;o.length-l.length>=0;){const t=o[0];for(let u=0;u<l.length;u++)o[u]^=n.mul(l[u],t);let u=0;for(;u<o.length&&0===o[u];)u++;o=o.slice(u)}return o},e.generateECPolynomial=function(t){let l=new Uint8Array([1]);for(let o=0;o<t;o++)l=e.mul(l,new Uint8Array([1,n.exp(o)]));return l}},834,[835]);
|
| 19 |
+
__d(function(g,r,_i,a,m,e,d){const n=new Uint8Array(512),t=new Uint8Array(256);!(function(){let o=1;for(let u=0;u<255;u++)n[u]=o,t[o]=u,o<<=1,256&o&&(o^=285);for(let t=255;t<512;t++)n[t]=n[t-255]})(),e.log=function(n){if(n<1)throw new Error('log('+n+')');return t[n]},e.exp=function(t){return n[t]},e.mul=function(o,u){return 0===o||0===u?0:n[t[o]+t[u]]}},835,[]);
|
| 20 |
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),f=r(_d[3]),u=r(_d[4]),c=t.getBCHDigit(7973);function s(t,n,o){for(let f=1;f<=40;f++)if(n<=e.getCapacity(f,o,t))return f}function l(t,n){return f.getCharCountIndicator(t,n)+4}function d(t,n){let o=0;return t.forEach(function(t){const f=l(t.mode,n);o+=f+t.getBitsLength()}),o}function C(t,n){for(let o=1;o<=40;o++){if(d(t,o)<=e.getCapacity(o,n,f.MIXED))return o}}e.from=function(t,n){return u.isValid(t)?parseInt(t,10):n},e.getCapacity=function(o,c,s){if(!u.isValid(o))throw new Error('Invalid QR Code version');void 0===s&&(s=f.BYTE);const d=8*(t.getSymbolTotalCodewords(o)-n.getTotalCodewordsCount(o,c));if(s===f.MIXED)return d;const C=d-l(s,o);switch(s){case f.NUMERIC:return Math.floor(C/10*3);case f.ALPHANUMERIC:return Math.floor(C/11*2);case f.KANJI:return Math.floor(C/13);case f.BYTE:default:return Math.floor(C/8)}},e.getBestVersionForData=function(t,n){let f;const u=o.from(n,o.M);if(Array.isArray(t)){if(t.length>1)return C(t,u);if(0===t.length)return 1;f=t[0]}else f=t;return s(f.mode,f.getLength(),u)},e.getEncodedBits=function(n){if(!u.isValid(n)||n<7)throw new Error('Invalid QR Code version');let o=n<<12;for(;t.getBCHDigit(o)-c>=0;)o^=7973<<t.getBCHDigit(o)-c;return n<<12|o}},836,[825,832,826,837,838]);
|
| 21 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]);function e(t){if('string'!=typeof t)throw new Error('Param is not a string');switch(t.toLowerCase()){case'numeric':return _e.NUMERIC;case'alphanumeric':return _e.ALPHANUMERIC;case'kanji':return _e.KANJI;case'byte':return _e.BYTE;default:throw new Error('Unknown mode: '+t)}}_e.NUMERIC={id:'Numeric',bit:1,ccBits:[10,12,14]},_e.ALPHANUMERIC={id:'Alphanumeric',bit:2,ccBits:[9,11,13]},_e.BYTE={id:'Byte',bit:4,ccBits:[8,16,16]},_e.KANJI={id:'Kanji',bit:8,ccBits:[8,10,12]},_e.MIXED={bit:-1},_e.getCharCountIndicator=function(n,e){if(!n.ccBits)throw new Error('Invalid mode: '+n);if(!t.isValid(e))throw new Error('Invalid version: '+e);return e>=1&&e<10?n.ccBits[0]:e<27?n.ccBits[1]:n.ccBits[2]},_e.getBestModeForData=function(t){return n.testNumeric(t)?_e.NUMERIC:n.testAlphanumeric(t)?_e.ALPHANUMERIC:n.testKanji(t)?_e.KANJI:_e.BYTE},_e.toString=function(t){if(t&&t.id)return t.id;throw new Error('Invalid mode')},_e.isValid=function(t){return t&&t.bit&&t.ccBits},_e.from=function(t,n){if(_e.isValid(t))return t;try{return e(t)}catch(t){return n}}},837,[838,839]);
|
| 22 |
+
__d(function(g,r,i,a,m,e,d){e.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}},838,[]);
|
| 23 |
+
__d(function(g,r,i,a,m,e,d){let u="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";u=u.replace(/u/g,'\\u');const n='(?:(?![A-Z0-9 $%*+\\-./:]|'+u+')(?:.|[\r\n]))+';e.KANJI=new RegExp(u,'g'),e.BYTE_KANJI=new RegExp('[^A-Z0-9 $%*+\\-./:]+','g'),e.BYTE=new RegExp(n,'g'),e.NUMERIC=new RegExp('[0-9]+','g'),e.ALPHANUMERIC=new RegExp('[A-Z $%*+\\-./:]+','g');const t=new RegExp('^'+u+'$'),E=new RegExp("^[0-9]+$"),A=new RegExp('^[A-Z0-9 $%*+\\-./:]+$');e.testKanji=function(u){return t.test(u)},e.testNumeric=function(u){return E.test(u)},e.testAlphanumeric=function(u){return A.test(u)}},839,[]);
|
| 24 |
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=t.getBCHDigit(1335);e.getEncodedBits=function(o,c){const B=o.bit<<3|c;let d=B<<10;for(;t.getBCHDigit(d)-n>=0;)d^=1335<<t.getBCHDigit(d)-n;return 21522^(B<<10|d)}},840,[825]);
|
| 25 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6]),h=r(d[7]);function i(t){return unescape(encodeURIComponent(t)).length}function f(t,n,o){const u=[];let s;for(;null!==(s=t.exec(o));)u.push({data:s[0],index:s.index,mode:n,length:s[0].length});return u}function E(n){const o=f(l.NUMERIC,t.NUMERIC,n),u=f(l.ALPHANUMERIC,t.ALPHANUMERIC,n);let s,h;c.isKanjiModeEnabled()?(s=f(l.BYTE,t.BYTE,n),h=f(l.KANJI,t.KANJI,n)):(s=f(l.BYTE_KANJI,t.BYTE,n),h=[]);return o.concat(u,s,h).sort(function(t,n){return t.index-n.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function A(l,c){switch(c){case t.NUMERIC:return n.getBitsLength(l);case t.ALPHANUMERIC:return o.getBitsLength(l);case t.KANJI:return s.getBitsLength(l);case t.BYTE:return u.getBitsLength(l)}}function I(t){return t.reduce(function(t,n){const o=t.length-1>=0?t[t.length-1]:null;return o&&o.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function C(n){const o=[];for(let u=0;u<n.length;u++){const s=n[u];switch(s.mode){case t.NUMERIC:o.push([s,{data:s.data,mode:t.ALPHANUMERIC,length:s.length},{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.ALPHANUMERIC:o.push([s,{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.KANJI:o.push([s,{data:s.data,mode:t.BYTE,length:i(s.data)}]);break;case t.BYTE:o.push([{data:s.data,mode:t.BYTE,length:i(s.data)}])}}return o}function p(n,o){const u={},s={start:{}};let l=['start'];for(let c=0;c<n.length;c++){const h=n[c],i=[];for(let n=0;n<h.length;n++){const f=h[n],E=''+c+n;i.push(E),u[E]={node:f,lastCount:0},s[E]={};for(let n=0;n<l.length;n++){const c=l[n];u[c]&&u[c].node.mode===f.mode?(s[c][E]=A(u[c].lastCount+f.length,f.mode)-A(u[c].lastCount,f.mode),u[c].lastCount+=f.length):(u[c]&&(u[c].lastCount=f.length),s[c][E]=A(f.length,f.mode)+4+t.getCharCountIndicator(f.mode,o))}}l=i}for(let t=0;t<l.length;t++)s[l[t]].end=0;return{map:s,table:u}}function B(l,h){let i;const f=t.getBestModeForData(l);if(i=t.from(h,f),i!==t.BYTE&&i.bit<f.bit)throw new Error('"'+l+"\" cannot be encoded with mode "+t.toString(i)+'.\n Suggested mode is: '+t.toString(f));switch(i!==t.KANJI||c.isKanjiModeEnabled()||(i=t.BYTE),i){case t.NUMERIC:return new n(l);case t.ALPHANUMERIC:return new o(l);case t.KANJI:return new s(l);case t.BYTE:return new u(l)}}e.fromArray=function(t){return t.reduce(function(t,n){return'string'==typeof n?t.push(B(n,null)):n.data&&t.push(B(n.data,n.mode)),t},[])},e.fromString=function(t,n){const o=p(C(E(t,c.isKanjiModeEnabled())),n),u=h.find_path(o.map,'start','end'),s=[];for(let t=1;t<u.length-1;t++)s.push(o.table[u[t]].node);return e.fromArray(I(s))},e.rawSplit=function(t){return e.fromArray(E(t,c.isKanjiModeEnabled()))}},841,[837,842,843,844,845,839,825,846]);
|
| 26 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.NUMERIC,this.data=n.toString()}n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,o,s;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),s=parseInt(o,10),t.put(s,10);const i=this.data.length-n;i>0&&(o=this.data.substr(n),s=parseInt(o,10),t.put(s,3*i+1))},m.exports=n},842,[837]);
|
| 27 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' ','$','%','*','+','-','.','/',':'];function i(n){this.mode=t.ALPHANUMERIC,this.data=n}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let h=45*n.indexOf(this.data[i]);h+=n.indexOf(this.data[i+1]),t.put(h,11)}this.data.length%2&&t.put(n.indexOf(this.data[i]),6)},m.exports=i},843,[837]);
|
| 28 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.BYTE,this.data='string'==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,o=this.data.length;n<o;n++)t.put(this.data[n],8)},m.exports=n},844,[837]);
|
| 29 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]);function i(n){this.mode=t.KANJI,this.data=n}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i<this.data.length;i++){let o=n.toSJIS(this.data[i]);if(o>=33088&&o<=40956)o-=33088;else{if(!(o>=57408&&o<=60351))throw new Error('Invalid SJIS character: '+this.data[i]+"\nMake sure your charset is UTF-8");o-=49472}o=192*(o>>>8&255)+(255&o),t.put(o,13)}},m.exports=i},845,[837,825]);
|
| 30 |
+
__d(function(g,r,i,_a,m,e,_d){'use strict';var t={single_source_shortest_paths:function(o,s,u){var n={},a={};a[s]=0;var h,f,p,_,c,v,d,l=t.PriorityQueue.make();for(l.push(s,0);!l.empty();)for(p in f=(h=l.pop()).value,_=h.cost,c=o[f]||{})c.hasOwnProperty(p)&&(v=_+c[p],d=a[p],(void 0===a[p]||d>v)&&(a[p]=v,l.push(p,v),n[p]=f));if(void 0!==u&&void 0===a[u]){var y=['Could not find a path from ',s,' to ',u,'.'].join('');throw new Error(y)}return n},extract_shortest_path_from_predecessor_list:function(t,o){for(var s=[],u=o;u;)s.push(u),t[u],u=t[u];return s.reverse(),s},find_path:function(o,s,u){var n=t.single_source_shortest_paths(o,s,u);return t.extract_shortest_path_from_predecessor_list(n,u)},PriorityQueue:{make:function(o){var s,u=t.PriorityQueue,n={};for(s in o=o||{},u)u.hasOwnProperty(s)&&(n[s]=u[s]);return n.queue=[],n.sorter=o.sorter||u.default_sorter,n},default_sorter:function(t,o){return t.cost-o.cost},push:function(t,o){var s={value:t,cost:o};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==m&&(m.exports=t)},846,[]);
|
| 31 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]);function e(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+'px',e.style.width=n+'px'}function n(){try{return document.createElement('canvas')}catch(t){throw new Error('You need to specify a canvas element')}}_e.render=function(o,c,s){let u=s,h=c;void 0!==u||c&&c.getContext||(u=c,c=void 0),c||(h=n()),u=t.getOptions(u);const l=t.getImageWidth(o.modules.size,u),p=h.getContext('2d'),y=p.createImageData(l,l);return t.qrToImageData(y.data,o,u),e(p,h,l),p.putImageData(y,0,0),h},_e.renderToDataURL=function(t,e,n){let o=n;void 0!==o||e&&e.getContext||(o=e,e=void 0),o||(o={});const c=_e.render(t,e,o),s=o.type||'image/png',u=o.rendererOpts||{};return c.toDataURL(s,u.quality)}},847,[848]);
|
| 32 |
+
__d(function(g,r,_i,a,m,e,d){function t(t){if('number'==typeof t&&(t=t.toString()),'string'!=typeof t)throw new Error('Color should be defined as hex string');let o=t.slice().replace('#','').split('');if(o.length<3||5===o.length||o.length>8)throw new Error('Invalid hex color: '+t);3!==o.length&&4!==o.length||(o=Array.prototype.concat.apply([],o.map(function(t){return[t,t]}))),6===o.length&&o.push('F','F');const n=parseInt(o.join(''),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:'#'+o.slice(0,6).join('')}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=void 0===o.margin||null===o.margin||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,l=o.scale||4;return{width:i,scale:i?4:l,margin:n,color:{dark:t(o.color.dark||'#000000ff'),light:t(o.color.light||'#ffffffff')},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(t,o){return o.width&&o.width>=t+2*o.margin?o.width/(t+2*o.margin):o.scale},e.getImageWidth=function(t,o){const n=e.getScale(t,o);return Math.floor((t+2*o.margin)*n)},e.qrToImageData=function(t,o,n){const i=o.modules.size,l=o.modules.data,c=e.getScale(i,n),f=Math.floor((i+2*n.margin)*c),h=n.margin*c,s=[n.color.light,n.color.dark];for(let o=0;o<f;o++)for(let u=0;u<f;u++){let p=4*(o*f+u),w=n.color.light;if(o>=h&&u>=h&&o<f-h&&u<f-h){w=s[l[Math.floor((o-h)/c)*i+Math.floor((u-h)/c)]?1:0]}t[p++]=w.r,t[p++]=w.g,t[p++]=w.b,t[p]=w.a}}},848,[]);
|
| 33 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function o(t,o){const n=t.a/255,i=o+'="'+t.hex+'"';return n<1?i+' '+o+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function n(t,o,n){let i=t+o;return void 0!==n&&(i+=' '+n),i}function i(t,o,i){let l='',h=0,s=!1,c=0;for(let u=0;u<t.length;u++){const f=Math.floor(u%o),w=Math.floor(u/o);f||s||(s=!0),t[u]?(c++,u>0&&f>0&&t[u-1]||(l+=s?n('M',f+i,.5+w+i):n('m',h,0),h=0,s=!1),f+1<o&&t[u+1]||(l+=n('h',c),c=0)):h++}return l}e.render=function(n,l,h){const s=t.getOptions(l),c=n.modules.size,u=n.modules.data,f=c+2*s.margin,w=s.color.light.a?'<path '+o(s.color.light,'fill')+' d="M0 0h'+f+'v'+f+'H0z"/>':'',p='<path '+o(s.color.dark,'stroke')+' d="'+i(u,c,s.margin)+'"/>',v="viewBox=\"0 0 "+f+' '+f+'"',x='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':'')+v+' shape-rendering="crispEdges">'+w+p+'</svg>\n';return'function'==typeof h&&h(null,x),x}},849,[848]);
|
| 34 |
+
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=(t,n)=>{const l=n/t.length;let c='';return t.forEach((n,u)=>{let o=!1;n.forEach((n,f)=>{n?(o||(c+=`M${l*f} ${l/2+l*u} `,o=!0),o&&f===t.length-1&&(c+=`L${l*(f+1)} ${l/2+l*u} `)):o&&(c+=`L${l*f} ${l/2+l*u} `,o=!1)})}),{cellSize:l,path:c}}},850,[]);
|
| 35 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}}),r(d[0]);var t=r(d[1]),n=r(d[2]),o=r(d[3]);var s=({svg:s,logoSize:l,logoColor:u})=>{if((0,n.isString)(s)){const u=(0,n.isUrlString)(s)?s:`data:image/svg+xml;base64,${window.btoa(s)}`;return(0,o.jsx)(t.Image,{href:encodeURI(u),width:l,height:l})}const c=s;return(0,o.jsx)(c,{fill:u,width:l,height:l})}},851,[12,853,852,6]);
|
| 36 |
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return'string'==typeof t}Object.defineProperty(e,'__esModule',{value:!0}),e.isString=t,e.isUrlString=function(n){return t(n)&&n.startsWith('http')}},852,[]);
|
staff-app/_expo/static/js/web/merch-2b36b9e0d2fa44fb3bb28bf4475e3cff.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e,t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),l=(e=s)&&e.__esModule?e:{default:e},r=_r(d[3]),o=_r(d[4]),c=_r(d[5]),u=_r(d[6]),m=_r(d[7]),h=_r(d[8]),j=_r(d[9]),p=_r(d[10]);function x(){const{rid:e}=(0,t.useLocalSearchParams)(),s=(0,c.useRestaurant)(e),x=(0,c.useCustomer)(),b=(0,c.useNow)(6e4),f=(0,u.useOwner)(e=>e.merch),[y,w]=(0,n.useState)({}),[k,S]=(0,n.useState)(null),[C,$]=(0,n.useState)(null);if(!s)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Restaurant not found."})});const v=f.find(e=>e.id===k),O=e=>y[e]??1;return(0,p.jsxs)(o.Screen,{title:"Shop",subtitle:`${s.name} merch \xb7 collect in the restaurant`,children:[C?(0,p.jsxs)(o.Banner,{kind:"success",title:"Order placed (demo)",children:[C," Collect it at the bar on your next visit."]}):null,f.filter(e=>e.live||0===e.stock).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(l.default,{style:{flex:1},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),(0,p.jsx)(o.T,{colour:j.colours.gold,weight:"semibold",children:(0,m.gbp)(e.price)})]}),0!==e.stock&&e.live?e.stock<8?(0,p.jsx)(o.Badge,{kind:"amber",label:`${e.stock} left`}):null:(0,p.jsx)(o.Badge,{kind:"neutral",label:"Sold out"})]}),e.live&&e.stock>0?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:O(e.id),min:1,max:Math.min(5,e.stock),onChange:t=>w({...y,[e.id]:t}),label:`${e.name} quantity`}),(0,p.jsx)(o.Button,{small:!0,label:`Buy \xb7 ${(0,m.gbp)(e.price*O(e.id))}`,onPress:()=>S(e.id)})]}):null]},e.id)),(0,p.jsxs)(o.Muted,{children:["Collection only in this prototype. Prices set by ",s.name,"."]}),v?(0,p.jsx)(r.MockPay,{visible:!0,onClose:()=>S(null),amount:v.price*O(v.id),restaurantId:s.id,allowGiftCard:!1,title:`Buy ${v.name}`,onPaid:()=>{const e=u.useOwner.getState();e.setOwner({merch:e.merch.map(e=>e.id===v.id?{...e,stock:Math.max(0,e.stock-O(v.id))}:e),merchOrders:[{id:`mo-${Date.now()}`,productId:v.id,qty:O(v.id),customer:x.name,at:(0,h.ymd)(b),status:'new'},...e.merchOrders]}),$(`${O(v.id)} \xd7 ${v.name}, ${(0,m.gbp)(v.price*O(v.id))}.`),S(null)}}):null]})}},766,[785,12,109,790,791,797,814,794,796,799,6]);
|
staff-app/_expo/static/js/web/offers-0aa896051a081d579d4564f13efc078e.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var n=_r(d[0]);_r(d[1]);var t=_r(d[2]),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),o=_r(d[6]),c=_r(d[7]);function f(){const{rid:f}=(0,n.useLocalSearchParams)(),u=(0,s.useRestaurant)(f),h=(0,s.useCustomer)(),j=(0,r.useOwner)(n=>n.offers);if(!u)return(0,c.jsx)(t.Screen,{title:"Not found",children:(0,c.jsx)(t.T,{children:"Restaurant not found."})});const x=!!h.marketingOptIn[u.id],b=j.filter(n=>n.live),p=b.filter(n=>'special'===n.kind),y=b.filter(n=>'offer'===n.kind);return(0,c.jsxs)(t.Screen,{title:"Specials & offers",subtitle:u.name,children:[(0,c.jsxs)(t.Card,{highlight:x?o.colours.green:o.colours.gold,children:[(0,c.jsx)(t.Toggle,{label:`Send me offers from ${u.name}`,value:x,onChange:n=>s.repo.customers.update({marketingOptIn:{...h.marketingOptIn,[u.id]:n}})}),(0,c.jsx)(t.Muted,{children:x?'You can switch this off any time. We only use it for this restaurant.':'Off by default. Turn on to see member offers and get the occasional notification (max one a week). You can switch it off any time.'})]}),(0,c.jsx)(t.H2,{children:"Today's specials"}),p.length?p.map(n=>(0,c.jsxs)(t.Card,{children:[(0,c.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,c.jsx)(t.Badge,{kind:"gold",label:"Special"})]}),(0,c.jsx)(t.Muted,{children:n.body})]},n.id)):(0,c.jsx)(t.Muted,{children:"No specials on the board right now."}),(0,c.jsx)(t.H2,{children:"Member offers"}),x?y.length?y.map(n=>(0,c.jsxs)(t.Card,{children:[(0,c.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,c.jsx)(t.Badge,{kind:"green",label:"Offer"})]}),(0,c.jsx)(t.Muted,{children:n.body}),n.until?(0,c.jsxs)(t.Muted,{children:["Until ",(0,l.niceDate)((0,l.parseYmd)(n.until))]}):null]},n.id)):(0,c.jsx)(t.Muted,{children:"No offers right now."}):(0,c.jsxs)(t.Banner,{kind:"info",children:["Turn on offers above to see ",y.length," member offer",1===y.length?'':'s',"."]}),(0,c.jsxs)(t.Muted,{children:["Offers are set by ",u.name,". Drinks promotions follow Scottish licensing rules. Demo: no notifications are sent."]})]})}},767,[785,12,791,797,814,796,799,6]);
|
staff-app/_expo/static/js/web/profile-226b50adbe3252e6b78e12d966a1af30.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var e=_r(d[0]);_r(d[1]);var r,l=_r(d[2]),s=(r=l)&&r.__esModule?r:{default:r},t=_r(d[3]),n=_r(d[4]),a=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]);function p(){const r=(0,u.useCustomer)(),l=(0,u.useStore)((0,c.useShallow)(e=>e.orders.filter(r=>r.customerId===e.customer.id))),p=(0,u.useStore)((0,c.useShallow)(e=>e.bookings.filter(r=>r.customerId===e.customer.id))),b=(0,u.useStore)(e=>e.restaurants),y=e=>b.find(r=>r.id===e)?.name??e;return(0,h.jsxs)(t.Screen,{title:"Your account",subtitle:"One Cover Charge account for every restaurant",children:[(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.Field,{label:"Name",value:r.name,onChangeText:e=>u.repo.customers.update({name:e})}),(0,h.jsx)(t.Field,{label:"Email",value:r.email,keyboardType:"email-address",onChangeText:e=>u.repo.customers.update({email:e})}),(0,h.jsx)(t.Field,{label:"Mobile",value:r.phone,keyboardType:"phone-pad",onChangeText:e=>u.repo.customers.update({phone:e})}),(0,h.jsxs)(t.Muted,{children:["Referral code: ",r.referralCode]})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Allergies & severity"}),(0,h.jsx)(t.Muted,{children:"Stored once and shared with a restaurant only when you order or book there. You confirm them on every order, table session and booking."}),(0,h.jsx)(t.Toggle,{label:"I consent to Cover Charge storing my allergy information (health data, UK GDPR)",value:r.allergyConsent,onChange:e=>u.repo.customers.update({allergyConsent:e})}),r.allergyConsent?null:(0,h.jsx)(t.Banner,{kind:"warn",children:"Without consent your allergies won\u2019t be stored \u2014 tell staff directly."}),n.ALLERGENS.map(e=>{const l=r.allergies.find(r=>r.allergen===e.id);return(0,h.jsxs)(s.default,{style:{gap:6,paddingVertical:6},children:[(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(t.T,{weight:l?'semibold':'regular',children:e.label}),l?(0,h.jsx)(t.Badge,{kind:"red",label:"Declared"}):null]}),(0,h.jsxs)(t.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(t.Chip,{label:"None",selected:!l,onPress:()=>u.repo.customers.setAllergy(e.id,null),disabled:!r.allergyConsent&&!l}),n.SEVERITIES.map(s=>(0,h.jsx)(t.Chip,{label:s.label,selected:l?.severity===s.id,disabled:!r.allergyConsent,onPress:()=>u.repo.customers.setAllergy(e.id,s.id)},s.id))]})]},e.id)})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your orders"}),l.length?l.map(r=>(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(t.T,{style:{flex:1},children:[r.ref," \xb7 ",y(r.restaurantId)," \xb7 ",'table'===r.type?`Table ${r.tableNo}`:'Takeaway']}),(0,h.jsx)(t.Button,{small:!0,kind:"secondary",label:`${r.status} \xb7 ${(0,a.gbp)(r.subtotal+r.tip)}`,onPress:()=>e.router.push(`/customer/order/${r.id}`)})]},r.id)):(0,h.jsx)(t.Muted,{children:"No orders yet."})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your bookings"}),p.length?p.map(e=>(0,h.jsxs)(t.T,{children:[e.ref," \xb7 ",y(e.restaurantId)," \xb7 ",(0,o.niceDate)((0,o.parseYmd)(e.date))," ",e.time," \xb7 ",e.partySize," people \xb7 ",e.status]},e.id)):(0,h.jsx)(t.Muted,{children:"No bookings yet."})]}),(0,h.jsx)(t.Muted,{children:"Account deletion and data export would live here (Apple 5.1.1(v); Google web deletion link)."})]})}},774,[785,12,109,791,792,794,796,797,858,6]);
|
staff-app/_expo/static/js/web/refer-e7c486c6f38735576d3772011eb2da7b.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var r=_r(d[0]),n=_r(d[1]),s=_r(d[2]),t=_r(d[3]),l=_r(d[4]),o=_r(d[5]),u=_r(d[6]);function c(){const{rid:c}=(0,r.useLocalSearchParams)(),h=(0,t.useRestaurant)(c),f=(0,t.useCustomer)(),j=(0,l.useOwner)(r=>r.referral),x=(0,l.useOwner)(r=>r.referrals),[p,w]=(0,n.useState)(!1);if(!h)return(0,u.jsx)(s.Screen,{title:"Not found",children:(0,u.jsx)(s.T,{children:"Restaurant not found."})});const b=x.filter(r=>r.referrer===f.name);return(0,u.jsxs)(s.Screen,{title:"Bring a friend",subtitle:h.name,children:[j.active?null:(0,u.jsxs)(s.Banner,{kind:"info",children:[h.name," isn't running referrals right now."]}),(0,u.jsxs)(s.Card,{highlight:o.colours.gold,children:[(0,u.jsxs)(s.H2,{children:["You get: ",j.giverReward]}),(0,u.jsxs)(s.T,{children:["Your friend gets: ",j.friendReward]}),(0,u.jsx)(s.Muted,{children:"When your friend makes their first paid visit or order."}),(0,u.jsx)(s.T,{size:30,weight:"bold",colour:o.colours.gold,center:!0,children:f.referralCode}),(0,u.jsx)(s.Button,{label:"Share my code",disabled:!j.active,onPress:()=>w(!0)}),p?(0,u.jsx)(s.Muted,{center:!0,children:"Demo: in the real app this opens your phone's share sheet. Nothing is sent from here."}):null]}),(0,u.jsxs)(s.Card,{children:[(0,u.jsx)(s.H2,{children:"Your referrals"}),b.length?b.map(r=>(0,u.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsx)(s.T,{style:{flex:1},children:r.friend}),(0,u.jsx)(s.Badge,{kind:'rewarded'===r.status?'green':'amber',label:r.status})]},r.id)):(0,u.jsx)(s.Muted,{children:"No referrals yet."})]}),(0,u.jsx)(s.Muted,{children:"One reward per new account, phone and card. Monthly cap applies. Rewards are on food, not drinks."})]})}},768,[785,12,791,797,814,799,6]);
|
staff-app/_expo/static/js/web/waitlist-3d5fa808005b46d07073a2a5135b539a.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return h}});var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),a=_r(d[3]),r=_r(d[4]),o=_r(d[5]),u=_r(d[6]),l=_r(d[7]),c=_r(d[8]);function h(){const{rid:h}=(0,t.useLocalSearchParams)(),j=(0,u.useRestaurant)(h),x=(0,u.useCustomer)(),b=(0,u.useWaitlist)(h),y=(0,u.useBookings)(h),f=(0,u.useOrders)(h),w=(0,u.useEvents)(h),p=(0,u.useNow)(15e3),[M,S]=(0,s.useState)(2),[v,P]=(0,s.useState)(x.name);if(!j)return(0,c.jsx)(n.Screen,{title:"Not found",children:(0,c.jsx)(n.T,{children:"Restaurant not found."})});const T=b.filter(t=>'waiting'===t.status||'notified'===t.status).sort((t,s)=>t.number-s.number),k=T.find(t=>t.customerId===x.id),B=(0,r.forecastToday)(j,y,f,w,p),C=B.nextHour?Math.min(1.6,Math.max(.8,B.nextHour.covers/(.75*j.settings.capacityPerHour))):1;if(k){const t=T.indexOf(k)+1;return(0,c.jsxs)(n.Screen,{title:"You\u2019re on the waitlist",subtitle:j.name,children:[(0,c.jsxs)(n.Card,{highlight:l.colours.gold,children:[(0,c.jsx)(n.Muted,{children:"Your queue number"}),(0,c.jsxs)(n.T,{size:56,weight:"bold",colour:l.colours.gold,children:["#",k.number]}),(0,c.jsx)(n.T,{children:1===t?'You\u2019re next':`${t-1} part${t-1==1?'y':'ies'} ahead of you`}),(0,c.jsxs)(n.T,{weight:"semibold",children:["Estimated wait: about ",(0,o.estimateWait)(t,j.settings.turnMins,C)," minutes"]}),(0,c.jsxs)(n.Muted,{children:["Estimate only \u2014 based on tables in use, typical turn times and today\u2019s forecast. Joined ",(0,a.minsBetween)(new Date(k.joinedAt),p)," min ago."]})]}),'notified'===k.status?(0,c.jsx)(n.Banner,{kind:"success",title:"Your table is ready!",children:"Please come to the door within 5 minutes to keep your table."}):(0,c.jsx)(n.Banner,{kind:"info",children:"We\u2019ll notify you when your table is ready (push/SMS simulated in this prototype)."}),(0,c.jsx)(n.Button,{kind:"secondary",label:"Leave the waitlist",onPress:()=>u.repo.waitlist.setStatus(k.id,'removed')})]})}return(0,c.jsxs)(n.Screen,{title:"Join the waitlist",subtitle:j.name,children:[(0,c.jsxs)(n.Card,{children:[(0,c.jsxs)(n.H2,{children:[T.length," part",1===T.length?'y':'ies'," waiting"]}),(0,c.jsxs)(n.Muted,{children:["Estimated wait if you join now: about ",(0,o.estimateWait)(T.length+1,j.settings.turnMins,C)," minutes (estimate)."]})]}),(0,c.jsx)(n.Field,{label:"Name",value:v,onChangeText:P}),(0,c.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(n.T,{weight:"semibold",children:"Party size"}),(0,c.jsx)(n.Stepper,{value:M,onChange:S,min:1,max:12,label:"party size"})]}),(0,c.jsx)(n.Button,{label:"Join the queue",disabled:v.trim().length<2,onPress:()=>u.repo.waitlist.join(j.id,v,M,x.id),testID:"join-waitlist"}),(0,c.jsx)(n.Muted,{children:"Waitlist messages are service messages only \u2014 no marketing."})]})}},769,[785,12,791,796,854,855,797,799,6]);
|
staff-app/_expo/static/js/web/whatson-9c60dd15f704285737d9a99e5fabdc58.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var t=_r(_d[0]),l=_r(_d[1]),n=_r(_d[2]),s=e(_r(_d[3])),o=e(_r(_d[4])),a=_r(_d[5]),r=_r(_d[6]),d=_r(_d[7]),i=_r(_d[8]),u=_r(_d[9]);const c=e=>'bank-holiday'===e.kind?(0,u.jsx)(a.Badge,{kind:"blue",label:"Scottish bank holiday"}):'school-holiday'===e.kind?(0,u.jsx)(a.Badge,{kind:"neutral",label:"School holiday"}):'occasion'===e.kind?(0,u.jsx)(a.Badge,{kind:"gold",label:"Key dining date"}):(0,u.jsx)(a.Badge,{kind:"green",label:"Restaurant event"});function h(){const{rid:e}=(0,t.useLocalSearchParams)(),h=(0,d.useRestaurant)(e),x=(0,d.useEvents)(e),y=(0,d.useNow)(6e4),[j,f]=(0,n.useState)(()=>new Date(y.getFullYear(),y.getMonth(),1)),[b,k]=(0,n.useState)(null);if(!h)return(0,u.jsx)(a.Screen,{title:"Not found",children:(0,u.jsx)(a.T,{children:"Restaurant not found."})});const p=(new Date(j).getDay()+6)%7,w=new Date(j.getFullYear(),j.getMonth()+1,0).getDate(),M=[...Array(p).fill(null),...Array.from({length:w},(e,t)=>new Date(j.getFullYear(),j.getMonth(),t+1))];for(;M.length%7;)M.push(null);const D=e=>x.filter(t=>t.date===e),v=x.filter(e=>e.date>=(0,r.ymd)(y)).sort((e,t)=>e.date.localeCompare(t.date)),S=b?D(b):v.slice(0,20);return(0,u.jsxs)(a.Screen,{title:"What\u2019s on",subtitle:`${h.name} \xb7 holidays, key dates and events`,children:[(0,u.jsxs)(a.Card,{children:[(0,u.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsx)(a.Button,{small:!0,kind:"ghost",label:"\u2039 Prev",onPress:()=>f(new Date(j.getFullYear(),j.getMonth()-1,1))}),(0,u.jsxs)(a.H2,{children:[(0,r.monthLong)(j.getMonth())," ",j.getFullYear()]}),(0,u.jsx)(a.Button,{small:!0,kind:"ghost",label:"Next \u203a",onPress:()=>f(new Date(j.getFullYear(),j.getMonth()+1,1))})]}),(0,u.jsx)(o.default,{style:{flexDirection:'row'},children:['Mon','Tue','Wed','Thu','Fri','Sat','Sun'].map(e=>(0,u.jsx)(a.T,{size:13,colour:i.colours.muted,style:{flex:1,textAlign:'center'},children:e},e))}),Array.from({length:M.length/7}).map((e,t)=>(0,u.jsx)(o.default,{style:{flexDirection:'row'},children:M.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,u.jsx)(o.default,{style:{flex:1,height:44}},t);const l=(0,r.ymd)(e),n=D(l),d=l===(0,r.ymd)(y);return(0,u.jsxs)(s.default,{accessibilityLabel:`${l}${n.length?`, ${n.length} events`:''}`,onPress:()=>k(b===l?null:l),style:{flex:1,height:44,alignItems:'center',justifyContent:'center',borderRadius:8,backgroundColor:b===l?i.colours.goldTint:'transparent',borderWidth:d?1:0,borderColor:i.colours.gold},children:[(0,u.jsx)(a.T,{size:15,colour:n.length?i.colours.text:i.colours.muted,weight:n.length?'semibold':'regular',children:e.getDate()}),(0,u.jsx)(a.Row,{gap:2,children:n.slice(0,3).map(e=>(0,u.jsx)(o.default,{style:{width:6,height:6,borderRadius:3,backgroundColor:'bank-holiday'===e.kind?i.colours.blue:'event'===e.kind?i.colours.green:i.colours.gold}},e.id))})]},t)})},t))]}),(0,u.jsx)(a.H2,{children:b?(0,r.niceDateYear)((0,r.parseYmd)(b)):'Coming up'}),0===S.length?(0,u.jsx)(a.Muted,{children:"Nothing on this day."}):S.map(e=>(0,u.jsxs)(a.Card,{children:[(0,u.jsxs)(a.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsx)(a.T,{weight:"semibold",style:{flex:1},children:(0,l.holidayName)(e.title)}),c(e)]}),(0,u.jsxs)(a.Muted,{children:[(0,r.niceDateYear)((0,r.parseYmd)(e.date)),e.source?` \xb7 source: ${e.source}`:'']}),(0,u.jsx)(a.T,{size:15,children:e.description}),e.example?(0,u.jsx)(a.Badge,{kind:"amber",label:"EXAMPLE EVENT"}):null,e.date>=(0,r.ymd)(y)?(0,u.jsx)(a.Button,{small:!0,kind:"secondary",label:"Book for this date",onPress:()=>t.router.push({pathname:'/customer/[rid]/book',params:{rid:h.id,date:e.date}})}):null]},e.id)),(0,u.jsx)(a.Muted,{children:"Bank holidays from gov.uk (Scotland division). Easter Monday is not a Scottish bank holiday; local council holidays vary."})]})}},770,[785,806,12,245,109,791,796,797,799,6]);
|
staff-app/index.html
CHANGED
|
@@ -34,8 +34,8 @@
|
|
| 34 |
<style>html,body{background:#0B0B0B}</style>
|
| 35 |
<script>(function(){var p=location.pathname;if(/\/index\.html$/.test(p))history.replaceState(null,'',p.slice(0,-10)+location.search+location.hash);})();</script>
|
| 36 |
<script>(function(){try{var r=sessionStorage.getItem('cc-redirect');if(!r)return;sessionStorage.removeItem('cc-redirect');var u=new URL(r,location.href);if(u.origin===location.origin&&u.pathname.indexOf('/staff-app/')===0&&u.pathname!==location.pathname)history.replaceState(null,'',u.pathname+u.search+u.hash);}catch(e){}})();</script>
|
| 37 |
-
<script>/* v0.2.21 update prompt: 'A new version is ready' with an Update button (posts SKIP_WAITING; the page reloads once). */
|
| 38 |
-
function ccShowUpdate(w){if(document.getElementById('cc-update'))return;var b=document.createElement('div');b.id='cc-update';b.setAttribute('role','status');b.style.cssText='position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:2147483000;max-width:520px;margin:0 auto;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:#17140F;border:1px solid rgba(207,164,95,.55);box-shadow:0 10px 30px rgba(0,0,0,.6);font:500 15px system-ui,sans-serif;color:#F5F1E8';b.innerHTML='<span style="flex:1">A new version of the app is ready.</span>';var u=document.createElement('button');u.textContent='Update';u.id='cc-update-btn';u.style.cssText='min-height:44px;padding:0 18px;border-radius:12px;border:0;background:#CFA45F;color:#17130D;font:700 15px system-ui,sans-serif;cursor:pointer';u.onclick=function(){u.textContent='Updating…';try{w.postMessage({type:'SKIP_WAITING'});}catch(e){location.reload();}setTimeout(function(){location.reload();},4000);};var l=document.createElement('button');l.textContent='Later';l.style.cssText='min-height:44px;padding:0 10px;border:0;background:transparent;color:#A89A80;font:500 14px system-ui,sans-serif;cursor:pointer';l.onclick=function(){b.remove();};b.appendChild(u);b.appendChild(l);document.body.appendChild(b);}
|
| 39 |
function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdate(r.waiting);r.addEventListener('updatefound',function(){var n=r.installing;if(!n)return;n.addEventListener('statechange',function(){if(n.state==='installed'&&navigator.serviceWorker.controller)ccShowUpdate(n);});});}</script>
|
| 40 |
<script>if('serviceWorker' in navigator){var hadSW=!!navigator.serviceWorker.controller,reloaded=false;navigator.serviceWorker.addEventListener('controllerchange',function(){if(hadSW&&!reloaded){reloaded=true;location.reload();}});window.addEventListener('load',function(){navigator.serviceWorker.register('/staff-app/sw.js',{scope:'/staff-app/',updateViaCache:'none'}).then(function(r){ccWatch(r);r.update().catch(function(){});setInterval(function(){r.update().catch(function(){});},30*60000);}).catch(function(e){console.warn('SW',e)});});}</script>
|
| 41 |
<style>html,body,#root{overflow-x:hidden;max-width:100vw;overscroll-behavior:none}body{touch-action:pan-x pan-y}</style><script>document.addEventListener("gesturestart",function(e){e.preventDefault()},{passive:false});document.addEventListener("touchmove",function(e){if(e.touches&&e.touches.length>1)e.preventDefault()},{passive:false});</script></head>
|
|
@@ -45,7 +45,7 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat
|
|
| 45 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 46 |
<!-- The root element for your Expo app. -->
|
| 47 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/staff-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 48 |
-
<script src="/staff-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/staff-app/_expo/static/js/web/__common-
|
| 49 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 50 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 51 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
|
|
|
| 34 |
<style>html,body{background:#0B0B0B}</style>
|
| 35 |
<script>(function(){var p=location.pathname;if(/\/index\.html$/.test(p))history.replaceState(null,'',p.slice(0,-10)+location.search+location.hash);})();</script>
|
| 36 |
<script>(function(){try{var r=sessionStorage.getItem('cc-redirect');if(!r)return;sessionStorage.removeItem('cc-redirect');var u=new URL(r,location.href);if(u.origin===location.origin&&u.pathname.indexOf('/staff-app/')===0&&u.pathname!==location.pathname)history.replaceState(null,'',u.pathname+u.search+u.hash);}catch(e){}})();</script>
|
| 37 |
+
<script>/* v0.2.21 update prompt: 'A new version is ready' with an Update button (posts SKIP_WAITING; the page reloads once). v0.2.22: shown through the app's shared slider (window.ccSlider) once the app has loaded, so it queues with other notices; this plain copy is the fallback before then. */
|
| 38 |
+
function ccShowUpdate(w){if(window.ccSlider){window.ccSlider({id:'app-update',title:'A new version of the app is ready.',testID:'cc-update',actions:[{label:'Update',testID:'cc-update-btn',keepOpen:true,onPress:function(){try{w.postMessage({type:'SKIP_WAITING'});}catch(e){location.reload();}setTimeout(function(){location.reload();},4000);}},{label:'Later',kind:'ghost'}]});return;}if(document.getElementById('cc-update'))return;var b=document.createElement('div');b.id='cc-update';b.setAttribute('role','status');b.style.cssText='position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:2147483000;max-width:520px;margin:0 auto;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:#17140F;border:1px solid rgba(207,164,95,.55);box-shadow:0 10px 30px rgba(0,0,0,.6);animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both;font:500 15px system-ui,sans-serif;color:#F5F1E8';b.innerHTML='<style>@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){#cc-update{animation:none!important}}</style><span style="flex:1">A new version of the app is ready.</span>';var u=document.createElement('button');u.textContent='Update';u.id='cc-update-btn';u.style.cssText='min-height:44px;padding:0 18px;border-radius:12px;border:0;background:#CFA45F;color:#17130D;font:700 15px system-ui,sans-serif;cursor:pointer';u.onclick=function(){u.textContent='Updating…';try{w.postMessage({type:'SKIP_WAITING'});}catch(e){location.reload();}setTimeout(function(){location.reload();},4000);};var l=document.createElement('button');l.textContent='Later';l.style.cssText='min-height:44px;padding:0 10px;border:0;background:transparent;color:#A89A80;font:500 14px system-ui,sans-serif;cursor:pointer';l.onclick=function(){b.remove();};b.appendChild(u);b.appendChild(l);document.body.appendChild(b);}
|
| 39 |
function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdate(r.waiting);r.addEventListener('updatefound',function(){var n=r.installing;if(!n)return;n.addEventListener('statechange',function(){if(n.state==='installed'&&navigator.serviceWorker.controller)ccShowUpdate(n);});});}</script>
|
| 40 |
<script>if('serviceWorker' in navigator){var hadSW=!!navigator.serviceWorker.controller,reloaded=false;navigator.serviceWorker.addEventListener('controllerchange',function(){if(hadSW&&!reloaded){reloaded=true;location.reload();}});window.addEventListener('load',function(){navigator.serviceWorker.register('/staff-app/sw.js',{scope:'/staff-app/',updateViaCache:'none'}).then(function(r){ccWatch(r);r.update().catch(function(){});setInterval(function(){r.update().catch(function(){});},30*60000);}).catch(function(e){console.warn('SW',e)});});}</script>
|
| 41 |
<style>html,body,#root{overflow-x:hidden;max-width:100vw;overscroll-behavior:none}body{touch-action:pan-x pan-y}</style><script>document.addEventListener("gesturestart",function(e){e.preventDefault()},{passive:false});document.addEventListener("touchmove",function(e){if(e.touches&&e.touches.length>1)e.preventDefault()},{passive:false});</script></head>
|
|
|
|
| 45 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 46 |
<!-- The root element for your Expo app. -->
|
| 47 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/staff-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 48 |
+
<script src="/staff-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/staff-app/_expo/static/js/web/__common-6585c9ee60e461f491e13a987c63fd48.js" defer></script><script src="/staff-app/_expo/static/js/web/entry-16d24b0817222185383fdee6e11e98a3.js" defer></script>
|
| 49 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 50 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 51 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
staff-app/sw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
// Anchorage Staff service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
-
const V = "cc-staff-
|
| 3 |
const BASE = "/staff-app/";
|
| 4 |
-
const PRECACHE = ["/staff-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/staff-app/_expo/static/js/web/[did]-
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
|
|
|
| 1 |
// Anchorage Staff service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
+
const V = "cc-staff-a251d348e4";
|
| 3 |
const BASE = "/staff-app/";
|
| 4 |
+
const PRECACHE = ["/staff-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/staff-app/_expo/static/js/web/[did]-e4382792c51e53176e20f8028790b773.js", "/staff-app/_expo/static/js/web/[n]-002152f12507e8163a44340d0899ec9c.js", "/staff-app/_expo/static/js/web/[oid]-affd80a8b572b9c207d9b216313d29dc.js", "/staff-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/staff-app/_expo/static/js/web/__common-6585c9ee60e461f491e13a987c63fd48.js", "/staff-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js", "/staff-app/_expo/static/js/web/_layout-f70b124d1f3c941f34aa922543bca28c.js", "/staff-app/_expo/static/js/web/basket-f625050b5378b7835c7b0531a8d87b99.js", "/staff-app/_expo/static/js/web/book-1d5b97d633d6c3f7b1fac568474b5644.js", "/staff-app/_expo/static/js/web/demo-2aeda33db335ba3a45d18733444a4df6.js", "/staff-app/_expo/static/js/web/entry-16d24b0817222185383fdee6e11e98a3.js", "/staff-app/_expo/static/js/web/feedback-6dbe946e1675fb596c5c4cd508919819.js", "/staff-app/_expo/static/js/web/gift-68f9ee1cd4ed0c0f9068fb93bfa60db9.js", "/staff-app/_expo/static/js/web/index-290443ca5d64073e7ddab8a437bbbbfb.js", "/staff-app/_expo/static/js/web/index-31f5cb0976e95a627a66d3e2c4d7279e.js", "/staff-app/_expo/static/js/web/index-3c853b36d880be5dea66261a8f87ff95.js", "/staff-app/_expo/static/js/web/index-3ce55512f207e0f4e938fcea314e34d2.js", "/staff-app/_expo/static/js/web/index-42c772ae8e6fc8ffb457607b71499331.js", "/staff-app/_expo/static/js/web/index-74ed5e3887809c4259d725a2965aa3f3.js", "/staff-app/_expo/static/js/web/index-9eb8c7acf25af76b6df08b2c1d3e0564.js", "/staff-app/_expo/static/js/web/index-e57a61ccf8b16e38bf91548a01cebbf1.js", "/staff-app/_expo/static/js/web/index-f92d197c1fe113b3fa2d8402c42f163d.js", "/staff-app/_expo/static/js/web/lost-1e6398f6494d3015c150145cf234acff.js", "/staff-app/_expo/static/js/web/loyalty-1983afbe0d08f311ef01775598cdda6e.js", "/staff-app/_expo/static/js/web/merch-2b36b9e0d2fa44fb3bb28bf4475e3cff.js", "/staff-app/_expo/static/js/web/offers-0aa896051a081d579d4564f13efc078e.js", "/staff-app/_expo/static/js/web/profile-226b50adbe3252e6b78e12d966a1af30.js", "/staff-app/_expo/static/js/web/refer-e7c486c6f38735576d3772011eb2da7b.js", "/staff-app/_expo/static/js/web/waitlist-3d5fa808005b46d07073a2a5135b539a.js", "/staff-app/_expo/static/js/web/whatson-9c60dd15f704285737d9a99e5fabdc58.js", "/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/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/staff-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.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"];
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|