Spaces:
Running
Running
Cover Charge prototype v0.3.12.11 (part 2)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- index.html +3 -3
- owner-app/_expo/static/js/web/[did]-0d8f5598929ab27d547672e738480c46.js +1 -0
- owner-app/_expo/static/js/web/[n]-f70147ed6be3e387c5c5b96a72ac6d67.js +1 -0
- owner-app/_expo/static/js/web/[oid]-d84141be120e5e94aac3862db784d536.js +1 -0
- owner-app/_expo/static/js/web/[token]-95091a67ece0565f844f7e286de11363.js +2 -0
- owner-app/_expo/static/js/web/__common-d1c6130527758186befb9ddcdc33afda.js +0 -0
- owner-app/_expo/static/js/web/_layout-e8b91a4f4f51319eadfa56ff01bfcf8a.js +38 -0
- owner-app/_expo/static/js/web/basket-bc55ff791a24832051ce9f8a27bbdba3.js +1 -0
- owner-app/_expo/static/js/web/book-fe1a511098175362c634032b33cc795c.js +1 -0
- owner-app/_expo/static/js/web/feedback-cb959353b54fab0866378ed2be72132e.js +1 -0
- owner-app/_expo/static/js/web/gift-07557aa0dc548594d98c389388830159.js +1 -0
- owner-app/_expo/static/js/web/index-5710ed20b010a67bbb9d07510858c5fc.js +1 -0
- owner-app/_expo/static/js/web/index-851ab32cc6cd46e29de2ee6ef736ea72.js +0 -0
- owner-app/_expo/static/js/web/index-923dc0939bc1713d1aef15a2ac88516d.js +0 -0
- owner-app/_expo/static/js/web/index-a7773a7d6e42f73e35c2623b14d84f24.js +2 -0
- owner-app/_expo/static/js/web/index-da33cd41d3cd5ea80a3d4a6704d09f4e.js +21 -0
- owner-app/_expo/static/js/web/index-e57c2833a3c34f2511b73cfc581fa833.js +1 -0
- owner-app/_expo/static/js/web/lost-312deba7d8cf34ee11eefd449487477f.js +1 -0
- owner-app/_expo/static/js/web/loyalty-715677b42fb5442f74f4277c5668357f.js +1 -0
- owner-app/_expo/static/js/web/merch-91d5784c59611cf1da0675ec4c04750d.js +1 -0
- owner-app/_expo/static/js/web/offers-ec22ebcf7c9b3691c768eaf1640d5012.js +1 -0
- owner-app/_expo/static/js/web/profile-337890e0e56d3b12d5f0637140cf7e83.js +1 -0
- owner-app/_expo/static/js/web/refer-c2fcc0a30b787a74fd99a7db78943e2f.js +1 -0
- owner-app/_expo/static/js/web/waitlist-50792dd191f30792d944d9760b052c34.js +1 -0
- owner-app/_expo/static/js/web/whatson-11543aaf1601e35745ccb1c678ae0747.js +1 -0
- owner-app/index.html +1 -1
- owner-app/sw.js +2 -2
- staff-app/_expo/static/js/web/[did]-0d8f5598929ab27d547672e738480c46.js +1 -0
- staff-app/_expo/static/js/web/[n]-76c5656c676288421db0bb5729fee8c4.js +1 -0
- staff-app/_expo/static/js/web/[oid]-d84141be120e5e94aac3862db784d536.js +1 -0
- staff-app/_expo/static/js/web/[token]-fdbfe5fde9cc61fcf3dc32350d1afcb7.js +3 -0
- staff-app/_expo/static/js/web/__common-d51e6f2f4e4a173fba5ea8f496bba6e9.js +0 -0
- staff-app/_expo/static/js/web/_layout-38a5adef8deb4995a6524b5adff49068.js +0 -0
- staff-app/_expo/static/js/web/basket-947f69add2ae4f194c9de79b3d82c072.js +1 -0
- staff-app/_expo/static/js/web/book-fe1a511098175362c634032b33cc795c.js +1 -0
- staff-app/_expo/static/js/web/feedback-cb959353b54fab0866378ed2be72132e.js +1 -0
- staff-app/_expo/static/js/web/gift-07557aa0dc548594d98c389388830159.js +1 -0
- staff-app/_expo/static/js/web/index-155d47a598c445f266c76c8911a79b2d.js +1 -0
- staff-app/_expo/static/js/web/index-55a981e7565fcdafd0326b14b6d27178.js +0 -0
- staff-app/_expo/static/js/web/index-a6f34dd6e4c646a7473555a9d477ec6b.js +2 -0
- staff-app/_expo/static/js/web/index-ac7e06de6c963d226085ed8b5d26139c.js +3 -0
- staff-app/_expo/static/js/web/index-b9e9f721dd239eab800e784db7dee5a3.js +0 -0
- staff-app/_expo/static/js/web/index-baca40cfebc80c4d4cb1b889ebcdb2b8.js +0 -0
- staff-app/_expo/static/js/web/lost-2838c270481f57397bc273f98b81a28f.js +1 -0
- staff-app/_expo/static/js/web/loyalty-3681574ad7135bf2b804a33fd1035552.js +1 -0
- staff-app/_expo/static/js/web/merch-24e697870623cff1fc6102dcc3560828.js +1 -0
- staff-app/_expo/static/js/web/offers-c767de6c19c185e1164f6e7297573175.js +1 -0
- staff-app/_expo/static/js/web/profile-a052ffa70b268db7c721cbfb89251de2.js +1 -0
- staff-app/_expo/static/js/web/refer-24c04c7b3c1e697d454ff41850a57760.js +1 -0
- staff-app/_expo/static/js/web/waitlist-b46915f0e0647622df385647dc062708.js +1 -0
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.3.12.
|
| 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.3.12.
|
| 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>
|
|
@@ -126,7 +126,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
|
|
| 126 |
</section>
|
| 127 |
|
| 128 |
<footer>
|
| 129 |
-
<p>Cover Charge prototype v0.3.12.
|
| 130 |
</footer>
|
| 131 |
</main>
|
| 132 |
</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.3.12.11)</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.3.12.11)</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>
|
|
|
|
| 126 |
</section>
|
| 127 |
|
| 128 |
<footer>
|
| 129 |
+
<p>Cover Charge prototype v0.3.12.11 · Demo data only. No real payments, messages or location tracking.</p>
|
| 130 |
</footer>
|
| 131 |
</main>
|
| 132 |
</body>
|
owner-app/_expo/static/js/web/[did]-0d8f5598929ab27d547672e738480c46.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:"ok",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"})]})]})}},768,[794,20,186,117,818,819,802,803,805,808,820,810,14]);
|
owner-app/_expo/static/js/web/[n]-f70147ed6be3e387c5c5b96a72ac6d67.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 l}});var t=_r(d[0]),r=_r(d[1]),n=_r(d[2]),o=_r(d[3]),u=_r(d[4]),c=_r(d[5]),s=_r(d[6]);function l(){const{n:l,r:f}=(0,t.useLocalSearchParams)(),b=(0,o.useStore)(t=>t.startBasket),[h,S]=(0,r.useState)(!1),j=f??u.VENUE_RID,O=(0,o.useOrderAtTable)(j),_=(0,c.guestServer)();return(0,r.useEffect)(()=>{_||(O&&b(j,'table',String(l)),S(!0))},[j,l,O,_]),_?(0,s.jsx)(n.Screen,{title:"Order at the table",children:(0,s.jsx)(n.Banner,{kind:"demo",title:"Scan the code on your table",children:"To order from your table, scan the QR code printed on it. Or order at the bar."})}):h?(0,s.jsx)(t.Redirect,{href:`/customer/${j}`}):null}},784,[794,20,802,808,836,824,14]);
|
owner-app/_expo/static/js/web/[oid]-d84141be120e5e94aac3862db784d536.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',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.ok,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 (test, no real money)"}),(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)}})]})}},781,[794,20,117,822,821,802,803,805,807,808,810,14]);
|
owner-app/_expo/static/js/web/[token]-95091a67ece0565f844f7e286de11363.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 u}});var t=r(d[0]);r(d[1]);var n=r(d[2]),o=r(d[3]),c=r(d[4]),s=r(d[5]),l=r(d[6]);function u(){const{token:u}=(0,t.useLocalSearchParams)(),h=(0,c.cleanToken)(u);return h?(0,s.guestServer)()?(0,l.jsx)(o.TableOrderLive,{token:h}):(0,l.jsx)(n.Screen,{title:"Order at the table",children:(0,l.jsx)(n.Banner,{kind:"demo",title:"Not connected",children:"This preview isn't connected to a venue, so table orders can't be sent from here."})}):(0,l.jsx)(n.Screen,{title:"Order at the table",children:(0,l.jsx)(n.Banner,{kind:"warn",title:"This code isn't working",children:"Please scan the QR code on your table again, or ask a member of staff."})})}},785,[794,20,802,838,839,824,14]);
|
| 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.TableOrderLive=function({token:e}){const[x,p]=(0,t.useState)(null),[f,b]=(0,t.useState)(null),[j,m]=(0,t.useState)([]),[y,k]=(0,t.useState)(null),w=(0,d.useCustomer)(),[T,C]=(0,t.useState)(()=>(w?.allergies??[]).map(e=>e.allergen)),[S,v]=(0,t.useState)(''),[P,O]=(0,t.useState)(''),[B,L]=(0,t.useState)(!1),[M,R]=(0,t.useState)(null),[N,$]=(0,t.useState)([]),A=(0,t.useCallback)(async()=>{try{p(await(0,o.tablePublic)(e)),b(null)}catch(e){b(e?.message??'Could not load the menu.')}},[e]),D=(0,t.useCallback)(async()=>{try{$(await(0,o.myTableOrders)(e))}catch{}},[e]);(0,t.useEffect)(()=>{A(),D();const e=setInterval(()=>{D(),A()},8e3);return()=>clearInterval(e)},[A,D]);const I=x?.menu??[];(0,t.useEffect)(()=>{m(e=>e.filter(e=>I.some(t=>t.id===e.id&&!t.soldOut)))},[x]);const _=(0,t.useMemo)(()=>{const e=new Map;for(const t of I)e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()]},[x]),q=(0,i.cartTotal)(j,I),Y='yes'===y?T.map(e=>({allergen:e,severity:w?.allergies?.find(t=>t.allergen===e)?.severity??'allergy'})):[],W=(0,i.allergyClashes)(j,I,Y.map(e=>e.allergen)),E=e=>j.find(t=>t.id===e)?.qty??0,z=(e,t)=>m(l=>t<=0?l.filter(t=>t.id!==e):l.some(t=>t.id===e)?l.map(l=>l.id===e?{...l,qty:t}:l):[...l,{id:e,qty:t,note:''}]),G=(e,t)=>m(l=>l.map(l=>l.id===e?{...l,note:t}:l)),H=async()=>{L(!0),R(null);try{const t=await(0,o.sendTableOrder)(e,j,{note:P,name:S,allergies:Y});m([]),O(''),R({kind:'success',text:t.held?`Order ${t.ref} sent. A member of staff will check it, then it goes to the kitchen.`:`Order ${t.ref} sent to the kitchen.`}),D()}catch(e){R({kind:'warn',text:e?.message??'The order was not sent. Please try again or ask a member of staff.'}),A()}finally{L(!1)}};if(f)return(0,h.jsxs)(s.Screen,{title:"Order at the table",children:[(0,h.jsx)(s.Banner,{kind:"warn",title:"Couldn't open the menu",children:f}),(0,h.jsx)(s.Button,{label:"Try again",onPress:()=>{A()}})]});if(!x)return(0,h.jsx)(s.Screen,{title:"Order at the table",children:(0,h.jsx)(s.Muted,{children:"Opening the menu\u2026"})});if(!x.ok)return(0,h.jsx)(s.Screen,{title:"Order at the table",children:(0,h.jsx)(s.Banner,{kind:"warn",title:"This code isn't working",children:x.reason??'Please ask a member of staff.'})});const V=x.open&&j.length>0&&null!==y&&('none'===y||T.length>0)&&!B;return(0,h.jsxs)(s.Screen,{title:`Table ${x.table}`,subtitle:x.venueName,footer:x.open?(0,h.jsx)(s.Button,{label:B?'Sending\u2026':j.length?`Send order to the kitchen (${(0,r.gbp)(q)})`:'Add a dish to order',disabled:!V,onPress:()=>{H()},testID:"send-table-order-live"}):void 0,children:[(0,h.jsxs)(s.Muted,{children:["Tip: add dishes, answer the allergy question, then send. Staff bring it to Table ",x.table,". ",i.PAY_WORDS]}),x.tip?(0,h.jsx)(s.Banner,{kind:"demo",children:x.tip}):null,x.open?null:(0,h.jsx)(s.Banner,{kind:"warn",title:"Not taking table orders right now",children:x.reason}),x.open&&x.staffAccept&&!N.some(e=>e.accepted)?(0,h.jsx)(s.Muted,{children:"The first order from your phone is checked by a member of staff before it goes to the kitchen."}):null,M?(0,h.jsx)(s.Banner,{kind:M.kind,children:M.text}):null,N.length?(0,h.jsx)(n.default,{testID:"my-table-orders",children:(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Your orders at this table"}),N.map(e=>(0,h.jsxs)(n.default,{style:{gap:2,paddingVertical:4},children:[(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.T,{children:e.ref}),(0,h.jsx)(s.T,{size:13,colour:'cancelled'===e.status?c.colours.amber:c.colours.gold,children:(0,i.guestStatusWords)(e)})]}),(0,h.jsxs)(s.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,r.gbp)(e.totalPence)," to pay at the bar or till"]})]},e.id))]})}):null,x.open?_.map(([e,t])=>(0,h.jsxs)(n.default,{style:{gap:8},children:[(0,h.jsx)(s.H2,{children:e}),t.map(e=>(0,h.jsxs)(s.Card,{children:[(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,h.jsxs)(n.default,{style:{flex:1,gap:2},children:[(0,h.jsx)(s.T,{weight:"semibold",children:e.name}),e.description?(0,h.jsx)(s.Muted,{children:e.description}):null,(0,h.jsxs)(s.T,{size:13,colour:c.colours.muted,children:[e.allergens.length?`Contains: ${e.allergens.map(a.allergenLabel).join(', ')}`:'No allergens listed: ask staff if unsure',e.mayContain.length?` \xb7 May contain: ${e.mayContain.map(a.allergenLabel).join(', ')}`:'']})]}),(0,h.jsx)(s.T,{weight:"semibold",colour:c.colours.gold,children:(0,r.gbp)(e.pricePence)})]}),e.soldOut?(0,h.jsx)(s.Badge,{kind:"amber",label:"Sold out today"}):E(e.id)?(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.Stepper,{value:E(e.id),min:0,max:20,onChange:t=>z(e.id,t),label:e.name}),(0,h.jsx)(s.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>z(e.id,0)})]}):(0,h.jsx)(s.Button,{small:!0,kind:"secondary",label:"Add",accessibilityLabel:`Add ${e.name}`,onPress:()=>z(e.id,1)})]},e.id))]},e)):null,x.open&&!I.length?(0,h.jsx)(s.Banner,{kind:"demo",title:"No dishes to order yet",children:"The venue hasn't put any priced dishes on the table menu yet. Please order at the bar."}):null,x.open&&j.length?(0,h.jsx)(n.default,{testID:"table-cart",children:(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Your order"}),j.map(e=>{const t=I.find(t=>t.id===e.id);return(0,h.jsxs)(n.default,{style:{gap:4},children:[(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(s.T,{children:[e.qty,"\xd7 ",t?.name]}),(0,h.jsx)(s.T,{children:(0,r.gbp)(e.qty*(t?.pricePence??0))})]}),(0,h.jsx)(l.default,{style:u,value:e.note,onChangeText:t=>G(e.id,t),placeholder:"Note for the kitchen (optional), e.g. no onions",placeholderTextColor:c.colours.muted,maxLength:140,accessibilityLabel:`Note for ${t?.name}`,testID:`table-note-${e.id}`})]},e.id)}),(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Total"}),(0,h.jsx)(s.T,{weight:"semibold",children:(0,r.gbp)(q)})]})]})}):null,x.open?(0,h.jsx)(n.default,{testID:"table-allergy",children:(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Does anyone at the table have a food allergy?"}),(0,h.jsx)(s.Muted,{children:"We ask everyone, so the kitchen can keep you safe."}),(0,h.jsxs)(s.Row,{gap:8,children:[(0,h.jsx)(s.Chip,{label:"No allergies",selected:'none'===y,onPress:()=>k('none')}),(0,h.jsx)(s.Chip,{label:"Yes, allergies",selected:'yes'===y,onPress:()=>k('yes')})]}),'yes'===y?(0,h.jsx)(s.Row,{wrap:!0,gap:6,children:a.ALLERGENS.map(e=>(0,h.jsx)(s.Chip,{label:e.short,selected:T.includes(e.id),onPress:()=>C(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},e.id))}):null,W.length?(0,h.jsxs)(s.Banner,{kind:"warn",title:"Check with staff",children:[W.map(e=>e.name).join(', ')," ",W.length>1?'contain':'contains'," or may contain an allergy you picked. The kitchen will see your allergies on the ticket."]}):null]})}):null,x.open?(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Anything else?"}),(0,h.jsx)(l.default,{style:u,value:S,onChangeText:v,placeholder:"Your first name (optional)",placeholderTextColor:c.colours.muted,maxLength:40,accessibilityLabel:"Your first name (optional)"}),(0,h.jsx)(l.default,{style:u,value:P,onChangeText:O,placeholder:"Note for the staff (optional)",placeholderTextColor:c.colours.muted,maxLength:300,accessibilityLabel:"Note for the staff (optional)"})]}):null,(0,h.jsx)(n.default,{testID:"pay-placeholder",children:(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Paying"}),(0,h.jsx)(s.T,{children:i.PAY_WORDS}),(0,h.jsx)(s.Muted,{children:"No card details are asked for or kept in this app."})]})})]})};var t=_r(_d[0]),l=e(_r(_d[1])),n=e(_r(_d[2])),s=_r(_d[3]),a=_r(_d[4]),r=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]);const u={borderWidth:1,borderColor:c.colours.border,borderRadius:10,padding:10,color:c.colours.text,backgroundColor:c.colours.surface2}},838,[20,263,117,802,803,805,839,840,808,810,14]);
|
owner-app/_expo/static/js/web/__common-d1c6130527758186befb9ddcdc33afda.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
owner-app/_expo/static/js/web/_layout-e8b91a4f4f51319eadfa56ff01bfcf8a.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 L}});var t=r(_d[0]),s=r(_d[1]),o=r(_d[2]),n=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){if('default'!==s){var o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{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])),h=r(_d[11]),y=r(_d[12]),S=r(_d[13]),O=r(_d[14]),j=r(_d[15]),_=r(_d[16]),b=r(_d[17]),w=r(_d[18]),P=r(_d[19]),x=r(_d[20]);r(_d[21]);var E=r(_d[22]),k=r(_d[23]),v=r(_d[24]),H=r(_d[25]),A=r(_d[26]),T=r(_d[27]),B=r(_d[28]);const F=r(_d[29]),C=r(_d[30]),R=r(_d[31]),I=r(_d[32]);function L(){const[e]=(0,t.useFonts)({Poppins_400Regular:F,Poppins_500Medium:C,Poppins_600SemiBold:R,Poppins_700Bold:I}),[P,H]=(0,c.useState)(O.useStore.persist.hasHydrated()),[A,T]=(0,c.useState)(_.useOwner.persist.hasHydrated()),L=P&&A;(0,c.useEffect)(()=>{const e=O.useStore.persist.onFinishHydration(()=>H(!0)),t=_.useOwner.persist.onFinishHydration(()=>T(!0));return O.useStore.persist.hasHydrated()&&H(!0),_.useOwner.persist.hasHydrated()&&T(!0),()=>{e(),t()}},[]),(0,c.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===O.useStore.persist.getOptions().name&&O.useStore.persist.rehydrate(),e.key===j.useFloor.persist.getOptions().name&&j.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)(()=>{L&&_.useOwner.getState().syncRoster()},[L]),(0,c.useEffect)(()=>{L&&(0,x.startAppSync)()},[L]);const M=e&&L,G=(0,o.usePathname)(),N=M&&!(0,y.isAllowedPath)(G||'/');return(0,c.useEffect)(()=>{if(!N)return;const e=setTimeout(()=>o.router.replace(y.ENTRY[y.APP_VARIANT]),0);return()=>clearTimeout(e)},[N,G]),(0,c.useEffect)(()=>{M&&n.hideAsync().catch(()=>{})},[M]),M?(0,B.jsxs)(S.SafeAreaProvider,{children:[(0,B.jsx)(u.StatusBar,{style:"light"}),(0,B.jsx)(p.default,{style:{flex:1},children:(0,B.jsx)(o.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:b.colours.bg}}})}),N?(0,B.jsx)(p.default,{style:[f.default.absoluteFill,{backgroundColor:b.colours.bg}]}):null,N?null:(0,B.jsx)(k.VoiceHost,{}),(0,B.jsx)(E.SyncBadge,{}),(0,B.jsx)(w.InviteGate,{}),N?null:(0,B.jsx)(v.SliderHost,{})]}):(0,B.jsxs)(p.default,{style:{flex:1,backgroundColor:b.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[h.HERO_LOGOS.anchorage?(0,B.jsx)(d.default,{source:h.HERO_LOGOS.anchorage,accessibilityLabel:"The Anchorage logo",style:{width:180,height:180},resizeMode:"contain"}):null,(0,B.jsx)(l.default,{color:b.colours.gold})]})}H.PITCH&&(globalThis.__pitch={useStore:O.useStore,useOwner:_.useOwner,useFloor:j.useFloor,useBlocks:s.useBlocks,useSession:P.useSession,useCashUp:A.useCashUp,seedPitch:T.seedPitch},setTimeout(()=>{try{(0,T.seedPitch)()}catch(e){console.warn('pitch seed',e)}},1500)),P.START_INVITE,n.preventAutoHideAsync().catch(()=>{})},792,[1060,813,794,1087,557,20,236,186,112,36,117,873,796,279,808,814,826,810,975,830,809,1089,1090,1091,864,2,991,1092,14,1093,1094,1095,1096]);
|
| 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])},1060,[1061,1084,1086]);
|
| 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)}}},1061,[291,1062,1065,1079,1080,1081,1082,1083]);
|
| 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}},1062,[291,1063]);
|
| 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}},1063,[1064]);
|
| 6 |
+
__d(function(g,r,i,a,m,e,d){},1064,[]);
|
| 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)}},1065,[1066,291,1062,1079,1080]);
|
| 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]}})})},1066,[1067,1068,1078]);
|
| 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()}})}},1067,[1068,1072,1077]);
|
| 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}}},1068,[291,222,1069,1073,1074,1075,1076,1072,1077]);
|
| 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}},1069,[291,1070,189,102,1071,1072]);
|
| 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])},1070,[565]);
|
| 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}}},1071,[291,189]);
|
| 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},1072,[]);
|
| 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}},1073,[]);
|
| 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}},1074,[]);
|
| 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])},1075,[1073]);
|
| 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}},1076,[]);
|
| 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},1077,[222,1071]);
|
| 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])},1078,[20,1068]);
|
| 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}},1079,[1066,291]);
|
| 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])},1080,[1066,1079]);
|
| 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}},1081,[1062]);
|
| 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])},1082,[291,1062,1065,1063]);
|
| 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})({})},1083,[]);
|
| 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]))},1084,[291,43,1085]);
|
| 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')},1085,[291]);
|
| 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]}},1086,[20,1061]);
|
| 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]}})})},1087,[1088]);
|
| 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(){}},1088,[]);
|
| 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()})},1089,[1097,820,809]);
|
| 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}),Object.defineProperty(_e,"STRIP",{enumerable:!0,get:function(){return I}}),_e.SyncBadge=function(){const e=(0,h.useSync)(),[C,P]=(0,n.useState)(!1),[R,S]=(0,n.useState)(''),z=(0,n.useRef)(e.failed),[k,w]=(0,n.useState)(!1),[A,N]=(0,n.useState)(''),W=(0,p.useDisplaySettings)(b.VENUE_RID),_=(0,x.useScreensaverAsleep)(e=>e.asleep);(0,n.useEffect)(()=>{if(e.failed>z.current){S('A change couldn\u2019t be saved to the shared system. It\u2019s kept on this device.');const n=setTimeout(()=>S(''),6e3);return z.current=e.failed,()=>clearTimeout(n)}z.current=e.failed},[e.failed]);const E='off'===e.mode&&(v.PITCH||!(0,T.isSupabaseConfigured)());if('customer'===u.APP_VARIANT||'off'===e.mode&&!E)return null;if(_)return null;const H='live'===e.mode,L='display'===u.APP_VARIANT,O=E?v.PITCH?'Demo \xb7 this device only':'This device only':H?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',V=E?y.colours.gold:H?y.colours.ok:'offline'===e.mode||'connecting'===e.mode?y.colours.gold:y.colours.muted,$=E?v.PITCH?'Demo mode. Nothing is shared or sent: everything you do stays in this browser.':'This copy isn\u2019t connected to a shared system. Everything stays on this device.':H?`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,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(c.default,{testID:"sync-strip",style:{height:I,paddingHorizontal:10,justifyContent:'center',alignItems:'flex-start',backgroundColor:y.colours.bg,borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.06)'},children:(0,j.jsxs)(o.default,{testID:"sync-badge",accessibilityRole:"button",accessibilityLabel:`Sync: ${O}`,onPress:()=>P(e=>!e),style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:14,minHeight:44,borderRadius:999,backgroundColor:'rgba(16,14,11,0.92)',borderWidth:1,borderColor:'rgba(255,255,255,0.14)',maxWidth:320},children:[(0,j.jsx)(c.default,{style:{width:8,height:8,borderRadius:4,backgroundColor:V}}),(0,j.jsx)(f.T,{size:12,weight:"semibold",children:O})]})}),C?(0,j.jsxs)(c.default,{testID:"sync-detail",style:{position:'absolute',left:10,bottom:52,zIndex:900,maxWidth:320,padding:12,borderRadius:12,backgroundColor:'#15120E',borderWidth:1,borderColor:'rgba(255,255,255,0.14)',gap:4},children:[(0,j.jsx)(f.T,{size:13,children:$}),e.failed?(0,j.jsxs)(f.T,{size:12,colour:y.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,j.jsx)(f.T,{size:12,colour:y.colours.muted,children:e.message}):null,e.venueId&&(H||'offline'===e.mode)?k?(0,j.jsxs)(c.default,{style:{gap:6,marginTop:6},children:[(0,j.jsx)(f.T,{size:12,children:L?'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.'}),L&&W.pinOn?(0,j.jsx)(l.default,{testID:"unpair-pin",value:A,onChangeText:N,placeholder:"Display PIN",placeholderTextColor:y.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:y.colours.text}}):null,(0,j.jsxs)(c.default,{style:{flexDirection:'row',gap:8},children:[(0,j.jsx)(o.default,{testID:"unpair-confirm",accessibilityRole:"button",accessibilityLabel:L?'Yes, unpair':'Yes, disconnect',disabled:L&&W.pinOn&&!(0,s.wakePinMatches)(W,A),onPress:()=>{w(!1),P(!1),N(''),L?(0,h.unpairDisplay)():(0,h.disconnectStaff)()},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,backgroundColor:L&&W.pinOn&&!(0,s.wakePinMatches)(W,A)?'rgba(255,255,255,0.08)':y.colours.red},children:(0,j.jsx)(f.T,{size:12,weight:"semibold",children:L?'Yes, unpair':'Yes, disconnect'})}),(0,j.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Keep connected",onPress:()=>{w(!1),N('')},style:{paddingHorizontal:12,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:'rgba(255,255,255,0.2)'},children:(0,j.jsx)(f.T,{size:12,children:"Keep"})})]})]}):(0,j.jsx)(o.default,{testID:"unpair",accessibilityRole:"button",accessibilityLabel:L?'Unpair this display':'Disconnect this device',onPress:()=>w(!0),style:{marginTop:6,alignSelf:'flex-start'},children:(0,j.jsx)(f.T,{size:12,colour:y.colours.gold,children:L?'Unpair this display\u2026':'Disconnect this device\u2026'})}):null,(0,j.jsx)(t.WipeDevice,{compact:!0})]}):null,R?(0,j.jsx)(c.default,{testID:"sync-toast",style:{position:'absolute',left:16,right:16,bottom:I+D+8,zIndex:950,alignItems:'center'},pointerEvents:"none",children:(0,j.jsx)(c.default,{style:{padding:12,borderRadius:12,backgroundColor:'#3A1712',borderWidth:1,borderColor:y.colours.red,maxWidth:460},children:(0,j.jsx)(f.T,{size:13,children:R})})}):null]})};var n=r(d[0]),t=r(d[1]),s=r(d[2]),o=e(r(d[3])),l=e(r(d[4])),c=e(r(d[5])),u=r(d[6]),h=r(d[7]),p=r(d[8]),b=r(d[9]),y=r(d[10]),f=r(d[11]),x=r(d[12]),T=r(d[13]),v=r(d[14]),j=r(d[15]);const I=48,D='display'===u.APP_VARIANT?0:60},1090,[20,1010,893,253,263,117,796,809,814,836,810,802,895,1098,2,14]);
|
| 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,f.useVoiceTarget)(),t=(0,f.useVoiceSlot)(e=>e.rect);return e?.on&&t?(0,A.jsx)(D,{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 a=e(_r(d[6])),l=e(_r(d[7])),c=e(_r(d[8])),u=e(_r(d[9])),h=e(_r(d[10])),p=_r(d[11]),f=_r(d[12]),g=_r(d[13]),y=e(g),m=_r(d[14]),w=_r(d[15]),x=_r(d[16]),b=_r(d[17]),v=_r(d[18]),k=_r(d[19]),j=_r(d[20]),S=_r(d[21]),T=_r(d[22]),R=_r(d[23]),C=_r(d[24]),I=_r(d[25]),M=_r(d[26]),z=_r(d[27]),A=_r(d[28]);const H=200;function E({colour:e,size:t=34}){return(0,A.jsxs)(y.default,{width:t,height:t,viewBox:"0 0 24 24",children:[(0,A.jsx)(g.Rect,{x:"9",y:"3",width:"6",height:"11",rx:"3",fill:e}),(0,A.jsx)(g.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 P={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 D({app:e,ui:g}){const y=(0,m.useCtx)(6e4),D=(0,x.useOwner)(e=>e.staff),O=(0,C.useVoiceSettings)(),V=(0,R.useVoiceNav)(e=>e.go),{height:W}=(0,u.default)(),$=(0,f.useVoiceSlot)(e=>e.rect),_=$.size,B=w.ROSTER.find(e=>'chef'===e.app),L='display'===e?'Main Display':'chef'===e?D.find(e=>e.id===B?.id)?.name??'Head Chef':y.me,N='display'===e?'display':'chef'===e?B?.id??'chef':y.meId,F={rid:y.rid,today:y.today,go:(e,t)=>V?.(e,t),app:e,who:L.replace(' (example)',''),whoId:N,role:'owner'===g?y.role:e},[G,X]=(0,t.useState)('idle'),[U,q]=(0,t.useState)(''),[Y,K]=(0,t.useState)(0),[J,Q]=(0,t.useState)(null),[Z,ee]=(0,t.useState)(!1),[te,oe]=(0,t.useState)(''),[ne,se]=(0,t.useState)(!1),re=(0,t.useRef)(null),ie=(0,t.useRef)(null),ae=(0,t.useRef)(F);ae.current=F;const le=(0,t.useRef)(J);le.current=J;const de=(0,t.useRef)(O.speakAnswers);de.current=O.speakAnswers;const ce=(0,t.useRef)(y.now);ce.current=y.now;const ue=e=>{Q(e),X('answer'),de.current&&(0,M.canSpeak)()&&(0,M.speak)(e.pending?e.pending.preview+' Say yes or tap Confirm.':e.text)},he=ue,pe=async e=>{X('working');const t=await(0,k.runAction)(e.id,e.params,ae.current,!0);(0,M.buzz)([20,40,20]),he({text:'needs_confirmation'===t.status?t.preview:t.message,tone:'error'===t.status?'warn':'ok'})},fe=()=>he({text:'Cancelled. Nothing was changed.',tone:'info'}),ge=async t=>{const o=t.trim(),n=ae.current;if(!o)return void ue({text:'I didn\u2019t catch that. Hold the button while you speak, then let go.',tone:'info'});const s=le.current?.pending;if(s){const e=(0,M.yesNo)(o);if('yes'===e)return void await pe(s);if('no'===e)return void fe()}X('working');const r=(0,k.matchIntent)(o,n.today,{app:e,rid:n.rid,whoId:n.whoId}),a=ce.current;if(!I.voiceUsage.allowed(n.rid,'action'===r.kind?r.action.id:null,a))return void ue({heard:o,text:I.REACHED_TEXT,tone:'info'});I.voiceUsage.record(n.rid,a);const l=I.voiceUsage.get(n.rid,a),c=l.reached?I.REACHED_TEXT:l.warn?(0,I.WARN_TEXT)(l):void 0,u=e=>ue({...e,note:c});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 u({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,k.runAction)(e.id,r.params,n,!1);return void('needs_confirmation'===s.status?u({heard:o,text:s.preview,pending:{id:e.id,params:r.params,preview:s.preview}}):u({heard:o,text:s.message,tone:'error'===s.status?'warn':'ok'}))}const h=()=>(0,k.toolSpecs)().filter(t=>{const o=(0,k.actionById)(t.function.name);return!!o&&(!o.apps||o.apps.includes(e))&&('staff'!==e||(0,k.staffMay)(o))}),p=async t=>{if('call'===t.kind){const s=(0,k.actionById)(t.name);if(s&&(!s.apps||s.apps.includes(e))&&('staff'!==e||(0,k.staffMay)(s))){const e=await(0,k.runAction)(s.id,t.args,n,!1);return'needs_confirmation'===e.status?u({heard:o,text:e.preview,pending:{id:s.id,params:t.args,preview:e.preview}}):u({heard:o,text:e.message,tone:'error'===e.status?'warn':'ok'}),!0}}return'text'===t.kind&&(u({heard:o,text:(0,k.moneySafe)(e,n.role)?(0,k.noMoney)(t.text):t.text,tone:'info'}),!0)};if('help'===r.kind){const t=r.ids.map(S.helpById).filter(Boolean)[0];if(!(((0,T.searchHelp)(S.HELP,o,1)[0]?.score??0)>=2.5)){const s=await(0,j.askServer)(e,o,h());if(await p(s))return;return(0,k.moneySafe)(e,n.role)&&(0,k.hasMoney)(`${t.title}. ${t.body}`)?void u({heard:o,text:`${j.SOON_TEXT} ${P[e].slice(0,2).join(' or ')}.`,tone:'info'}):void u({heard:o,text:`${j.SOON_TEXT} ${P[e].slice(0,2).join(' or ')}. This guide might help: ${t.title}.`,help:r.ids,tone:'info'})}const s=`${t.title}. ${t.body}`;return(0,k.moneySafe)(e,n.role)&&(0,k.hasMoney)(s)?void u({heard:o,text:'That isn\u2019t shown here. Ask a manager in the Managers app.',tone:'info'}):void u({heard:o,text:s,help:r.ids,tone:'info'})}await p(await(0,j.askServer)(e,o,h()))||u({heard:o,text:j.SOON_TEXT+' '+P[e].slice(0,2).join(' or ')+'.',tone:'info'})};(0,t.useEffect)(()=>()=>{re.current?.abort(),ie.current?.(),(0,M.stopSpeaking)()},[]);const ye=async()=>{if((0,M.stopSpeaking)(),!C.useVoiceSettings.getState().micExplained)return void se(!0);if(!(0,M.canListen)())return ee(!0),void he({text:'This browser can\u2019t listen (some iPhones and Firefox). Type instead below.',tone:'info'});if((0,M.buzz)(35),q(''),Q(null),ee(!1),X('listening'),re.current=(0,M.listen)(q,(e,t)=>{if(ie.current?.(),ie.current=null,K(0),'not-allowed'!==t&&'service-not-allowed'!==t)return'stt-failed'===t?(he({text:'Speech to text didn\u2019t start on this Mac. Type instead below; restarting the app usually fixes it.',tone:'warn'}),void ee(!0)):void ge(e);he({text:(0,M.desktopStt)()?'The microphone is blocked for CoverCharge. Open System Settings \u203a Privacy & Security \u203a Microphone, switch on CoverCharge for Mac, then try again. Or type instead.':'The microphone is blocked. Allow it in the browser\u2019s site settings, or tap the button to type instead.',tone:'warn'})}),!re.current)return X('idle'),void ee(!0);const e=await(0,M.levelMeter)(K);re.current?ie.current=e:e()},me=()=>{re.current&&(X('working'),re.current?.stop(),re.current=null,ie.current?.(),ie.current=null,K(0))},we=(0,t.useRef)({timer:0,holding:!1}),xe=(0,t.useRef)(ye);xe.current=ye;const be=(0,t.useRef)(me);be.current=me;const ve=(0,t.useMemo)(()=>r.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>{const e=we.current;e.holding=!1,e.timer=setTimeout(()=>{e.holding=!0,xe.current()},H)},onPanResponderRelease:()=>{const e=we.current;clearTimeout(e.timer),e.holding?be.current():(ee(!0),X(e=>'idle'===e?'answer':e))},onPanResponderTerminate:()=>{const e=we.current;clearTimeout(e.timer),e.holding&&be.current()}}),[e]);(0,t.useRef)(G).current=G,(0,t.useEffect)(()=>z.useVoiceKeys.subscribe((e,t)=>{const o=e.last;if(!o||o.n===t.last?.n)return;const n=!!re.current;'start'!==o.cmd||n?'stop'===o.cmd&&n?be.current():'toggle'===o.cmd?n?be.current():xe.current():'type'===o.cmd&&(ee(!0),X(e=>'idle'===e?'answer':e)):xe.current()}),[]);const ke=_>=64,je=(0,t.useRef)(new n.default.Value(0)).current;(0,t.useEffect)(()=>{if('listening'!==G)return je.stopAnimation(),void je.setValue(0);const e=n.default.loop(n.default.timing(je,{toValue:1,duration:1100,easing:s.default.out(s.default.quad),useNativeDriver:!1}));return e.start(),()=>e.stop()},[G]);const Se='listening'===G,Te='answer'===G&&(J||Z)||'working'===G||Se,Re=()=>{(0,M.stopSpeaking)(),Q(null),ee(!1),oe(''),X('idle')},Ce=()=>{const e=te.trim();e&&(oe(''),q(e),ge(e))},Ie='fixed',Me={top:$.y+_+8},ze=je.interpolate({inputRange:[0,1],outputRange:[1,1.7]}),Ae=je.interpolate({inputRange:[0,1],outputRange:[.6,0]}),He='warn'===J?.tone?v.colours.amber:J?.pending?v.colours.gold:v.colours.border;return(0,A.jsxs)(A.Fragment,{children:[Te?(0,A.jsx)(h.default,{testID:"voice-panel",style:[{position:Ie,left:12,right:12,alignItems:'flex-end',zIndex:60},Me],pointerEvents:"box-none",children:(0,A.jsxs)(h.default,{style:{width:'100%',maxWidth:ke?720:520,backgroundColor:v.colours.surface,borderRadius:16,borderWidth:2,borderColor:He,padding:ke?20:14,gap:10,maxHeight:W*(ke?.78:.6)},children:[(0,A.jsxs)(b.Row,{style:{justifyContent:'space-between'},children:[(0,A.jsx)(b.T,{size:16,weight:"semibold",colour:v.colours.gold,accessibilityRole:"header",children:Se?ke?'Listening\u2026 let go (or press \u2318\u21e7G) to send':'Listening\u2026 let go to send':'working'===G?'Working on it\u2026':J?.pending?'Please confirm':'Voice assistant'}),(0,A.jsx)(a.default,{testID:"voice-close",accessibilityRole:"button",accessibilityLabel:"Close voice assistant",hitSlop:12,onPress:Re,style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center'},children:(0,A.jsx)(b.T,{size:20,colour:v.colours.muted,children:"\u2715"})})]}),Se?(0,A.jsxs)(h.default,{style:{gap:8},children:[(0,A.jsx)(h.default,{style:{height:10,borderRadius:5,backgroundColor:v.colours.surface2,overflow:'hidden'},children:(0,A.jsx)(h.default,{testID:"voice-level",style:{width:`${Math.round(8+92*Y)}%`,height:10,backgroundColor:v.colours.ok}})}),(0,A.jsx)(b.T,{size:16,children:U||'Say it now\u2026'})]}):null,'working'===G?(0,A.jsxs)(b.Row,{gap:10,children:[(0,A.jsx)(o.default,{color:v.colours.gold}),(0,A.jsx)(b.T,{size:15,colour:v.colours.muted,children:U?`\u201c${U}\u201d`:''})]}):null,'answer'===G&&J?(0,A.jsxs)(l.default,{style:{maxHeight:W*(ke?.55:.36)},contentContainerStyle:{gap:8},children:[J.heard?(0,A.jsxs)(b.T,{size:13,colour:v.colours.muted,children:["You said: \u201c",J.heard,"\u201d"]}):null,J.note?(0,A.jsx)(h.default,{testID:"voice-usage-note",children:(0,A.jsx)(b.T,{size:13,colour:v.colours.amber,children:J.note})}):null,(0,A.jsx)(h.default,{testID:"voice-answer",children:(0,A.jsx)(b.T,{size:ke?24:18,weight:J.pending?'semibold':'regular',children:J.text})}),J.help&&'owner'===e&&V?J.help.slice(0,3).map(e=>{const t=(0,S.helpById)(e);return t?(0,A.jsx)(b.Button,{small:!0,kind:"secondary",label:`Open help: ${t.title}`,onPress:()=>{V('more','help'),Re()}},e):null}):null]}):null,'answer'===G&&J?.pending?(0,A.jsxs)(b.Row,{gap:10,children:[(0,A.jsx)(b.Button,{testID:"voice-confirm",kind:"success",label:"Confirm",onPress:()=>{pe(J.pending)},style:{flex:1,minHeight:56}}),(0,A.jsx)(b.Button,{testID:"voice-cancel",kind:"secondary",label:"Cancel",onPress:fe,style:{flex:1,minHeight:56}})]}):null,'answer'!==G||J?.pending?null:(0,A.jsxs)(h.default,{style:{gap:6},children:[Z||!(0,M.canListen)()?(0,A.jsxs)(b.Row,{gap:8,children:[(0,A.jsx)(c.default,{testID:"voice-type",value:te,onChangeText:oe,onSubmitEditing:Ce,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,A.jsx)(b.Button,{testID:"voice-send",kind:"success",label:"Ask",onPress:Ce,disabled:!te.trim()})]}):(0,A.jsx)(a.default,{accessibilityRole:"button",onPress:()=>ee(!0),children:(0,A.jsx)(b.T,{size:14,colour:v.colours.gold,children:"Type instead"})}),J?null:(0,A.jsxs)(b.T,{size:ke?15:13,colour:v.colours.muted,children:[ke?'Hold Space (or the gold button) and speak, or press \u2318\u21e7G to start and again to send. ':'Hold the gold button and speak, for example ',ke?`For example ${P[e].join(', ')}.`:`${P[e].join(', ')}.`]}),'owner'===g&&'owner'===e?(0,A.jsx)(a.default,{testID:"voice-open-assistant",accessibilityRole:"button",onPress:()=>{Re(),p.useAssistantUi.getState().setOpen(!0)},style:{minHeight:44,justifyContent:'center'},children:(0,A.jsx)(b.T,{size:14,colour:v.colours.gold,children:"\u2726 Open the Assistant (ideas, history and longer requests) \u203a"})}):null]})]})}):null,(0,A.jsxs)(h.default,{style:{position:Ie,left:$.x,top:$.y,width:_,height:_,zIndex:61},pointerEvents:"box-none",children:[Se?(0,A.jsx)(n.default.View,{pointerEvents:"none",style:{position:'absolute',left:0,top:0,width:_,height:_,borderRadius:_/2,borderWidth:4,borderColor:v.colours.ok,opacity:Ae,transform:[{scale:ze}]}}):null,Se?(0,A.jsx)(h.default,{pointerEvents:"none",style:{position:'absolute',left:-6,top:-6,width:_+12,height:_+12,borderRadius:(_+12)/2,borderWidth:3+Math.round(7*Y),borderColor:v.colours.ok}}):null,(0,A.jsx)(h.default,{testID:"voice-button",accessible:!0,accessibilityRole:"button",accessibilityLabel:'owner'===g&&'owner'===e?'Voice assistant and Assistant. Hold to talk, let go to send. Tap to type or open the Assistant.':'Voice assistant. Hold to talk, let go to send. Tap to type instead.',...ve.panHandlers,style:[{width:_,height:_,borderRadius:_/2,alignItems:'center',justifyContent:'center',backgroundColor:Se?v.colours.ok:v.colours.gold,borderWidth:2,borderColor:v.colours.bg},{userSelect:'none',WebkitUserSelect:'none',WebkitTouchCallout:'none',touchAction:'none',cursor:'pointer'}],children:'working'===G?(0,A.jsx)(o.default,{color:v.colours.onGold,size:"large"}):(0,A.jsx)(E,{colour:v.colours.onGold,size:Math.round(.5*_)})})]}),(0,A.jsx)(b.Sheet,{visible:ne,onClose:()=>se(!1),title:"Talk to CoverCharge",testID:"voice-explain",children:(0,A.jsxs)(h.default,{style:{gap:10},children:[(0,A.jsxs)(b.T,{children:["Hold the gold button, say what you need, then let go. For example ",P[e].slice(0,3).join(', '),"."]}),(0,A.jsx)(b.T,{children:(0,M.desktopStt)()?'Your Mac will now ask to let CoverCharge use the microphone. It only listens while you hold the button.':'Your browser will now ask to use the microphone. It only listens while you hold the button.'}),(0,A.jsx)(b.T,{size:14,colour:v.colours.muted,children:(0,M.desktopStt)()?'On this Mac, speech is turned into text on the Mac itself, so what you say isn\u2019t sent anywhere. macOS will ask once to let CoverCharge use the microphone. CoverCharge doesn\u2019t keep the audio.':'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,A.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,A.jsx)(b.Button,{testID:"voice-allow",kind:"success",label:"Allow microphone",onPress:async()=>{C.useVoiceSettings.getState().setMicExplained(!0),se(!1);(await(0,M.levelMeter)(()=>{}))(),he({text:'Ready. Now hold the button and speak.',tone:'ok'})}}),(0,A.jsx)(b.Button,{kind:"secondary",label:"Type instead",onPress:()=>{se(!1),ee(!0),X('answer')}})]})})]})}},1091,[20,236,110,214,231,112,253,141,263,277,117,980,872,897,875,5,826,802,810,1050,1099,1048,1049,981,1053,1029,1054,1055,14]);
|
| 34 |
+
__d(function(g,r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.seedPitch=function(){const h='owner'===d.APP_VARIANT?'st-tracy':'chef'===d.APP_VARIANT?'st-bisto':'staff'===d.APP_VARIANT?'st-lenny':null;!h||i.useSession.getState().meId||/[?&]invite=/.test('undefined'!=typeof window?window.location.search:'')||i.useSession.getState().signIn(h);t.useStore.setState(t=>({bookings:t.bookings.map((t,e)=>t.phone||t.walkIn?t:{...t,phone:`07700 900${String(100+e).slice(-3)}`})}));const S=s.useOwner.getState();if(S.shifts.some(t=>t.id.startsWith('pitch-')))return;const p=(0,e.nowFrom)(t.useStore.getState().clock),y=f(p),m=p.getHours()+p.getMinutes()/60,w=(0,s.addDays)(y,-(0,s.weekdayOf)(y)),A=[],k=[];for(const[t,[e,n,i]]of Object.entries(l))if(o.ROSTER.some(e=>e.id===t))for(let o=-7;o<14;o++){const d=(0,s.addDays)(w,o),c=(0,s.weekdayOf)(d);i.includes(c)||(A.push({id:`pitch-${t}-${d}`,staffId:t,date:d,day:c,start:e,end:n,published:o<7,breakAt:n-e>=6?e+3.5:void 0}),d<y?k.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:u(d,e-.1),out:u(d,n+.15),inSite:!0,outSite:!0,breakMins:n-e>=6?30:0,signOff:d<(0,s.addDays)(y,-1)?{by:'Alex',byId:'st-gordon',at:u(d,23.5)}:void 0}):d===y&&e<=m&&k.push({id:`pitch-a-${t}-${d}`,staffId:t,date:d,in:u(d,e-.05),inSite:!0}))}s.useOwner.setState({shifts:[...S.shifts.filter(t=>!A.some(e=>e.staffId===t.staffId&&e.date===t.date)),...A],attendance:[...S.attendance,...k]});const I=n.useCashUp.getState();for(let t=1;t<=10;t++){const e=(0,s.addDays)(y,-t);if([0,1].includes((0,s.weekdayOf)(e)))continue;if(I.cashUps.some(t=>t.rid===c&&t.date===e))continue;const n=1450+373*t%900,o=210+97*t%240;I.saveCashUp({rid:c,date:e,vals:{card:n,cash:o,float:200,cashTips:38+13*t%40,cardTips:92+29*t%70,overUnder:3===t?-2.5:0,notes:3===t?'Till 2 short \xa32.50, counted twice.':''},photos:[],confirmedBy:t%2?'Alex':'Priya',confirmedAt:u(e,23.25),readBy:null})}for(let t=1;t<=3;t++){const e=(0,s.addDays)(w,-7*t);if(I.sales.some(t=>t.rid===c&&t.weekStart===e))continue;const n=11800+640*t;I.saveSales({rid:c,weekStart:e,vals:{gross:n,net:Math.round(n/1.2),vat:Math.round(n-n/1.2),covers:610+22*t,discounts:140,refunds:35},categories:[{name:'Food',amount:Math.round(.62*n)},{name:'Drinks',amount:Math.round(.31*n)},{name:'Takeaway',amount:Math.round(.07*n)}],photos:[],confirmedBy:'Alex',confirmedAt:u((0,s.addDays)(e,7),11),readBy:null})}};var t=r(_d[0]),e=r(_d[1]),s=r(_d[2]),n=r(_d[3]),o=r(_d[4]),i=r(_d[5]),d=r(_d[6]);const c='anchorage',f=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`,u=(t,e)=>{const[s,n,o]=t.split('-').map(Number);return new Date(s,n-1,o,Math.floor(e),Math.round(e%1*60)).toISOString()},l={'st-gordon':[11,21,[0,1]],'st-bisto':[10,20.5,[0,1]],'st-agate':[16,22.5,[0,1,2]],'st-lenny':[11,19,[0,1,3]],'st-finn':[17,23,[0,1,4]],'st-eilidh':[12,18,[0,1,2]],'st-emily':[17,22,[0,1,3]],'st-lillie':[12,20,[0,1,5]],'st-jack':[16,22,[0,1,6]]}},1092,[808,835,826,991,5,830,796]);
|
| 35 |
+
__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"},1093,[]);
|
| 36 |
+
__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"},1094,[]);
|
| 37 |
+
__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"},1095,[]);
|
| 38 |
+
__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"},1096,[]);
|
owner-app/_expo/static/js/web/basket-bc55ff791a24832051ce9f8a27bbdba3.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 k}});var l=_r(d[0]),t=_r(d[1]),n=e(t),s=_r(d[2]),o=_r(d[3]),a=e(_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]),x=_r(d[14]),p=_r(d[15]);function k(){const e=(0,b.useBasket)(),k=(0,b.useRestaurant)(e.restaurantId??void 0),f=(0,b.useAllMenu)(e.restaurantId??void 0),v=(0,b.useCustomer)(),w=(0,b.useOrders)(k?.id),C=(0,b.useStore)(e=>e.setLineQty),S=(0,b.useStore)(e=>e.overrideLine),T=(0,b.useStore)(e=>e.startBasket),B=(0,b.useNow)(15e3),[P,$]=(0,t.useState)(null),[O,I]=(0,t.useState)(!1),[M,F]=(0,t.useState)(''),[L]=(0,t.useState)(()=>(0,o.startForm)()),[N,R]=(0,t.useState)(''),[z,A]=(0,t.useState)(v.phone??''),[D,E]=(0,t.useState)(v.email??''),[_,Y]=(0,t.useState)(!1),q=(0,b.useOrderAtTable)(e.restaurantId??void 0);n.default.useEffect(()=>{q||'table'!==e.mode||b.useStore.setState(e=>({basket:{...e.basket,mode:'takeaway',tableNo:void 0}}))},[q,e.mode]);const[H,G]=(0,t.useState)(null),[K,Q]=(0,t.useState)(!1),W=(0,t.useMemo)(()=>(0,y.linesFromBasket)(e,f,v.allergies),[e,f,v.allergies]);if(!k||!e.lines.length)return(0,p.jsxs)(i.Screen,{title:"Your basket",children:[(0,p.jsx)(i.Muted,{children:"Your basket is empty."}),(0,p.jsx)(i.Button,{label:"Browse restaurants",onPress:()=>l.router.replace('/customer')})]});const J=q&&'table'===e.mode,U=(0,h.takeawaySlots)(k,w,B),V=W.reduce((e,l)=>e+l.unitPrice*l.qty,0),X=W.some(e=>e.contains.length&&!e.overridden),Z=e.lines.filter(e=>{const l=f.find(l=>l.id===e.itemId);return!l||l.soldOut||!l.signOff}),ee=!J&&!P,le=!J&&k.settings.takeawayPaused,te=(0,x.ukPhone)(z),ne=!X&&!Z.length&&O&&!ee&&!le&&(J||te.ok&&(0,x.emailOk)(D)),se=async e=>{const t=await b.repo.orders.placeFromBasket({slotTime:J?void 0:P,tip:0,giftCardCode:e?.giftCardCode,notes:M,paidNow:!J,phone:J?void 0:te.pretty,email:J?void 0:D.trim()||void 0});(0,o.rememberGuard)(t.id,(0,o.guardFor)({...L,hp:N})),Y(!1),l.router.replace(`/customer/order/${t.id}`)},oe=e.lines.find(e=>e.key===H),ae=oe?W[e.lines.indexOf(oe)]:void 0;return(0,p.jsxs)(i.Screen,{title:"Your basket",subtitle:`${k.name} \xb7 ${J?`Table ${e.tableNo} (order at table)`:'Takeaway \u2014 collection'}`,footer:(0,p.jsxs)(a.default,{style:{gap:8},children:[(0,p.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(i.T,{weight:"semibold",children:"Subtotal"}),(0,p.jsx)(i.T,{weight:"bold",size:20,colour:j.colours.gold,children:(0,c.gbp)(V)})]}),X?(0,p.jsx)(i.T,{size:14,colour:j.colours.red,children:"Resolve the blocked allergy item(s) before continuing."}):O?ee&&!le?(0,p.jsx)(i.T,{size:14,colour:j.colours.amber,children:"Choose a collection time."}):null:(0,p.jsx)(i.T,{size:14,colour:j.colours.amber,children:"Confirm your allergies to continue."}),J?(0,p.jsx)(i.Button,{label:"Send order to the kitchen",disabled:!ne,onPress:()=>se(),testID:"send-table-order"}):(0,p.jsx)(i.Button,{label:`Continue to payment \xb7 ${(0,c.gbp)(V)}`,disabled:!ne,onPress:()=>Y(!0),testID:"checkout"})]}),children:[(J||e.tableNo,null),J?(0,p.jsx)(i.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,k.fictional?null:(0,p.jsx)(i.ExampleAllergenNotice,{}),W.map((l,t)=>{const n=e.lines[t],s=l.contains.length&&!l.overridden;return(0,p.jsxs)(i.Card,{highlight:l.contains.length?j.colours.red:l.may.length?j.colours.amber:void 0,children:[(0,p.jsxs)(i.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,p.jsxs)(a.default,{style:{flex:1,paddingRight:8},children:[(0,p.jsx)(i.T,{weight:"semibold",children:l.name}),l.choices.length?(0,p.jsx)(i.Muted,{children:l.choices.join(' \xb7 ')}):null,l.notes?(0,p.jsxs)(i.Muted,{children:["Note: ",l.notes]}):null]}),(0,p.jsx)(i.T,{weight:"semibold",children:(0,c.gbp)(l.unitPrice*l.qty)})]}),s?(0,p.jsxs)(i.Banner,{kind:"danger",title:`BLOCKED \u2014 contains ${l.contains.map(u.allergenLabel).join(', ')}`,children:[(0,p.jsx)(i.T,{size:14,colour:"#FFE3DF",children:`Conflicts with your declared ${v.allergies.filter(e=>l.contains.includes(e.allergen)).map(e=>`${(0,u.allergenLabel)(e.allergen)} (${(0,u.severityLabel)(e.severity)})`).join(', ')}.`}),(0,p.jsxs)(i.Row,{gap:8,style:{marginTop:6},children:[(0,p.jsx)(i.Button,{small:!0,kind:"secondary",label:"Remove",onPress:()=>C(n.key,0)}),(0,p.jsx)(i.Button,{small:!0,kind:"danger",label:"Override\u2026",onPress:()=>{Q(!1),G(n.key)}})]})]}):l.contains.length?(0,p.jsx)(i.Banner,{kind:"danger",title:`Allergy override recorded \u2014 contains ${l.contains.map(u.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,p.jsx)(i.Banner,{kind:"warn",title:`May contain ${l.may.map(u.allergenLabel).join(', ')}`,children:"Cross-contact risk (e.g. shared fryer). Please check with staff."}):null,Z.includes(n)?(0,p.jsx)(i.Badge,{kind:"amber",label:"No longer available online \u2014 please remove"}):null,(0,p.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>C(n.key,0)}),(0,p.jsx)(i.Stepper,{value:n.qty,onChange:e=>C(n.key,e),min:1,label:l.name})]})]},n.key)}),(0,p.jsx)(i.Button,{kind:"ghost",label:"Add more items",onPress:()=>l.router.push(`/customer/${k.id}`)}),J?null:(0,p.jsxs)(i.Card,{children:[(0,p.jsxs)(i.H2,{children:["Collection time \u2014 ",(0,m.niceDate)(B)]}),le?(0,p.jsx)(i.Banner,{kind:"warn",title:"Takeaway paused",children:"The restaurant has paused takeaway slots for now. Please try again later or book a table."}):0===U.length?(0,p.jsx)(i.Banner,{kind:"warn",children:"No collection slots left today."}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(i.Muted,{children:["15-minute slots, max ",k.settings.slotCap," orders each so the kitchen isn\u2019t overloaded."]}),(0,p.jsx)(i.Row,{wrap:!0,gap:6,children:U.slice(0,16).map(e=>(0,p.jsx)(i.Chip,{label:e.label,sub:e.full?'Full':e.cap-e.taken+" left",disabled:e.full,selected:P===e.time.toISOString(),onPress:()=>$(e.time.toISOString())},e.label))})]})]}),(0,p.jsxs)(i.Card,{highlight:O?void 0:j.colours.amber,children:[(0,p.jsx)(i.H2,{children:"Confirm allergies for this order"}),(0,p.jsx)(i.Row,{wrap:!0,gap:6,children:v.allergies.length?v.allergies.map(e=>(0,p.jsx)(i.Badge,{kind:"red",label:`${(0,u.allergenLabel)(e.allergen)} \u2014 ${(0,u.severityLabel)(e.severity)}`},e.allergen)):(0,p.jsx)(i.Muted,{children:"No allergies declared on your profile."})}),(0,p.jsx)(i.Toggle,{label:v.allergies.length?'Yes, these are correct for everyone this order is for':'I confirm no one in this order has a food allergy',value:O,onChange:I}),(0,p.jsx)(i.Button,{small:!0,kind:"ghost",label:"Edit allergies in profile",onPress:()=>l.router.push('/customer/profile')})]}),J?null:(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.H2,{children:"Your details"}),(0,p.jsx)(i.Field,{testID:"order-phone",label:"Mobile number (needed for collection)",value:z,onChangeText:A,keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),!te.ok&&z?(0,p.jsx)(i.T,{size:13,colour:j.colours.amber,children:te.error}):null,(0,p.jsx)(i.Field,{label:"Email (optional)",value:D,onChangeText:E,keyboardType:"email-address",autoCapitalize:"none",placeholder:"you@example.com"}),(0,x.emailOk)(D)?null:(0,p.jsx)(i.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,p.jsx)(i.Muted,{children:"We\u2019ll text your order confirmation and collection time. Preview mode: nothing is sent in this pilot."})]}),(0,p.jsx)(i.Field,{label:"Order notes (optional)",value:M,onChangeText:F,placeholder:"e.g. cutlery please"}),J?(0,p.jsx)(i.Button,{small:!0,kind:"ghost",label:"Switch to takeaway instead",onPress:()=>T(k.id,'takeaway')}):null,(0,p.jsx)(r.MockPay,{visible:_,onClose:()=>Y(!1),amount:V,restaurantId:k.id,onPaid:e=>se({giftCardCode:e.giftCardCode}),title:"Pay for your takeaway"}),(0,p.jsxs)(i.Sheet,{visible:!!oe,onClose:()=>G(null),title:"Allergy override",children:[ae?(0,p.jsx)(i.Banner,{kind:"danger",title:`${ae.name} contains ${ae.contains.map(u.allergenLabel).join(', ')}`,children:"Only continue if this item is for someone without this allergy, or you have spoken to staff."}):null,(0,p.jsx)(i.Toggle,{label:"I understand and want to add it anyway",value:K,onChange:Q}),(0,p.jsx)(i.Button,{kind:"danger",disabled:!K,label:"Confirm override",onPress:()=>{oe&&ae&&S(oe.key,ae.contains),G(null)}})]}),(0,p.jsx)(s.Honeypot,{value:N,onChange:R})]})}},779,[794,20,799,800,117,822,802,803,805,806,807,808,835,810,812,14]);
|
owner-app/_expo/static/js/web/book-fe1a511098175362c634032b33cc795c.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,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=(e=i)&&e.__esModule?e:{default:e},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]),j=_r(_d[16]),k=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),D=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]);function P(){const{rid:e,date:i}=(0,o.useLocalSearchParams)(),P=(0,y.useRestaurant)(e),M=(0,y.useCustomer)(),A=(0,y.useBookings)(e),B=(0,y.useEvents)(e),O=(0,y.useNow)(6e4),[R]=(0,s.useState)(()=>(0,l.startForm)()),[N,z]=(0,s.useState)(''),[F,q]=(0,s.useState)(2),[W,E]=(0,s.useState)(i??(0,f.ymd)(O)),[H,L]=(0,s.useState)(null),[I,_]=(0,s.useState)(M.name),[Y,U]=(0,s.useState)(M.phone??''),[G,Q]=(0,s.useState)(M.email??''),[V,J]=(0,s.useState)(!1),[K,X]=(0,s.useState)(''),[Z,ee]=(0,s.useState)(!1),[te,oe]=(0,s.useState)([]),[se,ne]=(0,s.useState)(!1),le=[...M.allergies,...te.filter(e=>!M.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[ie,ae]=(0,s.useState)(null),re=(0,w.useBlocks)(e=>e.blocks);(0,x.usePublicDayStore)(e=>e.n);const de=e?(0,x.publicDay)(e,W):null,ue=de?[...de.bookings,...A.filter(e=>e.date!==W)]:A,ce=de?[...re.filter(t=>t.rid!==e||t.date!==W),...de.blocks]:re,he=(0,S.usePlan)(e),[me,ge]=(0,s.useState)((0,D.emptyNeeds)()),pe=!0===me.dog,be=pe?me.dogs:0,fe=(0,s.useMemo)(()=>{const e=[],t=new Date(O);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 i&&!e.some(e=>(0,f.ymd)(e)===i)&&e.push((0,f.parseYmd)(i)),e},[O.toDateString(),i]);if(!P)return(0,$.jsx)(u.Screen,{title:"Not found",children:(0,$.jsx)(u.T,{children:"Restaurant not found."})});const ye=P.settings,xe=(0,f.parseYmd)(W),je=(0,w.blocksOn)(ce,P.id,W),ke=ue.filter(e=>e.date===W),ve=he.areas.filter(e=>e.dogs),we=(0,C.dogSetUp)(he),Se=e=>(0,T.freeTablesAt)(he,ke,F,new Date(`${W}T${e}:00`),(0,T.turnFor)(F,ye.turnMins),ye.turnMins,{dog:!0,closed:(0,w.closedAreasAt)(ce,P.id,W,e)}),Te=(0,b.bookingSlots)(P,xe,e=>ue.filter(t=>t.date===W&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),F,O).map(e=>{const t=(0,w.blockAt)(ce,P.id,W,e.time),o=pe&&we&&e.available&&!t&&(!Se(e.time).length||!(0,D.dogTimeOk)(P,ue,W,e.time,be));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),De=Te.some(e=>e.available),Ce=(0,r.depositOf)(ye),$e=(0,r.depositDue)(Ce,F),Pe=$e>0?'deposit':'none',Me=(0,r.depositWords)(Ce,F,P.name),Ae=B.filter(e=>e.date===W),Be=(0,v.ukPhone)(Y),Oe=(0,v.emailOk)(G),Re=(0,D.needsMissing)(me,M.allergies),Ne=!!H&&Z&&!Re.length&&I.trim().length>1&&Be.ok&&Oe,ze=async()=>{const e=(0,D.needsPatch)(me,M.allergies),t=pe&&we?Se(H).map(e=>e.table):[],o=pe?me.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await y.repo.bookings.create({restaurantId:P.id,customerId:M.id,name:I,partySize:F,date:W,time:H,notes:K.trim(),security:Pe,depositPaid:0,...$e?{depositDue:$e,depositPolicy:Me.join(' '),depositRefundable:Ce.refundable,depositCutoffHours:Ce.cutoffHours}:{},phone:Be.pretty,email:G.trim()||void 0,source:'online',...e,...Te.find(e=>e.time===H)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??le,...o?{table:o}:{}});(0,l.rememberGuard)(s.id,(0,l.guardFor)({...R,hp:N})),ae(s)},Fe=(0,y.useStore)(e=>ie?e.bookings.find(e=>e.id===ie.id)?.ref:void 0),qe=e=>(0,k.waMeLink)(P.settings.whatsapp,(0,k.guestWhatsAppText)({name:e.name,ref:Fe??e.ref,date:e.date,time:e.time,partySize:e.partySize},P.name));if(ie){const e='pending'===ie.status;return(0,$.jsxs)(u.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:P.name,children:[(0,$.jsx)(u.Banner,{kind:e?'info':'success',title:`Reference ${Fe??ie.ref}`,children:`${ie.partySize} people \xb7 ${(0,f.niceDateYear)((0,f.parseYmd)(ie.date))} at ${ie.time}`}),e?(0,$.jsx)(u.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,$.jsxs)(u.Card,{children:[(0,$.jsxs)(u.T,{children:["Name: ",ie.name]}),(0,$.jsxs)(u.T,{children:["Mobile: ",ie.phone]}),ie.email?(0,$.jsxs)(u.T,{children:["Email: ",ie.email]}):null,(0,$.jsxs)(u.T,{children:["Allergies shared with the restaurant: ",ie.allergies.length?ie.allergies.map(e=>`${(0,c.allergenLabel)(e.allergen)} (${(0,c.severityLabel)(e.severity)})`).join(', '):'none']}),ie.notes?(0,$.jsxs)(u.T,{children:["Notes: ",ie.notes]}):null,ie.dog?(0,$.jsxs)(u.T,{children:["\ud83d\udc15 Dog coming too",ie.table?` \xb7 dog-friendly table ${ie.table}`:'']}):null,ie.holds?.length?(0,$.jsxs)(u.T,{children:["Reserved: ",ie.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(P.settings.reservables??C.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,ie.tableReq?.length?(0,$.jsxs)(u.T,{children:["Table requested: ",ie.tableReq.map(e=>`T${e}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===ie.security&&ie.depositDue?(0,$.jsxs)(u.T,{weight:"semibold",children:["Deposit due: ",(0,p.gbp)(ie.depositDue),". ",P.name," will tell you how to pay it."]}):null,'deposit'===ie.security&&ie.depositPolicy?(0,$.jsx)(u.Muted,{children:ie.depositPolicy}):null,(0,$.jsxs)(u.Muted,{children:[e?'A text':'A confirmation text',ie.email?' and email':''," to ",ie.phone," ",ie.email?'and your inbox ':'',"is ready. This pilot is in preview mode, so nothing is actually sent yet."]}),(0,$.jsxs)(u.Muted,{children:["Need to change or cancel? Call ",P.phone," and quote ",Fe??ie.ref,"."]})]}),qe(ie)?(0,$.jsxs)(a.default,{style:{gap:4},children:[(0,$.jsx)(u.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=qe(ie);e&&(0,k.openWhatsApp)(e)}}),(0,$.jsx)(u.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,$.jsx)(u.Button,{label:"Back to restaurant",onPress:()=>o.router.replace(`/customer/${P.id}`)})]})}return(0,$.jsxs)(u.Screen,{title:"Book a table",subtitle:P.name,footer:(0,$.jsx)(u.Button,{label:Re.length?Re[0]:F>(ye.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Ne,onPress:()=>ze(),testID:"confirm-booking"}),children:[(0,$.jsx)(D.FirstQuestions,{rid:P.id,value:me,onChange:e=>{e.dog===me.dog&&e.dogs===me.dogs||L(null),ge(e)},party:F,audience:"guest",profile:M.allergies}),(0,$.jsxs)(u.Card,{children:[(0,$.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,$.jsx)(u.H2,{children:"Party size"}),(0,$.jsx)(u.Stepper,{value:F,onChange:e=>{q(e),L(null)},min:1,max:16,label:"party size"})]}),$e?(0,$.jsx)(u.Banner,{kind:"info",title:`Deposit: ${(0,p.gbp)($e)} for ${F} guests`,children:(0,$.jsx)(a.default,{style:{gap:4},children:Me.map(e=>(0,$.jsx)(u.T,{size:13,children:e},e))})}):Ce.on&&Ce.perPersonPence>0?(0,$.jsxs)(u.Muted,{children:["No deposit for fewer than ",Ce.fromParty," guests."]}):null,F>(ye.autoAcceptUpTo??7)?(0,$.jsxs)(u.Muted,{children:["For ",F," people the team checks the booking first, then texts you to confirm."]}):null,pe&&we?(0,$.jsxs)(u.Muted,{children:["Dogs are welcome in the ",ve.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",P.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,$.jsxs)(u.Card,{children:[(0,$.jsx)(u.H2,{children:"Date"}),(0,$.jsx)(u.Row,{wrap:!0,gap:6,children:fe.map(e=>{const t=!!(0,h.hoursFor)(P,e),o=B.some(t=>t.date===(0,f.ymd)(e));return(0,$.jsx)(u.Chip,{label:(0,f.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:W===(0,f.ymd)(e),onPress:()=>{E((0,f.ymd)(e)),L(null)}},(0,f.ymd)(e))})}),Ae.map(e=>(0,$.jsx)(u.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,$.jsxs)(u.Card,{children:[(0,$.jsx)(u.H2,{children:"Time"}),0===Te.length?(0,$.jsx)(u.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,$.jsx)(u.Row,{wrap:!0,gap:6,children:Te.map(e=>(0,$.jsx)(u.Chip,{label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left<F?'Full':'\u2014',disabled:!e.available,selected:H===e.time,onPress:()=>L(e.time)},e.time))}),je.length>0&&Te.some(e=>e.blocked)?(0,$.jsx)(u.Banner,{kind:"info",title:De?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${je.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,f.niceDate)(xe)}. Please give us a ring on ${P.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,t.lastFoodOn)(P,W);return e&&Te.some(e=>e.drinksOnly)?(0,$.jsx)(u.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})(),pe&&Te.some(e=>e.noDog)?(0,$.jsx)(u.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${ve.map(e=>e.name).join(' and ')}${P.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,w.closedAreasAt)(ce,P.id,W,H??'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,$.jsxs)(u.Muted,{children:["Times come from covers per slot (",ye.bookingCoversPerSlot," per half hour, example) and table rules."]})]}),(0,$.jsx)(D.MoreQuestions,{rid:P.id,r:P,value:me,onChange:ge,party:F,date:W,time:H,today:(0,f.ymd)(O),bookings:ue,audience:"guest",showTables:!0}),(0,$.jsxs)(u.Card,{highlight:Z?void 0:j.colours.amber,children:[(0,$.jsx)(u.Field,{label:"Notes (optional)",value:K,onChangeText:X,placeholder:d.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,$.jsx)(u.Toggle,{label:"I confirm the allergy information for this booking",value:Z,onChange:ee}),(0,$.jsx)(u.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,$.jsxs)(u.Card,{children:[(0,$.jsx)(u.H2,{children:"Your details"}),(0,$.jsx)(u.Field,{label:"Name for the booking",value:I,onChangeText:_}),(0,$.jsx)(u.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:Y,onChangeText:U,onBlur:()=>J(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Be.ok||!V&&!Y?null:(0,$.jsx)(u.T,{size:13,colour:j.colours.amber,children:Be.error}),(0,$.jsx)(u.Field,{testID:"book-email",label:"Email (optional)",value:G,onChangeText:Q,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Oe?null:(0,$.jsx)(u.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,$.jsxs)(u.Muted,{children:["We\u2019ll text you a confirmation",G.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,$.jsx)(n.Honeypot,{value:N,onChange:z})]})}},767,[798,794,20,799,800,117,4,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,14]);
|
owner-app/_expo/static/js/web/feedback-cb959353b54fab0866378ed2be72132e.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."})})}},769,[794,20,802,821,808,14]);
|
owner-app/_expo/static/js/web/gift-07557aa0dc548594d98c389388830159.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 b}});var t=_r(d[0]),a=_r(d[1]),n=_r(d[2]),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]);function b(){const{rid:a}=(0,t.useLocalSearchParams)(),n=(0,l.useRestaurant)(a);(0,l.useCustomer)();return(0,c.guestServer)()?n?(0,h.jsx)(u.GiftLive,{slug:a,venue:n.name}):(0,h.jsx)(s.Screen,{title:"Not found",children:(0,h.jsx)(s.T,{children:"Restaurant not found."})}):(0,h.jsx)(x,{})}function x(){const{rid:u}=(0,t.useLocalSearchParams)(),c=(0,l.useRestaurant)(u),b=(0,l.useGiftCards)(u),[x,f]=(0,a.useState)(5e3),[j,p]=(0,a.useState)(''),[g,y]=(0,a.useState)(''),[C,S]=(0,a.useState)(''),[v,w]=(0,a.useState)(!1),[P,T]=(0,a.useState)(null);if(!c)return(0,h.jsx)(s.Screen,{title:"Not found",children:(0,h.jsx)(s.T,{children:"Restaurant not found."})});const M=j?Math.round(100*Number(j))||0:x;return(0,h.jsxs)(s.Screen,{title:"Gift cards",subtitle:`${c.name} \u2014 redeemable only at ${c.name}`,children:[P?(0,h.jsx)(s.Banner,{kind:"success",title:`Gift card created \u2014 ${(0,r.gbp)(P.initial)}`,children:`Code ${P.code}. In production it would be emailed or sent in-app to ${P.recipientName||'the recipient'} (nothing sent in this demo).`}):null,(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.H2,{children:"Your gift cards"}),b.length?b.map(t=>(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.T,{style:{flex:1},children:t.code}),(0,h.jsxs)(s.T,{weight:"semibold",colour:o.colours.gold,children:[(0,r.gbp)(t.balance)," of ",(0,r.gbp)(t.initial)]})]},t.id)):(0,h.jsx)(s.Muted,{children:"None yet."}),(0,h.jsx)(s.Muted,{children:"Balances can be used at checkout on takeaway orders and table bills. Part-use leaves a balance."})]}),(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.H2,{children:"Buy a gift card"}),(0,h.jsx)(s.Row,{wrap:!0,children:[1e3,2500,5e3,15e3].map(t=>(0,h.jsx)(s.Chip,{label:(0,r.gbp)(t),selected:!j&&x===t,onPress:()=>{p(''),f(t)}},t))}),(0,h.jsx)(s.Field,{label:"Or another amount (\xa3)",keyboardType:"decimal-pad",value:j,onChangeText:p,placeholder:"e.g. 40"}),(0,h.jsx)(s.Field,{label:"Recipient\u2019s name",value:g,onChangeText:y}),(0,h.jsx)(s.Field,{label:"Message",value:C,onChangeText:S,multiline:!0,placeholder:"Happy birthday!"}),(0,h.jsx)(s.Muted,{children:"Valid for 24 months from purchase (suggested terms \u2014 to be confirmed by the restaurant)."}),(0,h.jsx)(s.Button,{label:`Buy ${(0,r.gbp)(M)} gift card`,disabled:M<500||M>5e4,onPress:()=>w(!0)})]}),(0,h.jsx)(n.MockPay,{visible:v,onClose:()=>w(!1),amount:M,restaurantId:c.id,allowGiftCard:!1,title:"Buy gift card",onPaid:async()=>{const t=await l.repo.giftCards.purchase(c.id,M,g,C);w(!1),T(t)}})]})}},770,[794,20,822,802,805,808,810,823,824,14]);
|
owner-app/_expo/static/js/web/index-5710ed20b010a67bbb9d07510858c5fc.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]),t=(r=s)&&r.__esModule?r:{default:r},n=_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)(n.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.ok: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)(t.default,{style:{height:8}})]})}},780,[794,20,117,819,802,803,804,808,810,825,836,14]);
|
owner-app/_expo/static/js/web/index-851ab32cc6cd46e29de2ee6ef736ea72.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
owner-app/_expo/static/js/web/index-923dc0939bc1713d1aef15a2ac88516d.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
owner-app/_expo/static/js/web/index-a7773a7d6e42f73e35c2623b14d84f24.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]})}},790,[794,20,796,1057,14]);
|
| 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,ae.jsx)(U.StaffAppCtx.Provider,{value:!0,children:(0,ae.jsx)(de,{})})};var s=_r(d[0]),t=_r(d[1]),o=_r(d[2]),i=_r(d[3]),r=_r(d[4]),l=_r(d[5]),n=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),f=_r(d[10]),p=_r(d[11]),y=_r(d[12]),x=_r(d[13]),b=_r(d[14]),j=_r(d[15]),k=_r(d[16]),w=e(_r(d[17])),S=e(_r(d[18])),C=e(_r(d[19])),v=e(_r(d[20])),T=_r(d[21]),M=_r(d[22]),R=_r(d[23]),P=_r(d[24]),B=_r(d[25]),I=_r(d[26]),O=_r(d[27]),A=_r(d[28]),z=_r(d[29]),L=_r(d[30]),W=_r(d[31]),H=_r(d[32]),_=_r(d[33]),E=_r(d[34]),N=_r(d[35]),U=_r(d[36]),V=_r(d[37]),D=_r(d[38]);_r(d[39]);var G=_r(d[40]),Y=_r(d[41]),F=_r(d[42]),$=_r(d[43]),Q=_r(d[44]),J=_r(d[45]),q=_r(d[46]),K=_r(d[47]),X=_r(d[48]),Z=_r(d[49]),ee=_r(d[50]),se=_r(d[51]),te=_r(d[52]),oe=_r(d[53]),ae=_r(d[54]);const ie=X.ROSTER.find(e=>'chef'===e.app)?.id,re=[{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'}],le={home:'Today',clock:'Clock in / out',rota:'Rota, swaps & leave',chat:'Staff chat',me:'Me'},ne=[{id:'bookings',title:'Bookings',sub:'Any day, back or forward: tables, Covers, Unseat and Undo'},{id:'loyalty',title:'Stamp card',sub:'Find a guest, add a stamp or use a reward'},{id:'guests',title:'Guest profiles',sub:'Look a guest up: visits, Covers, allergies they told us, preferences'},{id:'giftcards',title:'Gift cards',sub:'Check a balance, take it off the bill, mark paid at the till'},{id:'tableorders',title:'Table orders',sub:'Orders from guests\u2019 phones at the table: accept, mark served or cancel'},{id:'soldout',title:'Sold out',sub:'What\u2019s run out today. Mark sold out or Back on; shows on the Display'},{id:'board',title:'Question board',sub:'Ask the team anything anonymously, and vote'},{id:'recipecards',title:'Recipe cards',sub:'Signed-off dishes: photo, ingredients, method and allergens (read-only)'},{id:'avatar',title:'My avatar',sub:'Your space-age avatar, or create one from a photo'},{id:'cashup',title:'Cash up',sub:'End-of-night takings: take a picture of the taking sheet or upload a spreadsheet (if a manager has switched it on for you)'},{id:'haccp',title:'Food safety checks',sub:'Record fridge, freezer, cooking and other checks (say or type)'},{id:'accidents',title:'Accident book',sub:'Report an accident or near miss; see your own entries'},{id:'mypay',title:'My hours & pay',sub:'Shifts, paid hours and estimated pay'},{id:'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:'orderlists',title:'Order lists',sub:'Add what\u2019s running low (Alsons drinks, Cash and carry)'},{id:'phone',title:'Phone notifications',sub:'Turn on reminders on this phone'},{id:'suppliers',title:'Suppliers',sub:'Contacts and order days (if your manager allows)'},{id:'privacy',title:'Privacy & location',sub:'What CoverCharge for Staff stores about you'}];function de(){const{r:e,rid:y,me:x,meId:q,today:K,now:X}=(0,U.useCtx)(3e4);(0,p.useTipsPosted)(y,K);const de=(0,U.useSignedIn)();(0,c.useSoldOutLink)(!0,x);const he=(0,B.useOwner)(e=>e.staff),fe=(0,B.useOwner)(e=>e.staffCanViewSuppliers),[pe,me]=(0,b.useState)('home'),[ge,ye]=(0,b.useState)(null),[xe,be]=(0,b.useState)(!1),je=(0,b.useRef)(null);(0,b.useEffect)(()=>{(0,U.ensureAttendance)(K,X),(0,O.ensureChat)(X)},[K]),globalThis.__ccNow=X.getTime();const ke=(0,O.useChatUnread)().total,we=(0,b.useRef)({t:'home',s:null});we.current={t:pe,s:ge};const Se=(0,b.useRef)([]),Ce=(0,b.useCallback)((e,s=null)=>{const t=we.current;t.t===e&&t.s===s||(Se.current=[...Se.current,{...t,y:Me.leave()}].slice(-30),Me.restore(0)),me(e),ye(s)},[]),ve=(0,b.useCallback)(()=>{if((0,o.runBackLayer)())return!0;const e=we.current;let s=Se.current.pop();for(;s&&s.t===e.t&&s.s===e.s;)s=Se.current.pop();if(!s&&'home'===e.t&&!e.s)return!1;const t=s??{t:'home',s:null};return Me.leave(),me(t.t),ye(t.s),Me.restore(t.y??0),!0},[]);(0,o.useWebBack)(ve);const Te=(0,o.useInnerBackShown)();(0,b.useEffect)(()=>{h.PITCH&&(globalThis.__pitchGo=Ce)},[Ce]),(0,z.useShiftReminders)({rid:y,staffId:q,name:x,onStartBreak:()=>Ce('clock')}),(0,L.useScheduledNotices)({rid:y,staffId:de?.id??'',name:x,onOpen:()=>Ce('me','orderlists')}),(0,W.useOffRotaPrompt)({rid:y,staffId:de?.id??''});const Me=(0,t.useScrollMemory)(je),Re=(0,b.useCallback)((e,s=null)=>'chat'===e?Ce('chat'):'clock'===s?Ce('clock'):'rota'===s?Ce('rota'):s&&ne.some(e=>e.id===s)?Ce('me',s):void Ce('home'===e?'home':'me'),[Ce]);(0,b.useEffect)(()=>{const e=w.default.addEventListener('hardwareBackPress',ve);return()=>e.remove()},[ve]);const Pe='me'===pe&&ge?ne.find(e=>e.id===ge):void 0,Be=(0,E.useOrderLists)(e=>e.settings[y]?.allowStaff??!0),Ie=ne.filter(e=>('suppliers'!==e.id||fe)&&('orderlists'!==e.id||Be||de&&'staff'!==de.role)),Oe=he.filter(e=>e.active&&'staff'===e.role);return(0,ae.jsxs)(T.SafeAreaView,{style:{flex:1,backgroundColor:I.colours.bg},edges:['top','left','right','bottom'],children:[(0,ae.jsxs)(v.default,{style:{paddingHorizontal:14,paddingTop:6,paddingBottom:8,borderBottomWidth:1,borderColor:I.colours.border,gap:6},children:[(0,ae.jsx)(v.default,{style:{alignItems:'center'},children:(0,ae.jsx)(S.default,{testID:"header-me",accessibilityRole:"button",accessibilityLabel:"Signed in as",onPress:()=>be(!0),hitSlop:6,style:{borderWidth:1,borderColor:I.colours.gold,borderRadius:22,paddingHorizontal:10,paddingVertical:4,maxWidth:'86%',minHeight:44,justifyContent:'center'},children:(0,ae.jsxs)(M.Row,{gap:6,children:[(0,ae.jsx)(se.StaffAvatar,{id:q,size:24,ring:!1}),(0,ae.jsxs)(M.T,{size:13,weight:"semibold",colour:I.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[x.replace(' (example)',''),de?'':' (preview)'," \u25be"]})]})})}),(0,ae.jsxs)(M.Row,{gap:10,children:[(0,ae.jsx)(R.RestaurantLogo,{rid:e.id,size:36}),(0,ae.jsxs)(v.default,{style:{flex:1,minWidth:0},children:[(0,ae.jsxs)(M.Row,{gap:6,children:[(0,ae.jsx)(M.T,{weight:"semibold",size:15,numberOfLines:1,style:{flexShrink:1},children:e.name}),(0,ae.jsx)(N.AppBadge,{label:"STAFF"})]}),(0,ae.jsxs)(M.Muted,{size:12,numberOfLines:1,children:["Front of House",e.location?` \xb7 ${e.location.split(',').slice(0,2).join(',')}`:'']}),(0,ae.jsx)(R.PoweredBy,{})]}),(0,ae.jsx)(P.VoiceSlot,{})]})]}),(0,ae.jsxs)(C.default,{ref:je,...Me.props,contentContainerStyle:{padding:14,paddingBottom:60,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,ae.jsxs)(M.Row,{style:{justifyContent:'space-between'},children:['home'===pe&&!ge||Te?null:(0,ae.jsx)(o.BackButton,{onPress:ve}),(0,ae.jsx)(M.T,{size:22,weight:"bold",style:{flex:1,textAlign:'home'===pe&&!ge||Te?'left':'right'},children:Pe?Pe.title:le[pe]})]}),'home'===pe&&de&&'staff'!==de.role&&'undefined'!=typeof window?(0,ae.jsxs)(v.default,{testID:"manager-access-banner",style:{borderWidth:1,borderColor:I.colours.gold,borderRadius:12,padding:10,gap:6},children:[(0,ae.jsx)(M.T,{weight:"semibold",colour:I.colours.gold,children:"You have manager access"}),(0,ae.jsx)(M.Muted,{children:"The Manager app has everything here plus bookings, the rota, staff and settings."}),(0,ae.jsx)(S.default,{accessibilityRole:"button",onPress:()=>{const e=(0,D.appUrl)('owner');e&&window.location.assign(e)},style:{alignSelf:'flex-start',borderWidth:1,borderColor:I.colours.gold,borderRadius:14,paddingHorizontal:12,paddingVertical:5,minHeight:44,justifyContent:'center'},children:(0,ae.jsx)(M.T,{size:14,colour:I.colours.gold,children:"Open the Managers app \u203a"})})]}):null,'home'===pe&&de?(0,ae.jsx)(f.MyTasksToday,{rid:y,staffId:de.id,name:de.name,onShift:(0,z.shiftNow)(de.id,X.getTime()).on}):null,'home'===pe?(0,ae.jsx)(p.TodaysTipsCard,{rid:y,today:K}):null,'home'===pe?(0,ae.jsx)(p.TipsPotCard,{rid:y,today:K}):null,'home'===pe?(0,ae.jsx)(ce,{go:Re}):null,'clock'===pe?(0,ae.jsx)(Q.ClockInOut,{}):null,'rota'===pe?(0,ae.jsx)(Q.Rota,{}):null,'chat'===pe?(0,ae.jsx)(O.Chat,{go:Re}):null,'me'!==pe||Pe?null:(0,ae.jsxs)(v.default,{style:{gap:10},children:[(0,ae.jsx)(v.default,{style:{borderRadius:14,borderWidth:1,borderColor:I.colours.border,backgroundColor:I.colours.surface,overflow:'hidden'},children:Ie.map((e,s)=>(0,ae.jsx)(S.default,{accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>Ce('me',e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:I.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,ae.jsxs)(M.Row,{style:{justifyContent:'space-between'},children:[(0,ae.jsxs)(v.default,{style:{flex:1},children:[(0,ae.jsx)(M.T,{weight:"medium",children:e.title}),(0,ae.jsx)(M.Muted,{children:e.sub})]}),(0,ae.jsx)(M.T,{colour:I.colours.muted,children:"\u203a"})]})},e.id))}),fe?null:(0,ae.jsx)(M.Muted,{children:"Suppliers are hidden: your manager hasn\u2019t shared them with staff."}),(0,ae.jsxs)(M.Muted,{center:!0,children:["Staff app \xb7 ",u.APP_VERSION," \xb7 ",'live'===oe.useSync.getState().mode?'shared with your team':'saved on this device until it connects']})]}),'loyalty'===Pe?.id?(0,ae.jsx)(i.StaffLoyalty,{venue:e.name}):null,'guests'===Pe?.id?(0,ae.jsx)(r.GuestProfiles,{me:x.replace(' (example)',''),manager:!1}):null,'bookings'===Pe?.id?(0,ae.jsx)(A.Bookings,{}):null,'giftcards'===Pe?.id?(0,ae.jsx)(l.GiftCardsPage,{me:x.replace(' (example)','')}):null,'tableorders'===Pe?.id?(0,ae.jsx)(s.StaffTableOrders,{rid:y,me:x.replace(' (example)','')}):null,'soldout'===Pe?.id?(0,ae.jsx)(n.SoldOutList,{rid:y,by:x.replace(' (example)','')}):null,'board'===Pe?.id?(0,ae.jsx)(k.QuestionBoard,{rid:y,today:K,manager:!1,by:""}):null,'recipecards'===Pe?.id?(0,ae.jsx)(j.RecipeCards,{rid:e.id,actor:{name:x,role:'staff'},mode:"read"}):null,'avatar'===Pe?.id?(0,ae.jsx)(te.AvatarMaker,{meId:q,me:x}):null,'cashup'===Pe?.id?(0,ae.jsx)(ue,{rid:y,today:K,meId:q,me:x}):null,'haccp'===Pe?.id?(0,ae.jsx)(ee.HaccpLog,{mode:"staff",me:x,meId:q,now:X}):null,'accidents'===Pe?.id?(0,ae.jsx)(Z.AccidentBook,{app:"staff",me:x,meId:q,now:X,seeAll:!1}):null,'mypay'===Pe?.id?(0,ae.jsxs)(v.default,{style:{gap:10},children:[(0,ae.jsx)(F.MyPeriods,{staffId:q}),(0,ae.jsx)(Y.MyHoursPay,{staffId:q})]}):null,'mytips'===Pe?.id?(0,ae.jsx)(J.MyTips,{}):null,'timesheets'===Pe?.id?(0,ae.jsxs)(v.default,{style:{gap:10},children:[(0,ae.jsx)(F.MyPeriods,{staffId:q}),(0,ae.jsx)(Q.Timesheets,{})]}):null,'orderlists'===Pe?.id?(0,ae.jsx)(H.OrderListsScreen,{rid:y,today:K,editor:!!de&&'staff'!==de.role,who:{id:q,name:x.replace(' (example)','')}}):null,'phone'===Pe?.id?(0,ae.jsxs)(v.default,{style:{gap:8},children:[(0,ae.jsx)(M.Muted,{children:"Get reminders like \u201cMills milk order\u201d on this phone, even with the app closed (once your manager switches phone notifications on). iPhone: add the app to your Home Screen first (iOS 16.4 or later)."}),(0,ae.jsx)(_.PushButton,{})]}):null,'suppliers'===Pe?.id?fe?(0,ae.jsx)($.Suppliers,{}):(0,ae.jsx)(M.Muted,{children:"Your manager hasn\u2019t shared suppliers with staff."}):null,'privacy'===Pe?.id?(0,ae.jsxs)(v.default,{style:{gap:8},children:[(0,ae.jsx)(M.T,{size:14,children:"\u2022 Location is checked when you tap Clock in, Clock out, Start break or End break, and (if you allowed location) while the app is open to ask if you want to clock in when you\u2019re at the venue but not on the rota. Never in the background."}),(0,ae.jsx)(M.T,{size:14,children:"\u2022 Each clock record keeps the location reading, how accurate it was, whether it was inside the venue area, and the time. Managers can see these."}),(0,ae.jsx)(M.T,{size:14,children:"\u2022 You see only your own hours, pay estimates and tips. Managers see the team\u2019s."}),(0,ae.jsxs)(M.T,{size:14,children:["\u2022 Chat messages stay within ",e.name,"\u2019s team."]}),(0,ae.jsx)(M.T,{size:14,children:"\u2022 Pay figures are estimates before tax and deductions; your payslip is the official record."}),(0,ae.jsx)(M.Muted,{children:"Prototype: everything is stored on this device. Nothing is sent."})]}):null]}),(0,ae.jsx)(v.default,{style:{flexDirection:'row',borderTopWidth:1,borderColor:I.colours.border,backgroundColor:'#0d0d0d'},children:re.map(e=>{const s=pe===e.id;return(0,ae.jsxs)(S.default,{accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:e.label,onPress:()=>Ce(e.id),style:{flex:1,alignItems:'center',paddingVertical:8,gap:2},children:[(0,ae.jsxs)(v.default,{children:[(0,ae.jsx)(G.Icon,{name:e.icon,colour:s?I.colours.gold:I.colours.muted}),'chat'===e.id&&ke?(0,ae.jsx)(v.default,{style:{position:'absolute',right:-8,top:-4,backgroundColor:I.colours.red,borderRadius:8,minWidth:16,height:16,alignItems:'center',justifyContent:'center'},children:(0,ae.jsx)(M.T,{size:10,weight:"bold",children:ke})}):null]}),(0,ae.jsx)(M.T,{size:11,colour:s?I.colours.gold:I.colours.muted,children:e.label})]},e.id)})}),(0,ae.jsx)(M.Sheet,{visible:xe,onClose:()=>be(!1),title:"Signed in as",children:de?(0,ae.jsxs)(v.default,{style:{gap:8},children:[(0,ae.jsxs)(M.Row,{gap:10,children:[(0,ae.jsx)(se.StaffAvatar,{id:de.id,size:48}),(0,ae.jsxs)(v.default,{style:{flex:1},children:[(0,ae.jsx)(M.T,{weight:"semibold",children:de.name}),(0,ae.jsx)(M.Muted,{children:(0,D.levelJob)(de.level??'Staff',de.job)})]})]}),(0,ae.jsx)(M.Muted,{children:"Signed in with your personal link. This phone remembers you."}),'staff'!==de.role?(0,ae.jsx)(M.Button,{kind:"secondary",label:"Back to CoverCharge for Managers",onPress:()=>{const e=(0,D.appUrl)('owner');e&&window.location.assign(e)}}):null,de.id===ie?(0,ae.jsx)(M.Button,{kind:"secondary",label:"Back to CoverCharge for Head Chef",onPress:()=>{const e=(0,D.appUrl)('chef');e&&window.location.assign(e)}}):null,(0,ae.jsx)(M.Button,{kind:"ghost",label:"Not you? Sign out on this device",onPress:()=>{D.useSession.getState().signOut(),be(!1)}})]}):(0,ae.jsxs)(v.default,{style:{gap:8},children:[(0,ae.jsx)(M.Muted,{children:"Not signed in: this is a preview. Open your personal link, or paste it here, to sign in as yourself."}),(0,ae.jsx)(V.SignInWithLink,{}),(0,ae.jsx)(M.Muted,{children:"Or preview the app as a team member:"}),Oe.map(e=>(0,ae.jsxs)(M.Row,{gap:8,children:[(0,ae.jsx)(se.StaffAvatar,{id:e.id,size:36}),(0,ae.jsx)(M.Button,{kind:e.id===q?'primary':'secondary',label:`${e.name.replace(' (example)','')} \xb7 ${e.job}`,onPress:()=>{B.useOwner.setState({staffAs:e.id}),be(!1),Ce('home')},style:{flex:1}})]},e.id))]})})]})}function ce({go:e}){const{rid:s,today:t}=(0,U.useCtx)(3e4),o=(0,K.useTravelDay)('staff',t);return(0,ae.jsxs)(v.default,{style:{gap:10},children:[(0,ae.jsx)(K.DayBar,{app:"staff",today:t}),o?(0,ae.jsx)(K.DayView,{rid:s,day:o,today:t,app:"staff"}):(0,ae.jsx)(q.StaffHome,{go:e})]})}function ue({rid:e,today:s,meId:t,me:o}){return!0!==(0,x.useCashAccess)(e=>e.mine)?(0,ae.jsx)(y.NoCashUpAccess,{}):(0,ae.jsx)(p.CashUpScreen,{rid:e,today:s,canEdit:!0,who:{id:t??'me',name:o.replace(' (example)','')}})}},1057,[1034,969,970,1035,1025,1036,1024,863,1009,2,971,972,1027,1058,20,1031,995,223,253,141,117,279,802,873,872,826,810,979,973,903,982,983,1023,998,1059,865,875,975,830,112,978,1022,994,1007,1020,1021,977,869,5,1038,1040,898,1033,809,14]);
|
owner-app/_expo/static/js/web/index-da33cd41d3cd5ea80a3d4a6704d09f4e.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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]})}},786,[794,20,796,841,860,14]);
|
| 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 ce}}),_e.DisplayBoard=function(){const{width:e,height:l}=(0,T.default)(),B=e>=l,ne=B&&e>=600,oe=ne,fe=Math.round(Math.min(520,Math.max(240,.3*e))),[ye,je]=(0,c.useState)({w:0,h:0}),we=(0,z.useOwner)(e=>e.site),ke=(0,P.useRestaurant)(we);(0,J.useAlertWatcher)(we),(0,o.useSoldOutLink)(!1);const De=(0,P.useOrders)(we),ve=(0,P.useBookings)(we),Te=(0,P.useEvents)(we),Ie=(0,P.useStore)(e=>e.skipMinutes),Ce=(0,P.useStore)(e=>e.clock.mode),Se=(0,P.useNow)(5e3),Be=(0,z.useOwner)(e=>e.staff),Me=(0,z.useOwner)(e=>e.attendance),Pe=(0,z.useOwner)(e=>e.shifts);h.default.useEffect(()=>{(0,E.ensureAttendance)((0,M.ymd)(Se),Se)},[(0,M.ymd)(Se)]);const Re=Me.filter(e=>e.in&&!e.out&&Se.getTime()-new Date(e.in).getTime()<72e6&&Se.getTime()>=new Date(e.in).getTime()),ze=ge(Be.find(e=>e.id===Re[0]?.staffId)?.name)||'Duty Manager',Ae=(0,M.ymd)(Se),Ee=(0,p.useTravelDay)('display',Ae),Le=(0,A.useFrontDoor)(Ae,B),$e=(0,L.useDisplaySettings)(we),He=$e.privacy,Oe=(0,L.usePlan)(we),We=(0,L.useFloor)(e=>e.live[we]),Fe=(0,X.useBlocks)(e=>e.blocks),[Ge,Ne]=(0,c.useState)('plan'),[Ve,qe]=(0,c.useState)('all'),[Ue,Ke]=(0,c.useState)(null),[Ye,Qe]=(0,c.useState)(null),[Je,Xe]=(0,c.useState)(null),[Ze,et]=(0,c.useState)(!1),[tt,lt]=(0,c.useState)(!1),[st,it]=(0,c.useState)(null),[at,nt]=(0,c.useState)(!1),ot=(0,P.useWaitlist)(we),rt=(0,P.useStore)(e=>e.walkIns[we]??0),[dt,ut]=(0,c.useState)(!1),[ct,gt]=(0,c.useState)(null);h.default.useEffect(()=>{ct&&((0,r.notify)({id:`floor-note:${Date.now()}`,title:ct,timeoutMs:4500,big:!0,testID:'floor-toast'}),gt(null))},[ct]),h.default.useEffect(()=>((0,y.setDisplaySilent)(!0),()=>(0,y.setDisplaySilent)(!1)),[]);const[ht,ft]=(0,c.useState)(null),bt=h.default.useRef(0),[xt,pt]=(0,c.useState)(null);h.default.useEffect(()=>{if(!ht)return;bt.current=Date.now();const e=setInterval(()=>{const e=Date.now()-bt.current;if(e>=ce)return ft(null),void gt('Table plan locked again after 2 minutes with no touches. Unsaved changes were not kept.');pt(e>=105e3?Math.ceil((ce-e)/1e3):null)},1e3);return()=>clearInterval(e)},[ht]);const mt=e=>Xe({title:`Guest details \xb7 ${e.time}`,body:(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(me,{rid:we,id:e.id,turnBase:ke.settings.turnMins}),e.walkIn?null:(0,ue.jsx)(C.Button,{kind:"secondary",label:"Edit booking",testID:"details-edit-booking",accessibilityLabel:`Edit booking, ${e.name}, ${e.time}`,onPress:()=>{Xe(null),it(e.id)},style:{minHeight:56}}),(0,U.bookingDetails)(e)]})}),yt=ve.filter(e=>e.date===Ae).sort((e,t)=>e.time.localeCompare(t.time)),jt=yt.filter(e=>!['cancelled','noshow'].includes(e.status)),wt=jt.reduce((e,t)=>e+t.partySize,0),kt=De.filter(he).sort((e,t)=>Number('new'===t.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(t.slotTime??t.createdAt)),Dt=(0,c.useMemo)(()=>(0,t.forecastToday)(ke,ve,De,Te,Se),[ke,ve,De,Te,Se.getTime()/6e4|0]),vt=(0,X.closedAreasAt)(Fe,we,Ae,(0,M.hm)(Se)),Tt=[...vt].join(','),It=(0,c.useMemo)(()=>(0,$.floorView)(Oe,ve,De,We??{},Se,ke.settings.turnMins,vt),[Oe,ve,De,We,Se.getTime(),Tt]),Ct=(0,q.hoursFor)(ke,Se),St=Ct?.open??new Date(`${Ae}T12:00:00`),Bt=Ct?.close??new Date(`${Ae}T21:00:00`),Mt=(0,M.addMins)(St,-St.getMinutes()),Pt=(0,M.addMins)(Bt,90),Rt=e=>new Date(`${Ae}T${e}:00`),zt=(0,X.blocksOn)(Fe,we,Ae).map(e=>({from:Rt(e.from),to:Rt(e.to),label:e.reason??'Paused'})),At=Object.keys(It).filter(e=>'blocked'===It[e]?.status),Et=Dt.open&&Dt.enough&&Dt.restOfDay.high>0?`${Dt.example?'Example figures':'Estimate'} (faint guide only): ${(0,t.coversRange)(Dt.restOfDay.low,Dt.restOfDay.high)} for the rest of today`:void 0,Lt=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 gt('dirty'===s?`Table ${t} needs clearing first.`:`Table ${t} is ${$.STATUS[s].label.toLowerCase()}. Pick a free table.`);await P.repo.bookings.update(l.id,{table:t});const i=We?.[e]?.stage;L.useFloor.getState().setLive(we,t,{stage:i??'seated',dirty:!1}),L.useFloor.getState().setLive(we,e,{stage:void 0,dirty:!0}),gt(`${(0,V.privName)(l,He)} moved Table ${e} \u2192 ${t}. Table ${e} needs clearing.`)},$t=Oe.areas.filter(e=>Oe.tables.some(t=>t.areaId===e.id)),Ht=e=>{const t=Oe.tables.filter(t=>t.areaId===e);return`${t.filter(e=>['free','soon'].includes(It[e.name]?.status??'free')).length}/${t.length} free`},Ot='all'===Ve||$t.some(e=>e.id===Ve)?Ve:'all',Wt=e=>(0,ue.jsx)(H.FloorCanvas,{plan:Oe,areaId:e,mode:"live",fit:"contain",crop:!0,fill:ne,big:!0,view:It,privacy:He,turnBase:ke.settings.turnMins,highlight:Ye?[Ye]:void 0,onTap:e=>{return t=e.name,void(Ye?(t!==Ye&&Lt(Ye,t),Qe(null)):Ke(t));var t},onDrop:(e,t)=>Lt(e.name,t.name)}),Ft=B||$t.length>2?2:1,Gt=e=>{const t=Oe.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},Nt=[];for(let e=0;e<$t.length;e+=Ft)Nt.push($t.slice(e,e+Ft));const _t=ne?(0,O.venueGrid)($t.map(e=>{const t=(0,H.areaBounds)(Oe,e.id);return{id:e.id,w:t.w,h:t.h,minScale:(0,H.minReadableScale)(Oe,e.id)}}),ye.w,ye.h):null,Vt=e=>(0,ue.jsxs)(C.Row,{style:{justifyContent:'space-between',height:O.AREA_LABEL_H-2,paddingHorizontal:4},children:[(0,ue.jsxs)(C.T,{size:14,weight:"semibold",colour:(0,R.brandColour)(e.colour),numberOfLines:1,style:{flexShrink:1},children:[e.name,(0,W.areaMarks)(e)]}),vt.has(e.id)?(0,ue.jsx)(C.T,{size:13,weight:"semibold",colour:R.colours.blue,children:"Closed for weather"}):(0,ue.jsx)(C.T,{size:13,colour:R.colours.muted,children:Ht(e.id)})]}),qt=(0,ue.jsx)(v.default,{testID:"venue-grid",style:{flex:1,minHeight:0},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout;(Math.abs(t-ye.w)>1||Math.abs(l-ye.h)>1)&&je({w:t,h:l})},children:_t?(0,ue.jsx)(D.default,{style:{flex:1},scrollEnabled:_t.scroll,showsVerticalScrollIndicator:_t.scroll,contentContainerStyle:{gap:O.GRID_GAP},children:_t.rows.map((e,t)=>(0,ue.jsx)(v.default,{style:{height:_t.rowHeights[t],flexDirection:'row',gap:O.GRID_GAP},children:e.map(e=>{const t=$t.find(t=>t.id===e);return(0,ue.jsxs)(v.default,{testID:`area-cell-${e}`,style:{width:_t.cellW,gap:2},children:[Vt(t),(0,ue.jsx)(v.default,{style:{flex:1},children:Wt(e)})]},e)})},t))}):null}),Ut=(0,ue.jsxs)(v.default,{testID:"venue-plan",style:{flex:1,gap:10},children:[(()=>{const t=[(0,ue.jsx)(xe,{label:"Whole venue",selected:'all'===Ot,onPress:()=>qe('all')},"__all"),...$t.map(e=>(0,ue.jsx)(xe,{label:`${e.name}${(0,W.areaMarks)(e)}`,colour:(0,R.brandColour)(e.colour),sub:vt.has(e.id)?'closed':Ot===e.id?Ht(e.id):void 0,selected:Ot===e.id,onPress:()=>qe(e.id)},e.id))];return ne&&l<500||!ne&&e<900?(0,ue.jsx)(D.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:{flexGrow:0},contentContainerStyle:{gap:6},children:t}):(0,ue.jsx)(C.Row,{wrap:!0,gap:8,children:t})})(),Ye?(0,ue.jsxs)(C.Row,{gap:8,style:{backgroundColor:R.colours.goldTint,borderRadius:10,padding:8},children:[(0,ue.jsxs)(C.T,{weight:"semibold",colour:R.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Ye,": tap the new table."]}),(0,ue.jsx)(C.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Qe(null)})]}):null,'all'===Ot&&ne?qt:'all'===Ot?(0,ue.jsx)(v.default,{style:{flex:1,gap:12,minHeight:oe?void 0:360},children:Nt.map((e,t)=>(0,ue.jsxs)(v.default,{style:{flex:Math.max(.3,...e.map(e=>Gt(e.id))),flexDirection:'row',gap:8},children:[e.map(e=>(0,ue.jsxs)(v.default,{style:{flex:1,gap:2},children:[(0,ue.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,ue.jsxs)(C.T,{size:14,weight:"semibold",colour:(0,R.brandColour)(e.colour),children:[e.name,(0,W.areaMarks)(e)]}),vt.has(e.id)?(0,ue.jsx)(C.T,{size:13,weight:"semibold",colour:R.colours.blue,children:"Closed for weather"}):(0,ue.jsx)(C.Muted,{children:Ht(e.id)})]}),(0,ue.jsx)(v.default,{style:{flex:1},children:Wt(e.id)})]},e.id)),e.length<Ft?(0,ue.jsx)(v.default,{style:{flex:1}}):null]},t))}):(0,ue.jsx)(v.default,{style:{flex:1,minHeight:oe?void 0:360},children:Wt(Ot)})]}),Kt=(0,ue.jsx)(v.default,{testID:"venue-timeline",style:{flex:1,minHeight:oe?void 0:360},children:(0,ue.jsx)(N.Timeline,{plan:Oe,bookings:yt,now:Se,privacy:He,turnBase:ke.settings.turnMins,t0:Mt,t1:Pt,pauses:zt,blockedTables:At,onOpen:e=>{const t=(0,L.tablesOf)(e.table)[0];t&&It[t]?Ke(t):mt(e)}})}),Yt='timeline'===Ge,Qt=(0,ue.jsx)(v.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===Yt;return(0,ue.jsx)(k.default,{testID:l,accessibilityRole:"tab",accessibilityLabel:t,accessibilityState:{selected:s},onPress:()=>Ne(e),style:{flex:1,minHeight:44,paddingHorizontal:16,borderRadius:11,alignItems:'center',justifyContent:'center',backgroundColor:s?R.colours.gold:'transparent',...le.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,ue.jsx)(C.T,{size:15,weight:"semibold",colour:s?'#16120B':'#BDB5A6',children:t})},e)})}),Jt=e=>(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(se.BigAction,{premium:!0,label:"Walk-in",onPress:Le.openWalkIn,testID:"add-walkin",block:e,size:l<500?'m':'l'}),(0,ue.jsx)(se.BigAction,{premium:!0,label:"New booking",onPress:Le.openBooking,testID:"add-booking",block:e,size:l<500?'m':'l'}),(0,ue.jsx)(se.BigAction,{premium:!0,label:"Edit booking",onPress:()=>lt(!0),testID:"display-edit-booking",block:e,size:l<500?'m':'l'})]});(0,de.useDisplayNotices)(we);const Xt=(0,ue.jsxs)(v.default,{testID:"display-tools",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[(0,ue.jsx)(re.DisplayClockButton,{}),Oe.areas.some(e=>e.outdoor)?(0,ue.jsx)(Z.CloseGardenButton,{rid:we,r:ke,now:Se,by:ze,quiet:!0,short:!0}):null,(0,ue.jsx)(Z.BlockBookingsButton,{rid:we,r:ke,now:Se,by:ze,quiet:!0,display:!0}),(0,ue.jsx)(G.HoldToEdit,{quiet:!0,onUnlock:()=>{pt(null),ft({at:Date.now()})},onHint:()=>gt('Plan locked. Press and hold Edit plan for 2 seconds to unlock it.')}),(0,ue.jsx)(a.GiftQrButton,{rid:we,venue:ke.name}),(0,ue.jsx)(k.default,{testID:"eos-open",accessibilityRole:"button",accessibilityLabel:"End-of-service summary",onPress:()=>nt(!0),style:({pressed:e})=>({...le.look.quiet(e),flexGrow:1}),children:(0,ue.jsx)(C.T,{size:15,weight:"semibold",colour:R.colours.goldLight,children:"End of service"})})]}),Zt=kt.length?(0,ue.jsxs)(v.default,{testID:"takeaway-panel",style:[le.look.panel,{overflow:'hidden'}],children:[(0,ue.jsxs)(C.Row,{style:{justifyContent:'space-between',paddingHorizontal:14,paddingTop:12},children:[(0,ue.jsx)(C.T,{size:15,weight:"semibold",children:"Takeaway"}),(0,ue.jsxs)(C.T,{size:12,colour:R.colours.muted,children:[kt.length," live"]})]}),(0,ue.jsx)(v.default,{style:{padding:10},children:(0,ue.jsx)(pe,{list:kt,me:ze,compact:!0,bookings:ve})})]}):null,el=(0,ue.jsx)(te.DueToday,{shifts:Pe,att:Me,staff:Be,today:Ae,now:Se,compact:!ne}),tl=fe>=440,ll=(0,ue.jsxs)(v.default,{style:{flex:1,flexDirection:'row',padding:14,paddingTop:12,gap:14,minHeight:0},children:[(0,ue.jsx)(v.default,{testID:"display-main",style:{flex:1,minWidth:0},children:Ee?(0,ue.jsx)(D.default,{contentContainerStyle:{gap:10,paddingBottom:14},children:(0,ue.jsx)(p.DayView,{rid:we,day:Ee,today:Ae,app:"display"})}):Yt?Kt:Ut}),(0,ue.jsxs)(v.default,{testID:"display-side",style:{width:fe,gap:10,minHeight:0},children:[(0,ue.jsx)(v.default,{testID:"primary-actions",style:{flexDirection:tl?'row':'column',gap:10},children:Jt(!tl)}),(0,ue.jsxs)(D.default,{testID:"display-side-scroll",style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:14},children:[(0,ue.jsx)(p.DayBar,{app:"display",today:Ae}),Ee?null:(0,ue.jsx)(f.CoversToday,{rid:we,sound:(0,y.flapSoundOn)(),onPress:()=>Ne('timeline')}),Ee?null:(0,ue.jsx)(b.LastFoodBanner,{rid:we,now:Se,big:!0}),Ee?null:(0,ue.jsx)(x.NextTableFreeCard,{rid:we,now:Se,big:!0}),Qt,Xt,(0,ue.jsx)(Z.BlocksBanner,{rid:we,now:Se,big:!0,by:ze}),Zt,el,(0,ue.jsx)(ee.DayGraph,{todays:yt,open:St,close:Bt,now:Se,turnBase:ke.settings.turnMins,pauses:zt,height:Math.round(Math.min(140,Math.max(100,.14*l))),forecastNote:Et})]})]})]}),sl=B?Math.round(Math.min(160,Math.max(105,.16*l))):160,il=e<1180,al=B&&e>=900;return(0,ue.jsxs)(I.SafeAreaView,{style:{flex:1,backgroundColor:R.colours.bg},children:[(0,ue.jsxs)(v.default,{testID:"display-header",style:{flexDirection:'row',flexWrap:al?'nowrap':'wrap',alignItems:'center',paddingHorizontal:e>=1e3?18:14,paddingVertical:l<500?3:8,gap:il?10:14,minHeight:l<500?46:60,backgroundColor:'#0D0D0C',...le.look.web({backgroundImage:'linear-gradient(180deg, #121110 0%, #0B0B0B 100%)'})},children:[(0,ue.jsx)(v.default,{style:{flexShrink:1,minWidth:0},children:(0,ue.jsx)(S.RestaurantBrand,{rid:ke.id,size:30})}),(0,ue.jsx)(u.AppBadge,{label:"DISPLAY"}),e>=1e3?(0,ue.jsx)(v.default,{style:{width:1,height:26,backgroundColor:'rgba(255,255,255,0.08)'}}):null,(0,ue.jsxs)(v.default,{style:{flexDirection:'row',alignItems:'baseline',gap:10},children:[(0,ue.jsx)(C.T,{size:26,weight:"semibold",colour:R.colours.goldLight,style:{letterSpacing:.5,lineHeight:32},children:(0,M.hm)(Se)}),l>=500&&!il?(0,ue.jsx)(C.T,{size:14,colour:R.colours.muted,children:(0,M.niceDate)(Se)}):null]}),(0,ue.jsx)(v.default,{style:{flex:1}}),(0,ue.jsx)(ie.ShellfishChip,{rid:we,by:ze,app:"display",size:e<1e3||l<500?'s':'m'}),(0,ue.jsx)(be,{tight:e<1e3,items:[{label:'tables',value:jt.length,testID:'badge-tables'},{label:'covers',value:wt,testID:'badge-covers'},{label:'takeaway',value:kt.length,alert:kt.some(e=>'new'===e.status),testID:'badge-takeaway',onPress:()=>et(!0)}]}),l>=500||!He?(0,ue.jsx)(C.T,{size:12,colour:He?'#A89A80':R.colours.amber,children:He?'Privacy':'Privacy off'}):null,(0,ue.jsx)(k.default,{testID:"colour-key-help",accessibilityRole:"button",accessibilityLabel:"Help: table colours and symbols",onPress:()=>ut(!0),style:({pressed:e})=>({width:44,height:44,borderRadius:22,borderWidth:1,borderColor:'rgba(255,255,255,0.10)',backgroundColor:e?'rgba(255,255,255,0.08)':'rgba(255,255,255,0.03)',alignItems:'center',justifyContent:'center'}),children:(0,ue.jsx)(C.T,{size:15,weight:"semibold",colour:R.colours.muted,children:"?"})}),'simulated'===Ce?(0,ue.jsx)(k.default,{accessibilityRole:"button",accessibilityLabel:"Demo: skip 15 minutes",onPress:()=>Ie(15),style:{minHeight:44,minWidth:44,alignItems:'center',justifyContent:'center'},children:(0,ue.jsx)(C.T,{size:11,colour:R.colours.muted,children:il?'+15':'Demo +15 min'})}):null,(0,ue.jsx)(w.VoiceSlot,{size:l<500?52:il?56:72})]}),Ee?null:(0,ue.jsx)(ae.TodayGlance,{rid:we,today:Ae,now:Se,open:St,close:Bt,hours:Dt.hours,shifts:Pe,att:Me,staff:Be,height:ne?l<500?84:l<760?104:118:128}),ne?ll:(nl=(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsxs)(v.default,{testID:"front-door-bar",style:{gap:10},children:[(0,ue.jsx)(v.default,{testID:"primary-actions",style:{flexDirection:'row',gap:12},children:Jt(!1)}),(0,ue.jsxs)(v.default,{style:{flexDirection:'row',gap:10,alignItems:'center',flexWrap:e>=700?'nowrap':'wrap'},children:[(0,ue.jsx)(v.default,{style:{flexGrow:1,flexBasis:e>=700?280:'100%'},children:Qt}),(0,ue.jsx)(v.default,{style:{flexGrow:2,flexShrink:1,minWidth:0},children:Xt})]})]}),(0,ue.jsx)(Z.BlocksBanner,{rid:we,now:Se,big:!0,by:ze}),(0,ue.jsx)(p.DayBar,{app:"display",today:Ae}),Ee?(0,ue.jsx)(p.DayView,{rid:we,day:Ee,today:Ae,app:"display"}):(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(f.CoversToday,{rid:we,big:e>=700,sound:(0,y.flapSoundOn)(),onPress:()=>Ne('timeline')}),(0,ue.jsx)(b.LastFoodBanner,{rid:we,now:Se,big:!0}),(0,ue.jsx)(x.NextTableFreeCard,{rid:we,now:Se,big:!0}),(0,ue.jsx)(v.default,{style:{flex:1,minHeight:Math.max(460,.5*l)},children:Yt?Kt:Ut})]}),Zt,(0,ue.jsxs)(v.default,{style:{flexDirection:e>=700?'row':'column',gap:12,alignItems:'stretch'},children:[(0,ue.jsx)(v.default,{style:{flex:e>=700?1.4:void 0},children:(0,ue.jsx)(ee.DayGraph,{todays:yt,open:St,close:Bt,now:Se,turnBase:ke.settings.turnMins,pauses:zt,height:sl,forecastNote:Et})}),(0,ue.jsx)(v.default,{style:{flex:e>=700?1:void 0},children:el})]})]}),oe?(0,ue.jsx)(v.default,{style:{flex:1,padding:14,paddingTop:12,gap:12},children:nl}):(0,ue.jsx)(D.default,{style:{flex:1},contentContainerStyle:{flexGrow:1,padding:16,paddingTop:14,gap:14},children:nl})),(0,ue.jsx)(n.SoldOutStrip,{rid:we}),(0,ue.jsx)(i.TableOrderCue,{rid:we}),Le.elements,tt?(0,ue.jsx)(s.EditBookingPicker,{rid:we,today:Ae,who:ze,hidePrivate:!0,onClose:()=>lt(!1)}):null,st?(0,ue.jsx)(s.EditBookingSheet,{rid:we,id:st,who:ze,hidePrivate:!0,onClose:()=>it(null)}):null,Ue?(0,ue.jsx)(U.TableSheet,{rid:we,name:Ue,view:It,plan:Oe,todays:yt,now:Se,privacy:He,turnBase:ke.settings.turnMins,onClose:()=>Ke(null),onWalkIn:e=>Le.openWalkInAt(e),onMove:e=>Qe(e),onDetails:mt}):null,Je?(0,ue.jsx)(U.DetailsPanel,{title:Je.title,onClose:()=>Xe(null),children:Je.body}):null,at?(0,ue.jsx)(U.ServiceSummary,{r:ke,todays:yt,orders:De,waitlistAll:ot,walkInCount:rt,onClose:()=>nt(!1)}):null,dt?(0,ue.jsxs)(C.Sheet,{visible:!0,onClose:()=>ut(!1),title:"Table colours and symbols",maxWidth:560,testID:"colour-key",children:[(0,ue.jsx)(U.Legend,{}),(0,ue.jsx)(C.Button,{kind:"secondary",label:"Close",onPress:()=>ut(!1)})]}):null,Ze?(0,ue.jsxs)(U.DetailsPanel,{title:"Takeaway",onClose:()=>et(!1),children:[(0,ue.jsx)(C.Muted,{children:"In-house orders go through your till (EPOS). Only takeaway orders show here."}),(0,ue.jsx)(pe,{list:kt,me:ze,bookings:ve})]}):null,ht?(0,ue.jsx)(v.default,{testID:"display-editor",style:{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e3,backgroundColor:R.colours.bg},children:(0,ue.jsx)(F.PlanDesigner,{initial:Oe,venue:ke.name,mode:"display",startStep:"arrange",onActivity:()=>{bt.current=Date.now(),null!==xt&&pt(null)},notice:null!==xt?`Locking again in ${xt} s \xb7 touch to keep editing`:null,onSave:e=>{L.useFloor.getState().setPlan(we,e),ft(null),gt('Table plan saved. Editing is locked again.')},onCancel:()=>{ft(null),gt('No changes kept. Editing is locked again.')}},ht.at)}):null,(0,ue.jsx)(_.Screensaver,{rid:we,idleMins:$e.idleMins,pinOn:$e.pinOn,wake:$e,tonightCards:$e.tonightCards}),(0,ue.jsx)(Y.PrintHost,{rid:we}),(0,ue.jsx)(K.AlertHost,{variant:"display",rid:we,skipTakeaway:!0}),(0,ue.jsx)(j.SeatAllergenReminder,{rid:we}),(0,ue.jsx)(Q.TakeawayTakeover,{rid:we,me:ze})]});var nl};var t=_r(d[0]),l=_r(d[1]),s=_r(d[2]),i=_r(d[3]),a=_r(d[4]),n=_r(d[5]),o=_r(d[6]),r=_r(d[7]),u=_r(d[8]),c=_r(d[9]),h=e(c),f=_r(d[10]),b=_r(d[11]),x=_r(d[12]),p=_r(d[13]),y=_r(d[14]),j=_r(d[15]),w=_r(d[16]),k=e(_r(d[17])),D=e(_r(d[18])),v=e(_r(d[19])),T=e(_r(d[20])),I=_r(d[21]),C=_r(d[22]),S=_r(d[23]),B=_r(d[24]),M=_r(d[25]),P=_r(d[26]),R=_r(d[27]),z=_r(d[28]),A=_r(d[29]),E=_r(d[30]),L=_r(d[31]),$=_r(d[32]),H=_r(d[33]),O=_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]),Q=_r(d[45]),J=_r(d[46]),X=_r(d[47]),Z=_r(d[48]),ee=_r(d[49]),te=_r(d[50]),le=_r(d[51]),se=_r(d[52]),ie=_r(d[53]),ae=_r(d[54]),ne=_r(d[55]),oe=_r(d[56]),re=_r(d[57]),de=_r(d[58]),ue=_r(d[59]);const ce=12e4,ge=e=>(e??'').replace(' (example)',''),he=e=>'takeaway'===e.type&&!['collected','closed','cancelled'].includes(e.status),fe=e=>e.slotTime?(0,M.hm)(new Date(e.slotTime)):'ASAP';function be({items:e,tight:t}){return(0,ue.jsx)(v.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 s=(0,ue.jsxs)(v.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,ue.jsx)(C.T,{size:19,weight:"semibold",colour:e.alert?R.colours.amber:R.colours.text,children:e.value}),(0,ue.jsx)(C.T,{size:12,colour:R.colours.muted,style:{letterSpacing:.3},children:e.label})]});return e.onPress?(0,ue.jsx)(k.default,{accessibilityRole:"button",accessibilityLabel:`${e.label} ${e.value}`,onPress:e.onPress,children:s},e.testID):(0,ue.jsx)(h.default.Fragment,{children:s},e.testID)})})}function xe({label:e,sub:t,selected:l,onPress:s,colour:i}){return(0,ue.jsxs)(k.default,{accessibilityRole:"button",accessibilityState:{selected:l},accessibilityLabel:e,onPress:s,style:({pressed:e})=>({flexDirection:'row',alignItems:'center',gap:7,minHeight:44,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:[i?(0,ue.jsx)(v.default,{style:{width:7,height:7,borderRadius:4,backgroundColor:i}}):null,(0,ue.jsx)(C.T,{size:14,weight:l?'semibold':'medium',colour:l?R.colours.goldLight:'#CFC8BA',children:e}),t?(0,ue.jsx)(C.T,{size:12,colour:R.colours.muted,children:t}):null]})}function pe({list:e,me:t,compact:l,bookings:s}){const i=(e,t)=>(0,oe.statusBlock)(e,t,(0,oe.linkedBooking)(e,s));return e.length?(0,ue.jsx)(v.default,{style:{gap:8},children:e.map(e=>(0,ue.jsxs)(v.default,{testID:`takeaway-${e.ref}`,style:{backgroundColor:R.colours.surface2,borderRadius:12,padding:10,gap:4,borderLeftWidth:5,borderLeftColor:'ready'===e.status?R.colours.ok:e.allergies.length?R.colours.red:R.colours.gold},children:[(0,ue.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,ue.jsxs)(C.T,{size:l?16:18,weight:"bold",children:[fe(e)," \xb7 ",ge(e.customerName)]}),(0,ue.jsx)(C.Badge,{kind:'ready'===e.status?'ok':'new'===e.status?'amber':'gold',label:'new'===e.status?'NEW':'ready'===e.status?'READY':'preparing'===e.status?'COOKING':'CONFIRMED'})]}),(0,ue.jsxs)(C.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,ue.jsxs)(C.T,{size:14,weight:"semibold",colour:R.colours.red,children:["\u26a0 ",e.allergies.map(e=>(0,B.allergenLabel)(e.allergen)).join(', ')]}):null,e.allergies.length?(0,ue.jsx)(ne.AllergyChain,{o:e,me:t,compact:!0}):null,(0,ue.jsxs)(C.Row,{wrap:!0,gap:6,children:['new'!==e.status||e.accepted?null:(0,ue.jsx)(C.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>P.repo.orders.accept(e.id,t)}),e.accepted&&['new','acknowledged','preparing'].includes(e.status)?(0,ue.jsx)(C.Button,{small:!0,kind:"success",label:i(e,'ready')?'Kitchen sign-off first':'Ready',disabled:!!i(e,'ready'),testID:`ready-${e.ref}`,onPress:()=>P.repo.orders.setStatus(e.id,'ready',t)}):null,'ready'===e.status?(0,ue.jsx)(C.Button,{small:!0,label:i(e,'collected')?'Sign-offs needed':'Collected',disabled:!!i(e,'collected'),testID:`collected-${e.ref}`,onPress:()=>P.repo.orders.setStatus(e.id,'collected',t)}):null,(0,ue.jsx)(Y.ReprintButton,{rid:e.restaurantId,o:e})]})]},e.id))}):(0,ue.jsx)(C.Muted,{children:"No takeaway orders right now."})}function me({rid:e,id:t,turnBase:s}){const i=(0,P.useBookings)(e).find(e=>e.id===t);return i?(0,ue.jsx)(l.BookingTableButton,{rid:e,booking:i,turnBase:s}):null}},841,[833,861,862,842,843,844,863,864,865,20,866,867,868,869,870,871,872,253,141,117,277,279,802,873,803,807,808,810,826,874,875,814,815,876,845,877,878,846,847,850,849,804,852,879,880,881,882,813,883,853,855,884,856,885,857,886,887,888,859,14]);
|
| 3 |
+
__d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.TableOrderCue=function({rid:e}){const o=(0,l.useNow)(15e3).getTime(),c=(0,l.useOrders)(e).filter(e=>(0,n.isTableQr)(e)&&('new'===e.status||(0,n.waitingForStaff)(e))&&o-new Date(e.createdAt).getTime()<6e5);if(!c.length)return null;const f=[...new Set(c.map(e=>e.tableNo??'?'))].sort((e,o)=>Number(e)-Number(o)),b=c.some(n.waitingForStaff);return(0,u.jsx)(t.default,{testID:"table-order-cue",style:{marginHorizontal:10,marginTop:6,paddingVertical:6,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:s.colours.gold,backgroundColor:s.colours.surface2},children:(0,u.jsxs)(a.T,{weight:"semibold",colour:s.colours.gold,children:["New order \xb7 ",f.map(e=>`Table ${e}`).join(', '),b?' \xb7 waiting for staff to accept':'']})})},r(d[0]);var e,o=r(d[1]),t=(e=o)&&e.__esModule?e:{default:e},a=r(d[2]),l=r(d[3]),n=r(d[4]),s=r(d[5]),u=r(d[6])},842,[20,117,802,808,839,810,14]);
|
| 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.GiftQrButton=function({rid:e,venue:x}){const j=(0,f.useFloor)(t=>t.settings[e]),[C,R]=(0,t.useState)(!1),{width:F,height:T}=(0,l.default)();if(!(0,h.giftQrShown)(j))return null;const w=Math.round(Math.max(180,Math.min(.7*F,.55*T,520)));return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s.default,{testID:"gift-qr-open",accessibilityRole:"button",accessibilityLabel:"Buy a gift card. Shows a QR code to scan",onPress:()=>R(!0),style:({pressed:e})=>({...b.look.quiet(e),flexGrow:1,minHeight:48}),children:(0,p.jsx)(u.T,{size:15,weight:"semibold",colour:y.colours.goldLight,children:"Buy a gift card"})}),(0,p.jsx)(o.default,{visible:C,animationType:"fade",onRequestClose:()=>R(!1),supportedOrientations:['portrait','landscape'],children:(0,p.jsxs)(n.default,{testID:"gift-qr-panel",style:{flex:1,backgroundColor:y.colours.bg,alignItems:'center',justifyContent:'center',padding:24,gap:20},children:[(0,p.jsx)(u.T,{size:30,weight:"bold",colour:y.colours.gold,style:{textAlign:'center'},children:h.GIFT_QR_TEXT}),(0,p.jsx)(n.default,{accessible:!0,accessibilityRole:"image",accessibilityLabel:`QR code for ${x}'s gift card page`,style:{padding:14,backgroundColor:'#FFFFFF',borderRadius:16,borderWidth:2,borderColor:y.colours.gold},children:(0,p.jsx)(c.QR,{value:(j.giftQrUrl??'').trim(),size:w})}),(0,p.jsxs)(u.T,{size:20,colour:y.colours.text,style:{textAlign:'center'},children:[x," gift cards are sold on our website."]}),(0,p.jsx)(s.default,{testID:"gift-qr-close",accessibilityRole:"button",accessibilityLabel:"Close",onPress:()=>R(!1),hitSlop:8,style:({pressed:e})=>({minHeight:56,minWidth:160,paddingHorizontal:24,alignItems:'center',justifyContent:'center',borderRadius:14,borderWidth:1.5,borderColor:y.colours.gold,backgroundColor:e?y.colours.goldTint:'transparent'}),children:(0,p.jsx)(u.T,{size:20,weight:"semibold",colour:y.colours.gold,children:"Close"})})]})})]})};var t=r(d[0]),o=e(r(d[1])),s=e(r(d[2])),l=e(r(d[3])),n=e(r(d[4])),c=r(d[5]),u=r(d[6]),b=r(d[7]),f=r(d[8]),h=r(d[9]),y=r(d[10]),p=r(d[11])},843,[20,246,253,277,117,832,802,884,814,889,810,14]);
|
| 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,"STRIP_FONT",{enumerable:!0,get:function(){return F}}),_e.SoldOutStrip=function({rid:e,now:j}){const k=(0,u.useSoldOut)(e=>e.entries),O=(0,c.useStore)(e=>e.clock),[T,v]=(0,t.useState)(0),[C,I]=(0,t.useState)(!1),z=(0,h.useAutoSoldOutView)(e);(0,t.useEffect)(()=>{w()},[]);const H=j??(0,f.nowFrom)(O),D=(0,y.activeSoldOut)(k,e,H);if(!D.length)return null;const _=D.map(e=>(0,p.withReason)(e.name,z.reason(e.itemId))),A=(0,y.stripText)(_),M=T>0&&(0,y.stripNeedsTicker)(_,T,F),L=Math.round(.28*A.length),P=[20,30,40,50,60,80,100,120].find(e=>e>=L)??120,R=(e,t=!1)=>(0,b.jsx)(l.default,{numberOfLines:t?void 0:1,style:{flexShrink:t?0:1,...t&&x?{whiteSpace:'nowrap'}:{},fontFamily:S.fonts.medium,fontSize:F,lineHeight:20,color:S.colours.gold,paddingRight:48},children:A},e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(o.default,{testID:"display-soldout-strip",accessibilityRole:"button",accessibilityLabel:`Sold out: ${_.join(', ')}. Tap for the list.`,onPress:()=>I(!0),onLayout:e=>v(e.nativeEvent.layout.width),style:{flexDirection:'row',alignItems:'center',minHeight:30,paddingHorizontal:12,paddingVertical:4,gap:10,backgroundColor:'#161411',borderTopWidth:1,borderTopColor:S.colours.accentBorder},children:[(0,b.jsxs)(l.default,{style:{fontFamily:S.fonts.bold,fontSize:12,lineHeight:16,letterSpacing:1,color:S.colours.amber},children:["SOLD OUT",D.length>1?` \xb7 ${D.length}`:'']}),(0,b.jsx)(s.default,{style:{flex:1,overflow:'hidden'},children:M&&x?(0,b.jsxs)(s.default,{testID:"display-soldout-ticker",dataSet:{ccso:`tick-${P}`},style:{flexDirection:'row',alignSelf:'flex-start',flexShrink:0},children:[R('a',!0),R('b',!0)]}):R('a')}),M&&!x?(0,b.jsx)(l.default,{style:{fontFamily:S.fonts.regular,fontSize:12,color:S.colours.muted},children:"Tap for all"}):null]}),(0,b.jsxs)(d.Sheet,{visible:C,onClose:()=>I(!1),title:(0,y.soldOutCount)(D.length),maxWidth:520,testID:"display-soldout-sheet",children:[(0,b.jsx)(n.default,{style:{maxHeight:420},children:D.map(e=>(0,b.jsxs)(s.default,{style:{paddingVertical:8,borderBottomWidth:1,borderBottomColor:S.colours.border},children:[(0,b.jsx)(l.default,{style:{fontFamily:S.fonts.semibold,fontSize:17,color:S.colours.text},children:e.name}),z.reason(e.itemId)?(0,b.jsx)(l.default,{style:{fontFamily:S.fonts.medium,fontSize:14,color:S.colours.amber},children:z.reason(e.itemId).replace(/^./,e=>e.toUpperCase())}):null,(0,b.jsxs)(l.default,{style:{fontFamily:S.fonts.regular,fontSize:13,color:S.colours.muted},children:["Since ",$(e.at),e.auto?' \xb7 Auto, from the counts \xb7 back on when the count is back up':`${e.by?` \xb7 ${e.by}`:''}${e.clearAfter?` \xb7 back on at ${$(e.clearAfter)}`:''}`]})]},e.itemId))}),(0,b.jsx)(l.default,{style:{fontFamily:S.fonts.regular,fontSize:13,color:S.colours.muted,marginTop:8},children:"A reminder for staff. Mark dishes sold out or back on in Front of House, Managers or Head Chef."})]})]})};var t=r(_d[0]);r(_d[1]);var o=e(r(_d[2])),n=e(r(_d[3])),l=e(r(_d[4])),s=e(r(_d[5])),d=r(_d[6]),c=r(_d[7]),u=r(_d[8]),f=r(_d[9]),h=r(_d[10]),p=r(_d[11]),y=r(_d[12]),S=r(_d[13]),b=r(_d[14]);const x='undefined'!=typeof document,j=`\n${[20,30,40,50,60,80,100,120].map(e=>`[data-ccso="tick-${e}"]{display:inline-flex;white-space:nowrap;animation:ccso-tick ${e}s linear infinite}`).join('\n')}\n@keyframes ccso-tick{from{transform:translate3d(0,0,0)}to{transform:translate3d(-50%,0,0)}}\n@media (prefers-reduced-motion: reduce){[data-ccso^="tick"]{animation:none!important}}\n`;let k=!1;function w(){if(!x||k)return;k=!0;const e=document.createElement('style');e.setAttribute('data-ccso-css','1'),e.textContent=j,document.head.appendChild(e)}const $=e=>{const t=new Date(e);return`${String(t.getHours()).padStart(2,'0')}:${String(t.getMinutes()).padStart(2,'0')}`},F=15},844,[20,112,253,141,196,117,802,808,863,835,890,891,892,810,14]);
|
| 6 |
+
__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},845,[]);
|
| 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.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:'\ud83d\udd11'}),(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])},846,[20,253,117,810,802,884,14]);
|
| 8 |
+
__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return f}}),_e.Timeline=function({plan:e,bookings:p,now:x,privacy:y,onOpen:j,turnBase:k,t0:C,t1:v,height:T,pauses:w,blockedTables:M}){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,l.tableLabel)(e)})))],[e]),z=p.filter(e=>!['cancelled','noshow'].includes(e.status)),O=(0,t.useMemo)(()=>(0,i.clashes)(z,k),[z,k]),$=Math.ceil((v.getTime()-C.getTime())/9e5),_=e=>(e.getTime()-C.getTime())/9e5*b,[E,B]=(0,t.useState)(null),I=(0,t.useRef)(null),W=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,_(x)-120);setTimeout(()=>W.current?.scrollTo({x:e,animated:!1}),50)},[]);const[L,S]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{I.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!I.current)return;const r=o.nativeEvent.pageX-I.current.x,n=o.nativeEvent.pageY-I.current.y;Math.abs(r)+Math.abs(n)>=6&&B({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=I.current;I.current=null,B(null);const s=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(s)+Math.abs(d)<6)return void('move'===t&&j(e));const u=Math.round(s/b);if('stretch'===t){const t=Math.max(30,(0,i.durOf)(e,k)+15*u);return n.repo.bookings.update(e.id,{durationMins:t}),void S(`${(0,c.privName)(e,y)} now ${t} min`)}const h=R.findIndex(t=>t.key===((0,l.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(R.length-1,h+Math.round(d/f))),p={};u&&'confirmed'===e.status&&(p.time=(0,a.hm)((0,a.addMins)((0,i.startOf)(e),15*u))),g!==h&&'__none'!==R[g].key&&(p.table=R[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),S(`${(0,c.privName)(e,y)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):u&&'confirmed'!==e.status&&S('Seated parties can move table, not time.')}}),F=_(x);return(0,h.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.Badge,{kind:O.size?'red':'ok',label:O.size?`${O.size} bookings clash`:'No clashes'}),(0,h.jsx)(r.default,{style:{flex:1,minWidth:0},children:(0,h.jsx)(u.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})})]}),(0,h.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${O.size}`,children:(0,h.jsx)(u.T,{size:13,colour:d.colours.goldLight,children:L})})]}),(0,h.jsx)(r.default,{style:{flex:T?void 0:1,height:T,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:d.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,h.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,h.jsxs)(r.default,{style:{width:g,borderRightWidth:1,borderColor:d.colours.border,backgroundColor:d.colours.surface},children:[(0,h.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:d.colours.border},children:(0,h.jsx)(u.T,{size:12,colour:d.colours.muted,children:"Table"})}),R.map((e,t)=>(0,h.jsxs)(r.default,{style:{height:f,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&R[t-1].area!==e.area?2:0,borderTopColor:d.colours.gold},children:[(0,h.jsx)(u.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,h.jsx)(u.T,{size:10,colour:d.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,h.jsx)(o.default,{ref:W,horizontal:!0,style:{flex:1},children:(0,h.jsxs)(r.default,{style:{width:$*b},children:[(0,h.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:d.colours.border},children:Array.from({length:Math.ceil($/4)},(e,t)=>(0,h.jsx)(r.default,{style:{width:Math.min(4,$-4*t)*b,justifyContent:'center',borderLeftWidth:1,borderColor:d.colours.border},children:(0,h.jsx)(u.T,{size:11,colour:d.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,a.hm)((0,a.addMins)(C,60*t))})},t))}),(w??[]).map((e,t)=>{const o=Math.max(0,_(e.from)),n=Math.min($*b,_(e.to));return n<=o?null:(0,h.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,h.jsx)(r.default,{style:{backgroundColor:d.colours.amber,alignSelf:'flex-start',borderBottomRightRadius:6,paddingHorizontal:5},children:(0,h.jsxs)(u.T,{size:10,weight:"bold",colour:"#0B0B0B",numberOfLines:1,children:["\u23f8 ",e.label]})})},`pz${t}`)}),R.map((e,t)=>{return(0,h.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:f,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,h.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*b,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),M?.includes(e.key)?(0,h.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,h.jsx)(u.T,{size:11,weight:"bold",colour:"#CFCFCF",children:"Table blocked"})}):null,(o=e.key,z.filter(e=>'__none'===o?!e.table:(0,l.tablesOf)(e.table).includes(o))).map(e=>{const t=E?.id===e.id?E:null,o=_((0,i.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(b,(0,i.durOf)(e,k)/15*b+('stretch'===t?.kind?t.dx:0)),l=O.has(e.id);return(0,h.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,c.privName)(e,y)}, ${e.partySize}, ${(0,a.hm)((0,i.startOf)(e))}, ${(0,i.durOf)(e,k)} min${l?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:(0,s.blockColour)(e),borderWidth:l?2.5:1,borderColor:l?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?s.FINISHED_OPACITY:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,h.jsxs)(u.T,{size:12,weight:"semibold",colour:(0,s.blockTextColour)(e),numberOfLines:1,children:[l?'\u26a0 ':'',(0,a.hm)((0,i.startOf)(e))," ",e.walkIn?'Walk-in':(0,c.privName)(e,y)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,h.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<=$*b?(0,h.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:F,top:0,bottom:0,width:2,backgroundColor:d.colours.gold,zIndex:30},children:(0,h.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:d.colours.gold,borderRadius:6},children:(0,h.jsx)(u.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,a.hm)(x)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),l=_r(_d[5]),i=_r(_d[6]),a=_r(_d[7]),s=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]),h=_r(_d[12]);const b=30,f=44,g=96},847,[20,112,141,117,808,814,815,807,848,810,802,849,14]);
|
| 9 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"blockColour",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"blockTextColour",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"FINISHED_OPACITY",{enumerable:!0,get:function(){return u}});const t=t=>'seated'===t.status?'#CFA45F':'finished'===t.status?'#3A352C':t.walkIn?'#B9925A':'#7A5C2E',n=t=>'seated'===t.status||t.walkIn&&'finished'!==t.status?'#0B0B0B':'#EAF4FF',u=.8},848,[]);
|
| 10 |
+
__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)},849,[]);
|
| 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.Screensaver=function({rid:e,idleMins:n,pinOn:o,wake:s,tonightCards:c}){const[u,l]=(0,t.useState)(!1),[d,f]=(0,t.useState)(!1),[p,I]=(0,t.useState)(''),_=(0,t.useRef)(Date.now()),j=(0,t.useRef)(!1),S=(0,t.useRef)(0);j.current=u,(0,t.useEffect)(()=>(w.useScreensaverAsleep.getState().set(u),()=>w.useScreensaverAsleep.getState().set(!1)),[u]);const D=6e4*n;(0,t.useEffect)(()=>k?(0,y.keepFullscreen)():void 0,[]),(0,t.useEffect)(()=>{if(!k)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return y.FULLSCREEN_TAP_EVENTS.includes(t.type)&&(0,y.enterFullscreen)(),j.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),S.current=n+800,j.current=!1,window.__ccWokeAt=n,l(!1),L.current&&f(!0),void(_.current=Date.now())):n<S.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(_.current=Date.now())};v.PITCH&&(globalThis.__pitchSaver=()=>{_.current=0});const 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&&!P.current&&Date.now()-_.current>=D&&(j.current=!0,l(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[D]);const L=(0,t.useRef)(o);L.current=o;const P=(0,t.useRef)(d);return P.current=d,(0,t.useEffect)(()=>{if(!k)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,b.jsx)(E,{wake:s,entry:p,setEntry:I,onOk:()=>{f(!1),I(''),_.current=Date.now(),s.pinDefault&&(0,h.notify)({id:'wake-pin-default',tone:'warn',icon:'\ud83d\udd11',title:'Change the wake PIN',body:'This Display still uses the starting PIN (2580). A manager should set a new 6 to 8 digit PIN in Settings \u203a Display.',timeoutMs:12e3})}}):u?(0,b.jsx)(x,{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]),f=r(_d[9]),p=r(_d[10]),h=r(_d[11]),w=r(_d[12]),y=r(_d[13]),v=r(_d[14]),b=r(_d[15]);const k='undefined'!=typeof window;function E({wake:e,entry:t,setEntry:n,onOk:o}){const u=e.pinLen||4,d=s=>{const c=(t+s).slice(0,u);n(c),c.length===u&&((0,p.wakePinMatches)(e,c)?o():setTimeout(()=>n(''),300))};return(0,b.jsxs)(c.default,{testID:"wake-pin",style:{position:k?'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,b.jsx)(f.T,{size:22,weight:"semibold",colour:l.colours.gold,children:"Enter staff PIN"}),(0,b.jsxs)(f.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(Math.max(0,u-t.length))]}),(0,b.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,b.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>d(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:l.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,b.jsx)(f.T,{size:26,colour:l.colours.gold,children:e})},e))})]})}function x({rid:e}){const{width:s,height:c}=(0,u.default)(),p=(0,d.useBrand)(e),h=d.HERO_LOGOS[e]??p.logo,w=(0,t.useRef)(new n.default.Value(0)).current;(0,t.useEffect)(()=>{n.default.timing(w,{toValue:1,duration:700,useNativeDriver:!1}).start()},[]);const y=.5*Math.min(s,c);return(0,b.jsx)(n.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:k?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#000000',opacity:w,overflow:'hidden',cursor:'pointer',alignItems:'center',justifyContent:'center'},children:h?(0,b.jsx)(o.default,{source:h,style:{width:y,height:y},resizeMode:"contain",accessibilityLabel:`${p.name} logo`}):(0,b.jsx)(f.T,{size:48,weight:"bold",colour:l.colours.gold,children:p.name})})}},850,[20,110,186,112,253,117,277,810,873,802,893,894,895,851,2,14]);
|
| 12 |
+
__d(function(g,_r,i,a,m,e,_d){"use strict";function n(){if('undefined'!=typeof document&&!c())try{const n=document;if(n.fullscreenElement||n.webkitFullscreenElement)return;const t=document.documentElement,c=t.requestFullscreen??t.webkitRequestFullscreen;if('function'!=typeof c)return;const u=t.requestFullscreen?t.requestFullscreen({navigationUI:'hide'}):c.call(t);u&&'function'==typeof u.catch&&u.catch(()=>{})}catch{}}Object.defineProperty(e,'__esModule',{value:!0}),e.enterFullscreen=n,Object.defineProperty(e,"FULLSCREEN_TAP_EVENTS",{enumerable:!0,get:function(){return t}}),e.inTabletApp=c,e.keepFullscreen=function(){if('undefined'==typeof document||c())return()=>{};const t=()=>{'hidden'!==document.visibilityState&&n()};t();const u=()=>t(),r=()=>{const n=document;n.fullscreenElement||n.webkitFullscreenElement?window.__ccFullscreen='on':window.__ccFullscreen='off, next tap'};return document.addEventListener('visibilitychange',u),document.addEventListener('fullscreenchange',r),document.addEventListener('webkitfullscreenchange',r),()=>{document.removeEventListener('visibilitychange',u),document.removeEventListener('fullscreenchange',r),document.removeEventListener('webkitfullscreenchange',r)}},_r(_d[0]);const t=['pointerup','touchend','click','keydown'];function c(){return'undefined'!=typeof navigator&&/CoverChargeTablet\//.test(navigator.userAgent||'')}},851,[112]);
|
| 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,"Card",{enumerable:!0,get:function(){return v}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const l=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,j.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,w.jsxs)(i.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,w.jsx)(u.T,{size:13,weight:"semibold",colour:y.colours.gold,children:"NEXT HOUR"}),(0,w.jsxs)(o.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===l.length?(0,w.jsx)(u.Muted,{children:"No arrivals due in the next hour."}):null,l.map(({b:e,m:t})=>(0,w.jsxs)(i.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?y.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?y.colours.amber:'#3C78B5'},children:[(0,w.jsx)(u.T,{size:13,weight:"semibold",children:e.time}),(0,w.jsxs)(u.T,{size:13,children:[(0,h.privName)(e,s)," \xb7 ",e.partySize]}),(0,w.jsx)(u.T,{size:12,colour:y.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,w.jsx)(u.T,{size:12,colour:t<0?y.colours.amber:y.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,w.jsx)(u.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,w.jsx)(u.T,{size:12,children:f.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,w.jsxs)(u.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(f.STATUS).map(e=>(0,w.jsxs)(u.Row,{gap:4,children:[(0,w.jsx)(i.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:f.STATUS[e].colour}}),(0,w.jsx)(u.T,{size:12,colour:y.colours.muted,children:f.STATUS[e].label})]},e)),(0,w.jsx)(u.T,{size:12,colour:y.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc9d anniversary"})]})},_e.DetailsPanel=function({title:e,children:t,onClose:s}){const[r,a]=(0,l.useState)(20);return(0,l.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,l.useEffect)(()=>{r<=0&&s()},[r]),(0,w.jsxs)(u.Sheet,{visible:!0,onClose:s,title:e,maxWidth:560,testID:"private-details",children:[(0,w.jsx)(u.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),t,(0,w.jsx)(u.Button,{kind:"secondary",label:"Close now",onPress:s})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return k}}),_e.TableSheet=function({rid:e,name:t,view:r,plan:o,todays:x,now:p,privacy:v,turnBase:k,onClose:S,onWalkIn:T,onMove:$,onDetails:C}){const M=r[t],B=m.useFloor.getState(),[z,I]=(0,l.useState)(!1),[D,P]=(0,l.useState)(M?.note??''),[R,A]=(0,l.useState)(!1);if(!M)return null;const N=M.booking,O=['seated','mains','dessert','bill'].includes(M.status),W=x.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,j.minsBetween)(p,(0,f.startOf)(e)))-Math.abs((0,j.minsBetween)(p,(0,f.startOf)(t)))),L=e=>e.partySize<=M.table.maxSeats,H=(0,f.turnFor)(M.covers||M.table.maxSeats,k);return(0,w.jsxs)(u.Sheet,{visible:!0,onClose:S,title:`Table ${t} \xb7 ${f.STATUS[M.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,w.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,w.jsx)(u.Badge,{kind:"neutral",label:`${M.table.minSeats}\u2013${M.table.maxSeats} seats`}),N?(0,w.jsx)(u.Badge,{kind:"gold",label:`${(0,h.privName)(N,v)} \xb7 ${N.partySize} \xb7 ${M.seatedMins}m`}):null,N?(0,w.jsx)(u.Badge,{kind:M.seatedMins>(0,f.durOf)(N,k)?'red':'neutral',label:`Turn about ${(0,f.durOf)(N,k)} min \xb7 free about ${(0,j.hm)((0,f.endOf)(N,k))} (est.)`}):(0,w.jsx)(u.Badge,{kind:"neutral",label:`Turn estimate for ${M.table.maxSeats}: about ${H} min`}),M.next?(0,w.jsx)(u.Badge,{kind:"blue",label:`Next: ${M.next.time} ${(0,h.privName)(M.next,v)} (${M.next.partySize})`}):null,M.allergy?(0,w.jsx)(u.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),N??M.next?(0,w.jsx)(s.BookingTableButton,{rid:e,booking:N??M.next,turnBase:k,testID:"table-sheet-table-btn"}):null,O||'blocked'===M.status?null:(0,w.jsxs)(u.Row,{gap:8,children:[(0,w.jsx)(u.Button,{label:"Seat walk-in here",onPress:()=>{S(),T(t)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,w.jsx)(u.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>A(!R),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),R?(0,w.jsxs)(i.default,{style:{gap:6},children:[0===W.length?(0,w.jsx)(u.Muted,{children:"No bookings left to seat today."}):null,W.slice(0,8).map(s=>(0,w.jsxs)(a.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,h.privName)(s,v)} ${s.time}`,onPress:async()=>{await b.repo.bookings.update(s.id,{table:t}),await b.repo.bookings.setStatus(s.id,'seated'),(0,c.resetTableLive)(e,t),S()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:L(s)?y.colours.border:y.colours.amber,backgroundColor:y.colours.surface2},children:[(0,w.jsxs)(u.T,{weight:"semibold",children:[s.time," \xb7 ",(0,h.privName)(s,v)," \xb7 ",s.partySize,s.table?` \xb7 booked T${s.table}`:'',s.allergies.length?' \xb7 \u26a0':'']}),L(s)?null:(0,w.jsxs)(u.T,{size:12,colour:y.colours.amber,children:["Bigger than this table (",M.table.maxSeats," max)"]})]},s.id))]}):null,O?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(u.T,{size:14,colour:y.colours.muted,children:"Course / status"}),(0,w.jsx)(u.Row,{wrap:!0,gap:6,children:f.STAGES.map(s=>(0,w.jsx)(u.Chip,{label:f.STATUS[s].label,selected:M.status===s,onPress:()=>B.setLive(e,t,{stage:s})},s))}),(0,w.jsxs)(u.Row,{wrap:!0,gap:8,children:[N?(0,w.jsx)(u.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{S(),$(t)},testID:"move-party"}):null,(0,w.jsx)(u.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{N&&await b.repo.bookings.setStatus(N.id,'finished'),B.setLive(e,t,{stage:void 0,dirty:!0}),S()}})]})]}):null,'dirty'===M.status?(0,w.jsx)(u.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{B.setLive(e,t,{dirty:!1}),S()},testID:"mark-clean"}):null,(0,w.jsxs)(u.Row,{wrap:!0,gap:8,children:[(0,w.jsx)(u.Button,{kind:"secondary",label:'blocked'===M.status?'Unblock table':'Block table',onPress:()=>{B.setLive(e,t,{blocked:'blocked'!==M.status}),S()},testID:"block-table"}),(0,w.jsx)(u.Button,{kind:"ghost",label:M.note?'Edit note':'Note',onPress:()=>I(!z)}),N||M.next?(0,w.jsx)(u.Button,{kind:"ghost",label:"Guest details",onPress:()=>{S(),C(N??M.next)},testID:"guest-details"}):null]}),z?(0,w.jsxs)(u.Row,{gap:6,children:[(0,w.jsx)(n.default,{accessibilityLabel:"Table note",value:D,onChangeText:P,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[u.styles.input,{flex:1}]}),(0,w.jsx)(u.Button,{small:!0,label:"Save",onPress:()=>{B.setLive(e,t,{note:D.trim()||void 0}),I(!1)}})]}):null,v?(0,w.jsx)(u.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,o.joins.some(e=>e.tables.includes(t))?(0,w.jsxs)(u.Muted,{children:["Joins with ",o.joins.find(e=>e.tables.includes(t)).tables.filter(e=>e!==t).join(', ')," for bigger parties (book as ",o.joins.find(e=>e.tables.includes(t)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:t,plan:s,view:r,todays:o,waiting:x,now:k,privacy:S,busy:T,onToast:$}){const[C,M]=(0,l.useState)(''),[B,z]=(0,l.useState)(2),I=(0,m.useFloor)(e=>e.smsLog);return(0,w.jsxs)(v,{title:`Waitlist (${x.length})`,right:(0,w.jsxs)(u.Muted,{children:["new party about ",(0,p.estimateWait)(x.length+1,t.settings.turnMins,T)," min"]}),testID:"waitlist-panel",children:[0===x.length?(0,w.jsx)(u.Muted,{children:"Nobody waiting."}):null,x.map((l,a)=>{const n=(0,f.suggestTable)(s,o,r,l.partySize,k,(0,f.turnFor)(l.partySize,t.settings.turnMins)),x=(0,p.estimateWait)(a+1,t.settings.turnMins,T),v=Math.max(0,(0,j.minsBetween)(new Date(l.joinedAt),k)),C=I.find(t=>t.rid===e&&t.text.includes(`#${l.number} `));return(0,w.jsxs)(i.default,{style:{backgroundColor:y.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,w.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,w.jsxs)(u.T,{weight:"semibold",children:["#",l.number," ",(0,h.pv)(l.name,S)," \xb7 ",l.partySize]}),(0,w.jsxs)(u.T,{size:12,colour:v>x?y.colours.amber:y.colours.muted,children:["waited ",v,"m \xb7 quoted about ",x,"m"]})]}),n?(0,w.jsxs)(u.T,{size:12,colour:n.clashes?y.colours.amber:y.colours.ok,children:["Best table: ",n.table," (",n.why,")"]}):(0,w.jsx)(u.T,{size:12,colour:y.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,w.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,w.jsx)(u.Button,{small:!0,label:C||'notified'===l.status?'Mark as told again':'Mark as told: table ready',testID:`sms-${l.number}`,onPress:()=>{m.useFloor.getState().logSms(e,k.toISOString(),`#${l.number} ${l.partySize}: Your table at ${t.name} is ready.`),b.repo.waitlist.setStatus(l.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${t.name} is ready."`)}}),n?(0,w.jsx)(u.Button,{small:!0,kind:"success",label:`Seat at ${n.table}`,onPress:async()=>{await b.repo.waitlist.setStatus(l.id,'seated'),await b.repo.bookings.seatWalkIn(e,l.partySize,n.table,`From waitlist #${l.number}`),(0,c.resetTableLive)(e,n.table),$(`Waitlist #${l.number} seated at ${n.table}`)}}):null,(0,w.jsx)(u.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>b.repo.waitlist.setStatus(l.id,'removed')})]}),'notified'===l.status?(0,w.jsx)(u.Badge,{kind:"ok",label:`Told table ready${C?` ${(0,j.hm)(new Date(C.at))}`:''} `}):null]},l.id)}),(0,w.jsxs)(u.Row,{gap:6,children:[(0,w.jsx)(n.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,w.jsx)(a.default,{accessibilityLabel:"Waitlist party size",onPress:()=>z(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:y.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,w.jsx)(u.T,{weight:"bold",colour:y.colours.gold,children:B})}),(0,w.jsx)(u.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{b.repo.waitlist.join(e,C.trim(),B),M('')}})]})]})},_e.PacePanel=function({r:e,fc:s,todays:l,now:r,walkInCount:a,staffOn:o,onSummary:n}){const c=a+l.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),h=r.getHours(),b=Math.round(s.hours.filter(e=>e.hour<h).reduce((e,t)=>e+t.covers,0)+(s.hours.find(e=>e.hour===h)?.covers??0)*(r.getMinutes()/60)),m=b?c/b:1,x=m>=1.1?y.colours.amber:m>=.85?y.colours.ok:y.colours.blue,p=Array.from({length:8},(e,t)=>{const s=(0,j.addMins)(r,15*(t-4)-r.getMinutes()%15),a=(0,j.addMins)(s,15),o=l.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,f.startOf)(e);return t>=s&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:s,covers:o,future:t>=4}}),k=Math.max(4,Math.round(e.settings.capacityPerHour/4)),S=Math.max(k,...p.map(e=>e.covers)),T=p.filter(e=>e.future&&e.covers>k),$=s.nextHour?.covers??0,C=Math.ceil($/16);return(0,w.jsxs)(v,{title:"Pace & kitchen",right:(0,w.jsx)(u.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,w.jsxs)(i.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${c} vs forecast ${b}`,style:{gap:4},children:[(0,w.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,w.jsx)(u.T,{size:14,children:"Covers so far"}),(0,w.jsxs)(u.T,{weight:"bold",colour:x,children:[c," ",(0,w.jsxs)(u.T,{size:13,colour:y.colours.muted,children:["/ about ",b," forecast"]})]})]}),(0,w.jsx)(i.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,w.jsx)(i.default,{style:{width:`${Math.min(100,75*m)}%`,height:10,borderRadius:5,backgroundColor:x}})}),(0,w.jsxs)(u.Muted,{children:[m>=1.1?'Ahead of forecast':m>=.85?'On pace':'Behind forecast'," \xb7 next hour about ",s.nextHour?(0,t.coversRange)(s.nextHour.coversLow,s.nextHour.coversHigh):'0 covers']})]}),(0,w.jsx)(u.T,{size:13,colour:y.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,w.jsx)(i.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:p.map((e,t)=>(0,w.jsxs)(i.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,w.jsx)(u.T,{size:10,colour:y.colours.muted,children:e.covers||''}),(0,w.jsx)(i.default,{style:{width:'80%',height:Math.max(2,e.covers/S*40),borderRadius:3,backgroundColor:e.covers>k?y.colours.red:e.future?'#6B5A3A':y.colours.gold}}),(0,w.jsx)(u.T,{size:9,colour:4===t?y.colours.gold:y.colours.muted,children:(0,j.hm)(e.from)})]},t))}),T.map(e=>(0,w.jsxs)(u.T,{size:13,colour:y.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,j.hm)(e.from),"\u2013",(0,j.hm)((0,j.addMins)(e.from,15))," (pace about ",k,") \u2014 stagger seating if you can."]},e.from.getTime())),C>o?(0,w.jsxs)(u.T,{size:13,colour:y.colours.amber,children:["\u26a0 Next hour about ",$," covers with ",o," on: about ",C-o," more on the floor suggested."]}):(0,w.jsxs)(u.T,{size:13,colour:y.colours.ok,children:["Staffing looks OK for the next hour (",o," on)."]}),(0,w.jsx)(u.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,i=t.filter(e=>e.walkIn),c=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,j.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),h=(0,m.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),b=(e,t)=>(0,w.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,w.jsx)(u.T,{children:e}),(0,w.jsx)(u.T,{weight:"semibold",children:t})]},e);return(0,w.jsxs)(u.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[b('Covers served',String(n)),b('Bookings seated',`${o.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),b('Walk-ins',`${i.length} parties \xb7 ${i.reduce((e,t)=>e+t.partySize,0)+r} covers`),b('No-shows',String(t.filter(e=>'noshow'===e.status).length)),b('Average table time',c.length?`${Math.round(c.reduce((e,t)=>e+t,0)/c.length)} min`:'\u2014'),b('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),b('"Table ready" texts',`${h} (texts not set up yet, none sent)`),(0,w.jsx)(u.Muted,{children:"Nothing is sent anywhere: texting guests is not set up yet."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return m.tablesOf}});var t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),r=_r(d[3]);_r(d[4]);var a=e(_r(d[5])),o=e(_r(d[6])),n=e(_r(d[7])),i=e(_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]),w=_r(d[19]);const v=({title:e,right:t,children:s,testID:l})=>(0,w.jsxs)(i.default,{testID:l,style:{backgroundColor:y.colours.surface,borderRadius:14,borderWidth:1,borderColor:y.colours.border,padding:10,gap:6},children:[(0,w.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,w.jsx)(u.T,{weight:"semibold",colour:y.colours.gold,children:e}),t]}),s]});const k=e=>(0,w.jsxs)(i.default,{style:{gap:6},children:[(0,w.jsxs)(u.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,w.jsxs)(u.Muted,{children:[e.time," \xb7 ",e.table?(0,m.tablesLabel)(e.table):'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),(0,w.jsx)(r.BookingNeeds,{b:e,big:!0}),e.notes?(0,w.jsxs)(u.T,{children:["Notes: ",e.notes]}):(0,w.jsx)(u.Muted,{children:"No notes."}),e.allergies.length?(0,w.jsx)(i.default,{style:{backgroundColor:y.colours.redBg,borderRadius:8,padding:8},children:(0,w.jsxs)(u.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,x.allergenLabel)(e.allergen)} \u2014 ${(0,x.severityLabel)(e.severity)}`).join('; ')]})}):(0,w.jsx)(u.Muted,{children:"No allergies declared."}),(0,w.jsx)(u.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const S=!0},852,[833,861,20,896,112,253,141,263,117,802,874,849,808,814,803,815,807,834,810,14]);
|
| 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}),_e.DayGraph=function({todays:e,open:f,close:u,now:y,turnBase:p,pauses:j,height:T=150,forecastNote:F}){const[M,k]=(0,t.useState)(0),b=f.getTime()-18e5,w=u.getTime()+36e5,v=(0,t.useMemo)(()=>(0,x.coverCurve)(e,new Date(b),new Date(w),p),[e,b,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-b)/(w-b)*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(b);e.getTime()<=w;e=new Date(e.getTime()+36e5)){const t=new Date(e);t.setMinutes(0,0,0),t.getTime()>=b&&O.push(t.getTime())}const q=y.getTime()>=b&&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=>k(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(207,164,95,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.ok,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:"#8C8477",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])},853,[20,117,897,802,884,807,810,854,14]);
|
| 15 |
+
__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},854,[815]);
|
| 16 |
+
__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:'ok'===f?a.colours.ok: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':'ok')),...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]},855,[20,117,898,802,884,807,810,14]);
|
| 17 |
+
__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_GOLD",{enumerable:!0,get:function(){return f}}),_e.BigAction=function({label:e,onPress:l,testID:u,size:h="l",block:x,premium:p}){const{width:y}=(0,o.default)(),w='l'===h&&y>=520,b=x?{alignSelf:'stretch'}:p?{flex:1,minWidth:0}:{flexGrow:1,flexShrink:1,minWidth:0,flexBasis:w?200:150,maxWidth:w?300:260};return(0,c.jsx)(n.default,{testID:u,accessibilityRole:"button",accessibilityLabel:e,onPress:l,style:({pressed:e})=>p?{...b,minHeight:w?78:62,borderRadius:20,alignItems:'center',justifyContent:'center',flexDirection:'row',gap:w?12:8,paddingHorizontal:w?20:10,...t.look.primary(e)}:{...b,minHeight:w?76:62,borderRadius:18,backgroundColor:e?'#B8904F':f,borderWidth:2,borderColor:'#E8C98F',alignItems:'center',justifyContent:'center',flexDirection:'row',gap:w?10:6,paddingHorizontal:w?18:8,shadowColor:'#000',shadowOpacity:.35,shadowRadius:8,shadowOffset:{width:0,height:3}},children:(0,c.jsx)(s.T,{size:w?p?25:26:18,weight:p?'semibold':'bold',colour:t.look.onPrimary,style:p?{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'},856,[20,884,253,117,277,802,14]);
|
| 18 |
+
__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,"GLANCE_LINE",{enumerable:!0,get:function(){return j}}),_e.TodayGlance=function({rid:e,today:o,now:n,open:h,close:j,hours:z,shifts:D,att:M,staff:L,height:I=118}){const O=60*n.getHours()+n.getMinutes(),v=60*h.getHours()+h.getMinutes(),S=60*j.getHours()+j.getMinutes();s.default.useEffect(()=>{u.useNotifs.getState().ensure(e)},[e]);const W=(0,u.useNotifs)(e=>e.items),N=(0,t.useMemo)(()=>W.filter(t=>t.rid===e),[W,e]),T=(0,t.useMemo)(()=>(0,x.hourBars)(z,v,S),[z,v,S]),H=(0,x.peakOf)(T),$=(0,x.breakWindows)(T,O),E=(0,x.cutoffsToday)(N,n.getDay(),O),A=(0,x.onNowNext)(D,M,L,o,O,3),C=T.reduce((e,t)=>e+t.covers,0),R=T.reduce((e,t)=>e+t.booked,0),B=(0,x.glanceTip)({cutoffs:E,breaks:$,peak:H,nowMins:O,closeMins:S,dueIn:A.next.length}),{width:_}=(0,l.default)(),q=_<900,F=!q&&_<1180,G=I<100,K=G?3:4,P=G?12:13,U=[...E.filter(e=>'passed'!==e.state),...E.filter(e=>'passed'===e.state).reverse()].slice(0,K),V=(E.filter(e=>'passed'===e.state).length,(e,t)=>{const s=t&&e.start&&O>e.start+10;return(0,m.jsxs)(i.default,{style:{flexDirection:'row',alignItems:'baseline',gap:5,overflow:'hidden'},children:[(0,m.jsx)(y,{size:P,weight:"semibold",numberOfLines:1,style:{flexShrink:1,minWidth:24},children:e.name}),(0,m.jsx)(y,{size:11,colour:b,numberOfLines:1,style:{flexShrink:4,minWidth:0},children:e.role}),(0,m.jsx)(i.default,{style:{flex:1,minWidth:2}}),(0,m.jsx)(y,{size:11.5,weight:"medium",colour:s?f.colours.amber:f.colours.goldLight,children:e.end?F?t?(0,x.hhmm)(e.start):`to ${(0,x.hhmm)(e.end)}`:`${(0,x.hhmm)(e.start)}\u2013${(0,x.hhmm)(e.end)}`:`in ${e.inAt?(0,x.hhmm)(60*new Date(e.inAt).getHours()+new Date(e.inAt).getMinutes()):''}`})]},`${t?'n':'o'}${e.id}`)});return(0,m.jsxs)(i.default,{testID:"today-glance",accessibilityLabel:"Today at a glance",style:{flexDirection:'row',flexWrap:q?'wrap':'nowrap',minHeight:I,backgroundColor:'#100F0D',borderBottomWidth:1,borderBottomColor:'rgba(207,164,95,0.12)',borderTopWidth:1,borderTopColor:'rgba(255,255,255,0.04)',...c.look.web({backgroundImage:'linear-gradient(180deg, rgba(207,164,95,0.06) 0%, rgba(207,164,95,0.012) 100%)'})},children:[(0,m.jsxs)(w,{flex:1.5,testID:"glance-covers",first:!0,tight:G,basis:q?'40%':void 0,children:[(0,m.jsxs)(i.default,{style:{flexDirection:'row',alignItems:'baseline',gap:6},children:[(0,m.jsx)(p,{children:"COVERS BY HOUR"}),(0,m.jsx)(i.default,{style:{flex:1}}),(0,m.jsxs)(y,{size:11,colour:b,numberOfLines:1,style:{flexShrink:1,minWidth:0},children:[R," booked",C>R?` \xb7 about ${C-R} walk-in`:'']})]}),(0,m.jsx)(k,{bars:T,nowMins:O,quiet:$,height:I-30})]}),(0,m.jsxs)(w,{flex:.75,testID:"glance-breaks",tight:G,basis:q?'20%':void 0,children:[(0,m.jsx)(p,{children:"BREAKS"}),$.length?$.map(e=>(0,m.jsxs)(i.default,{style:{gap:0},children:[(0,m.jsxs)(y,{size:G?15:17,weight:"semibold",colour:f.colours.goldLight,children:[(0,x.hhmm)(e.from),"\u2013",(0,x.hhmm)(e.to)]}),(0,m.jsx)(y,{size:11,colour:b,children:e.from<=O+1?'quiet now':'quiet spell'})]},e.from)):(0,m.jsx)(y,{size:P,colour:b,children:"No quiet spell left today"})]}),(0,m.jsx)(w,{flex:1.55,testID:"glance-team",tight:G,basis:q?'40%':void 0,children:(0,m.jsxs)(i.default,{style:{flexDirection:'row',gap:12,flex:1},children:[(0,m.jsxs)(i.default,{style:{flex:1,minWidth:0,gap:2},testID:"glance-on-now",children:[(0,m.jsx)(p,{children:`ON NOW \xb7 ${A.now.length}`}),A.now.length?A.now.map(e=>V(e,!1)):(0,m.jsx)(y,{size:P,colour:b,children:"Nobody clocked in"})]}),(0,m.jsxs)(i.default,{style:{flex:1,minWidth:0,gap:2},testID:"glance-next",children:[(0,m.jsx)(p,{children:"NEXT"}),A.next.length?A.next.map(e=>V(e,!0)):(0,m.jsx)(y,{size:P,colour:b,children:"Nobody else today"})]})]})}),(0,m.jsxs)(w,{flex:1.3,testID:"glance-cutoffs",first:q,row2:q,tight:G,basis:q?'50%':void 0,children:[(0,m.jsx)(p,{children:"ORDER CUT-OFFS"}),U.length?U.map(e=>(0,m.jsxs)(i.default,{testID:`cutoff-${e.state}`,style:{flexDirection:'row',alignItems:'baseline',gap:6,opacity:'passed'===e.state?.5:1},children:[(0,m.jsx)(y,{size:P,weight:"semibold",numberOfLines:1,style:{flexShrink:1},colour:'soon'===e.state?f.colours.amber:f.colours.text,children:e.label}),(0,m.jsx)(y,{size:11,colour:b,children:e.at}),(0,m.jsx)(i.default,{style:{flex:1}}),(0,m.jsx)(y,{size:11.5,weight:"semibold",colour:'soon'===e.state?f.colours.amber:f.colours.goldLight,children:'passed'===e.state?'\u2713':(0,x.countdown)(e.left)})]},e.id)):(0,m.jsx)(y,{size:P,colour:b,children:"No orders due today"}),E.length>U.length?(0,m.jsxs)(y,{size:10.5,colour:b,children:["+",E.length-U.length," more",'']}):null]}),(0,m.jsxs)(w,{flex:1.15,testID:"glance-today",row2:q,tight:G,basis:q?'50%':void 0,children:[(0,m.jsx)(p,{children:"TODAY"}),(0,m.jsxs)(y,{size:P,numberOfLines:1,children:[(0,m.jsxs)(y,{size:P,weight:"semibold",colour:f.colours.goldLight,children:["About ",C]})," covers expected"]}),H&&H.covers?(0,m.jsxs)(y,{size:P,numberOfLines:1,children:["Busiest ",(0,m.jsx)(y,{size:P,weight:"semibold",colour:f.colours.goldLight,children:(0,x.hhmm)(60*H.hour)})]}):null,(0,m.jsxs)(y,{size:P,numberOfLines:1,children:["Kitchen ",(0,x.hhmm)(v),"\u2013",(0,x.hhmm)(S)]}),(0,m.jsx)(i.default,{testID:"glance-tip",children:(0,m.jsx)(y,{size:11.5,colour:f.colours.muted,numberOfLines:G?1:2,style:{fontStyle:"italic"},children:B})})]})]})};var t=r(d[0]),s=e(t),l=e(r(d[1])),i=e(r(d[2])),o=r(d[3]),n=e(o),h=r(d[4]),c=r(d[5]),u=r(d[6]),x=r(d[7]),f=r(d[8]),m=r(d[9]);const b='#857D6E',j=1.35,y=({size:e,style:t,...s})=>(0,m.jsx)(h.T,{size:e,...s,style:[{flexShrink:0,lineHeight:Math.ceil(e*j)},c.look.web({lineHeight:String(j)}),t]}),p=({children:e})=>(0,m.jsx)(y,{size:10.5,weight:"semibold",colour:f.colours.goldMuted,style:{letterSpacing:1.6},numberOfLines:1,children:e}),w=({flex:e,children:t,testID:s,first:l,tight:o,basis:n,row2:h})=>(0,m.jsx)(i.default,{testID:s,style:{...n?{flexGrow:1,flexShrink:1,flexBasis:n}:{flex:e},minWidth:0,paddingHorizontal:12,paddingVertical:o?5:8,gap:o?1:3,borderLeftWidth:l?0:1,borderLeftColor:'rgba(207,164,95,0.14)',borderTopWidth:h?1:0,borderTopColor:'rgba(207,164,95,0.14)'},children:t});function k({bars:e,nowMins:l,quiet:h,height:c}){const[u,x]=(0,t.useState)(0),j=Math.max(6,...e.map(e=>e.covers)),y=Math.max(1,e.length),p=Math.max(10,c-13-12),w=u/y,k=Math.max(4,Math.min(22,.62*w)),z=e=>12+p-e/j*p,D=e.length?60*e[0].hour:0,M=e=>(e-D)/60*w;return(0,m.jsx)(i.default,{style:{flex:1,minHeight:c},onLayout:e=>x(e.nativeEvent.layout.width),children:u?(0,m.jsxs)(n.default,{width:u,height:c,children:[h.map((e,t)=>(0,m.jsx)(o.Rect,{x:Math.max(0,M(e.from)),y:8,width:Math.max(2,M(e.to)-M(e.from)),height:p+4,fill:"rgba(207,164,95,0.07)",rx:4},`q${t}`)),e.map((e,t)=>{const i=t*w+(w-k)/2,n=60*(e.hour+1)<=l;return(0,m.jsxs)(s.default.Fragment,{children:[e.walkIns?(0,m.jsx)(o.Rect,{x:i+.5,y:z(e.covers),width:k-1,height:Math.max(0,z(e.booked)-z(e.covers)),fill:"rgba(207,164,95,0.10)",stroke:f.colours.gold,strokeWidth:1,strokeDasharray:"2,2",rx:2,opacity:n?.45:1}):null,e.booked?(0,m.jsx)(o.Rect,{x:i,y:z(e.booked),width:k,height:Math.max(1,12+p-z(e.booked)),fill:f.colours.gold,rx:2,opacity:n?.45:1}):null,t%(y>9?2:1)==0?(0,m.jsx)(o.Text,{x:i+k/2,y:c-2,fill:b,fontSize:9.5,textAnchor:"middle",children:String(e.hour).padStart(2,'0')}):null]},e.hour)}),l>=D&&l<=D+60*y?(0,m.jsx)(o.Line,{x1:M(l),x2:M(l),y1:6,y2:12+p,stroke:f.colours.goldLight,strokeWidth:1.5}):null]}):null})}},857,[20,277,117,897,802,884,899,858,810,14]);
|
| 19 |
+
__d(function(g,_r,_i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SOON_MINS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"hhmm",{enumerable:!0,get:function(){return n}}),e.hourBars=function(t,n,o){const r=[];for(let s=Math.floor(n/60);60*s<o;s++){const n=t.find(t=>t.hour===s);r.push({hour:s,booked:n?.booked??0,walkIns:n?.walkIns??0,covers:n?n.booked+n.walkIns:0})}return r},e.peakOf=function(t){return t.reduce((t,n)=>n.covers>(t?.covers??0)?n:t,null)},e.breakWindows=function(t,n){const o=Math.max(0,...t.map(t=>t.covers));if(!t.length)return[];const r=Math.min(6,Math.max(2,Math.floor(.25*o))),s=[];let a=null;return t.forEach((n,o)=>{const i=n.covers<=r;if(i&&null===a&&(a=60*n.hour),null!==a&&(!i||o===t.length-1)){const t=i?60*(n.hour+1):60*n.hour;s.push({from:a,to:t}),a=null}}),s.filter(t=>t.to-t.from>=60).map(t=>({from:Math.max(t.from,15*Math.ceil(n/15)),to:t.to})).filter(t=>t.to-t.from>=30).slice(0,2)},e.isSupplierCutoff=s,Object.defineProperty(e,"cutoffLabel",{enumerable:!0,get:function(){return a}}),e.cutoffsToday=function(n,r,i){return n.filter(t=>!t.removed&&!t.paused&&t.days.includes(r)&&s(t)).map(n=>{const s=n.dayTimes?.[String(r)]??n.time,l=o(s)-i;return{id:n.id,label:a(n.title),at:s,left:l,state:l<0?'passed':l<t?'soon':'later'}}).sort((t,n)=>t.at.localeCompare(n.at)||t.label.localeCompare(n.label))},e.countdown=i,e.roleShort=l,e.onNowNext=function(t,n,o,r,s,a=4){const i=t.filter(t=>t.date===r&&t.published).sort((t,n)=>t.start-n.start),u=t=>n.filter(n=>n.staffId===t&&n.date===r&&n.in).sort((t,n)=>n.in.localeCompare(t.in))[0],c=t=>o.find(n=>n.id===t),h=t=>({id:t.staffId,name:f(c(t.staffId)),role:l(c(t.staffId)?.job,c(t.staffId)?.level),start:60*t.start,end:60*t.end,inAt:u(t.staffId)?.in}),m=new Set,p=i.filter(t=>{const n=u(t.staffId);return n&&!n.out}).map(h).filter(t=>!m.has(t.id)&&(m.add(t.id),!0));for(const t of n.filter(t=>t.date===r&&t.in&&!t.out&&!m.has(t.staffId))){m.add(t.staffId);const n=c(t.staffId);p.push({id:t.staffId,name:f(n),role:l(n?.job,n?.level),start:0,end:0,inAt:t.in})}const b=i.filter(t=>!u(t.staffId)&&60*t.end>s&&!m.has(t.staffId)).map(h).filter(t=>!m.has(t.id)&&(m.add(t.id),!0));return{now:p.sort((t,n)=>(t.end||1e9)-(n.end||1e9)).slice(0,a),next:b.slice(0,a)}},e.glanceTip=function(t){const o=t.cutoffs.find(t=>'soon'===t.state);if(o)return`${o.label} closes ${i(o.left)}. Get it in now.`;const r=t.breaks.find(n=>n.from<=t.nowMins+1&&n.to>t.nowMins);if(r)return`Quiet now until ${n(r.to)}. Good time for breaks.`;if(t.peak&&60*t.peak.hour>t.nowMins&&60*t.peak.hour-t.nowMins<=120)return`Rush from ${n(60*t.peak.hour)}. Restock and prep now.`;const s=t.breaks.find(n=>n.from>t.nowMins);return s?`Next quiet spell ${n(s.from)}\u2013${n(s.to)}. Plan breaks for then.`:t.nowMins>=t.closeMins?'Kitchen closed. Close down and run the end of service.':t.dueIn?`${t.dueIn} still due in today.`:'All set. Keep an eye on the plan.'};const t=30,n=t=>`${String(Math.floor(t/60)%24).padStart(2,'0')}:${String(Math.round(t%60)).padStart(2,'0')}`,o=t=>60*Number(t.slice(0,2))+Number(t.slice(3,5));const r=new Set(['mills','peronis','veg-second','reeds','spezbona','olsens','allsons-list']);function s(t){return!(!t.seed||!r.has(t.seed))||/\b(order|drinks list)\b/i.test(t.title)&&!/\b(rota|chairs|tea towels?)\b/i.test(t.title)}const a=t=>t.replace(/\s+(order|drinks list|list)$/i,'').trim()||t;function i(t){if(t<0)return'done';if(t<1)return'now';if(t<60)return`in ${Math.ceil(t)} min`;const n=Math.floor(t/60),o=Math.round(t%60);return`in ${n}h ${String(o).padStart(2,'0')}m`}function l(t,n){const o=(n&&/head chef|manager|owner/i.test(n)?n:t)??'',r=o.match(/\(([^)]+)\)/);return r?r[1]:o.replace(/^Front of house/i,'FOH').replace(/ assistant$/i,' asst').trim()||'Team'}const f=t=>(t?.nickname||t?.name||'Staff').replace(' (example)','').split(' ')[0]},858,[]);
|
| 20 |
+
__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDisplayNotices=function(d){const D=(0,s.useNotifs)(t=>t.items.map(t=>`${t.id}:${t.updatedAt??''}`).join()),y=(0,f.useDisplayTiles)(t=>t.at??0);(0,t.useEffect)(()=>{const t=()=>{const t=p(),D=new Date(t).toLocaleDateString('en-CA',{timeZone:'Europe/London'}),y=o.useOwner.getState().staff,S=f.useDisplayTiles.getState().tiles??(0,f.localTiles)(y,D),v=y.map(t=>({id:t.id,role:t.role,level:t.level,job:t.job,department:t.dept,active:t.active})),$=v.filter(s=>!1!==s.active&&(0,u.shiftNow)(s.id,t).on).map(t=>t.id),h=s.useNotifs.getState();for(const o of h.items)if(o.rid===d)for(const f of S){const u=`sched:${o.id}:${f.ref}`;if(o.removed||o.paused||!o.sendBy.inApp||!(0,c.isRecipient)(o,f.ref,v,$)){(0,l.dismissNotice)(u);continue}const{due:D,forDate:y}=(0,c.notifDue)(o,t),S=n.useReminders.getState().done.find(t=>t.reminderId===o.id&&t.forDate===y),I=`sched:${o.id}:${y}:${f.ref}`;!D||S||(h.snooze[I]??0)>t?(0,l.dismissNotice)(u):(0,l.notify)({id:u,icon:'\ud83d\udd14',kicker:`FOR ${f.name.toUpperCase()}`,title:`${f.name}: ${o.title}`,body:o.message,testID:'display-sched-notice',timeoutMs:null,actions:[{label:'Done',testID:'display-sched-done',onPress:()=>n.useReminders.getState().markDone({rid:d,reminderId:o.id,forDate:y,at:new Date(p()).toISOString(),staffRef:f.ref,staffName:`${f.name} (via Display)`})},{label:'Later',kind:'ghost',testID:'display-sched-later',onPress:()=>s.useNotifs.getState().setSnooze(I,p()+9e5)}]})}};t();const D=setInterval(t,2e4);return()=>clearInterval(D)},[d,D,y])};var t=r(_d[0]),s=r(_d[1]),o=r(_d[2]),n=r(_d[3]),d=r(_d[4]),c=r(_d[5]),l=r(_d[6]),f=r(_d[7]),u=r(_d[8]);const p=()=>{try{return(0,d.nowFrom)(d.useStore.getState().clock).getTime()}catch{return Date.now()}}},859,[20,899,826,900,835,901,894,902,903]);
|
| 21 |
+
__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)(''),[P,C]=(0,t.useState)(!1),[S,k]=(0,t.useState)(''),[z,I]=(0,t.useState)(''),D=async e=>{const t=h(e);if(t.length<6)return void k('Type the code exactly as shown in Managers \u2192 Displays.');C(!0),k('');const r=await(0,n.pairWithCode)(t);C(!1),r.ok?(I(`Paired with ${r.venueName}`),x(!1),w(''),setTimeout(()=>I(''),4e3)):k(r.error)};(0,t.useEffect)(()=>{p&&(x(!0),w(p),D(p))},[]);const T=(0,c.useScreensaverAsleep)(e=>e.asleep),v='unpaired'===e,_=f||v&&!y&&!p;return(0,u.jsxs)(u.Fragment,{children:[z?(0,u.jsx)(o.default,{testID:"pair-ok",style:{position:'absolute',top:12,alignSelf:'center',zIndex:960,padding:10,borderRadius:10,backgroundColor:s.colours.okBg,borderWidth:1,borderColor:s.colours.ok},children:(0,u.jsx)(l.T,{size:14,children:z})}):null,!v||_||T?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:P?'Pairing\u2026':'Pair',disabled:P||!m.trim(),onPress:()=>D(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,'')}},860,[20,112,253,117,809,810,802,895,14]);
|
owner-app/_expo/static/js/web/index-e57c2833a3c34f2511b73cfc581fa833.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 $}});var l=_r(_d[0]),t=_r(_d[1]),s=e(t);_r(_d[2]);var n=e(_r(_d[3])),r=e(_r(_d[4])),o=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),u=_r(_d[8]),c=_r(_d[9]),b=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),m=_r(_d[14]),y=_r(_d[15]),x=_r(_d[16]),k=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),T=_r(_d[20]),S=_r(_d[21]),O=_r(_d[22]);const A=['book','takeaway'].includes(w.START_GO??'')?w.START_GO:null;let P=!1,R=!1,B=!1;const C=[{id:'main',label:'Main menu'},{id:'specials',label:'Specials'},{id:'takeaway',label:'Takeaway'}];function $(){const{rid:e}=(0,l.useLocalSearchParams)(),$=(0,h.useRestaurant)(e),v=(0,h.useMenu)(e),I=(0,h.useCustomer)(),M=(0,h.useBasket)(),_=(0,h.useStore)(e=>e.startBasket),N=(0,h.useNow)(3e4),[L,E]=(0,t.useState)('All'),[H,D]=(0,t.useState)(null),[W,F]=(0,t.useState)(!1),[G,K]=(0,t.useState)(!1),[Y,z]=(0,t.useState)('takeaway'===A?'takeaway':'main');s.default.useEffect(()=>{A&&!P&&(P=!0,'book'===A?setTimeout(()=>l.router.push(`/customer/${e}/book`),0):setTimeout(()=>{try{document.querySelector('[data-testid="menu-tabs"]')?.scrollIntoView({block:'start'})}catch{}},400))},[e]);const Q=(0,k.useSpecials)(l=>l.current[e]??null),V=!!Q&&(0,j.isToday)(Q.postedAt,N),q=(0,y.useOwner)(e=>e.offers.filter(e=>e.live).length),J=(0,h.useStore)(l=>l.stampCards.find(t=>t.restaurantId===e&&t.customerId===l.customer.id)),U=(0,T.useLiveTile)(e),X=(0,S.guestServer)();s.default.useEffect(()=>{w.START_TABLE_TOKEN&&!B&&(B=!0,setTimeout(()=>l.router.push(`/table/live/${w.START_TABLE_TOKEN}`),0))},[e]),s.default.useEffect(()=>{w.START_LOYALTY_CODE&&!R&&(R=!0,setTimeout(()=>l.router.push(`/customer/${e}/loyalty`),0))},[e]);const Z=(0,h.useOrderAtTable)(e);if(s.default.useEffect(()=>{Z||M.restaurantId!==e||'table'!==M.mode||h.useStore.setState(e=>({basket:{...e.basket,mode:'takeaway',tableNo:void 0}}))},[Z,M.mode,M.restaurantId,e]),!$)return(0,O.jsx)(d.Screen,{title:"Not found",children:(0,O.jsx)(d.T,{children:"Restaurant not found."})});const ee=Z&&M.restaurantId===$.id&&'table'===M.mode,le=$.sections.length?$.sections:Array.from(new Set(v.map(e=>e.section))),te=e=>!(e.soldOut||!e.signOff||null===e.price),se=v.filter(e=>('All'===L||e.section===L)&&('takeaway'!==Y||te(e))),ae=(0,b.hoursFor)($,N),ne=e=>()=>l.router.push(`/customer/${$.id}${e}`),re=[{icon:'box',label:'Takeaway',sub:'Order to collect',on:()=>{E('All'),z('takeaway'),ee&&_($.id,'takeaway')}},...Z?[{icon:'phone',label:'Order at table',sub:'Scan the QR',on:()=>K(!0)}]:[],{icon:'calendarPlus',label:'Book a table',on:ne('/book')},{icon:'clock',label:'Waitlist',sub:'Walk in',on:ne('/waitlist')},{icon:'star',label:'Stamp card',sub:X?U.stamps:`${J?.stamps??0} of ${$.settings.stampTarget}`,on:ne('/loyalty')},{icon:'userPlus',label:'Bring a friend',on:ne('/refer')},{icon:'gift',label:'Gift cards',on:ne('/gift')},{icon:'alert',label:'My allergens',sub:I.allergies.length?`${I.allergies.length} declared`:'None declared',on:()=>l.router.push('/customer/profile')},{icon:'tag',label:'Offers',sub:X?void 0:I.marketingOptIn[$.id]?'Opted in':'Opt in',on:ne('/offers'),badge:(X?U.offers:q)?String(X?U.offers:q):void 0},{icon:'sparkle',label:"What's on",on:ne('/whatson')},{icon:'chat',label:'Feedback',sub:'Private',on:ne('/feedback')},{icon:'hanger',label:'Lost property',on:ne('/lost')},{icon:'bag',label:'Shop',sub:'Merch',on:ne('/merch')}];return(0,O.jsxs)(d.Screen,{title:$.name,subtitle:`${$.location}${$.phone?` \xb7 ${$.phone}`:''}`,back:'customer'!==m.APP_VARIANT,right:(0,O.jsxs)(d.Row,{children:[(0,O.jsx)(i.BasketButton,{}),(0,O.jsx)(d.Button,{small:!0,kind:"ghost",label:"Account",onPress:()=>l.router.push('/customer/profile')})]}),children:[$.fictional?(0,O.jsx)(d.Banner,{kind:"warn",title:"Fictional demo restaurant",children:"Shown only to demonstrate multi-restaurant support."}):null,ee?(0,O.jsx)(d.Banner,{kind:"success",title:`Ordering at Table ${M.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,O.jsx)(d.Card,{children:(0,O.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,O.jsxs)(r.default,{style:{flex:1},children:[(0,O.jsx)(d.T,{weight:"semibold",children:"Takeaway \u2014 collection"}),(0,O.jsxs)(d.Muted,{children:[ae?`Kitchen today ${(0,b.kitchenHoursOn)($,N)[0]}\u2013${(0,b.kitchenHoursOn)($,N)[1]}`:'Kitchen closed today',$.settings.takeawayPaused?' \xb7 slots paused by the restaurant':'']})]}),(0,O.jsx)(d.Badge,{kind:$.settings.takeawayPaused||!ae?'amber':'ok',label:$.settings.takeawayPaused?'Paused':ae?'Taking orders':'Closed'})]})}),$.fictional?(0,O.jsx)(d.Row,{wrap:!0,gap:8,children:re.slice(2,7).map(e=>(0,O.jsx)(d.Button,{small:!0,kind:"secondary",label:e.label,onPress:e.on},e.label))}):(0,O.jsx)(r.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:re.map(e=>(0,O.jsx)(f.HubTile,{icon:e.icon,label:e.label,sub:e.sub,badge:e.badge,onPress:e.on},e.label))}),ee?(0,O.jsx)(d.Button,{small:!0,kind:"danger",label:"Call staff",onPress:()=>F(!0)}):null,W?(0,O.jsx)(d.Banner,{kind:"success",children:"We've told the staff on this device. Calling staff: not set up yet."}):null,$.hoursNote?(0,O.jsx)(d.Muted,{children:$.hoursNote}):null,$.fictional?null:(0,O.jsx)(d.ExampleAllergenNotice,{}),(0,O.jsxs)(d.Muted,{children:["Menu dishes and prices from ",$.name,"\u2019s menu. Items marked \u26a0 conflict with your declared allergies."]}),(0,O.jsx)(r.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:C.map(e=>{const l=Y===e.id;return(0,O.jsxs)(n.default,{testID:`menu-tab-${e.id}`,accessibilityRole:"tab",accessibilityState:{selected:l},"aria-selected":l,accessibilityLabel:'specials'===e.id&&V?'Specials, updated today':e.label,onPress:()=>z(e.id),style:{flex:1,minHeight:44,borderRadius:10,alignItems:'center',justifyContent:'center',paddingHorizontal:4,backgroundColor:l?p.colours.gold:'transparent'},children:[(0,O.jsx)(d.T,{size:14,weight:"semibold",colour:l?p.colours.onGold:p.colours.text,center:!0,children:e.label}),'specials'===e.id&&V&&!l?(0,O.jsx)(r.default,{style:{position:'absolute',top:6,right:8,width:7,height:7,borderRadius:4,backgroundColor:p.colours.gold}}):null]},e.id)})}),'specials'===Y?(0,O.jsx)(x.SpecialsTab,{rid:$.id,declared:I.allergies,now:N}):null,'takeaway'===Y?(0,O.jsx)(d.Muted,{children:"Order to collect. Only dishes available to order online are shown; pick a collection slot at checkout."}):null,'specials'!==Y?(0,O.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,O.jsx)(d.Chip,{label:"All",selected:'All'===L,onPress:()=>E('All')}),le.map(e=>(0,O.jsx)(d.Chip,{label:e,selected:L===e,onPress:()=>E(e)},e))]}):null,'specials'!==Y?le.filter(e=>('All'===L||e===L)&&se.some(l=>l.section===e)).map(e=>(0,O.jsxs)(r.default,{style:{gap:10},children:[(0,O.jsx)(d.H2,{style:{color:p.colours.gold,marginTop:6},children:e}),se.filter(l=>l.section===e).map(e=>{const t=(0,u.conflictsFor)(e.allergens,I.allergies),s=e.soldOut||!e.signOff||null===e.price;return(0,O.jsxs)(d.Card,{highlight:t.contains.length?p.colours.red:t.may.length?p.colours.amber:void 0,children:[(0,O.jsxs)(n.default,{accessibilityRole:"button",onPress:()=>{M.restaurantId&&M.restaurantId===$.id||_($.id,'takeaway'),l.router.push(`/customer/${$.id}/dish/${e.id}`)},children:[(0,O.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,O.jsx)(d.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,O.jsx)(d.T,{weight:"semibold",colour:p.colours.gold,children:null===e.price?e.priceNote??'\u2014':(0,c.gbp)(e.price)})]}),(0,O.jsx)(d.Muted,{numberOfLines:2,children:e.description})]}),(0,O.jsxs)(d.Row,{wrap:!0,gap:6,children:[e.dietary.map(e=>(0,O.jsx)(d.Badge,{kind:"ok",label:e},e)),e.special?(0,O.jsx)(d.Badge,{kind:"gold",label:"Special"}):null,e.soldOut?(0,O.jsx)(d.Badge,{kind:"neutral",label:"Sold out"}):null,e.signOff?null:(0,O.jsx)(d.Badge,{kind:"amber",label:"Awaiting allergen sign-off"}),t.contains.length?(0,O.jsx)(d.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):t.may.length?(0,O.jsx)(d.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null]}),(0,O.jsx)(o.AllergenChips,{map:e.allergens,declared:I.allergies}),H===e.id?(0,O.jsx)(o.AllergenPanel,{item:e,map:e.allergens,declared:I.allergies}):null,(0,O.jsxs)(d.Row,{gap:8,children:[(0,O.jsx)(d.Button,{small:!0,kind:"ghost",label:H===e.id?'Hide allergen panel':'Allergen panel',onPress:()=>D(H===e.id?null:e.id)}),(0,O.jsx)(r.default,{style:{flex:1}}),(0,O.jsx)(d.Button,{small:!0,label:s?e.soldOut?'Sold out':'Not available online':'Choose',disabled:s,onPress:()=>{M.restaurantId&&M.restaurantId===$.id||_($.id,'takeaway'),l.router.push(`/customer/${$.id}/dish/${e.id}`)}})]})]},e.id)})]},e)):null,(0,O.jsx)(d.Muted,{children:"Drinks list coming soon. Ask your server for today\u2019s drinks."}),(0,O.jsx)(d.Muted,{children:"Card payments: not set up yet. Pay at the till as usual."}),(0,O.jsx)(f.LauncherLine,{}),Z?(0,O.jsxs)(d.Sheet,{visible:G,onClose:()=>K(!1),title:"Order at your table",children:[(0,O.jsx)(d.Muted,{children:"Scan the QR code on your table with your phone camera, or pick your table number."}),(0,O.jsx)(d.Row,{wrap:!0,gap:6,children:Array.from({length:12},(e,l)=>String(l+1)).map(e=>(0,O.jsx)(d.Button,{small:!0,kind:"secondary",label:`Table ${e}`,onPress:()=>{K(!1),_($.id,'table',e)}},e))}),(0,O.jsx)(d.Muted,{children:"Orders go straight to the kitchen. Card payments: not set up yet. Pay at the till as usual."})]}):null]})}},771,[794,20,112,253,117,818,819,802,803,805,804,808,810,825,796,826,827,828,829,830,831,824,14]);
|
owner-app/_expo/static/js/web/lost-312deba7d8cf34ee11eefd449487477f.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,y]=(0,n.useState)(''),[w,b]=(0,n.useState)(''),[S,C]=(0,n.useState)(''),[R,v]=(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 O=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 (sent to the venue on this device only: messaging is not set up yet)."]}):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:y,placeholder:"e.g. Grey scarf"}),(0,o.jsx)(s.Field,{label:"When were you in?",value:w,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||w.trim().length<2,onPress:()=>{l.useOwner.getState().setOwner({lostReports:[{id:`lr-${Date.now()}`,item:f.trim(),when:w.trim(),where:S.trim()||'Not sure',contact:`${c.name} \xb7 ${c.email}`,at:x.toISOString(),status:'open'},...l.useOwner.getState().lostReports]}),y(''),b(''),C(''),v(!0)}})]}),O.length?(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Your reports"}),O.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?'ok':'open'===t.status?'amber':'neutral',label:'matched'===t.status?'Found!':'open'===t.status?'Looking':'Closed'})]},t.id))]}):null]})}},772,[794,20,802,808,826,14]);
|
owner-app/_expo/static/js/web/loyalty-715677b42fb5442f74f4277c5668357f.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]),t=(r=s)&&r.__esModule?r:{default:r},n=_r(d[3]),i=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),p=_r(d[10]);function f(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r);return(0,h.guestServer)()?s?(0,p.jsx)(u.LoyaltyLive,{slug:r,venue:s.name}):(0,p.jsx)(i.Screen,{title:"Not found",children:(0,p.jsx)(i.T,{children:"Restaurant not found."})}):(0,p.jsx)(j,{})}function j(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r),u=(0,l.useCustomer)(),h=(0,l.useStampCard)(r);if(!s)return(0,p.jsx)(i.Screen,{title:"Not found",children:(0,p.jsx)(i.T,{children:"Restaurant not found."})});const f=s.settings.stampTarget,j=h?.stamps??0;return(0,p.jsxs)(i.Screen,{title:"Stamp card",subtitle:`${s.name} \u2014 this card is just for ${s.name}`,children:[(0,p.jsx)(i.Banner,{kind:"example",title:"Example card (demo)",children:"On a real venue your card is saved by the venue and is the same on any phone."}),(0,p.jsxs)(i.Card,{highlight:c.colours.gold,children:[(0,p.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(i.H2,{children:[j," of ",f," stamps"]}),(0,p.jsxs)(i.T,{colour:c.colours.gold,weight:"semibold",children:["Reward: ",s.settings.stampReward]})]}),(0,p.jsx)(t.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:10,justifyContent:'center',paddingVertical:8},children:Array.from({length:f}).map((e,r)=>(0,p.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,p.jsx)(i.T,{size:22,colour:r<j?c.colours.onGold:c.colours.border,children:"\u2605"})},r))}),(0,p.jsxs)(i.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,"."]}),h?.rewardsAvailable?(0,p.jsx)(i.Banner,{kind:"success",title:`${h.rewardsAvailable} reward${h.rewardsAvailable>1?'s':''} ready: ${s.settings.stampReward}`,children:(0,p.jsx)(i.Button,{small:!0,label:"Use reward (show staff)",onPress:()=>l.repo.loyalty.redeemReward(s.id,u.id)})}):null]}),(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.H2,{children:"Show this to staff"}),(0,p.jsx)(i.Muted,{children:"Staff scan this on the tablet to add a stamp for dine-in visits not paid by table QR."}),(0,p.jsx)(n.QR,{value:`covercharge:stamp:${s.id}:${u.id}`,size:190}),(0,p.jsx)(i.T,{center:!0,weight:"semibold",children:u.name})]}),(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.H2,{children:"Bring a friend"}),(0,p.jsx)(i.T,{children:"Your referral code"}),(0,p.jsx)(i.T,{size:28,weight:"bold",colour:c.colours.gold,center:!0,children:u.referralCode}),(0,p.jsx)(i.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,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.H2,{children:"History"}),(h?.history??[]).length?h.history.slice(0,10).map((e,r)=>(0,p.jsxs)(i.Muted,{children:[e.at.slice(0,10)," \xb7 ",e.source]},r)):(0,p.jsx)(i.Muted,{children:"No stamps yet."})]}),(0,p.jsx)(i.Muted,{children:"Rewards are kept on food (Scottish licensing rules restrict drinks promotions). Stamps are never given for reviews."})]})}},773,[794,20,117,832,802,805,808,810,831,824,14]);
|
owner-app/_expo/static/js/web/merch-91d5784c59611cf1da0675ec4c04750d.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 b}});var e,t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),r=(e=s)&&e.__esModule?e:{default:e},l=_r(d[3]),o=_r(d[4]),u=_r(d[5]),c=_r(d[6]),m=_r(d[7]),h=_r(d[8]),j=_r(d[9]),x=_r(d[10]),f=_r(d[11]),p=_r(d[12]);function b(){const{rid:e}=(0,t.useLocalSearchParams)(),n=(0,u.useRestaurant)(e),s=(0,u.useCustomer)();return(0,f.guestServer)()?n?(0,p.jsx)(x.ShopLive,{slug:e,venue:n.name,guestName:s.name}):(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Restaurant not found."})}):(0,p.jsx)(y,{})}function y(){const{rid:e}=(0,t.useLocalSearchParams)(),s=(0,u.useRestaurant)(e),x=(0,u.useCustomer)(),f=(0,u.useNow)(6e4),b=(0,c.useOwner)(e=>e.merch),[y,S]=(0,n.useState)({}),[k,w]=(0,n.useState)(null),[v,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 $=b.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:[v?(0,p.jsxs)(o.Banner,{kind:"success",title:"Order noted (no payment taken)",children:[v," Collect it at the bar on your next visit."]}):null,b.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)(r.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=>S({...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:()=>w(e.id)})]}):null]},e.id)),(0,p.jsxs)(o.Muted,{children:["Collection only in this prototype. Prices set by ",s.name,"."]}),$?(0,p.jsx)(l.MockPay,{visible:!0,onClose:()=>w(null),amount:$.price*O($.id),restaurantId:s.id,allowGiftCard:!1,title:`Buy ${$.name}`,onPaid:()=>{const e=c.useOwner.getState();e.setOwner({merch:e.merch.map(e=>e.id===$.id?{...e,stock:Math.max(0,e.stock-O($.id))}:e),merchOrders:[{id:`mo-${Date.now()}`,productId:$.id,qty:O($.id),customer:x.name,at:(0,h.ymd)(f),status:'new'},...e.merchOrders]}),C(`${O($.id)} \xd7 ${$.name}, ${(0,m.gbp)($.price*O($.id))}.`),w(null)}}):null]})}},774,[794,20,117,822,802,808,826,805,807,810,823,824,14]);
|
owner-app/_expo/static/js/web/offers-ec22ebcf7c9b3691c768eaf1640d5012.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 n=_r(d[0]);_r(d[1]);var t=_r(d[2]),s=_r(d[3]),r=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);function h(){const{rid:r}=(0,n.useLocalSearchParams)(),o=(0,s.useRestaurant)(r);return(0,u.guestServer)()?o?(0,f.jsx)(c.OffersLive,{slug:r,venue:o.name}):(0,f.jsx)(t.Screen,{title:"Not found",children:(0,f.jsx)(t.T,{children:"Restaurant not found."})}):(0,f.jsx)(j,{})}function j(){const{rid:c}=(0,n.useLocalSearchParams)(),u=(0,s.useRestaurant)(c),h=(0,s.useCustomer)(),j=(0,r.useOwner)(n=>n.offers);if(!u)return(0,f.jsx)(t.Screen,{title:"Not found",children:(0,f.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,f.jsxs)(t.Screen,{title:"Specials & offers",subtitle:u.name,children:[(0,f.jsxs)(t.Card,{highlight:x?l.colours.ok:l.colours.gold,children:[(0,f.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,f.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,f.jsx)(t.H2,{children:"Today's specials"}),p.length?p.map(n=>(0,f.jsxs)(t.Card,{children:[(0,f.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,f.jsx)(t.Badge,{kind:"gold",label:"Special"})]}),(0,f.jsx)(t.Muted,{children:n.body})]},n.id)):(0,f.jsx)(t.Muted,{children:"No specials on the board right now."}),(0,f.jsx)(t.H2,{children:"Member offers"}),x?y.length?y.map(n=>(0,f.jsxs)(t.Card,{children:[(0,f.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,f.jsx)(t.Badge,{kind:"ok",label:"Offer"})]}),(0,f.jsx)(t.Muted,{children:n.body}),n.until?(0,f.jsxs)(t.Muted,{children:["Until ",(0,o.niceDate)((0,o.parseYmd)(n.until))]}):null]},n.id)):(0,f.jsx)(t.Muted,{children:"No offers right now."}):(0,f.jsxs)(t.Banner,{kind:"info",children:["Turn on offers above to see ",y.length," member offer",1===y.length?'':'s',"."]}),(0,f.jsxs)(t.Muted,{children:["Offers are set by ",u.name,". Drinks promotions follow Scottish licensing rules. Demo: no notifications are sent."]})]})}},775,[794,20,802,808,826,807,810,831,824,14]);
|
owner-app/_expo/static/js/web/profile-337890e0e56d3b12d5f0637140cf7e83.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 b}});var e=_r(d[0]),r=_r(d[1]);_r(d[2]);var s,t=_r(d[3]),l=(s=t)&&s.__esModule?s:{default:s},n=_r(d[4]),a=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]);function b(){const s=(0,c.useCustomer)(),t=(0,c.useStore)((0,h.useShallow)(e=>e.orders.filter(r=>r.customerId===e.customer.id))),b=(0,c.useStore)((0,h.useShallow)(e=>e.bookings.filter(r=>r.customerId===e.customer.id))),y=(0,c.useStore)(e=>e.restaurants),x=e=>y.find(r=>r.id===e)?.name??e;return(0,p.jsxs)(n.Screen,{title:"Your account",subtitle:"One CoverCharge account for every restaurant",children:[(0,p.jsxs)(n.Card,{children:[(0,p.jsx)(n.Field,{label:"Name",value:s.name,onChangeText:e=>c.repo.customers.update({name:e})}),(0,p.jsx)(n.Field,{label:"Email",value:s.email,keyboardType:"email-address",onChangeText:e=>c.repo.customers.update({email:e})}),(0,p.jsx)(n.Field,{label:"Mobile",value:s.phone,keyboardType:"phone-pad",onChangeText:e=>c.repo.customers.update({phone:e})}),(0,p.jsx)(n.Muted,{children:(0,e.guestServer)()?'Your bring-a-friend code is on each restaurant\u2019s stamp card.':`Referral code: ${s.referralCode}`})]}),(0,p.jsxs)(n.Card,{children:[(0,p.jsx)(n.H2,{children:"Allergies & severity"}),(0,p.jsx)(n.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,p.jsx)(n.Toggle,{label:"I consent to CoverCharge storing my allergy information (health data, UK GDPR)",value:s.allergyConsent,onChange:e=>c.repo.customers.update({allergyConsent:e})}),s.allergyConsent?null:(0,p.jsx)(n.Banner,{kind:"warn",children:"Without consent your allergies won\u2019t be stored \u2014 tell staff directly."}),a.ALLERGENS.map(e=>{const r=s.allergies.find(r=>r.allergen===e.id);return(0,p.jsxs)(l.default,{style:{gap:6,paddingVertical:6},children:[(0,p.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(n.T,{weight:r?'semibold':'regular',children:e.label}),r?(0,p.jsx)(n.Badge,{kind:"red",label:"Declared"}):null]}),(0,p.jsxs)(n.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(n.Chip,{label:"None",selected:!r,onPress:()=>c.repo.customers.setAllergy(e.id,null),disabled:!s.allergyConsent&&!r}),a.SEVERITIES.map(t=>(0,p.jsx)(n.Chip,{label:t.label,selected:r?.severity===t.id,disabled:!s.allergyConsent,onPress:()=>c.repo.customers.setAllergy(e.id,t.id)},t.id))]})]},e.id)})]}),(0,p.jsxs)(n.Card,{children:[(0,p.jsx)(n.H2,{children:"Your orders"}),t.length?t.map(e=>(0,p.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(n.T,{style:{flex:1},children:[e.ref," \xb7 ",x(e.restaurantId)," \xb7 ",'table'===e.type?`Table ${e.tableNo}`:'Takeaway']}),(0,p.jsx)(n.Button,{small:!0,kind:"secondary",label:`${e.status} \xb7 ${(0,o.gbp)(e.subtotal+e.tip)}`,onPress:()=>r.router.push(`/customer/order/${e.id}`)})]},e.id)):(0,p.jsx)(n.Muted,{children:"No orders yet."})]}),(0,p.jsxs)(n.Card,{children:[(0,p.jsx)(n.H2,{children:"Your bookings"}),b.length?b.map(e=>(0,p.jsxs)(n.T,{children:[e.ref," \xb7 ",x(e.restaurantId)," \xb7 ",(0,u.niceDate)((0,u.parseYmd)(e.date))," ",e.time," \xb7 ",e.partySize," people \xb7 ",e.status]},e.id)):(0,p.jsx)(n.Muted,{children:"No bookings yet."})]}),(0,p.jsx)(n.Muted,{children:"Account deletion and data export would live here (Apple 5.1.1(v); Google web deletion link)."})]})}},782,[824,794,20,117,802,803,805,807,808,837,14]);
|
owner-app/_expo/static/js/web/refer-c2fcc0a30b787a74fd99a7db78943e2f.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 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]),c=_r(d[7]),h=_r(d[8]);function f(){const{rid:n}=(0,r.useLocalSearchParams)(),l=(0,t.useRestaurant)(n);return(0,c.guestServer)()?l?(0,h.jsx)(u.ReferLive,{slug:n,venue:l.name}):(0,h.jsx)(s.Screen,{title:"Not found",children:(0,h.jsx)(s.T,{children:"Restaurant not found."})}):(0,h.jsx)(j,{})}function j(){const{rid:u}=(0,r.useLocalSearchParams)(),c=(0,t.useRestaurant)(u),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(!c)return(0,h.jsx)(s.Screen,{title:"Not found",children:(0,h.jsx)(s.T,{children:"Restaurant not found."})});const b=x.filter(r=>r.referrer===f.name);return(0,h.jsxs)(s.Screen,{title:"Bring a friend",subtitle:c.name,children:[j.active?null:(0,h.jsxs)(s.Banner,{kind:"info",children:[c.name," isn't running referrals right now."]}),(0,h.jsxs)(s.Card,{highlight:o.colours.gold,children:[(0,h.jsxs)(s.H2,{children:["You get: ",j.giverReward]}),(0,h.jsxs)(s.T,{children:["Your friend gets: ",j.friendReward]}),(0,h.jsx)(s.Muted,{children:"When your friend makes their first paid visit or order."}),(0,h.jsx)(s.T,{size:30,weight:"bold",colour:o.colours.gold,center:!0,children:f.referralCode}),(0,h.jsx)(s.Button,{label:"Share my code",disabled:!j.active,onPress:()=>w(!0)}),p?(0,h.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,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.H2,{children:"Your referrals"}),b.length?b.map(r=>(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.T,{style:{flex:1},children:r.friend}),(0,h.jsx)(s.Badge,{kind:'rewarded'===r.status?'ok':'amber',label:r.status})]},r.id)):(0,h.jsx)(s.Muted,{children:"No referrals yet."})]}),(0,h.jsx)(s.Muted,{children:"One reward per new account, phone and card. Monthly cap applies. Rewards are on food, not drinks."})]})}},776,[794,20,802,808,826,810,831,824,14]);
|
owner-app/_expo/static/js/web/waitlist-50792dd191f30792d944d9760b052c34.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."})]})}},777,[794,20,802,807,833,834,808,810,14]);
|
owner-app/_expo/static/js/web/whatson-11543aaf1601e35745ccb1c678ae0747.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:"ok",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.ok: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."})]})}},778,[794,817,20,253,117,802,807,808,810,14]);
|
owner-app/index.html
CHANGED
|
@@ -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. */
|
|
|
|
| 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-d1c6130527758186befb9ddcdc33afda.js" defer></script><script src="/owner-app/_expo/static/js/web/index-851ab32cc6cd46e29de2ee6ef736ea72.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-c0715b37ad823d4ce2f5206f62c5b405.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-e82aa16c3d";
|
| 3 |
const BASE = "/owner-app/";
|
| 4 |
+
const PRECACHE = ["/owner-app/_expo/static/js/web/+not-found-c0715b37ad823d4ce2f5206f62c5b405.js", "/owner-app/_expo/static/js/web/[did]-0d8f5598929ab27d547672e738480c46.js", "/owner-app/_expo/static/js/web/[n]-f70147ed6be3e387c5c5b96a72ac6d67.js", "/owner-app/_expo/static/js/web/[oid]-d84141be120e5e94aac3862db784d536.js", "/owner-app/_expo/static/js/web/[section]-50debfd935d9eea30738639c6d520ce7.js", "/owner-app/_expo/static/js/web/[token]-95091a67ece0565f844f7e286de11363.js", "/owner-app/_expo/static/js/web/__common-d1c6130527758186befb9ddcdc33afda.js", "/owner-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js", "/owner-app/_expo/static/js/web/_layout-e8b91a4f4f51319eadfa56ff01bfcf8a.js", "/owner-app/_expo/static/js/web/basket-bc55ff791a24832051ce9f8a27bbdba3.js", "/owner-app/_expo/static/js/web/book-fe1a511098175362c634032b33cc795c.js", "/owner-app/_expo/static/js/web/demo-5228d8fc9d31e5306c21169ef41d9d0b.js", "/owner-app/_expo/static/js/web/feedback-cb959353b54fab0866378ed2be72132e.js", "/owner-app/_expo/static/js/web/gift-07557aa0dc548594d98c389388830159.js", "/owner-app/_expo/static/js/web/index-0506435bb652454ffa198594a7e57f92.js", "/owner-app/_expo/static/js/web/index-1a8d8df916faced7d6bcdb98065c09fe.js", "/owner-app/_expo/static/js/web/index-5710ed20b010a67bbb9d07510858c5fc.js", "/owner-app/_expo/static/js/web/index-58de8f051c20cc445fbe8adc0c139dce.js", "/owner-app/_expo/static/js/web/index-851ab32cc6cd46e29de2ee6ef736ea72.js", "/owner-app/_expo/static/js/web/index-923dc0939bc1713d1aef15a2ac88516d.js", "/owner-app/_expo/static/js/web/index-a7773a7d6e42f73e35c2623b14d84f24.js", "/owner-app/_expo/static/js/web/index-b6ff7e28395260bd4bf7e990a00bbd2d.js", "/owner-app/_expo/static/js/web/index-da33cd41d3cd5ea80a3d4a6704d09f4e.js", "/owner-app/_expo/static/js/web/index-e57c2833a3c34f2511b73cfc581fa833.js", "/owner-app/_expo/static/js/web/lost-312deba7d8cf34ee11eefd449487477f.js", "/owner-app/_expo/static/js/web/loyalty-715677b42fb5442f74f4277c5668357f.js", "/owner-app/_expo/static/js/web/merch-91d5784c59611cf1da0675ec4c04750d.js", "/owner-app/_expo/static/js/web/offers-ec22ebcf7c9b3691c768eaf1640d5012.js", "/owner-app/_expo/static/js/web/profile-337890e0e56d3b12d5f0637140cf7e83.js", "/owner-app/_expo/static/js/web/refer-c2fcc0a30b787a74fd99a7db78943e2f.js", "/owner-app/_expo/static/js/web/waitlist-50792dd191f30792d944d9760b052c34.js", "/owner-app/_expo/static/js/web/whatson-11543aaf1601e35745ccb1c678ae0747.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]-0d8f5598929ab27d547672e738480c46.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:"ok",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"})]})]})}},768,[794,20,186,117,818,819,802,803,805,808,820,810,14]);
|
staff-app/_expo/static/js/web/[n]-76c5656c676288421db0bb5729fee8c4.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 l}});var t=_r(d[0]),r=_r(d[1]),n=_r(d[2]),o=_r(d[3]),u=_r(d[4]),c=_r(d[5]),s=_r(d[6]);function l(){const{n:l,r:f}=(0,t.useLocalSearchParams)(),b=(0,o.useStore)(t=>t.startBasket),[h,S]=(0,r.useState)(!1),j=f??u.VENUE_RID,O=(0,o.useOrderAtTable)(j),_=(0,c.guestServer)();return(0,r.useEffect)(()=>{_||(O&&b(j,'table',String(l)),S(!0))},[j,l,O,_]),_?(0,s.jsx)(n.Screen,{title:"Order at the table",children:(0,s.jsx)(n.Banner,{kind:"demo",title:"Scan the code on your table",children:"To order from your table, scan the QR code printed on it. Or order at the bar."})}):h?(0,s.jsx)(t.Redirect,{href:`/customer/${j}`}):null}},784,[794,20,802,808,837,824,14]);
|
staff-app/_expo/static/js/web/[oid]-d84141be120e5e94aac3862db784d536.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',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.ok,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 (test, no real money)"}),(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)}})]})}},781,[794,20,117,822,821,802,803,805,807,808,810,14]);
|
staff-app/_expo/static/js/web/[token]-fdbfe5fde9cc61fcf3dc32350d1afcb7.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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]);r(d[1]);var n=r(d[2]),o=r(d[3]),c=r(d[4]),s=r(d[5]),l=r(d[6]);function u(){const{token:u}=(0,t.useLocalSearchParams)(),h=(0,c.cleanToken)(u);return h?(0,s.guestServer)()?(0,l.jsx)(o.TableOrderLive,{token:h}):(0,l.jsx)(n.Screen,{title:"Order at the table",children:(0,l.jsx)(n.Banner,{kind:"demo",title:"Not connected",children:"This preview isn't connected to a venue, so table orders can't be sent from here."})}):(0,l.jsx)(n.Screen,{title:"Order at the table",children:(0,l.jsx)(n.Banner,{kind:"warn",title:"This code isn't working",children:"Please scan the QR code on your table again, or ask a member of staff."})})}},785,[794,20,802,839,841,824,14]);
|
| 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.TableOrderLive=function({token:e}){const[x,p]=(0,t.useState)(null),[f,b]=(0,t.useState)(null),[j,m]=(0,t.useState)([]),[y,k]=(0,t.useState)(null),w=(0,d.useCustomer)(),[T,C]=(0,t.useState)(()=>(w?.allergies??[]).map(e=>e.allergen)),[S,v]=(0,t.useState)(''),[P,O]=(0,t.useState)(''),[B,L]=(0,t.useState)(!1),[M,R]=(0,t.useState)(null),[N,$]=(0,t.useState)([]),A=(0,t.useCallback)(async()=>{try{p(await(0,o.tablePublic)(e)),b(null)}catch(e){b(e?.message??'Could not load the menu.')}},[e]),D=(0,t.useCallback)(async()=>{try{$(await(0,o.myTableOrders)(e))}catch{}},[e]);(0,t.useEffect)(()=>{A(),D();const e=setInterval(()=>{D(),A()},8e3);return()=>clearInterval(e)},[A,D]);const I=x?.menu??[];(0,t.useEffect)(()=>{m(e=>e.filter(e=>I.some(t=>t.id===e.id&&!t.soldOut)))},[x]);const _=(0,t.useMemo)(()=>{const e=new Map;for(const t of I)e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()]},[x]),q=(0,i.cartTotal)(j,I),Y='yes'===y?T.map(e=>({allergen:e,severity:w?.allergies?.find(t=>t.allergen===e)?.severity??'allergy'})):[],W=(0,i.allergyClashes)(j,I,Y.map(e=>e.allergen)),E=e=>j.find(t=>t.id===e)?.qty??0,z=(e,t)=>m(l=>t<=0?l.filter(t=>t.id!==e):l.some(t=>t.id===e)?l.map(l=>l.id===e?{...l,qty:t}:l):[...l,{id:e,qty:t,note:''}]),G=(e,t)=>m(l=>l.map(l=>l.id===e?{...l,note:t}:l)),H=async()=>{L(!0),R(null);try{const t=await(0,o.sendTableOrder)(e,j,{note:P,name:S,allergies:Y});m([]),O(''),R({kind:'success',text:t.held?`Order ${t.ref} sent. A member of staff will check it, then it goes to the kitchen.`:`Order ${t.ref} sent to the kitchen.`}),D()}catch(e){R({kind:'warn',text:e?.message??'The order was not sent. Please try again or ask a member of staff.'}),A()}finally{L(!1)}};if(f)return(0,h.jsxs)(s.Screen,{title:"Order at the table",children:[(0,h.jsx)(s.Banner,{kind:"warn",title:"Couldn't open the menu",children:f}),(0,h.jsx)(s.Button,{label:"Try again",onPress:()=>{A()}})]});if(!x)return(0,h.jsx)(s.Screen,{title:"Order at the table",children:(0,h.jsx)(s.Muted,{children:"Opening the menu\u2026"})});if(!x.ok)return(0,h.jsx)(s.Screen,{title:"Order at the table",children:(0,h.jsx)(s.Banner,{kind:"warn",title:"This code isn't working",children:x.reason??'Please ask a member of staff.'})});const V=x.open&&j.length>0&&null!==y&&('none'===y||T.length>0)&&!B;return(0,h.jsxs)(s.Screen,{title:`Table ${x.table}`,subtitle:x.venueName,footer:x.open?(0,h.jsx)(s.Button,{label:B?'Sending\u2026':j.length?`Send order to the kitchen (${(0,r.gbp)(q)})`:'Add a dish to order',disabled:!V,onPress:()=>{H()},testID:"send-table-order-live"}):void 0,children:[(0,h.jsxs)(s.Muted,{children:["Tip: add dishes, answer the allergy question, then send. Staff bring it to Table ",x.table,". ",i.PAY_WORDS]}),x.tip?(0,h.jsx)(s.Banner,{kind:"demo",children:x.tip}):null,x.open?null:(0,h.jsx)(s.Banner,{kind:"warn",title:"Not taking table orders right now",children:x.reason}),x.open&&x.staffAccept&&!N.some(e=>e.accepted)?(0,h.jsx)(s.Muted,{children:"The first order from your phone is checked by a member of staff before it goes to the kitchen."}):null,M?(0,h.jsx)(s.Banner,{kind:M.kind,children:M.text}):null,N.length?(0,h.jsx)(n.default,{testID:"my-table-orders",children:(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Your orders at this table"}),N.map(e=>(0,h.jsxs)(n.default,{style:{gap:2,paddingVertical:4},children:[(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.T,{children:e.ref}),(0,h.jsx)(s.T,{size:13,colour:'cancelled'===e.status?c.colours.amber:c.colours.gold,children:(0,i.guestStatusWords)(e)})]}),(0,h.jsxs)(s.Muted,{children:[e.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",(0,r.gbp)(e.totalPence)," to pay at the bar or till"]})]},e.id))]})}):null,x.open?_.map(([e,t])=>(0,h.jsxs)(n.default,{style:{gap:8},children:[(0,h.jsx)(s.H2,{children:e}),t.map(e=>(0,h.jsxs)(s.Card,{children:[(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,h.jsxs)(n.default,{style:{flex:1,gap:2},children:[(0,h.jsx)(s.T,{weight:"semibold",children:e.name}),e.description?(0,h.jsx)(s.Muted,{children:e.description}):null,(0,h.jsxs)(s.T,{size:13,colour:c.colours.muted,children:[e.allergens.length?`Contains: ${e.allergens.map(a.allergenLabel).join(', ')}`:'No allergens listed: ask staff if unsure',e.mayContain.length?` \xb7 May contain: ${e.mayContain.map(a.allergenLabel).join(', ')}`:'']})]}),(0,h.jsx)(s.T,{weight:"semibold",colour:c.colours.gold,children:(0,r.gbp)(e.pricePence)})]}),e.soldOut?(0,h.jsx)(s.Badge,{kind:"amber",label:"Sold out today"}):E(e.id)?(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.Stepper,{value:E(e.id),min:0,max:20,onChange:t=>z(e.id,t),label:e.name}),(0,h.jsx)(s.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>z(e.id,0)})]}):(0,h.jsx)(s.Button,{small:!0,kind:"secondary",label:"Add",accessibilityLabel:`Add ${e.name}`,onPress:()=>z(e.id,1)})]},e.id))]},e)):null,x.open&&!I.length?(0,h.jsx)(s.Banner,{kind:"demo",title:"No dishes to order yet",children:"The venue hasn't put any priced dishes on the table menu yet. Please order at the bar."}):null,x.open&&j.length?(0,h.jsx)(n.default,{testID:"table-cart",children:(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Your order"}),j.map(e=>{const t=I.find(t=>t.id===e.id);return(0,h.jsxs)(n.default,{style:{gap:4},children:[(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(s.T,{children:[e.qty,"\xd7 ",t?.name]}),(0,h.jsx)(s.T,{children:(0,r.gbp)(e.qty*(t?.pricePence??0))})]}),(0,h.jsx)(l.default,{style:u,value:e.note,onChangeText:t=>G(e.id,t),placeholder:"Note for the kitchen (optional), e.g. no onions",placeholderTextColor:c.colours.muted,maxLength:140,accessibilityLabel:`Note for ${t?.name}`,testID:`table-note-${e.id}`})]},e.id)}),(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Total"}),(0,h.jsx)(s.T,{weight:"semibold",children:(0,r.gbp)(q)})]})]})}):null,x.open?(0,h.jsx)(n.default,{testID:"table-allergy",children:(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Does anyone at the table have a food allergy?"}),(0,h.jsx)(s.Muted,{children:"We ask everyone, so the kitchen can keep you safe."}),(0,h.jsxs)(s.Row,{gap:8,children:[(0,h.jsx)(s.Chip,{label:"No allergies",selected:'none'===y,onPress:()=>k('none')}),(0,h.jsx)(s.Chip,{label:"Yes, allergies",selected:'yes'===y,onPress:()=>k('yes')})]}),'yes'===y?(0,h.jsx)(s.Row,{wrap:!0,gap:6,children:a.ALLERGENS.map(e=>(0,h.jsx)(s.Chip,{label:e.short,selected:T.includes(e.id),onPress:()=>C(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},e.id))}):null,W.length?(0,h.jsxs)(s.Banner,{kind:"warn",title:"Check with staff",children:[W.map(e=>e.name).join(', ')," ",W.length>1?'contain':'contains'," or may contain an allergy you picked. The kitchen will see your allergies on the ticket."]}):null]})}):null,x.open?(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Anything else?"}),(0,h.jsx)(l.default,{style:u,value:S,onChangeText:v,placeholder:"Your first name (optional)",placeholderTextColor:c.colours.muted,maxLength:40,accessibilityLabel:"Your first name (optional)"}),(0,h.jsx)(l.default,{style:u,value:P,onChangeText:O,placeholder:"Note for the staff (optional)",placeholderTextColor:c.colours.muted,maxLength:300,accessibilityLabel:"Note for the staff (optional)"})]}):null,(0,h.jsx)(n.default,{testID:"pay-placeholder",children:(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.T,{weight:"semibold",children:"Paying"}),(0,h.jsx)(s.T,{children:i.PAY_WORDS}),(0,h.jsx)(s.Muted,{children:"No card details are asked for or kept in this app."})]})})]})};var t=_r(_d[0]),l=e(_r(_d[1])),n=e(_r(_d[2])),s=_r(_d[3]),a=_r(_d[4]),r=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]);const u={borderWidth:1,borderColor:c.colours.border,borderRadius:10,padding:10,color:c.colours.text,backgroundColor:c.colours.surface2}},839,[20,263,117,802,803,805,841,840,808,810,14]);
|
| 3 |
+
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tablePublic",{enumerable:!0,get:function(){return s}}),e.sendTableOrder=async function(t,r,a){if(!await(0,n.guestSession)())throw new Error('No connection. Try again when you are back online.');return(0,n.rpc)('guest_table_order',{p_token:t,p_lines:r.map(t=>({id:t.id,qty:t.qty,note:t.note.trim().slice(0,140)})),p_note:a.note.trim().slice(0,300)||null,p_allergies:a.allergies.map(t=>({allergen:t.allergen,severity:t.severity})),p_name:a.name.trim().slice(0,40)||null})},e.myTableOrders=async function(t){return await(0,n.guestSession)()?await(0,n.rpc)('guest_table_my_orders',{p_token:t})??[]:[]},e.loadTableSettings=async function(){const{data:t,error:n}=await a().from('table_order_settings').select('*').eq('venue_id',o()).maybeSingle();if(n)throw n;return(0,r.fromRow)(t)},e.saveTableSettings=async function(t,n){const{error:s}=await a().from('table_order_settings').upsert({venue_id:o(),...(0,r.toRow)(t),updated_at:(new Date).toISOString(),updated_by:n.slice(0,80)});if(s)throw s},e.listTableCodes=async function(){const{data:t,error:n}=await a().from('table_qr_codes').select('table_no, token, created_at').eq('venue_id',o()).eq('is_on',!0);if(n)throw n;return(t??[]).map(t=>({table:String(t.table_no),token:String(t.token),createdAt:String(t.created_at)})).sort((t,n)=>Number(t.table)-Number(n.table))},Object.defineProperty(e,"makeTableCodes",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"renewTableCode",{enumerable:!0,get:function(){return c}}),e.watchTableSettings=function(t){const r=n.useSync.getState().venueId;if(!r)return()=>{};const o=a().channel(`tos-${r}-${Math.random().toString(36).slice(2,8)}`).on('postgres_changes',{event:'*',schema:'public',table:'table_order_settings',filter:`venue_id=eq.${r}`},()=>t()).subscribe();return()=>{a().removeChannel(o)}};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const a=()=>(0,t.getSupabase)(),o=()=>{const t=n.useSync.getState().venueId;if(!t)throw new Error('Not connected to the venue yet.');return t},s=t=>(0,n.rpc)('table_public',{p_token:t});const l=t=>(0,n.rpc)('table_qr_make',{p_venue:o(),p_tables:t}),c=t=>(0,n.rpc)('table_qr_renew',{p_venue:o(),p_table:t})},840,[842,809,841]);
|
staff-app/_expo/static/js/web/__common-d51e6f2f4e4a173fba5ea8f496bba6e9.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/_layout-38a5adef8deb4995a6524b5adff49068.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/basket-947f69add2ae4f194c9de79b3d82c072.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 k}});var l=_r(d[0]),t=_r(d[1]),n=e(t),s=_r(d[2]),o=_r(d[3]),a=e(_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]),x=_r(d[14]),p=_r(d[15]);function k(){const e=(0,b.useBasket)(),k=(0,b.useRestaurant)(e.restaurantId??void 0),f=(0,b.useAllMenu)(e.restaurantId??void 0),v=(0,b.useCustomer)(),w=(0,b.useOrders)(k?.id),C=(0,b.useStore)(e=>e.setLineQty),S=(0,b.useStore)(e=>e.overrideLine),T=(0,b.useStore)(e=>e.startBasket),B=(0,b.useNow)(15e3),[P,$]=(0,t.useState)(null),[O,I]=(0,t.useState)(!1),[M,F]=(0,t.useState)(''),[L]=(0,t.useState)(()=>(0,o.startForm)()),[N,R]=(0,t.useState)(''),[z,A]=(0,t.useState)(v.phone??''),[D,E]=(0,t.useState)(v.email??''),[_,Y]=(0,t.useState)(!1),q=(0,b.useOrderAtTable)(e.restaurantId??void 0);n.default.useEffect(()=>{q||'table'!==e.mode||b.useStore.setState(e=>({basket:{...e.basket,mode:'takeaway',tableNo:void 0}}))},[q,e.mode]);const[H,G]=(0,t.useState)(null),[K,Q]=(0,t.useState)(!1),W=(0,t.useMemo)(()=>(0,y.linesFromBasket)(e,f,v.allergies),[e,f,v.allergies]);if(!k||!e.lines.length)return(0,p.jsxs)(i.Screen,{title:"Your basket",children:[(0,p.jsx)(i.Muted,{children:"Your basket is empty."}),(0,p.jsx)(i.Button,{label:"Browse restaurants",onPress:()=>l.router.replace('/customer')})]});const J=q&&'table'===e.mode,U=(0,h.takeawaySlots)(k,w,B),V=W.reduce((e,l)=>e+l.unitPrice*l.qty,0),X=W.some(e=>e.contains.length&&!e.overridden),Z=e.lines.filter(e=>{const l=f.find(l=>l.id===e.itemId);return!l||l.soldOut||!l.signOff}),ee=!J&&!P,le=!J&&k.settings.takeawayPaused,te=(0,x.ukPhone)(z),ne=!X&&!Z.length&&O&&!ee&&!le&&(J||te.ok&&(0,x.emailOk)(D)),se=async e=>{const t=await b.repo.orders.placeFromBasket({slotTime:J?void 0:P,tip:0,giftCardCode:e?.giftCardCode,notes:M,paidNow:!J,phone:J?void 0:te.pretty,email:J?void 0:D.trim()||void 0});(0,o.rememberGuard)(t.id,(0,o.guardFor)({...L,hp:N})),Y(!1),l.router.replace(`/customer/order/${t.id}`)},oe=e.lines.find(e=>e.key===H),ae=oe?W[e.lines.indexOf(oe)]:void 0;return(0,p.jsxs)(i.Screen,{title:"Your basket",subtitle:`${k.name} \xb7 ${J?`Table ${e.tableNo} (order at table)`:'Takeaway \u2014 collection'}`,footer:(0,p.jsxs)(a.default,{style:{gap:8},children:[(0,p.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(i.T,{weight:"semibold",children:"Subtotal"}),(0,p.jsx)(i.T,{weight:"bold",size:20,colour:j.colours.gold,children:(0,c.gbp)(V)})]}),X?(0,p.jsx)(i.T,{size:14,colour:j.colours.red,children:"Resolve the blocked allergy item(s) before continuing."}):O?ee&&!le?(0,p.jsx)(i.T,{size:14,colour:j.colours.amber,children:"Choose a collection time."}):null:(0,p.jsx)(i.T,{size:14,colour:j.colours.amber,children:"Confirm your allergies to continue."}),J?(0,p.jsx)(i.Button,{label:"Send order to the kitchen",disabled:!ne,onPress:()=>se(),testID:"send-table-order"}):(0,p.jsx)(i.Button,{label:`Continue to payment \xb7 ${(0,c.gbp)(V)}`,disabled:!ne,onPress:()=>Y(!0),testID:"checkout"})]}),children:[(J||e.tableNo,null),J?(0,p.jsx)(i.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,k.fictional?null:(0,p.jsx)(i.ExampleAllergenNotice,{}),W.map((l,t)=>{const n=e.lines[t],s=l.contains.length&&!l.overridden;return(0,p.jsxs)(i.Card,{highlight:l.contains.length?j.colours.red:l.may.length?j.colours.amber:void 0,children:[(0,p.jsxs)(i.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,p.jsxs)(a.default,{style:{flex:1,paddingRight:8},children:[(0,p.jsx)(i.T,{weight:"semibold",children:l.name}),l.choices.length?(0,p.jsx)(i.Muted,{children:l.choices.join(' \xb7 ')}):null,l.notes?(0,p.jsxs)(i.Muted,{children:["Note: ",l.notes]}):null]}),(0,p.jsx)(i.T,{weight:"semibold",children:(0,c.gbp)(l.unitPrice*l.qty)})]}),s?(0,p.jsxs)(i.Banner,{kind:"danger",title:`BLOCKED \u2014 contains ${l.contains.map(u.allergenLabel).join(', ')}`,children:[(0,p.jsx)(i.T,{size:14,colour:"#FFE3DF",children:`Conflicts with your declared ${v.allergies.filter(e=>l.contains.includes(e.allergen)).map(e=>`${(0,u.allergenLabel)(e.allergen)} (${(0,u.severityLabel)(e.severity)})`).join(', ')}.`}),(0,p.jsxs)(i.Row,{gap:8,style:{marginTop:6},children:[(0,p.jsx)(i.Button,{small:!0,kind:"secondary",label:"Remove",onPress:()=>C(n.key,0)}),(0,p.jsx)(i.Button,{small:!0,kind:"danger",label:"Override\u2026",onPress:()=>{Q(!1),G(n.key)}})]})]}):l.contains.length?(0,p.jsx)(i.Banner,{kind:"danger",title:`Allergy override recorded \u2014 contains ${l.contains.map(u.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,p.jsx)(i.Banner,{kind:"warn",title:`May contain ${l.may.map(u.allergenLabel).join(', ')}`,children:"Cross-contact risk (e.g. shared fryer). Please check with staff."}):null,Z.includes(n)?(0,p.jsx)(i.Badge,{kind:"amber",label:"No longer available online \u2014 please remove"}):null,(0,p.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(i.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>C(n.key,0)}),(0,p.jsx)(i.Stepper,{value:n.qty,onChange:e=>C(n.key,e),min:1,label:l.name})]})]},n.key)}),(0,p.jsx)(i.Button,{kind:"ghost",label:"Add more items",onPress:()=>l.router.push(`/customer/${k.id}`)}),J?null:(0,p.jsxs)(i.Card,{children:[(0,p.jsxs)(i.H2,{children:["Collection time \u2014 ",(0,m.niceDate)(B)]}),le?(0,p.jsx)(i.Banner,{kind:"warn",title:"Takeaway paused",children:"The restaurant has paused takeaway slots for now. Please try again later or book a table."}):0===U.length?(0,p.jsx)(i.Banner,{kind:"warn",children:"No collection slots left today."}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(i.Muted,{children:["15-minute slots, max ",k.settings.slotCap," orders each so the kitchen isn\u2019t overloaded."]}),(0,p.jsx)(i.Row,{wrap:!0,gap:6,children:U.slice(0,16).map(e=>(0,p.jsx)(i.Chip,{label:e.label,sub:e.full?'Full':e.cap-e.taken+" left",disabled:e.full,selected:P===e.time.toISOString(),onPress:()=>$(e.time.toISOString())},e.label))})]})]}),(0,p.jsxs)(i.Card,{highlight:O?void 0:j.colours.amber,children:[(0,p.jsx)(i.H2,{children:"Confirm allergies for this order"}),(0,p.jsx)(i.Row,{wrap:!0,gap:6,children:v.allergies.length?v.allergies.map(e=>(0,p.jsx)(i.Badge,{kind:"red",label:`${(0,u.allergenLabel)(e.allergen)} \u2014 ${(0,u.severityLabel)(e.severity)}`},e.allergen)):(0,p.jsx)(i.Muted,{children:"No allergies declared on your profile."})}),(0,p.jsx)(i.Toggle,{label:v.allergies.length?'Yes, these are correct for everyone this order is for':'I confirm no one in this order has a food allergy',value:O,onChange:I}),(0,p.jsx)(i.Button,{small:!0,kind:"ghost",label:"Edit allergies in profile",onPress:()=>l.router.push('/customer/profile')})]}),J?null:(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.H2,{children:"Your details"}),(0,p.jsx)(i.Field,{testID:"order-phone",label:"Mobile number (needed for collection)",value:z,onChangeText:A,keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),!te.ok&&z?(0,p.jsx)(i.T,{size:13,colour:j.colours.amber,children:te.error}):null,(0,p.jsx)(i.Field,{label:"Email (optional)",value:D,onChangeText:E,keyboardType:"email-address",autoCapitalize:"none",placeholder:"you@example.com"}),(0,x.emailOk)(D)?null:(0,p.jsx)(i.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,p.jsx)(i.Muted,{children:"We\u2019ll text your order confirmation and collection time. Preview mode: nothing is sent in this pilot."})]}),(0,p.jsx)(i.Field,{label:"Order notes (optional)",value:M,onChangeText:F,placeholder:"e.g. cutlery please"}),J?(0,p.jsx)(i.Button,{small:!0,kind:"ghost",label:"Switch to takeaway instead",onPress:()=>T(k.id,'takeaway')}):null,(0,p.jsx)(r.MockPay,{visible:_,onClose:()=>Y(!1),amount:V,restaurantId:k.id,onPaid:e=>se({giftCardCode:e.giftCardCode}),title:"Pay for your takeaway"}),(0,p.jsxs)(i.Sheet,{visible:!!oe,onClose:()=>G(null),title:"Allergy override",children:[ae?(0,p.jsx)(i.Banner,{kind:"danger",title:`${ae.name} contains ${ae.contains.map(u.allergenLabel).join(', ')}`,children:"Only continue if this item is for someone without this allergy, or you have spoken to staff."}):null,(0,p.jsx)(i.Toggle,{label:"I understand and want to add it anyway",value:K,onChange:Q}),(0,p.jsx)(i.Button,{kind:"danger",disabled:!K,label:"Confirm override",onPress:()=>{oe&&ae&&S(oe.key,ae.contains),G(null)}})]}),(0,p.jsx)(s.Honeypot,{value:N,onChange:R})]})}},779,[794,20,799,800,117,822,802,803,805,806,807,808,836,810,812,14]);
|
staff-app/_expo/static/js/web/book-fe1a511098175362c634032b33cc795c.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,t=_r(_d[0]),o=_r(_d[1]),s=_r(_d[2]),n=_r(_d[3]),l=_r(_d[4]),i=_r(_d[5]),a=(e=i)&&e.__esModule?e:{default:e},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]),j=_r(_d[16]),k=_r(_d[17]),v=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),D=_r(_d[22]),C=_r(_d[23]),$=_r(_d[24]);function P(){const{rid:e,date:i}=(0,o.useLocalSearchParams)(),P=(0,y.useRestaurant)(e),M=(0,y.useCustomer)(),A=(0,y.useBookings)(e),B=(0,y.useEvents)(e),O=(0,y.useNow)(6e4),[R]=(0,s.useState)(()=>(0,l.startForm)()),[N,z]=(0,s.useState)(''),[F,q]=(0,s.useState)(2),[W,E]=(0,s.useState)(i??(0,f.ymd)(O)),[H,L]=(0,s.useState)(null),[I,_]=(0,s.useState)(M.name),[Y,U]=(0,s.useState)(M.phone??''),[G,Q]=(0,s.useState)(M.email??''),[V,J]=(0,s.useState)(!1),[K,X]=(0,s.useState)(''),[Z,ee]=(0,s.useState)(!1),[te,oe]=(0,s.useState)([]),[se,ne]=(0,s.useState)(!1),le=[...M.allergies,...te.filter(e=>!M.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[ie,ae]=(0,s.useState)(null),re=(0,w.useBlocks)(e=>e.blocks);(0,x.usePublicDayStore)(e=>e.n);const de=e?(0,x.publicDay)(e,W):null,ue=de?[...de.bookings,...A.filter(e=>e.date!==W)]:A,ce=de?[...re.filter(t=>t.rid!==e||t.date!==W),...de.blocks]:re,he=(0,S.usePlan)(e),[me,ge]=(0,s.useState)((0,D.emptyNeeds)()),pe=!0===me.dog,be=pe?me.dogs:0,fe=(0,s.useMemo)(()=>{const e=[],t=new Date(O);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 i&&!e.some(e=>(0,f.ymd)(e)===i)&&e.push((0,f.parseYmd)(i)),e},[O.toDateString(),i]);if(!P)return(0,$.jsx)(u.Screen,{title:"Not found",children:(0,$.jsx)(u.T,{children:"Restaurant not found."})});const ye=P.settings,xe=(0,f.parseYmd)(W),je=(0,w.blocksOn)(ce,P.id,W),ke=ue.filter(e=>e.date===W),ve=he.areas.filter(e=>e.dogs),we=(0,C.dogSetUp)(he),Se=e=>(0,T.freeTablesAt)(he,ke,F,new Date(`${W}T${e}:00`),(0,T.turnFor)(F,ye.turnMins),ye.turnMins,{dog:!0,closed:(0,w.closedAreasAt)(ce,P.id,W,e)}),Te=(0,b.bookingSlots)(P,xe,e=>ue.filter(t=>t.date===W&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),F,O).map(e=>{const t=(0,w.blockAt)(ce,P.id,W,e.time),o=pe&&we&&e.available&&!t&&(!Se(e.time).length||!(0,D.dogTimeOk)(P,ue,W,e.time,be));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),De=Te.some(e=>e.available),Ce=(0,r.depositOf)(ye),$e=(0,r.depositDue)(Ce,F),Pe=$e>0?'deposit':'none',Me=(0,r.depositWords)(Ce,F,P.name),Ae=B.filter(e=>e.date===W),Be=(0,v.ukPhone)(Y),Oe=(0,v.emailOk)(G),Re=(0,D.needsMissing)(me,M.allergies),Ne=!!H&&Z&&!Re.length&&I.trim().length>1&&Be.ok&&Oe,ze=async()=>{const e=(0,D.needsPatch)(me,M.allergies),t=pe&&we?Se(H).map(e=>e.table):[],o=pe?me.tableReq.find(e=>t.includes(e))??t[0]:void 0,s=await y.repo.bookings.create({restaurantId:P.id,customerId:M.id,name:I,partySize:F,date:W,time:H,notes:K.trim(),security:Pe,depositPaid:0,...$e?{depositDue:$e,depositPolicy:Me.join(' '),depositRefundable:Ce.refundable,depositCutoffHours:Ce.cutoffHours}:{},phone:Be.pretty,email:G.trim()||void 0,source:'online',...e,...Te.find(e=>e.time===H)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??le,...o?{table:o}:{}});(0,l.rememberGuard)(s.id,(0,l.guardFor)({...R,hp:N})),ae(s)},Fe=(0,y.useStore)(e=>ie?e.bookings.find(e=>e.id===ie.id)?.ref:void 0),qe=e=>(0,k.waMeLink)(P.settings.whatsapp,(0,k.guestWhatsAppText)({name:e.name,ref:Fe??e.ref,date:e.date,time:e.time,partySize:e.partySize},P.name));if(ie){const e='pending'===ie.status;return(0,$.jsxs)(u.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:P.name,children:[(0,$.jsx)(u.Banner,{kind:e?'info':'success',title:`Reference ${Fe??ie.ref}`,children:`${ie.partySize} people \xb7 ${(0,f.niceDateYear)((0,f.parseYmd)(ie.date))} at ${ie.time}`}),e?(0,$.jsx)(u.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,$.jsxs)(u.Card,{children:[(0,$.jsxs)(u.T,{children:["Name: ",ie.name]}),(0,$.jsxs)(u.T,{children:["Mobile: ",ie.phone]}),ie.email?(0,$.jsxs)(u.T,{children:["Email: ",ie.email]}):null,(0,$.jsxs)(u.T,{children:["Allergies shared with the restaurant: ",ie.allergies.length?ie.allergies.map(e=>`${(0,c.allergenLabel)(e.allergen)} (${(0,c.severityLabel)(e.severity)})`).join(', '):'none']}),ie.notes?(0,$.jsxs)(u.T,{children:["Notes: ",ie.notes]}):null,ie.dog?(0,$.jsxs)(u.T,{children:["\ud83d\udc15 Dog coming too",ie.table?` \xb7 dog-friendly table ${ie.table}`:'']}):null,ie.holds?.length?(0,$.jsxs)(u.T,{children:["Reserved: ",ie.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(P.settings.reservables??C.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,ie.tableReq?.length?(0,$.jsxs)(u.T,{children:["Table requested: ",ie.tableReq.map(e=>`T${e}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===ie.security&&ie.depositDue?(0,$.jsxs)(u.T,{weight:"semibold",children:["Deposit due: ",(0,p.gbp)(ie.depositDue),". ",P.name," will tell you how to pay it."]}):null,'deposit'===ie.security&&ie.depositPolicy?(0,$.jsx)(u.Muted,{children:ie.depositPolicy}):null,(0,$.jsxs)(u.Muted,{children:[e?'A text':'A confirmation text',ie.email?' and email':''," to ",ie.phone," ",ie.email?'and your inbox ':'',"is ready. This pilot is in preview mode, so nothing is actually sent yet."]}),(0,$.jsxs)(u.Muted,{children:["Need to change or cancel? Call ",P.phone," and quote ",Fe??ie.ref,"."]})]}),qe(ie)?(0,$.jsxs)(a.default,{style:{gap:4},children:[(0,$.jsx)(u.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=qe(ie);e&&(0,k.openWhatsApp)(e)}}),(0,$.jsx)(u.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,$.jsx)(u.Button,{label:"Back to restaurant",onPress:()=>o.router.replace(`/customer/${P.id}`)})]})}return(0,$.jsxs)(u.Screen,{title:"Book a table",subtitle:P.name,footer:(0,$.jsx)(u.Button,{label:Re.length?Re[0]:F>(ye.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!Ne,onPress:()=>ze(),testID:"confirm-booking"}),children:[(0,$.jsx)(D.FirstQuestions,{rid:P.id,value:me,onChange:e=>{e.dog===me.dog&&e.dogs===me.dogs||L(null),ge(e)},party:F,audience:"guest",profile:M.allergies}),(0,$.jsxs)(u.Card,{children:[(0,$.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,$.jsx)(u.H2,{children:"Party size"}),(0,$.jsx)(u.Stepper,{value:F,onChange:e=>{q(e),L(null)},min:1,max:16,label:"party size"})]}),$e?(0,$.jsx)(u.Banner,{kind:"info",title:`Deposit: ${(0,p.gbp)($e)} for ${F} guests`,children:(0,$.jsx)(a.default,{style:{gap:4},children:Me.map(e=>(0,$.jsx)(u.T,{size:13,children:e},e))})}):Ce.on&&Ce.perPersonPence>0?(0,$.jsxs)(u.Muted,{children:["No deposit for fewer than ",Ce.fromParty," guests."]}):null,F>(ye.autoAcceptUpTo??7)?(0,$.jsxs)(u.Muted,{children:["For ",F," people the team checks the booking first, then texts you to confirm."]}):null,pe&&we?(0,$.jsxs)(u.Muted,{children:["Dogs are welcome in the ",ve.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",P.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,$.jsxs)(u.Card,{children:[(0,$.jsx)(u.H2,{children:"Date"}),(0,$.jsx)(u.Row,{wrap:!0,gap:6,children:fe.map(e=>{const t=!!(0,h.hoursFor)(P,e),o=B.some(t=>t.date===(0,f.ymd)(e));return(0,$.jsx)(u.Chip,{label:(0,f.niceDate)(e),sub:t?o?'\u2605 event':void 0:'Closed',disabled:!t,selected:W===(0,f.ymd)(e),onPress:()=>{E((0,f.ymd)(e)),L(null)}},(0,f.ymd)(e))})}),Ae.map(e=>(0,$.jsx)(u.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,$.jsxs)(u.Card,{children:[(0,$.jsx)(u.H2,{children:"Time"}),0===Te.length?(0,$.jsx)(u.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,$.jsx)(u.Row,{wrap:!0,gap:6,children:Te.map(e=>(0,$.jsx)(u.Chip,{label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.left<F?'Full':'\u2014',disabled:!e.available,selected:H===e.time,onPress:()=>L(e.time)},e.time))}),je.length>0&&Te.some(e=>e.blocked)?(0,$.jsx)(u.Banner,{kind:"info",title:De?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${je.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,f.niceDate)(xe)}. Please give us a ring on ${P.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,t.lastFoodOn)(P,W);return e&&Te.some(e=>e.drinksOnly)?(0,$.jsx)(u.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})(),pe&&Te.some(e=>e.noDog)?(0,$.jsx)(u.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${ve.map(e=>e.name).join(' and ')}${P.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,w.closedAreasAt)(ce,P.id,W,H??'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,$.jsxs)(u.Muted,{children:["Times come from covers per slot (",ye.bookingCoversPerSlot," per half hour, example) and table rules."]})]}),(0,$.jsx)(D.MoreQuestions,{rid:P.id,r:P,value:me,onChange:ge,party:F,date:W,time:H,today:(0,f.ymd)(O),bookings:ue,audience:"guest",showTables:!0}),(0,$.jsxs)(u.Card,{highlight:Z?void 0:j.colours.amber,children:[(0,$.jsx)(u.Field,{label:"Notes (optional)",value:K,onChangeText:X,placeholder:d.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,$.jsx)(u.Toggle,{label:"I confirm the allergy information for this booking",value:Z,onChange:ee}),(0,$.jsx)(u.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,$.jsxs)(u.Card,{children:[(0,$.jsx)(u.H2,{children:"Your details"}),(0,$.jsx)(u.Field,{label:"Name for the booking",value:I,onChangeText:_}),(0,$.jsx)(u.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:Y,onChangeText:U,onBlur:()=>J(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Be.ok||!V&&!Y?null:(0,$.jsx)(u.T,{size:13,colour:j.colours.amber,children:Be.error}),(0,$.jsx)(u.Field,{testID:"book-email",label:"Email (optional)",value:G,onChangeText:Q,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Oe?null:(0,$.jsx)(u.T,{size:13,colour:j.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,$.jsxs)(u.Muted,{children:["We\u2019ll text you a confirmation",G.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,$.jsx)(n.Honeypot,{value:N,onChange:z})]})}},767,[798,794,20,799,800,117,4,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,14]);
|
staff-app/_expo/static/js/web/feedback-cb959353b54fab0866378ed2be72132e.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."})})}},769,[794,20,802,821,808,14]);
|
staff-app/_expo/static/js/web/gift-07557aa0dc548594d98c389388830159.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 b}});var t=_r(d[0]),a=_r(d[1]),n=_r(d[2]),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]);function b(){const{rid:a}=(0,t.useLocalSearchParams)(),n=(0,l.useRestaurant)(a);(0,l.useCustomer)();return(0,c.guestServer)()?n?(0,h.jsx)(u.GiftLive,{slug:a,venue:n.name}):(0,h.jsx)(s.Screen,{title:"Not found",children:(0,h.jsx)(s.T,{children:"Restaurant not found."})}):(0,h.jsx)(x,{})}function x(){const{rid:u}=(0,t.useLocalSearchParams)(),c=(0,l.useRestaurant)(u),b=(0,l.useGiftCards)(u),[x,f]=(0,a.useState)(5e3),[j,p]=(0,a.useState)(''),[g,y]=(0,a.useState)(''),[C,S]=(0,a.useState)(''),[v,w]=(0,a.useState)(!1),[P,T]=(0,a.useState)(null);if(!c)return(0,h.jsx)(s.Screen,{title:"Not found",children:(0,h.jsx)(s.T,{children:"Restaurant not found."})});const M=j?Math.round(100*Number(j))||0:x;return(0,h.jsxs)(s.Screen,{title:"Gift cards",subtitle:`${c.name} \u2014 redeemable only at ${c.name}`,children:[P?(0,h.jsx)(s.Banner,{kind:"success",title:`Gift card created \u2014 ${(0,r.gbp)(P.initial)}`,children:`Code ${P.code}. In production it would be emailed or sent in-app to ${P.recipientName||'the recipient'} (nothing sent in this demo).`}):null,(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.H2,{children:"Your gift cards"}),b.length?b.map(t=>(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.T,{style:{flex:1},children:t.code}),(0,h.jsxs)(s.T,{weight:"semibold",colour:o.colours.gold,children:[(0,r.gbp)(t.balance)," of ",(0,r.gbp)(t.initial)]})]},t.id)):(0,h.jsx)(s.Muted,{children:"None yet."}),(0,h.jsx)(s.Muted,{children:"Balances can be used at checkout on takeaway orders and table bills. Part-use leaves a balance."})]}),(0,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.H2,{children:"Buy a gift card"}),(0,h.jsx)(s.Row,{wrap:!0,children:[1e3,2500,5e3,15e3].map(t=>(0,h.jsx)(s.Chip,{label:(0,r.gbp)(t),selected:!j&&x===t,onPress:()=>{p(''),f(t)}},t))}),(0,h.jsx)(s.Field,{label:"Or another amount (\xa3)",keyboardType:"decimal-pad",value:j,onChangeText:p,placeholder:"e.g. 40"}),(0,h.jsx)(s.Field,{label:"Recipient\u2019s name",value:g,onChangeText:y}),(0,h.jsx)(s.Field,{label:"Message",value:C,onChangeText:S,multiline:!0,placeholder:"Happy birthday!"}),(0,h.jsx)(s.Muted,{children:"Valid for 24 months from purchase (suggested terms \u2014 to be confirmed by the restaurant)."}),(0,h.jsx)(s.Button,{label:`Buy ${(0,r.gbp)(M)} gift card`,disabled:M<500||M>5e4,onPress:()=>w(!0)})]}),(0,h.jsx)(n.MockPay,{visible:v,onClose:()=>w(!1),amount:M,restaurantId:c.id,allowGiftCard:!1,title:"Buy gift card",onPaid:async()=>{const t=await l.repo.giftCards.purchase(c.id,M,g,C);w(!1),T(t)}})]})}},770,[794,20,822,802,805,808,810,823,824,14]);
|
staff-app/_expo/static/js/web/index-155d47a598c445f266c76c8911a79b2d.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]),t=(r=s)&&r.__esModule?r:{default:r},n=_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)(n.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.ok: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)(t.default,{style:{height:8}})]})}},780,[794,20,117,819,802,803,804,808,810,827,837,14]);
|
staff-app/_expo/static/js/web/index-55a981e7565fcdafd0326b14b6d27178.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/index-a6f34dd6e4c646a7473555a9d477ec6b.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,{})}},789,[794,20,915,796,14]);
|
| 2 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OwnerApp=function(){return null}},915,[]);
|
staff-app/_expo/static/js/web/index-ac7e06de6c963d226085ed8b5d26139c.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 $}});var l=_r(_d[0]),t=_r(_d[1]),s=e(t);_r(_d[2]);var n=e(_r(_d[3])),r=e(_r(_d[4])),o=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),u=_r(_d[8]),c=_r(_d[9]),b=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),m=_r(_d[14]),y=_r(_d[15]),x=_r(_d[16]),k=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),T=_r(_d[20]),S=_r(_d[21]),O=_r(_d[22]);const A=['book','takeaway'].includes(w.START_GO??'')?w.START_GO:null;let P=!1,R=!1,B=!1;const C=[{id:'main',label:'Main menu'},{id:'specials',label:'Specials'},{id:'takeaway',label:'Takeaway'}];function $(){const{rid:e}=(0,l.useLocalSearchParams)(),$=(0,h.useRestaurant)(e),v=(0,h.useMenu)(e),I=(0,h.useCustomer)(),M=(0,h.useBasket)(),_=(0,h.useStore)(e=>e.startBasket),N=(0,h.useNow)(3e4),[L,E]=(0,t.useState)('All'),[H,D]=(0,t.useState)(null),[W,F]=(0,t.useState)(!1),[G,K]=(0,t.useState)(!1),[Y,z]=(0,t.useState)('takeaway'===A?'takeaway':'main');s.default.useEffect(()=>{A&&!P&&(P=!0,'book'===A?setTimeout(()=>l.router.push(`/customer/${e}/book`),0):setTimeout(()=>{try{document.querySelector('[data-testid="menu-tabs"]')?.scrollIntoView({block:'start'})}catch{}},400))},[e]);const Q=(0,k.useSpecials)(l=>l.current[e]??null),V=!!Q&&(0,j.isToday)(Q.postedAt,N),q=(0,y.useOwner)(e=>e.offers.filter(e=>e.live).length),J=(0,h.useStore)(l=>l.stampCards.find(t=>t.restaurantId===e&&t.customerId===l.customer.id)),U=(0,T.useLiveTile)(e),X=(0,S.guestServer)();s.default.useEffect(()=>{w.START_TABLE_TOKEN&&!B&&(B=!0,setTimeout(()=>l.router.push(`/table/live/${w.START_TABLE_TOKEN}`),0))},[e]),s.default.useEffect(()=>{w.START_LOYALTY_CODE&&!R&&(R=!0,setTimeout(()=>l.router.push(`/customer/${e}/loyalty`),0))},[e]);const Z=(0,h.useOrderAtTable)(e);if(s.default.useEffect(()=>{Z||M.restaurantId!==e||'table'!==M.mode||h.useStore.setState(e=>({basket:{...e.basket,mode:'takeaway',tableNo:void 0}}))},[Z,M.mode,M.restaurantId,e]),!$)return(0,O.jsx)(d.Screen,{title:"Not found",children:(0,O.jsx)(d.T,{children:"Restaurant not found."})});const ee=Z&&M.restaurantId===$.id&&'table'===M.mode,le=$.sections.length?$.sections:Array.from(new Set(v.map(e=>e.section))),te=e=>!(e.soldOut||!e.signOff||null===e.price),se=v.filter(e=>('All'===L||e.section===L)&&('takeaway'!==Y||te(e))),ae=(0,b.hoursFor)($,N),ne=e=>()=>l.router.push(`/customer/${$.id}${e}`),re=[{icon:'box',label:'Takeaway',sub:'Order to collect',on:()=>{E('All'),z('takeaway'),ee&&_($.id,'takeaway')}},...Z?[{icon:'phone',label:'Order at table',sub:'Scan the QR',on:()=>K(!0)}]:[],{icon:'calendarPlus',label:'Book a table',on:ne('/book')},{icon:'clock',label:'Waitlist',sub:'Walk in',on:ne('/waitlist')},{icon:'star',label:'Stamp card',sub:X?U.stamps:`${J?.stamps??0} of ${$.settings.stampTarget}`,on:ne('/loyalty')},{icon:'userPlus',label:'Bring a friend',on:ne('/refer')},{icon:'gift',label:'Gift cards',on:ne('/gift')},{icon:'alert',label:'My allergens',sub:I.allergies.length?`${I.allergies.length} declared`:'None declared',on:()=>l.router.push('/customer/profile')},{icon:'tag',label:'Offers',sub:X?void 0:I.marketingOptIn[$.id]?'Opted in':'Opt in',on:ne('/offers'),badge:(X?U.offers:q)?String(X?U.offers:q):void 0},{icon:'sparkle',label:"What's on",on:ne('/whatson')},{icon:'chat',label:'Feedback',sub:'Private',on:ne('/feedback')},{icon:'hanger',label:'Lost property',on:ne('/lost')},{icon:'bag',label:'Shop',sub:'Merch',on:ne('/merch')}];return(0,O.jsxs)(d.Screen,{title:$.name,subtitle:`${$.location}${$.phone?` \xb7 ${$.phone}`:''}`,back:'customer'!==m.APP_VARIANT,right:(0,O.jsxs)(d.Row,{children:[(0,O.jsx)(i.BasketButton,{}),(0,O.jsx)(d.Button,{small:!0,kind:"ghost",label:"Account",onPress:()=>l.router.push('/customer/profile')})]}),children:[$.fictional?(0,O.jsx)(d.Banner,{kind:"warn",title:"Fictional demo restaurant",children:"Shown only to demonstrate multi-restaurant support."}):null,ee?(0,O.jsx)(d.Banner,{kind:"success",title:`Ordering at Table ${M.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,O.jsx)(d.Card,{children:(0,O.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,O.jsxs)(r.default,{style:{flex:1},children:[(0,O.jsx)(d.T,{weight:"semibold",children:"Takeaway \u2014 collection"}),(0,O.jsxs)(d.Muted,{children:[ae?`Kitchen today ${(0,b.kitchenHoursOn)($,N)[0]}\u2013${(0,b.kitchenHoursOn)($,N)[1]}`:'Kitchen closed today',$.settings.takeawayPaused?' \xb7 slots paused by the restaurant':'']})]}),(0,O.jsx)(d.Badge,{kind:$.settings.takeawayPaused||!ae?'amber':'ok',label:$.settings.takeawayPaused?'Paused':ae?'Taking orders':'Closed'})]})}),$.fictional?(0,O.jsx)(d.Row,{wrap:!0,gap:8,children:re.slice(2,7).map(e=>(0,O.jsx)(d.Button,{small:!0,kind:"secondary",label:e.label,onPress:e.on},e.label))}):(0,O.jsx)(r.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:re.map(e=>(0,O.jsx)(f.HubTile,{icon:e.icon,label:e.label,sub:e.sub,badge:e.badge,onPress:e.on},e.label))}),ee?(0,O.jsx)(d.Button,{small:!0,kind:"danger",label:"Call staff",onPress:()=>F(!0)}):null,W?(0,O.jsx)(d.Banner,{kind:"success",children:"We've told the staff on this device. Calling staff: not set up yet."}):null,$.hoursNote?(0,O.jsx)(d.Muted,{children:$.hoursNote}):null,$.fictional?null:(0,O.jsx)(d.ExampleAllergenNotice,{}),(0,O.jsxs)(d.Muted,{children:["Menu dishes and prices from ",$.name,"\u2019s menu. Items marked \u26a0 conflict with your declared allergies."]}),(0,O.jsx)(r.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:C.map(e=>{const l=Y===e.id;return(0,O.jsxs)(n.default,{testID:`menu-tab-${e.id}`,accessibilityRole:"tab",accessibilityState:{selected:l},"aria-selected":l,accessibilityLabel:'specials'===e.id&&V?'Specials, updated today':e.label,onPress:()=>z(e.id),style:{flex:1,minHeight:44,borderRadius:10,alignItems:'center',justifyContent:'center',paddingHorizontal:4,backgroundColor:l?p.colours.gold:'transparent'},children:[(0,O.jsx)(d.T,{size:14,weight:"semibold",colour:l?p.colours.onGold:p.colours.text,center:!0,children:e.label}),'specials'===e.id&&V&&!l?(0,O.jsx)(r.default,{style:{position:'absolute',top:6,right:8,width:7,height:7,borderRadius:4,backgroundColor:p.colours.gold}}):null]},e.id)})}),'specials'===Y?(0,O.jsx)(x.SpecialsTab,{rid:$.id,declared:I.allergies,now:N}):null,'takeaway'===Y?(0,O.jsx)(d.Muted,{children:"Order to collect. Only dishes available to order online are shown; pick a collection slot at checkout."}):null,'specials'!==Y?(0,O.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,O.jsx)(d.Chip,{label:"All",selected:'All'===L,onPress:()=>E('All')}),le.map(e=>(0,O.jsx)(d.Chip,{label:e,selected:L===e,onPress:()=>E(e)},e))]}):null,'specials'!==Y?le.filter(e=>('All'===L||e===L)&&se.some(l=>l.section===e)).map(e=>(0,O.jsxs)(r.default,{style:{gap:10},children:[(0,O.jsx)(d.H2,{style:{color:p.colours.gold,marginTop:6},children:e}),se.filter(l=>l.section===e).map(e=>{const t=(0,u.conflictsFor)(e.allergens,I.allergies),s=e.soldOut||!e.signOff||null===e.price;return(0,O.jsxs)(d.Card,{highlight:t.contains.length?p.colours.red:t.may.length?p.colours.amber:void 0,children:[(0,O.jsxs)(n.default,{accessibilityRole:"button",onPress:()=>{M.restaurantId&&M.restaurantId===$.id||_($.id,'takeaway'),l.router.push(`/customer/${$.id}/dish/${e.id}`)},children:[(0,O.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,O.jsx)(d.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,O.jsx)(d.T,{weight:"semibold",colour:p.colours.gold,children:null===e.price?e.priceNote??'\u2014':(0,c.gbp)(e.price)})]}),(0,O.jsx)(d.Muted,{numberOfLines:2,children:e.description})]}),(0,O.jsxs)(d.Row,{wrap:!0,gap:6,children:[e.dietary.map(e=>(0,O.jsx)(d.Badge,{kind:"ok",label:e},e)),e.special?(0,O.jsx)(d.Badge,{kind:"gold",label:"Special"}):null,e.soldOut?(0,O.jsx)(d.Badge,{kind:"neutral",label:"Sold out"}):null,e.signOff?null:(0,O.jsx)(d.Badge,{kind:"amber",label:"Awaiting allergen sign-off"}),t.contains.length?(0,O.jsx)(d.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):t.may.length?(0,O.jsx)(d.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null]}),(0,O.jsx)(o.AllergenChips,{map:e.allergens,declared:I.allergies}),H===e.id?(0,O.jsx)(o.AllergenPanel,{item:e,map:e.allergens,declared:I.allergies}):null,(0,O.jsxs)(d.Row,{gap:8,children:[(0,O.jsx)(d.Button,{small:!0,kind:"ghost",label:H===e.id?'Hide allergen panel':'Allergen panel',onPress:()=>D(H===e.id?null:e.id)}),(0,O.jsx)(r.default,{style:{flex:1}}),(0,O.jsx)(d.Button,{small:!0,label:s?e.soldOut?'Sold out':'Not available online':'Choose',disabled:s,onPress:()=>{M.restaurantId&&M.restaurantId===$.id||_($.id,'takeaway'),l.router.push(`/customer/${$.id}/dish/${e.id}`)}})]})]},e.id)})]},e)):null,(0,O.jsx)(d.Muted,{children:"Drinks list coming soon. Ask your server for today\u2019s drinks."}),(0,O.jsx)(d.Muted,{children:"Card payments: not set up yet. Pay at the till as usual."}),(0,O.jsx)(f.LauncherLine,{}),Z?(0,O.jsxs)(d.Sheet,{visible:G,onClose:()=>K(!1),title:"Order at your table",children:[(0,O.jsx)(d.Muted,{children:"Scan the QR code on your table with your phone camera, or pick your table number."}),(0,O.jsx)(d.Row,{wrap:!0,gap:6,children:Array.from({length:12},(e,l)=>String(l+1)).map(e=>(0,O.jsx)(d.Button,{small:!0,kind:"secondary",label:`Table ${e}`,onPress:()=>{K(!1),_($.id,'table',e)}},e))}),(0,O.jsx)(d.Muted,{children:"Orders go straight to the kitchen. Card payments: not set up yet. Pay at the till as usual."})]}):null]})}},771,[794,20,112,253,117,818,819,802,803,805,804,808,810,827,796,828,825,829,830,831,832,824,14]);
|
| 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 k}}),_e.BoardPhoto=C,_e.PhotoZoom=T,_e.SpecialRow=M,_e.SpecialsTab=function({rid:e,declared:s,now:l}){const o=(0,p.useSpecials)(t=>t.current[e]??null),[n,u]=(0,t.useState)(null);if(!o)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=o.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)(o,l)})}),(0,x.isToday)(o.postedAt,l)?(0,b.jsx)(h.Badge,{kind:"ok",label:"Today"}):(0,b.jsx)(h.Badge,{kind:"amber",label:"Not updated today"})]}),(0,x.isToday)(o.postedAt,l)?null:(0,b.jsx)(h.Muted,{children:"These are the most recent specials posted. Today\u2019s may differ, so please ask."}),o.photo?(0,b.jsxs)(c.default,{style:{gap:4},children:[(0,b.jsx)(C,{photo:o.photo,testID:"specials-photo",onPress:()=>u(o.photo)}),(0,b.jsx)(h.Muted,{center:!0,children:"Tap the photo to zoom"})]}):null,o.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)),"."]}):null,o.photo&&!o.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)(T,{photo:n,onClose:()=>u(null)})]})};var t=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),o=e(r(d[3])),n=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]),k=e=>e===x.SAMPLE_PHOTO?w:{uri:e};function C({photo:e,width:l,onPress:n,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:k(e),resizeMode:"contain",accessibilityLabel:h,style:{width:l??'100%',aspectRatio:p,borderRadius:12,backgroundColor:'#1b1f1d'}});return n?(0,b.jsx)(o.default,{testID:u,accessibilityRole:"button",accessibilityLabel:`${h}. Tap to zoom`,onPress:n,children:y}):(0,b.jsx)(c.default,{testID:u,children:y})}function T({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)(n.default,{horizontal:u,contentContainerStyle:{padding:12,alignItems:'center',justifyContent:'center',flexGrow:1},children:(0,b.jsx)(n.default,{contentContainerStyle:{alignItems:'center'},children:e?(0,b.jsx)(o.default,{onPress:()=>p(!u),accessibilityLabel:u?'Zoom out':'Zoom in',children:(0,b.jsx)(C,{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]})})}},825,[20,186,246,253,141,117,818,802,829,803,830,807,810,14,826]);
|
| 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}}},826,[]);
|
staff-app/_expo/static/js/web/index-b9e9f721dd239eab800e784db7dee5a3.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/index-baca40cfebc80c4d4cb1b889ebcdb2b8.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
staff-app/_expo/static/js/web/lost-2838c270481f57397bc273f98b81a28f.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,y]=(0,n.useState)(''),[w,b]=(0,n.useState)(''),[S,C]=(0,n.useState)(''),[R,v]=(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 O=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 (sent to the venue on this device only: messaging is not set up yet)."]}):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:y,placeholder:"e.g. Grey scarf"}),(0,o.jsx)(s.Field,{label:"When were you in?",value:w,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||w.trim().length<2,onPress:()=>{l.useOwner.getState().setOwner({lostReports:[{id:`lr-${Date.now()}`,item:f.trim(),when:w.trim(),where:S.trim()||'Not sure',contact:`${c.name} \xb7 ${c.email}`,at:x.toISOString(),status:'open'},...l.useOwner.getState().lostReports]}),y(''),b(''),C(''),v(!0)}})]}),O.length?(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Your reports"}),O.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?'ok':'open'===t.status?'amber':'neutral',label:'matched'===t.status?'Found!':'open'===t.status?'Looking':'Closed'})]},t.id))]}):null]})}},772,[794,20,802,808,828,14]);
|
staff-app/_expo/static/js/web/loyalty-3681574ad7135bf2b804a33fd1035552.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]),t=(r=s)&&r.__esModule?r:{default:r},n=_r(d[3]),i=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),p=_r(d[10]);function f(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r);return(0,h.guestServer)()?s?(0,p.jsx)(u.LoyaltyLive,{slug:r,venue:s.name}):(0,p.jsx)(i.Screen,{title:"Not found",children:(0,p.jsx)(i.T,{children:"Restaurant not found."})}):(0,p.jsx)(j,{})}function j(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r),u=(0,l.useCustomer)(),h=(0,l.useStampCard)(r);if(!s)return(0,p.jsx)(i.Screen,{title:"Not found",children:(0,p.jsx)(i.T,{children:"Restaurant not found."})});const f=s.settings.stampTarget,j=h?.stamps??0;return(0,p.jsxs)(i.Screen,{title:"Stamp card",subtitle:`${s.name} \u2014 this card is just for ${s.name}`,children:[(0,p.jsx)(i.Banner,{kind:"example",title:"Example card (demo)",children:"On a real venue your card is saved by the venue and is the same on any phone."}),(0,p.jsxs)(i.Card,{highlight:c.colours.gold,children:[(0,p.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(i.H2,{children:[j," of ",f," stamps"]}),(0,p.jsxs)(i.T,{colour:c.colours.gold,weight:"semibold",children:["Reward: ",s.settings.stampReward]})]}),(0,p.jsx)(t.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:10,justifyContent:'center',paddingVertical:8},children:Array.from({length:f}).map((e,r)=>(0,p.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,p.jsx)(i.T,{size:22,colour:r<j?c.colours.onGold:c.colours.border,children:"\u2605"})},r))}),(0,p.jsxs)(i.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,"."]}),h?.rewardsAvailable?(0,p.jsx)(i.Banner,{kind:"success",title:`${h.rewardsAvailable} reward${h.rewardsAvailable>1?'s':''} ready: ${s.settings.stampReward}`,children:(0,p.jsx)(i.Button,{small:!0,label:"Use reward (show staff)",onPress:()=>l.repo.loyalty.redeemReward(s.id,u.id)})}):null]}),(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.H2,{children:"Show this to staff"}),(0,p.jsx)(i.Muted,{children:"Staff scan this on the tablet to add a stamp for dine-in visits not paid by table QR."}),(0,p.jsx)(n.QR,{value:`covercharge:stamp:${s.id}:${u.id}`,size:190}),(0,p.jsx)(i.T,{center:!0,weight:"semibold",children:u.name})]}),(0,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.H2,{children:"Bring a friend"}),(0,p.jsx)(i.T,{children:"Your referral code"}),(0,p.jsx)(i.T,{size:28,weight:"bold",colour:c.colours.gold,center:!0,children:u.referralCode}),(0,p.jsx)(i.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,p.jsxs)(i.Card,{children:[(0,p.jsx)(i.H2,{children:"History"}),(h?.history??[]).length?h.history.slice(0,10).map((e,r)=>(0,p.jsxs)(i.Muted,{children:[e.at.slice(0,10)," \xb7 ",e.source]},r)):(0,p.jsx)(i.Muted,{children:"No stamps yet."})]}),(0,p.jsx)(i.Muted,{children:"Rewards are kept on food (Scottish licensing rules restrict drinks promotions). Stamps are never given for reviews."})]})}},773,[794,20,117,833,802,805,808,810,832,824,14]);
|
staff-app/_expo/static/js/web/merch-24e697870623cff1fc6102dcc3560828.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 b}});var e,t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),r=(e=s)&&e.__esModule?e:{default:e},l=_r(d[3]),o=_r(d[4]),u=_r(d[5]),c=_r(d[6]),m=_r(d[7]),h=_r(d[8]),j=_r(d[9]),x=_r(d[10]),f=_r(d[11]),p=_r(d[12]);function b(){const{rid:e}=(0,t.useLocalSearchParams)(),n=(0,u.useRestaurant)(e),s=(0,u.useCustomer)();return(0,f.guestServer)()?n?(0,p.jsx)(x.ShopLive,{slug:e,venue:n.name,guestName:s.name}):(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Restaurant not found."})}):(0,p.jsx)(y,{})}function y(){const{rid:e}=(0,t.useLocalSearchParams)(),s=(0,u.useRestaurant)(e),x=(0,u.useCustomer)(),f=(0,u.useNow)(6e4),b=(0,c.useOwner)(e=>e.merch),[y,S]=(0,n.useState)({}),[k,w]=(0,n.useState)(null),[v,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 $=b.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:[v?(0,p.jsxs)(o.Banner,{kind:"success",title:"Order noted (no payment taken)",children:[v," Collect it at the bar on your next visit."]}):null,b.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)(r.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=>S({...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:()=>w(e.id)})]}):null]},e.id)),(0,p.jsxs)(o.Muted,{children:["Collection only in this prototype. Prices set by ",s.name,"."]}),$?(0,p.jsx)(l.MockPay,{visible:!0,onClose:()=>w(null),amount:$.price*O($.id),restaurantId:s.id,allowGiftCard:!1,title:`Buy ${$.name}`,onPaid:()=>{const e=c.useOwner.getState();e.setOwner({merch:e.merch.map(e=>e.id===$.id?{...e,stock:Math.max(0,e.stock-O($.id))}:e),merchOrders:[{id:`mo-${Date.now()}`,productId:$.id,qty:O($.id),customer:x.name,at:(0,h.ymd)(f),status:'new'},...e.merchOrders]}),C(`${O($.id)} \xd7 ${$.name}, ${(0,m.gbp)($.price*O($.id))}.`),w(null)}}):null]})}},774,[794,20,117,822,802,808,828,805,807,810,823,824,14]);
|
staff-app/_expo/static/js/web/offers-c767de6c19c185e1164f6e7297573175.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 n=_r(d[0]);_r(d[1]);var t=_r(d[2]),s=_r(d[3]),r=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]);function h(){const{rid:r}=(0,n.useLocalSearchParams)(),o=(0,s.useRestaurant)(r);return(0,u.guestServer)()?o?(0,f.jsx)(c.OffersLive,{slug:r,venue:o.name}):(0,f.jsx)(t.Screen,{title:"Not found",children:(0,f.jsx)(t.T,{children:"Restaurant not found."})}):(0,f.jsx)(j,{})}function j(){const{rid:c}=(0,n.useLocalSearchParams)(),u=(0,s.useRestaurant)(c),h=(0,s.useCustomer)(),j=(0,r.useOwner)(n=>n.offers);if(!u)return(0,f.jsx)(t.Screen,{title:"Not found",children:(0,f.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,f.jsxs)(t.Screen,{title:"Specials & offers",subtitle:u.name,children:[(0,f.jsxs)(t.Card,{highlight:x?l.colours.ok:l.colours.gold,children:[(0,f.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,f.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,f.jsx)(t.H2,{children:"Today's specials"}),p.length?p.map(n=>(0,f.jsxs)(t.Card,{children:[(0,f.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,f.jsx)(t.Badge,{kind:"gold",label:"Special"})]}),(0,f.jsx)(t.Muted,{children:n.body})]},n.id)):(0,f.jsx)(t.Muted,{children:"No specials on the board right now."}),(0,f.jsx)(t.H2,{children:"Member offers"}),x?y.length?y.map(n=>(0,f.jsxs)(t.Card,{children:[(0,f.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,f.jsx)(t.Badge,{kind:"ok",label:"Offer"})]}),(0,f.jsx)(t.Muted,{children:n.body}),n.until?(0,f.jsxs)(t.Muted,{children:["Until ",(0,o.niceDate)((0,o.parseYmd)(n.until))]}):null]},n.id)):(0,f.jsx)(t.Muted,{children:"No offers right now."}):(0,f.jsxs)(t.Banner,{kind:"info",children:["Turn on offers above to see ",y.length," member offer",1===y.length?'':'s',"."]}),(0,f.jsxs)(t.Muted,{children:["Offers are set by ",u.name,". Drinks promotions follow Scottish licensing rules. Demo: no notifications are sent."]})]})}},775,[794,20,802,808,828,807,810,832,824,14]);
|
staff-app/_expo/static/js/web/profile-a052ffa70b268db7c721cbfb89251de2.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 b}});var e=_r(d[0]),r=_r(d[1]);_r(d[2]);var s,t=_r(d[3]),l=(s=t)&&s.__esModule?s:{default:s},n=_r(d[4]),a=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]);function b(){const s=(0,c.useCustomer)(),t=(0,c.useStore)((0,h.useShallow)(e=>e.orders.filter(r=>r.customerId===e.customer.id))),b=(0,c.useStore)((0,h.useShallow)(e=>e.bookings.filter(r=>r.customerId===e.customer.id))),y=(0,c.useStore)(e=>e.restaurants),x=e=>y.find(r=>r.id===e)?.name??e;return(0,p.jsxs)(n.Screen,{title:"Your account",subtitle:"One CoverCharge account for every restaurant",children:[(0,p.jsxs)(n.Card,{children:[(0,p.jsx)(n.Field,{label:"Name",value:s.name,onChangeText:e=>c.repo.customers.update({name:e})}),(0,p.jsx)(n.Field,{label:"Email",value:s.email,keyboardType:"email-address",onChangeText:e=>c.repo.customers.update({email:e})}),(0,p.jsx)(n.Field,{label:"Mobile",value:s.phone,keyboardType:"phone-pad",onChangeText:e=>c.repo.customers.update({phone:e})}),(0,p.jsx)(n.Muted,{children:(0,e.guestServer)()?'Your bring-a-friend code is on each restaurant\u2019s stamp card.':`Referral code: ${s.referralCode}`})]}),(0,p.jsxs)(n.Card,{children:[(0,p.jsx)(n.H2,{children:"Allergies & severity"}),(0,p.jsx)(n.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,p.jsx)(n.Toggle,{label:"I consent to CoverCharge storing my allergy information (health data, UK GDPR)",value:s.allergyConsent,onChange:e=>c.repo.customers.update({allergyConsent:e})}),s.allergyConsent?null:(0,p.jsx)(n.Banner,{kind:"warn",children:"Without consent your allergies won\u2019t be stored \u2014 tell staff directly."}),a.ALLERGENS.map(e=>{const r=s.allergies.find(r=>r.allergen===e.id);return(0,p.jsxs)(l.default,{style:{gap:6,paddingVertical:6},children:[(0,p.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(n.T,{weight:r?'semibold':'regular',children:e.label}),r?(0,p.jsx)(n.Badge,{kind:"red",label:"Declared"}):null]}),(0,p.jsxs)(n.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(n.Chip,{label:"None",selected:!r,onPress:()=>c.repo.customers.setAllergy(e.id,null),disabled:!s.allergyConsent&&!r}),a.SEVERITIES.map(t=>(0,p.jsx)(n.Chip,{label:t.label,selected:r?.severity===t.id,disabled:!s.allergyConsent,onPress:()=>c.repo.customers.setAllergy(e.id,t.id)},t.id))]})]},e.id)})]}),(0,p.jsxs)(n.Card,{children:[(0,p.jsx)(n.H2,{children:"Your orders"}),t.length?t.map(e=>(0,p.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(n.T,{style:{flex:1},children:[e.ref," \xb7 ",x(e.restaurantId)," \xb7 ",'table'===e.type?`Table ${e.tableNo}`:'Takeaway']}),(0,p.jsx)(n.Button,{small:!0,kind:"secondary",label:`${e.status} \xb7 ${(0,o.gbp)(e.subtotal+e.tip)}`,onPress:()=>r.router.push(`/customer/order/${e.id}`)})]},e.id)):(0,p.jsx)(n.Muted,{children:"No orders yet."})]}),(0,p.jsxs)(n.Card,{children:[(0,p.jsx)(n.H2,{children:"Your bookings"}),b.length?b.map(e=>(0,p.jsxs)(n.T,{children:[e.ref," \xb7 ",x(e.restaurantId)," \xb7 ",(0,u.niceDate)((0,u.parseYmd)(e.date))," ",e.time," \xb7 ",e.partySize," people \xb7 ",e.status]},e.id)):(0,p.jsx)(n.Muted,{children:"No bookings yet."})]}),(0,p.jsx)(n.Muted,{children:"Account deletion and data export would live here (Apple 5.1.1(v); Google web deletion link)."})]})}},782,[824,794,20,117,802,803,805,807,808,838,14]);
|
staff-app/_expo/static/js/web/refer-24c04c7b3c1e697d454ff41850a57760.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 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]),c=_r(d[7]),h=_r(d[8]);function f(){const{rid:n}=(0,r.useLocalSearchParams)(),l=(0,t.useRestaurant)(n);return(0,c.guestServer)()?l?(0,h.jsx)(u.ReferLive,{slug:n,venue:l.name}):(0,h.jsx)(s.Screen,{title:"Not found",children:(0,h.jsx)(s.T,{children:"Restaurant not found."})}):(0,h.jsx)(j,{})}function j(){const{rid:u}=(0,r.useLocalSearchParams)(),c=(0,t.useRestaurant)(u),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(!c)return(0,h.jsx)(s.Screen,{title:"Not found",children:(0,h.jsx)(s.T,{children:"Restaurant not found."})});const b=x.filter(r=>r.referrer===f.name);return(0,h.jsxs)(s.Screen,{title:"Bring a friend",subtitle:c.name,children:[j.active?null:(0,h.jsxs)(s.Banner,{kind:"info",children:[c.name," isn't running referrals right now."]}),(0,h.jsxs)(s.Card,{highlight:o.colours.gold,children:[(0,h.jsxs)(s.H2,{children:["You get: ",j.giverReward]}),(0,h.jsxs)(s.T,{children:["Your friend gets: ",j.friendReward]}),(0,h.jsx)(s.Muted,{children:"When your friend makes their first paid visit or order."}),(0,h.jsx)(s.T,{size:30,weight:"bold",colour:o.colours.gold,center:!0,children:f.referralCode}),(0,h.jsx)(s.Button,{label:"Share my code",disabled:!j.active,onPress:()=>w(!0)}),p?(0,h.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,h.jsxs)(s.Card,{children:[(0,h.jsx)(s.H2,{children:"Your referrals"}),b.length?b.map(r=>(0,h.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.T,{style:{flex:1},children:r.friend}),(0,h.jsx)(s.Badge,{kind:'rewarded'===r.status?'ok':'amber',label:r.status})]},r.id)):(0,h.jsx)(s.Muted,{children:"No referrals yet."})]}),(0,h.jsx)(s.Muted,{children:"One reward per new account, phone and card. Monthly cap applies. Rewards are on food, not drinks."})]})}},776,[794,20,802,808,828,810,832,824,14]);
|
staff-app/_expo/static/js/web/waitlist-b46915f0e0647622df385647dc062708.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."})]})}},777,[794,20,802,807,834,835,808,810,14]);
|