Spaces:
Running
Running
Cover Charge prototype v0.1.11
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- CHECKSUMS.txt +11 -11
- HOW-TO-INSTALL.txt +2 -1
- README.md +1 -1
- chef-app/_expo/static/js/web/__common-b7c06dc0c9f4ad0c0d56c33437571b54.js +0 -0
- chef-app/_expo/static/js/web/_layout-81b36bfeddca0b4e38b5954ffb5293f2.js +34 -0
- chef-app/_expo/static/js/web/basket-08b87f6408ab6870cfda24769972c955.js +1 -0
- chef-app/_expo/static/js/web/entry-bb1562f619d10ba0f9a22b5cff5b52e3.js +0 -0
- chef-app/_expo/static/js/web/index-2126b5aa7e82751237c9d2717f57d66f.js +0 -0
- chef-app/_expo/static/js/web/index-262c67710af9665f3d517bccf3c36b47.js +1 -0
- chef-app/_expo/static/js/web/index-cd1a75d1c6392ea7f363e8d3491f1093.js +10 -0
- chef-app/_expo/static/js/web/index-fbb7a768b57e7588ba2174f223b7bfd2.js +2 -0
- chef-app/_expo/static/js/web/loyalty-3afa3f098d21bb7ab00753ff2e0dcc9d.js +36 -0
- chef-app/_expo/static/js/web/profile-b0183082b0dcf2e0d1b983ab023ecb11.js +1 -0
- chef-app/_expo/static/js/web/waitlist-66e55b1e298508430a6f018b8afdee7b.js +1 -0
- chef-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg +0 -0
- chef-app/index.html +1 -1
- chef-app/sw.js +2 -2
- customer-app/_expo/static/js/web/__common-52a49e9076da5e6246f0b3bc8aa4a0c8.js +0 -0
- customer-app/_expo/static/js/web/_layout-40923b7d6a3d0851d16f012e9082d331.js +34 -0
- customer-app/_expo/static/js/web/basket-2b7132442dd9b45a229362d18bb3b379.js +1 -0
- customer-app/_expo/static/js/web/entry-f1c6a1da80b60e7480866755232908a5.js +0 -0
- customer-app/_expo/static/js/web/index-00d06db77562b3402bcb1797b945656d.js +10 -0
- customer-app/_expo/static/js/web/index-19e91eebe2265fb3fefa525477cea205.js +0 -0
- customer-app/_expo/static/js/web/index-34fcf613bc0bc58ae7f62714d63f3bed.js +3 -0
- customer-app/_expo/static/js/web/index-40f95cd6322320cbf9524c02b0284dba.js +1 -0
- customer-app/_expo/static/js/web/index-f4304d490b72825b88900169751ec98b.js +2 -0
- customer-app/_expo/static/js/web/lost-254ada7b9fc10346689d98d894e24ca3.js +1 -0
- customer-app/_expo/static/js/web/loyalty-b4cf2f88c2062e44f0bc0b1af86851e7.js +36 -0
- customer-app/_expo/static/js/web/merch-83b3de1a838e4dd4728123294fac8f36.js +1 -0
- customer-app/_expo/static/js/web/offers-e468fdf2d44335b7725e9cc9534ba97f.js +1 -0
- customer-app/_expo/static/js/web/profile-73c051c1dbf6dad5751e1adc512639c1.js +1 -0
- customer-app/_expo/static/js/web/refer-f700617b9f3c45564500cdd90f403d95.js +1 -0
- customer-app/_expo/static/js/web/waitlist-1ddc562d54c8a687874413b16b0e57b2.js +1 -0
- customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg +0 -0
- customer-app/index.html +1 -1
- customer-app/sw.js +2 -2
- display-app/_expo/static/js/web/__common-f0ad3b75a38e1fa43d43bd8b57dbdc9e.js +0 -0
- display-app/_expo/static/js/web/_layout-b9e85ed4c34fabeb7e33c986346746fc.js +34 -0
- display-app/_expo/static/js/web/basket-2b7132442dd9b45a229362d18bb3b379.js +1 -0
- display-app/_expo/static/js/web/entry-5ed8dee5553bc4d4dc05cd9d17403942.js +0 -0
- display-app/_expo/static/js/web/index-00d06db77562b3402bcb1797b945656d.js +10 -0
- display-app/_expo/static/js/web/index-0b8f656cbb4a0114badc145b4e012efb.js +3 -0
- display-app/_expo/static/js/web/index-19e91eebe2265fb3fefa525477cea205.js +0 -0
- display-app/_expo/static/js/web/index-40f95cd6322320cbf9524c02b0284dba.js +1 -0
- display-app/_expo/static/js/web/index-f4304d490b72825b88900169751ec98b.js +2 -0
- display-app/_expo/static/js/web/lost-254ada7b9fc10346689d98d894e24ca3.js +1 -0
- display-app/_expo/static/js/web/loyalty-b4cf2f88c2062e44f0bc0b1af86851e7.js +36 -0
- display-app/_expo/static/js/web/merch-83b3de1a838e4dd4728123294fac8f36.js +1 -0
- display-app/_expo/static/js/web/offers-e468fdf2d44335b7725e9cc9534ba97f.js +1 -0
- display-app/_expo/static/js/web/profile-73c051c1dbf6dad5751e1adc512639c1.js +1 -0
CHECKSUMS.txt
CHANGED
|
@@ -1,23 +1,23 @@
|
|
| 1 |
-
Cover Charge prototype v0.1.
|
| 2 |
SHA-256 of each web app's start page, service worker, manifest and logo:
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
f55e319dbc2c60a4fdc484584098bc3c80b780d7ee8b8df280c30a673f94e69d owner-app/manifest.webmanifest
|
| 7 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png
|
| 8 |
-
|
| 9 |
-
|
| 10 |
18923b63d620744c81e8ae77204858313f0e3c54683b0c68a4ef6417975b92e3 staff-app/manifest.webmanifest
|
| 11 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png
|
| 12 |
-
|
| 13 |
-
|
| 14 |
559816eba2698515c255da3cb9240a338f5bf8f5a4826a64e332cf51d5522e09 customer-app/manifest.webmanifest
|
| 15 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png
|
| 16 |
-
|
| 17 |
-
|
| 18 |
8212811f397e23840df0b7ecb6a753ce5532c9383d6fdcad71b2deea30665077 display-app/manifest.webmanifest
|
| 19 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png
|
| 20 |
-
|
| 21 |
-
|
| 22 |
7aa962371046330167f56dd74180ed58cba417770e3e4bae9ec8289b1837c461 chef-app/manifest.webmanifest
|
| 23 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png
|
|
|
|
| 1 |
+
Cover Charge prototype v0.1.11: web apps only. No APKs were built for v0.1.2 to v0.1.11.
|
| 2 |
SHA-256 of each web app's start page, service worker, manifest and logo:
|
| 3 |
|
| 4 |
+
4105a9f68a61cf4995ac878504bdce92f3efc90c4862e3bc4c9ca2eb6cd1c30d owner-app/index.html
|
| 5 |
+
5cf576471550d901896d3a7614be5dfc0a7c0aa5eec5e7cadde577f13f97c080 owner-app/sw.js
|
| 6 |
f55e319dbc2c60a4fdc484584098bc3c80b780d7ee8b8df280c30a673f94e69d owner-app/manifest.webmanifest
|
| 7 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png
|
| 8 |
+
f81ef0adb1a557d20c21a7fd8eaa77c10e9bf3503ce5f8176493ae213e2ec1f7 staff-app/index.html
|
| 9 |
+
4b4424fc6c5a73b852dfa318ea1ad96909c7b1e456b5ba78f7c7ddc2173b0885 staff-app/sw.js
|
| 10 |
18923b63d620744c81e8ae77204858313f0e3c54683b0c68a4ef6417975b92e3 staff-app/manifest.webmanifest
|
| 11 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png
|
| 12 |
+
2896937781bead31d2cd30f8b2c20c94a710a5b3df80d29f63d8289cd95b5360 customer-app/index.html
|
| 13 |
+
3fd8d5e517c3cea2500e4723f930996168690fb35e51fccb1fe67377b91ff6e5 customer-app/sw.js
|
| 14 |
559816eba2698515c255da3cb9240a338f5bf8f5a4826a64e332cf51d5522e09 customer-app/manifest.webmanifest
|
| 15 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png
|
| 16 |
+
a12aa574fc0887bc0e1ef485ba70768c57f329284a1364ef733d4dcbff768d2a display-app/index.html
|
| 17 |
+
38c5ec447a4e36eea59351060b0b7dbf90ab30c57dc0cc3df828ec7737d6f878 display-app/sw.js
|
| 18 |
8212811f397e23840df0b7ecb6a753ce5532c9383d6fdcad71b2deea30665077 display-app/manifest.webmanifest
|
| 19 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png
|
| 20 |
+
31d9132f4c82b037d312bb6d214ddfa56053be1f3b96005c943b657f9f2449fd chef-app/index.html
|
| 21 |
+
ec87dc0129d6bf31d715bfe85744247f085e9b912fa7251c6d41e27732205e2e chef-app/sw.js
|
| 22 |
7aa962371046330167f56dd74180ed58cba417770e3e4bae9ec8289b1837c461 chef-app/manifest.webmanifest
|
| 23 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png
|
HOW-TO-INSTALL.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
Cover Charge prototype apps, v0.1.
|
| 2 |
Pilot restaurant: The Anchorage, Harbour View, Dunure
|
| 3 |
|
| 4 |
These are test versions with made-up demo data. No real payments, messages, social posts or location tracking happen.
|
|
@@ -40,6 +40,7 @@ TIPS
|
|
| 40 |
- Food safety (HACCP): Head Chef > Kitchen > Food safety log; Staff > Me > Food safety checks; Managers > More > Food safety log. Today shows a progress ring and the opening, midday and closing checks with what is due or overdue; tap a check, type the temperature on the big keypad or say it, and it is signed with your initials and the time. Out of range needs a corrective action (and can take a photo). Fridges & units shows each unit green, amber or red with its trend. Diary for notes and the daily sign-off, Weekly sign-off for the Head Chef or a manager, and EHO report for a PDF, print or CSV for any dates. The app never fills in a reading. Wireless probes: add a probe and follow Connect your probe; there is no probe hardware in the prototype, so probes show Not connected and no probe readings appear.
|
| 41 |
- My avatar (Staff > Me > My avatar; Managers > More > My avatar): everyone has a retro space-age avatar. Create my avatar from a photo turns a photo or selfie into a stylised avatar on the phone itself; the photo is never uploaded. You can only change your own; managers can reset one.
|
| 42 |
- New dish creator: add each price you pay for an ingredient and cost dishes at the latest price or the average of the last 3, 5 or 10. Booking counts show Tables and Pax.
|
|
|
|
| 43 |
- Accident book: in Managers, Staff and Head Chef. Staff and Head Chef see their own entries; managers see all, with a RIDDOR prompt for serious ones. Nothing is reported automatically.
|
| 44 |
- Cover Charge for Managers: tap the role pill at the top to preview what staff see. More > All features gives a guided tour.
|
| 45 |
- Cover Charge for Display: best on a tablet held sideways. The big Walk-in and New booking buttons are always at the top.
|
|
|
|
| 1 |
+
Cover Charge prototype apps, v0.1.11 (web apps)
|
| 2 |
Pilot restaurant: The Anchorage, Harbour View, Dunure
|
| 3 |
|
| 4 |
These are test versions with made-up demo data. No real payments, messages, social posts or location tracking happen.
|
|
|
|
| 40 |
- Food safety (HACCP): Head Chef > Kitchen > Food safety log; Staff > Me > Food safety checks; Managers > More > Food safety log. Today shows a progress ring and the opening, midday and closing checks with what is due or overdue; tap a check, type the temperature on the big keypad or say it, and it is signed with your initials and the time. Out of range needs a corrective action (and can take a photo). Fridges & units shows each unit green, amber or red with its trend. Diary for notes and the daily sign-off, Weekly sign-off for the Head Chef or a manager, and EHO report for a PDF, print or CSV for any dates. The app never fills in a reading. Wireless probes: add a probe and follow Connect your probe; there is no probe hardware in the prototype, so probes show Not connected and no probe readings appear.
|
| 41 |
- My avatar (Staff > Me > My avatar; Managers > More > My avatar): everyone has a retro space-age avatar. Create my avatar from a photo turns a photo or selfie into a stylised avatar on the phone itself; the photo is never uploaded. You can only change your own; managers can reset one.
|
| 42 |
- New dish creator: add each price you pay for an ingredient and cost dishes at the latest price or the average of the last 3, 5 or 10. Booking counts show Tables and Pax.
|
| 43 |
+
- Specials board (Managers > More > Specials board; Head Chef > Kitchen > Specials board): take or upload a photo of the chalkboard and/or type each special with its price and allergens, tick the allergen check, then Post to customer app. Update today's specials, Clear board (asks first) and Use again on a past board. In the customer app the menu has Main menu, Specials and Takeaway tabs; Specials shows the photo (tap to zoom) and typed specials with allergens and when it was updated. The sample board uses example dishes.
|
| 44 |
- Accident book: in Managers, Staff and Head Chef. Staff and Head Chef see their own entries; managers see all, with a RIDDOR prompt for serious ones. Nothing is reported automatically.
|
| 45 |
- Cover Charge for Managers: tap the role pill at the top to preview what staff see. More > All features gives a guided tour.
|
| 46 |
- Cover Charge for Display: best on a tablet held sideways. The big Walk-in and New booking buttons are always at the top.
|
README.md
CHANGED
|
@@ -9,7 +9,7 @@ pinned: false
|
|
| 9 |
short_description: Cover Charge prototype, five web apps, demo data
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# Cover Charge apps (prototype v0.1.
|
| 13 |
|
| 14 |
Web apps (PWAs) for The Anchorage, Harbour View, Dunure: Managers, Staff, the customer app, Display and Head Chef.
|
| 15 |
Each one opens in the browser and can be added to the Home screen (Chrome, Huawei Browser, Safari).
|
|
|
|
| 9 |
short_description: Cover Charge prototype, five web apps, demo data
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Cover Charge apps (prototype v0.1.11)
|
| 13 |
|
| 14 |
Web apps (PWAs) for The Anchorage, Harbour View, Dunure: Managers, Staff, the customer app, Display and Head Chef.
|
| 15 |
Each one opens in the browser and can be added to the Home screen (Chrome, Huawei Browser, Safari).
|
chef-app/_expo/static/js/web/__common-b7c06dc0c9f4ad0c0d56c33437571b54.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
chef-app/_expo/static/js/web/_layout-81b36bfeddca0b4e38b5954ffb5293f2.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 E}});var t=r(_d[0]),s=r(_d[1]),o=(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[2])),n=r(_d[3]),u=r(_d[4]),c=e(r(_d[5])),d=e(r(_d[6]));r(_d[7]);var l=e(r(_d[8])),f=e(r(_d[9])),p=r(_d[10]),h=r(_d[11]),y=r(_d[12]),b=r(_d[13]),O=r(_d[14]),S=r(_d[15]),_=r(_d[16]),j=r(_d[17]);const w=r(_d[18]),P=r(_d[19]),v=r(_d[20]),A=r(_d[21]);function E(){const[e]=(0,t.useFonts)({Poppins_400Regular:w,Poppins_500Medium:P,Poppins_600SemiBold:v,Poppins_700Bold:A}),[E,x]=(0,u.useState)(b.useStore.persist.hasHydrated()),[H,k]=(0,u.useState)(S.useOwner.persist.hasHydrated()),F=E&&H;(0,u.useEffect)(()=>{const e=b.useStore.persist.onFinishHydration(()=>x(!0)),t=S.useOwner.persist.onFinishHydration(()=>k(!0));return b.useStore.persist.hasHydrated()&&x(!0),S.useOwner.persist.hasHydrated()&&k(!0),()=>{e(),t()}},[]),(0,u.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===b.useStore.persist.getOptions().name&&b.useStore.persist.rehydrate(),e.key===O.useFloor.persist.getOptions().name&&O.useFloor.persist.rehydrate()};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]);const M=e&&F,T=(0,s.usePathname)(),C=M&&!(0,h.isAllowedPath)(T||'/');return(0,u.useEffect)(()=>{if(!C)return;const e=setTimeout(()=>s.router.replace(h.ENTRY[h.APP_VARIANT]),0);return()=>clearTimeout(e)},[C,T]),(0,u.useEffect)(()=>{M&&o.hideAsync().catch(()=>{})},[M]),M?(0,j.jsxs)(y.SafeAreaProvider,{children:[(0,j.jsx)(n.StatusBar,{style:"light"}),(0,j.jsx)(s.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:_.colours.bg}}}),C?(0,j.jsx)(f.default,{style:[l.default.absoluteFill,{backgroundColor:_.colours.bg}]}):null]}):(0,j.jsxs)(f.default,{style:{flex:1,backgroundColor:_.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[(0,j.jsx)(d.default,{source:p.HERO_LOGOS.anchorage,accessibilityLabel:"The Anchorage logo",style:{width:180,height:180},resizeMode:"contain"}),(0,j.jsx)(c.default,{color:_.colours.gold})]})}o.preventAutoHideAsync().catch(()=>{})},783,[887,785,914,549,12,228,178,104,28,109,855,787,271,796,860,802,797,6,916,917,918,919]);
|
| 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])},887,[888,911,913]);
|
| 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)}}},888,[283,889,892,906,907,908,909,910]);
|
| 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}},889,[283,890]);
|
| 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}},890,[891]);
|
| 6 |
+
__d(function(g,r,i,a,m,e,d){},891,[]);
|
| 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)}},892,[893,283,889,906,907]);
|
| 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]}})})},893,[894,895,905]);
|
| 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()}})}},894,[895,899,904]);
|
| 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}}},895,[283,214,896,900,901,902,903,899,904]);
|
| 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}},896,[283,897,181,94,898,899]);
|
| 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])},897,[557]);
|
| 13 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}}),r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e};function c(e){const t=n.pickScale(e.scales,s.default.get()),c=1===t?'':'@'+t+'x',o=e.type?`.${e.type}`:'';return e.httpServerLocation.replace(/\.\.\//g,'_')+'/'+e.name+c+o}class n{constructor(e,t,s){this.serverUrl=e||'https://expo.dev',this.jsbundleUrl=null,this.asset=s}isLoadedFromServer(){return!0}isLoadedFromFileSystem(){return!1}defaultAsset(){return this.assetServerURL()}assetServerURL(){const e=new URL(c(this.asset),this.serverUrl);return e.searchParams.set('platform',"web"),e.searchParams.set('hash',this.asset.hash),this.fromSource(e.toString().replace(e.origin,''))}fromSource(e){return{__packager_asset:!0,width:this.asset.width??void 0,height:this.asset.height??void 0,uri:e,scale:n.pickScale(this.asset.scales,s.default.get())}}static pickScale(e,t){for(const s of e)if(s>=t)return s;return e[e.length-1]||1}}},898,[283,181]);
|
| 14 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IS_ENV_WITH_LOCAL_ASSETS",{enumerable:!0,get:function(){return t}}),e.getLocalAssets=function(){return{}},e.getManifest2=function(){return{}},Object.defineProperty(e,"manifestBaseUrl",{enumerable:!0,get:function(){return n}});const t=!1;const n=null},899,[]);
|
| 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}},900,[]);
|
| 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}},901,[]);
|
| 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])},902,[900]);
|
| 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}},903,[]);
|
| 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},904,[214,898]);
|
| 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])},905,[12,895]);
|
| 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}},906,[893,283]);
|
| 22 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fontSourceFromFace=function(n){const{path:o,display:s}=n,u=(0,l.resolveFaceWeight)(n),c=(0,l.resolveFaceStyle)(n);if(o instanceof t.Asset)return{uri:o.uri,...void 0!==u?{weight:u}:null,...void 0!==c?{style:c}:null,...void 0!==s?{display:s}:null};const y='string'==typeof o||'number'==typeof o?{uri:o}:o;return{...y,weight:u,style:c,display:s??y.display}};var t=r(d[0]),l=r(d[1])},907,[893,906]);
|
| 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}},908,[889]);
|
| 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])},909,[283,889,892,890]);
|
| 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})({})},910,[]);
|
| 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]))},911,[283,35,912]);
|
| 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')},912,[283]);
|
| 28 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},913,[12,888]);
|
| 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]}})})},914,[915]);
|
| 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(){}},915,[]);
|
| 31 |
+
__d(function(e,o,s,p,t,a,n){"use strict";t.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},916,[]);
|
| 32 |
+
__d(function(e,o,s,p,c,t,d){"use strict";c.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},917,[]);
|
| 33 |
+
__d(function(o,e,s,p,f,t,d){"use strict";f.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},918,[]);
|
| 34 |
+
__d(function(o,s,e,p,d,t,n){"use strict";d.exports="/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},919,[]);
|
chef-app/_expo/static/js/web/basket-08b87f6408ab6870cfda24769972c955.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 j}});var e,l=_r(d[0]),t=_r(d[1]),n=_r(d[2]),s=(e=n)&&e.__esModule?e:{default:e},a=_r(d[3]),r=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),b=_r(d[10]),m=_r(d[11]),y=_r(d[12]);function j(){const e=(0,h.useBasket)(),n=(0,h.useRestaurant)(e.restaurantId??void 0),j=(0,h.useStore)(e=>e.menu),x=(0,h.useCustomer)(),f=(0,h.useOrders)(n?.id),k=(0,h.useStore)(e=>e.setLineQty),p=(0,h.useStore)(e=>e.overrideLine),w=(0,h.useStore)(e=>e.startBasket),v=(0,h.useNow)(15e3),[C,B]=(0,t.useState)(null),[S,P]=(0,t.useState)(!1),[T,$]=(0,t.useState)(''),[O,L]=(0,t.useState)(!1),[R,I]=(0,t.useState)(null),[M,N]=(0,t.useState)(!1),F=(0,t.useMemo)(()=>(0,b.linesFromBasket)(e,j,x.allergies),[e,j,x.allergies]);if(!n||!e.lines.length)return(0,y.jsxs)(r.Screen,{title:"Your basket",children:[(0,y.jsx)(r.Muted,{children:"Your basket is empty."}),(0,y.jsx)(r.Button,{label:"Browse restaurants",onPress:()=>l.router.replace('/customer')})]});const _='table'===e.mode,z=(0,c.takeawaySlots)(n,f,v),D=F.reduce((e,l)=>e+l.unitPrice*l.qty,0),A=F.some(e=>e.contains.length&&!e.overridden),E=e.lines.filter(e=>{const l=j.find(l=>l.id===e.itemId);return!l||l.soldOut||!l.signOff}),Y=!_&&!C,q=!_&&n.settings.takeawayPaused,H=!A&&!E.length&&S&&!Y&&!q,K=async e=>{const t=await h.repo.orders.placeFromBasket({slotTime:_?void 0:C,tip:0,giftCardCode:e?.giftCardCode,notes:T,paidNow:!_});L(!1),l.router.replace(`/customer/order/${t.id}`)},Q=e.lines.find(e=>e.key===R),G=Q?F[e.lines.indexOf(Q)]:void 0;return(0,y.jsxs)(r.Screen,{title:"Your basket",subtitle:`${n.name} \xb7 ${_?`Table ${e.tableNo} (order at table)`:'Takeaway \u2014 collection'}`,footer:(0,y.jsxs)(s.default,{style:{gap:8},children:[(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(r.T,{weight:"semibold",children:"Subtotal"}),(0,y.jsx)(r.T,{weight:"bold",size:20,colour:m.colours.gold,children:(0,i.gbp)(D)})]}),A?(0,y.jsx)(r.T,{size:14,colour:m.colours.red,children:"Resolve the blocked allergy item(s) before continuing."}):S?Y&&!q?(0,y.jsx)(r.T,{size:14,colour:m.colours.amber,children:"Choose a collection time."}):null:(0,y.jsx)(r.T,{size:14,colour:m.colours.amber,children:"Confirm your allergies to continue."}),_?(0,y.jsx)(r.Button,{label:"Send order to the kitchen",disabled:!H,onPress:()=>K(),testID:"send-table-order"}):(0,y.jsx)(r.Button,{label:`Continue to payment \xb7 ${(0,i.gbp)(D)}`,disabled:!H,onPress:()=>L(!0),testID:"checkout"})]}),children:[(_||e.tableNo,null),_?(0,y.jsx)(r.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,n.fictional?null:(0,y.jsx)(r.ExampleAllergenNotice,{}),F.map((l,t)=>{const n=e.lines[t],a=l.contains.length&&!l.overridden;return(0,y.jsxs)(r.Card,{highlight:l.contains.length?m.colours.red:l.may.length?m.colours.amber:void 0,children:[(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,y.jsxs)(s.default,{style:{flex:1,paddingRight:8},children:[(0,y.jsx)(r.T,{weight:"semibold",children:l.name}),l.choices.length?(0,y.jsx)(r.Muted,{children:l.choices.join(' \xb7 ')}):null,l.notes?(0,y.jsxs)(r.Muted,{children:["Note: ",l.notes]}):null]}),(0,y.jsx)(r.T,{weight:"semibold",children:(0,i.gbp)(l.unitPrice*l.qty)})]}),a?(0,y.jsxs)(r.Banner,{kind:"danger",title:`BLOCKED \u2014 contains ${l.contains.map(o.allergenLabel).join(', ')}`,children:[(0,y.jsx)(r.T,{size:14,colour:"#FFE3DF",children:`Conflicts with your declared ${x.allergies.filter(e=>l.contains.includes(e.allergen)).map(e=>`${(0,o.allergenLabel)(e.allergen)} (${(0,o.severityLabel)(e.severity)})`).join(', ')}.`}),(0,y.jsxs)(r.Row,{gap:8,style:{marginTop:6},children:[(0,y.jsx)(r.Button,{small:!0,kind:"secondary",label:"Remove",onPress:()=>k(n.key,0)}),(0,y.jsx)(r.Button,{small:!0,kind:"danger",label:"Override\u2026",onPress:()=>{N(!1),I(n.key)}})]})]}):l.contains.length?(0,y.jsx)(r.Banner,{kind:"danger",title:`Allergy override recorded \u2014 contains ${l.contains.map(o.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,y.jsx)(r.Banner,{kind:"warn",title:`May contain ${l.may.map(o.allergenLabel).join(', ')}`,children:"Cross-contact risk (e.g. shared fryer). Please check with staff."}):null,E.includes(n)?(0,y.jsx)(r.Badge,{kind:"amber",label:"No longer available online \u2014 please remove"}):null,(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>k(n.key,0)}),(0,y.jsx)(r.Stepper,{value:n.qty,onChange:e=>k(n.key,e),min:1,label:l.name})]})]},n.key)}),(0,y.jsx)(r.Button,{kind:"ghost",label:"+ Add more items",onPress:()=>l.router.push(`/customer/${n.id}`)}),_?null:(0,y.jsxs)(r.Card,{children:[(0,y.jsxs)(r.H2,{children:["Collection time \u2014 ",(0,u.niceDate)(v)]}),q?(0,y.jsx)(r.Banner,{kind:"warn",title:"Takeaway paused",children:"The restaurant has paused takeaway slots for now. Please try again later or book a table."}):0===z.length?(0,y.jsx)(r.Banner,{kind:"warn",children:"No collection slots left today."}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(r.Muted,{children:["15-minute slots, max ",n.settings.slotCap," orders each so the kitchen isn\u2019t overloaded."]}),(0,y.jsx)(r.Row,{wrap:!0,gap:6,children:z.slice(0,16).map(e=>(0,y.jsx)(r.Chip,{label:e.label,sub:e.full?'Full':e.cap-e.taken+" left",disabled:e.full,selected:C===e.time.toISOString(),onPress:()=>B(e.time.toISOString())},e.label))})]})]}),(0,y.jsxs)(r.Card,{highlight:S?void 0:m.colours.amber,children:[(0,y.jsx)(r.H2,{children:"Confirm allergies for this order"}),(0,y.jsx)(r.Row,{wrap:!0,gap:6,children:x.allergies.length?x.allergies.map(e=>(0,y.jsx)(r.Badge,{kind:"red",label:`${(0,o.allergenLabel)(e.allergen)} \u2014 ${(0,o.severityLabel)(e.severity)}`},e.allergen)):(0,y.jsx)(r.Muted,{children:"No allergies declared on your profile."})}),(0,y.jsx)(r.Toggle,{label:x.allergies.length?'Yes, these are correct for everyone this order is for':'I confirm no one in this order has a food allergy',value:S,onChange:P}),(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Edit allergies in profile",onPress:()=>l.router.push('/customer/profile')})]}),(0,y.jsx)(r.Field,{label:"Order notes (optional)",value:T,onChangeText:$,placeholder:"e.g. cutlery please"}),_?(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Switch to takeaway instead",onPress:()=>w(n.id,'takeaway')}):null,(0,y.jsx)(a.MockPay,{visible:O,onClose:()=>L(!1),amount:D,restaurantId:n.id,onPaid:e=>K({giftCardCode:e.giftCardCode}),title:"Pay for your takeaway"}),(0,y.jsxs)(r.Sheet,{visible:!!Q,onClose:()=>I(null),title:"Allergy override",children:[G?(0,y.jsx)(r.Banner,{kind:"danger",title:`${G.name} contains ${G.contains.map(o.allergenLabel).join(', ')}`,children:"Only continue if this item is for someone without this allergy, or you have spoken to staff."}):null,(0,y.jsx)(r.Toggle,{label:"I understand and want to add it anyway",value:M,onChange:N}),(0,y.jsx)(r.Button,{kind:"danger",disabled:!M,label:"Confirm override",onPress:()=>{Q&&G&&p(Q.key,G.contains),I(null)}})]})]})}},771,[785,12,109,789,790,791,793,794,795,796,844,797,6]);
|
chef-app/_expo/static/js/web/entry-bb1562f619d10ba0f9a22b5cff5b52e3.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
chef-app/_expo/static/js/web/index-2126b5aa7e82751237c9d2717f57d66f.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
chef-app/_expo/static/js/web/index-262c67710af9665f3d517bccf3c36b47.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 S}});var l=_r(_d[0]),s=_r(_d[1]),t=e(_r(_d[2])),n=e(_r(_d[3])),r=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]),m=_r(_d[13]),f=_r(_d[14]),y=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),k=_r(_d[18]);const w=[{id:'main',label:'Main menu'},{id:'specials',label:'Specials'},{id:'takeaway',label:'Takeaway'}];function S(){const{rid:e}=(0,l.useLocalSearchParams)(),S=(0,b.useRestaurant)(e),A=(0,b.useMenu)(e),P=(0,b.useCustomer)(),B=(0,b.useBasket)(),O=(0,b.useStore)(e=>e.startBasket),C=(0,b.useNow)(3e4),[R,T]=(0,s.useState)('All'),[M,$]=(0,s.useState)(null),[I,v]=(0,s.useState)(!1),[D,N]=(0,s.useState)(!1),[H,_]=(0,s.useState)('main'),L=(0,x.useSpecials)(l=>l.current[e]??null),F=!!L&&(0,j.isToday)(L.postedAt,C),W=(0,f.useOwner)(e=>e.offers.filter(e=>e.live).length),z=(0,b.useStore)(l=>l.stampCards.find(s=>s.restaurantId===e&&s.customerId===l.customer.id));if(!S)return(0,k.jsx)(i.Screen,{title:"Not found",children:(0,k.jsx)(i.T,{children:"Restaurant not found."})});const G=B.restaurantId===S.id&&'table'===B.mode,K=S.sections.length?S.sections:Array.from(new Set(A.map(e=>e.section))),Q=e=>!(e.soldOut||!e.signOff||null===e.price),Y=A.filter(e=>('All'===R||e.section===R)&&('takeaway'!==H||Q(e))),E=(0,u.hoursFor)(S,C),V=e=>()=>l.router.push(`/customer/${S.id}${e}`),q=[{icon:'\ud83e\udd61',label:'Takeaway',sub:'Order to collect',on:()=>{T('All'),_('takeaway'),G&&O(S.id,'takeaway')}},{icon:'\ud83d\udcf1',label:'Order at table',sub:'Scan the QR',on:()=>N(!0)},{icon:'\ud83d\udcc5',label:'Book a table',on:V('/book')},{icon:'\u23f3',label:'Waitlist',sub:'Walk in',on:V('/waitlist')},{icon:'\u2b50',label:'Stamp card',sub:`${z?.stamps??0} of ${S.settings.stampTarget}`,on:V('/loyalty')},{icon:'\ud83e\udd1d',label:'Bring a friend',on:V('/refer')},{icon:'\ud83c\udf81',label:'Gift cards',on:V('/gift')},{icon:'\u26a0\ufe0f',label:'My allergens',sub:P.allergies.length?`${P.allergies.length} declared`:'None declared',on:()=>l.router.push('/customer/profile')},{icon:'\ud83c\udff7\ufe0f',label:'Offers',sub:P.marketingOptIn[S.id]?'Opted in':'Opt in',on:V('/offers'),badge:W?String(W):void 0},{icon:'\ud83c\udf89',label:"What's on",on:V('/whatson')},{icon:'\ud83d\udcac',label:'Feedback',sub:'Private',on:V('/feedback')},{icon:'\ud83e\udde3',label:'Lost property',on:V('/lost')},{icon:'\ud83d\udecd\ufe0f',label:'Shop',sub:'Merch',on:V('/merch')}];return(0,k.jsxs)(i.Screen,{title:S.name,subtitle:`${S.location}${S.phone?` \xb7 ${S.phone}`:''}`,back:'customer'!==m.APP_VARIANT,right:(0,k.jsxs)(i.Row,{children:[(0,k.jsx)(o.BasketButton,{}),(0,k.jsx)(i.Button,{small:!0,kind:"ghost",label:"Account",onPress:()=>l.router.push('/customer/profile')})]}),children:[S.fictional?(0,k.jsx)(i.Banner,{kind:"warn",title:"Fictional demo restaurant",children:"Shown only to demonstrate multi-restaurant support."}):null,G?(0,k.jsx)(i.Banner,{kind:"success",title:`Ordering at Table ${B.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,k.jsx)(i.Card,{children:(0,k.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsxs)(n.default,{style:{flex:1},children:[(0,k.jsx)(i.T,{weight:"semibold",children:"Takeaway \u2014 collection"}),(0,k.jsxs)(i.Muted,{children:[E?`Kitchen today ${S.kitchenHours[C.getDay()][0]}\u2013${S.kitchenHours[C.getDay()][1]}`:'Kitchen closed today',S.settings.takeawayPaused?' \xb7 slots paused by the restaurant':'']})]}),(0,k.jsx)(i.Badge,{kind:S.settings.takeawayPaused||!E?'amber':'green',label:S.settings.takeawayPaused?'Paused':E?'Taking orders':'Closed'})]})}),S.fictional?(0,k.jsx)(i.Row,{wrap:!0,gap:8,children:q.slice(2,7).map(e=>(0,k.jsx)(i.Button,{small:!0,kind:"secondary",label:e.label,onPress:e.on},e.label))}):(0,k.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:q.map(e=>(0,k.jsx)(p.HubTile,{icon:e.icon,label:e.label,sub:e.sub,badge:e.badge,onPress:e.on},e.label))}),G?(0,k.jsx)(i.Button,{small:!0,kind:"danger",label:"Call staff",onPress:()=>v(!0)}):null,I?(0,k.jsx)(i.Banner,{kind:"success",children:"A member of staff is on their way to your table (demo)."}):null,S.hoursNote?(0,k.jsx)(i.Muted,{children:S.hoursNote}):null,S.fictional?null:(0,k.jsx)(i.ExampleAllergenNotice,{}),(0,k.jsx)(i.Muted,{children:"Menu dishes and prices from The Anchorage\u2019s public menu (PDF). Items marked \u26a0 conflict with your declared allergies."}),(0,k.jsx)(n.default,{accessibilityRole:"tablist",testID:"menu-tabs",style:{flexDirection:'row',gap:6,backgroundColor:h.colours.surface,borderRadius:14,borderWidth:1,borderColor:h.colours.border,padding:4},children:w.map(e=>{const l=H===e.id;return(0,k.jsxs)(t.default,{testID:`menu-tab-${e.id}`,accessibilityRole:"tab",accessibilityState:{selected:l},"aria-selected":l,accessibilityLabel:'specials'===e.id&&F?'Specials, updated today':e.label,onPress:()=>_(e.id),style:{flex:1,minHeight:44,borderRadius:10,alignItems:'center',justifyContent:'center',paddingHorizontal:4,backgroundColor:l?h.colours.gold:'transparent'},children:[(0,k.jsx)(i.T,{size:14,weight:"semibold",colour:l?h.colours.onGold:h.colours.text,center:!0,children:e.label}),'specials'===e.id&&F&&!l?(0,k.jsx)(n.default,{style:{position:'absolute',top:6,right:8,width:7,height:7,borderRadius:4,backgroundColor:h.colours.gold}}):null]},e.id)})}),'specials'===H?(0,k.jsx)(y.SpecialsTab,{rid:S.id,declared:P.allergies,now:C}):null,'takeaway'===H?(0,k.jsx)(i.Muted,{children:"Order to collect. Only dishes available to order online are shown; pick a collection slot at checkout."}):null,'specials'!==H?(0,k.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,k.jsx)(i.Chip,{label:"All",selected:'All'===R,onPress:()=>T('All')}),K.map(e=>(0,k.jsx)(i.Chip,{label:e,selected:R===e,onPress:()=>T(e)},e))]}):null,'specials'!==H?K.filter(e=>('All'===R||e===R)&&Y.some(l=>l.section===e)).map(e=>(0,k.jsxs)(n.default,{style:{gap:10},children:[(0,k.jsx)(i.H2,{style:{color:h.colours.gold,marginTop:6},children:e}),Y.filter(l=>l.section===e).map(e=>{const s=(0,d.conflictsFor)(e.allergens,P.allergies),o=e.soldOut||!e.signOff||null===e.price;return(0,k.jsxs)(i.Card,{highlight:s.contains.length?h.colours.red:s.may.length?h.colours.amber:void 0,children:[(0,k.jsxs)(t.default,{accessibilityRole:"button",onPress:()=>{B.restaurantId&&B.restaurantId===S.id||O(S.id,'takeaway'),l.router.push(`/customer/${S.id}/dish/${e.id}`)},children:[(0,k.jsxs)(i.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,k.jsx)(i.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,k.jsx)(i.T,{weight:"semibold",colour:h.colours.gold,children:null===e.price?e.priceNote??'\u2014':(0,c.gbp)(e.price)})]}),(0,k.jsx)(i.Muted,{numberOfLines:2,children:e.description})]}),(0,k.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.dietary.map(e=>(0,k.jsx)(i.Badge,{kind:"green",label:e},e)),e.special?(0,k.jsx)(i.Badge,{kind:"gold",label:"Special"}):null,e.soldOut?(0,k.jsx)(i.Badge,{kind:"neutral",label:"Sold out"}):null,e.signOff?null:(0,k.jsx)(i.Badge,{kind:"amber",label:"Awaiting allergen sign-off"}),s.contains.length?(0,k.jsx)(i.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):s.may.length?(0,k.jsx)(i.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null]}),(0,k.jsx)(r.AllergenChips,{map:e.allergens,declared:P.allergies}),M===e.id?(0,k.jsx)(r.AllergenPanel,{item:e,map:e.allergens,declared:P.allergies}):null,(0,k.jsxs)(i.Row,{gap:8,children:[(0,k.jsx)(i.Button,{small:!0,kind:"ghost",label:M===e.id?'Hide allergen panel':'Allergen panel',onPress:()=>$(M===e.id?null:e.id)}),(0,k.jsx)(n.default,{style:{flex:1}}),(0,k.jsx)(i.Button,{small:!0,label:o?e.soldOut?'Sold out':'Not available online':'Choose',disabled:o,onPress:()=>{B.restaurantId&&B.restaurantId===S.id||O(S.id,'takeaway'),l.router.push(`/customer/${S.id}/dish/${e.id}`)}})]})]},e.id)})]},e)):null,(0,k.jsx)(i.Muted,{children:"Drinks list coming soon. Ask your server for today\u2019s drinks."}),(0,k.jsx)(i.Muted,{children:"All payments in this app are demo only: Demo, no real payment."}),(0,k.jsx)(p.LauncherLine,{}),(0,k.jsxs)(i.Sheet,{visible:D,onClose:()=>N(!1),title:"Order at your table",children:[(0,k.jsx)(i.Muted,{children:"Scan the QR code on your table with your phone camera, or pick your table number (demo)."}),(0,k.jsx)(i.Row,{wrap:!0,gap:6,children:Array.from({length:12},(e,l)=>String(l+1)).map(e=>(0,k.jsx)(i.Button,{small:!0,kind:"secondary",label:`Table ${e}`,onPress:()=>{N(!1),O(S.id,'table',e)}},e))}),(0,k.jsx)(i.Muted,{children:"Orders go straight to the kitchen. You pay from your order page (Demo, no real payment)."})]})]})}},763,[785,12,245,109,798,799,790,791,793,792,796,797,801,787,802,803,804,805,6]);
|
chef-app/_expo/static/js/web/index-cd1a75d1c6392ea7f363e8d3491f1093.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 o}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function o(){return(0,n.canShow)('display')?(0,c.jsx)(u.DisplayBoard,{}):(0,c.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},777,[785,12,787,846,6]);
|
| 2 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisplayBoard=function(){const{width:e,height:Y}=(0,n.default)(),_=e>=1e3,q=(0,T.useOwner)(e=>e.site),K=(0,y.useRestaurant)(q),X=(0,y.useOrders)(q),J=(0,y.useBookings)(q),Q=(0,y.useWaitlist)(q),Z=(0,y.useEvents)(q),ee=(0,y.useRatings)(q),se=(0,y.useAudit)(q),le=(0,y.useStore)(e=>e.menu),te=(0,y.useStore)(e=>e.walkIns[q]??0),ae=(0,y.useStore)(e=>e.alertAcks),re=((0,y.useStore)(e=>e.customer),(0,y.useStore)(e=>e.skipMinutes)),oe=(0,y.useNow)(5e3),ne=(0,T.useOwner)(e=>e.staff),ie=(0,T.useOwner)(e=>e.attendance),de=(0,T.useOwner)(e=>e.shifts),ue=(0,T.useOwner)(e=>e.chat),[ce,ge]=(0,s.useState)(!0);l.default.useEffect(()=>{(0,$.ensureAttendance)((0,f.ymd)(oe),oe),(0,v.ensureChat)(oe)},[(0,f.ymd)(oe)]);const he=ie.filter(e=>e.in&&!e.out&&oe.getTime()-new Date(e.in).getTime()<72e6&&oe.getTime()>=new Date(e.in).getTime()),pe=he.length?he.map(e=>F(ne.find(s=>s.id===e.staffId)?.name)).filter(Boolean):['Duty Manager'],[me,be]=(0,s.useState)(null),xe=me&&pe.includes(me)?me:pe[0],[fe,je]=(0,s.useState)(''),[ye,we]=(0,s.useState)('2'),ke=(0,f.ymd)(oe),Te=(0,C.useFrontDoor)(ke,e>Y),ve=(0,B.useDisplaySettings)(q),Ce=ve.privacy,$e=(0,B.usePlan)(q),Be=(0,B.useFloor)(e=>e.live[q]),[Se,Re]=(0,s.useState)('floor'),[Pe,Me]=(0,s.useState)(''),[De,Ae]=(0,s.useState)(null),[Ie,Le]=(0,s.useState)(null),[ze,Ee]=(0,s.useState)(null),[He,Ne]=(0,s.useState)(!1),[We,Oe]=(0,s.useState)(null);l.default.useEffect(()=>{if(!We)return;const e=setTimeout(()=>Oe(null),4500);return()=>clearTimeout(e)},[We]);const Fe=(e,s)=>Ee({title:e,body:s}),Ve=e=>Fe(`Guest details \xb7 ${e.time}`,(0,E.bookingDetails)(e)),Ge=(0,s.useMemo)(()=>(0,p.forecastToday)(K,J,X,Z,oe),[K,J,X,Z,oe.getTime()/6e4|0]),Ue=J.filter(e=>e.date===ke).sort((e,s)=>e.time.localeCompare(s.time)),Ye=te+Ue.filter(e=>e.walkIn&&['seated','finished'].includes(e.status)).reduce((e,s)=>e+s.partySize,0),qe=Ue.filter(e=>!e.walkIn&&'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ke=Q.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),Xe=X.filter(e=>!['collected','closed','cancelled'].includes(e.status)).sort((e,s)=>Number('new'===s.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(s.slotTime??s.createdAt)),Je=X.filter(e=>['collected','closed'].includes(e.status)).length,Qe=(0,x.takeawaySlots)(K,X,oe),Ze=Ge.nextHour?Math.min(1.6,Math.max(.8,Ge.nextHour.covers/(.75*K.settings.capacityPerHour))):1,es=(e,s)=>!!(0,z.statusBlock)(e,s,(0,z.linkedBooking)(e,J)),ss=e=>{const s=(0,z.nextStep)(e,(0,z.linkedBooking)(e,J));return!(!s||'table'===s&&!['ready','served'].includes(e.status))},ls=Xe.filter(e=>e.allergies.length&&ss(e)),ts=Ue.filter(e=>e.allergies.length&&!e.allergyAck&&['confirmed','seated'].includes(e.status)&&!Xe.some(s=>s.allergies.length&&(0,z.linkedBooking)(s,[e]))),as=Xe.flatMap(e=>(0,b.readinessFor)(e,K,oe).map(s=>({...s,order:e}))),rs=as.filter(e=>'due'===e.state||'overdue'===e.state),os=as.filter(e=>'upcoming'===e.state).sort((e,s)=>e.due.getTime()-s.due.getTime()),ns=ee.filter(e=>e.stars<=2&&!ae[`rating:${e.id}`]),is=Xe.filter(e=>'new'===e.status&&!e.allergies.length&&(0,f.minsBetween)(new Date(e.createdAt),oe)>=0),ds=le.filter(e=>e.restaurantId===q&&e.soldOut),us=(se.filter(e=>'stamp'===e.kind||'giftcard'===e.kind).slice(0,4),ls.length+ts.length+rs.length+ns.length+is.length),cs=(0,s.useMemo)(()=>(0,S.floorView)($e,J,X,Be??{},oe,K.settings.turnMins),[$e,J,X,Be,oe.getTime()]),gs=$e.areas.some(e=>e.id===Pe)?Pe:$e.areas[0]?.id??'',hs=Object.fromEntries($e.areas.map(e=>{const s=$e.tables.filter(s=>s.areaId===e.id);return[e.id,`${s.filter(e=>'free'===cs[e.name]?.status).length}/${s.length} free`]})),ps=(0,I.hoursFor)(K,oe),ms=ps?(0,f.addMins)(ps.open,-ps.open.getMinutes()):new Date(`${ke}T12:00:00`),bs=ps?(0,f.addMins)(ps.close,120):new Date(`${ke}T23:00:00`),xs=async(e,s)=>{const l=cs[e]?.booking;if(!l||e===s)return;const t=cs[s]?.status;if(t&&!['free','soon'].includes(t))return void Oe('dirty'===t?`Table ${s} needs clearing first.`:`Table ${s} is ${S.STATUS[t].label.toLowerCase()} \u2014 pick a free table.`);await y.repo.bookings.update(l.id,{table:s});const a=Be?.[e]?.stage;B.useFloor.getState().setLive(q,s,{stage:a??'seated',dirty:!1}),B.useFloor.getState().setLive(q,e,{stage:void 0,dirty:!0}),Oe(`${(0,A.privName)(l,Ce)} moved Table ${e} \u2192 ${s}. Table ${e} needs clearing.`)},fs=e=>Fe(`Order ${e.ref} \xb7 details`,(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(e.customerName)}),e.allergies.length?(0,W.jsxs)(u.T,{weight:"bold",colour:k.colours.red,children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}):(0,W.jsx)(u.Muted,{children:"No allergies declared."}),e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{colour:k.colours.red,children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.notes?` \xb7 \u201c${e.notes}\u201d`:'']},s))]})),js=Ge.hours,ys=Math.max(K.settings.capacityPerHour,...js.map(e=>e.coversHigh)),ws=(0,W.jsxs)(V,{title:`Bookings & waitlist \xb7 ${(0,f.niceDate)(oe)}`,right:(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`}),children:[0===Ue.length?(0,W.jsx)(u.Muted,{children:"No bookings today."}):null,Ue.map(e=>{const s='confirmed'===e.status&&(0,f.minsBetween)(new Date(`${e.date}T${e.time}:00`),oe)>15;return(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10,opacity:['finished','noshow','cancelled'].includes(e.status)?.5:1,borderColor:e.allergies.length?k.colours.red:s?k.colours.amber:k.colours.border}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:[e.time," \xb7 ",Ce?`${(0,A.privName)(e,!0)} \xb7 ${e.partySize}`:(0,C.walkInLabel)(e)]}),(0,W.jsx)(u.Badge,{kind:'seated'===e.status?'green':'noshow'===e.status?'red':'neutral',label:'noshow'===e.status?'No-show':e.status})]}),(0,W.jsxs)(u.Muted,{children:[e.table?`Table ${e.table}`:e.walkIn?'Table to assign':'Table TBC',e.walkIn?` \xb7 ${e.ref}`:'','none'!==e.security?" \xb7 "+('deposit'===e.security?'Deposit':'Card saved'):'',e.notes?Ce?' \xb7 \u270e':` \xb7 ${e.notes}`:'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:"\u26a0 Allergy"}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>Ve(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsx)(u.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,W.jsx)(u.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,s?(0,W.jsx)(u.T,{size:13,colour:k.colours.amber,children:"Running late \u2014 15+ min past booking time"}):null,!e.table&&e.walkIn&&'seated'===e.status?(0,W.jsx)(u.Button,{label:"Assign table",onPress:()=>Te.assignTable(e)}):null,'confirmed'===e.status?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.bookings.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>y.repo.bookings.setStatus(e.id,'noshow')})]}):'seated'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Finished",onPress:()=>y.repo.bookings.setStatus(e.id,'finished')}):null]},e.id)}),(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',marginTop:6},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.gold,children:["Waitlist (",Ke.length,")"]}),(0,W.jsxs)(u.Muted,{children:["~",(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)," min for a new party (est.)"]})]}),Ke.map((e,s)=>(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:["#",e.number," ",(0,A.pv)(e.name,Ce)," \xb7 ",e.partySize]}),(0,W.jsxs)(u.Muted,{children:["waiting ",(0,f.minsBetween)(new Date(e.joinedAt),oe)," min \xb7 est. ",(0,j.estimateWait)(s+1,K.settings.turnMins,Ze)," min"]})]}),'notified'===e.status?(0,W.jsx)(u.Badge,{kind:"green",label:"Notified \u2014 table ready"}):null,(0,W.jsxs)(u.Row,{gap:6,children:['waiting'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>y.repo.waitlist.setStatus(e.id,'notified')}):null,(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.waitlist.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>y.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:fe,onChangeText:je,style:[u.styles.input,{flex:1,paddingVertical:6}]}),(0,W.jsx)(r.default,{accessibilityLabel:"Party size",value:ye,onChangeText:we,keyboardType:"number-pad",style:[u.styles.input,{width:50,paddingVertical:6}]}),(0,W.jsx)(u.Button,{small:!0,label:"Add",disabled:fe.trim().length<2,onPress:()=>{y.repo.waitlist.join(q,fe.trim(),Math.max(1,Number(ye)||2)),je('')}})]})]}),ks=(0,W.jsxs)(V,{title:"Live orders & kitchen tickets",right:(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Chip,{label:"Tickets",selected:ce,onPress:()=>ge(!0)}),(0,W.jsx)(u.Chip,{label:"Full orders",selected:!ce,onPress:()=>ge(!1)})]}),children:[(0,W.jsxs)(u.Muted,{children:[Xe.length," live \xb7 ",Je," done today"]}),0===Xe.length?(0,W.jsx)(u.Muted,{children:"No live orders."}):null,ce?(0,W.jsxs)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[Xe.filter(e=>['new','acknowledged','preparing'].includes(e.status)).map(e=>{const s=Math.max(0,(0,f.minsBetween)(new Date(e.createdAt),oe)),l=s>=20?k.colours.red:s>=12?k.colours.amber:k.colours.green;return(0,W.jsxs)(o.default,{testID:`ticket-${e.ref}`,style:{width:210,backgroundColor:'#F4EFE3',borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:e.allergies.length?k.colours.red:l},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",colour:"#111",children:'table'===e.type?`TABLE ${e.tableNo}`:`TAKEAWAY ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`}),(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:s>=20?'#B3261E':'#333',children:[s,"m"]})]}),(0,W.jsxs)(u.T,{size:12,colour:"#444",children:[e.ref," \xb7 ",e.status.toUpperCase()]}),e.allergies.length?(0,W.jsx)(o.default,{style:{backgroundColor:'#B3261E',borderRadius:4,padding:4},children:(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:"#fff",children:["\u26a0 ",Ce?'ALLERGY \u2014 see details':e.allergies.map(e=>(0,h.allergenLabel)(e.allergen)).join(', ').toUpperCase()]})}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,weight:"semibold",colour:"#111",children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'']},s)),e.lines.some(e=>e.notes)?(0,W.jsx)(u.T,{size:12,colour:"#444",children:Ce?'Notes \u2014 see details':`Notes: ${e.lines.filter(e=>e.notes).map(e=>e.notes).join(' \xb7 ')}`}):null,Ce&&(e.allergies.length||e.lines.some(e=>e.notes))?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Details",onPress:()=>fs(e)}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:'takeaway'===e.type?'Ready':'Food out',disabled:es(e,'takeaway'===e.type?'ready':'served'),onPress:()=>y.repo.orders.setStatus(e.id,'takeaway'===e.type?'ready':'served',xe)}):null]},e.id)}),Xe.filter(e=>['ready','served'].includes(e.status)).map(e=>(0,W.jsxs)(o.default,{style:{width:210,backgroundColor:k.colours.surface2,borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:k.colours.green},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",children:'table'===e.type?`Table ${e.tableNo}`:`Takeaway ${e.ref}`}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce),'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':'']}),e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",testID:`collected-${e.ref}`,disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]},e.id))]}):null,ce?null:Xe.map(e=>{const s=e.allergies.length>0&&ss(e),l=e.lines.filter(e=>e.overridden),t=e.lines.filter(e=>e.contains.length||e.may.length);return(0,W.jsxs)(o.default,{testID:`order-${e.ref}`,style:[u.styles.card,{padding:10,borderColor:s?k.colours.red:'ready'===e.status?k.colours.green:k.colours.border,borderWidth:s?2:1}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"bold",children:e.ref}),(0,W.jsx)(u.Badge,{kind:'takeaway'===e.type?'gold':'blue',label:'takeaway'===e.type?`Takeaway \xb7 ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`:`Table ${e.tableNo}`})]}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce)," \xb7 ",(0,m.gbp)(e.subtotal)," \xb7 ",e.paid>=e.total?'Paid (demo)':e.paid>0?`Part paid ${(0,m.gbp)(e.paid)}`:'Unpaid \u2014 bill at end',e.customerSignal?" \xb7 "+('here'===e.customerSignal?'CUSTOMER IS HERE':'Customer on the way'):'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:s?'\u26a0 Allergy: sign-off needed':'\u26a0 Allergy (signed off)'}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>fs(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.redBg,borderRadius:8,padding:8,borderLeftWidth:5,borderLeftColor:k.colours.red},children:[(0,W.jsxs)(u.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}),l.length?(0,W.jsxs)(u.T,{size:14,weight:"semibold",colour:"#FFE3DF",children:["Customer OVERRODE block on: ",l.map(e=>`${e.name} [contains ${e.contains.map(h.allergenLabel).join(', ')}]`).join('; ')]}):null,t.filter(e=>!e.overridden&&e.may.length).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:"#FFE2A8",children:["May contain: ",e.name," [",e.may.map(h.allergenLabel).join(', '),"]"]},s))]}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.choices.length?` \u2014 ${e.choices.join(', ')}`:'',e.notes?Ce?' \xb7 \u270e':` \xb7 \u201c${e.notes}\u201d`:'']},s)),(0,W.jsxs)(u.Row,{wrap:!0,gap:6,children:['new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start preparing",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status&&'takeaway'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",disabled:es(e,'ready'),onPress:()=>y.repo.orders.setStatus(e.id,'ready',xe)}):null,'preparing'===e.status&&'table'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Food out",disabled:es(e,'served'),onPress:()=>y.repo.orders.setStatus(e.id,'served',xe)}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]})]},e.id)})]}),Ts=({colour:e,title:s,children:l})=>(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.surface2,borderRadius:10,padding:10,borderLeftWidth:6,borderLeftColor:e,gap:4},children:[(0,W.jsx)(u.T,{weight:"bold",colour:e,children:s}),l]}),vs={cook:'START COOKING',bag:'BAG IT',ready:'READY'},Cs=(0,W.jsxs)(V,{title:"Allergy & takeaway alerts",right:(0,W.jsx)(u.Badge,{kind:us?'red':'green',label:`${us} need action`}),children:[ls.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 ${e.ref} ${'table'===e.type?`(Table ${e.tableNo})`:'(takeaway)'}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>fs(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),Ce?null:e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:k.colours.red,weight:"semibold",children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0})]},e.id)),ts.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 booking ${e.time} ${(0,A.privName)(e,Ce)} (${e.partySize})`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>Ve(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),(0,W.jsx)(L.BookingAllergyChain,{b:e,me:xe})]},e.id)),rs.map(e=>(0,W.jsxs)(Ts,{colour:'overdue'===e.state?k.colours.red:k.colours.amber,title:`${vs[e.stage]} \u2014 ${e.order.ref} \xb7 pickup ${(0,f.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,W.jsx)(u.T,{size:14,children:e.detail}),(0,W.jsxs)(u.Muted,{children:["Due ",(0,f.hm)(e.due)," (slot \u2212 prep \u2212 ",K.settings.bufferMins," min buffer)",e.order.allergies.length?' \xb7 \u26a0 allergy order':'']}),'ready'===e.stage?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>y.repo.orders.setStatus(e.orderId,'ready',xe)}):(0,W.jsx)(u.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:es(e.order,'preparing'),onPress:()=>y.repo.orders.acknowledgeReadiness(e.orderId,e.stage,xe)})]},e.id)),is.map(e=>(0,W.jsx)(Ts,{colour:k.colours.amber,title:`New order ${e.ref} \u2014 not yet acknowledged`,children:(0,W.jsx)(u.Button,{small:!0,label:"Acknowledge",onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)})},e.id)),ns.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`LOW RATING ${e.stars}/5 \u2014 ${e.context}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show comment",onPress:()=>Fe(`Rating ${e.stars}/5`,(0,W.jsxs)(u.T,{children:[F(e.customerName),e.comment?`: \u201c${e.comment}\u201d`:'']}))}):(0,W.jsxs)(u.T,{size:15,children:[e.customerName,e.comment?`: \u201c${e.comment}\u201d`:'']}),(0,W.jsx)(u.Muted,{children:"Manager: speak to the guest while they\u2019re still here."}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`Handled \u2014 ${xe}`,onPress:()=>y.repo.alerts.acknowledge(`rating:${e.id}`,xe)})]},e.id)),0===us?(0,W.jsx)(u.Muted,{children:"No alerts need action."}):null,os.length?(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Upcoming takeaway timings"}),os.slice(0,6).map(e=>(0,W.jsxs)(u.T,{size:14,children:[(0,f.hm)(e.due)," \xb7 ",vs[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,f.hm)(new Date(e.order.slotTime)),")"]},e.id))]}):null,ds.length?(0,W.jsx)(Ts,{colour:k.colours.muted,title:"Sold out",children:(0,W.jsx)(u.T,{size:14,children:ds.map(e=>e.name).join(', ')})}):null,(0,W.jsxs)(o.default,{style:{gap:2,marginTop:6},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Allergy log"}),Ce?(0,W.jsxs)(u.Muted,{children:[se.filter(e=>'allergy'===e.kind).length," entries today \u2014 full log in the Managers app (privacy mode)."]}):se.filter(e=>'allergy'===e.kind).slice(0,5).map(e=>(0,W.jsxs)(u.T,{size:13,colour:"#FFD9D4",children:[(0,f.hm)(new Date(e.at))," \xb7 ",e.text]},e.id))]})]}),$s=de.filter(e=>e.day===(0,$.weekday)(oe)&&!he.some(s=>s.staffId===e.staffId)&&60*e.start>60*oe.getHours()+oe.getMinutes()).sort((e,s)=>e.start-s.start),Bs=ue.filter(e=>'all'===e.ch&&!e.removed).sort((e,s)=>Number(!!s.pinned)-Number(!!e.pinned)||s.at.localeCompare(e.at)).slice(0,6),Ss=(0,W.jsxs)(o.default,{style:{flex:.8,gap:10},children:[(0,W.jsxs)(V,{title:"Who's on",right:(0,W.jsx)(u.Badge,{kind:"green",label:`${he.length} clocked in`}),children:[0===he.length?(0,W.jsx)(u.Muted,{children:"Nobody clocked in yet."}):null,he.map(e=>{const s=ne.find(s=>s.id===e.staffId),l=de.find(s=>s.staffId===e.staffId&&s.day===(0,$.weekday)(oe));return(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(N.StaffAvatar,{id:e.staffId,size:34}),(0,W.jsxs)(o.default,{style:{flex:1},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(s?.name)}),(0,W.jsxs)(u.Muted,{children:[s?.job,l?` \xb7 rota ${(0,$.fmtH)(l.start)}\u2013${(0,$.fmtH)(l.end)}`:'']})]}),(0,W.jsx)(u.Badge,{kind:"green",label:`in ${(0,f.hm)(new Date(e.in))}`})]},e.id)}),$s.map(e=>(0,W.jsxs)(u.Muted,{children:["Due in ",(0,$.fmtH)(e.start),": ",F(ne.find(s=>s.id===e.staffId)?.name)]},e.id))]}),(0,W.jsxs)(V,{title:"Staff announcements",right:(0,W.jsx)(u.Muted,{children:"All staff chat"}),children:[0===Bs.length?(0,W.jsx)(u.Muted,{children:"No announcements."}):null,Bs.map(e=>(0,W.jsxs)(o.default,{style:{gap:2,borderLeftWidth:3,borderLeftColor:e.pinned?k.colours.gold:k.colours.border,paddingLeft:8},children:[(0,W.jsxs)(u.T,{size:12,colour:e.pinned?k.colours.gold:k.colours.muted,children:[e.pinned?'\ud83d\udccc ':'','system'===e.from?'Cover Charge':F(ne.find(s=>s.id===e.from)?.name)," \xb7 ",(0,f.hm)(new Date(e.at))]}),(0,W.jsx)(u.T,{size:14,children:e.text??(e.photo?`Photo: ${e.photo.caption}`:'')})]},e.id)),(0,W.jsx)(u.Muted,{children:"Read-only on the display. Post from Cover Charge for Staff or Cover Charge for Managers."})]})]}),Rs=_||e>=900,Ps=(0,W.jsx)(E.WaitlistPanel,{rid:q,r:K,plan:$e,view:cs,todays:Ue,waiting:Ke,now:oe,privacy:Ce,busy:Ze,onToast:Oe}),Ms=(0,W.jsx)(E.PacePanel,{r:K,fc:Ge,todays:Ue,now:oe,walkInCount:te,staffOn:he.length||1,onSummary:()=>Ne(!0)}),Ds=s=>Rs?(0,W.jsx)(t.default,{style:{width:e>=1200?340:300,flexGrow:0},contentContainerStyle:{gap:10,paddingBottom:20},children:s}):(0,W.jsx)(o.default,{style:{gap:10},children:s}),As=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsxs)(o.default,{style:{flex:1,gap:6,minHeight:Rs?void 0:420},children:[(0,W.jsx)(E.ArrivalsStrip,{todays:Ue,now:oe,privacy:Ce}),(0,W.jsx)(P.AreaTabs,{plan:$e,area:gs,onPick:Me,counts:hs}),Ie?(0,W.jsxs)(u.Row,{gap:8,style:{backgroundColor:k.colours.goldTint,borderRadius:10,padding:8},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Ie,": tap the new table (or drag it there)."]}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Le(null)})]}):null,(0,W.jsx)(o.default,{style:{flex:1,minHeight:Rs?300:Math.min(520,.62*e)},children:(0,W.jsx)(R.FloorCanvas,{plan:$e,areaId:gs,mode:"live",fit:"contain",view:cs,privacy:Ce,sectionColours:!0,turnBase:K.settings.turnMins,highlight:Ie?[Ie]:void 0,onTap:e=>{Ie?(e.name!==Ie&&xs(Ie,e.name),Le(null)):Ae(e.name)},onDrop:(e,s)=>xs(e.name,s.name)})}),(0,W.jsx)(E.Legend,{})]}),Ds((0,W.jsxs)(W.Fragment,{children:[Ps,Ms]}))]}),Is=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsx)(o.default,{style:{flex:1,minHeight:420},children:(0,W.jsx)(M.Timeline,{plan:$e,bookings:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,t0:ms,t1:bs,onOpen:e=>{const s=(0,B.tablesOf)(e.table)[0];s&&cs[s]?Ae(s):Ve(e)}})}),Ds((0,W.jsx)(W.Fragment,{children:Ps}))]}),Ls=(0,W.jsxs)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10,flexGrow:1},scrollEnabled:!_,children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{gap:6},children:[(0,W.jsx)(u.Muted,{children:"Signing off as (who's on):"}),pe.map(e=>(0,W.jsx)(u.Chip,{label:e,selected:xe===e,onPress:()=>be(e)},e))]}),(0,W.jsxs)(o.default,{testID:"forecast-strip",style:{gap:8},children:[(0,W.jsxs)(u.Row,{wrap:!0,gap:8,style:{alignItems:'stretch'},children:[(0,W.jsx)(G,{label:"Next hour"+(Ge.nextHour?` \xb7 ${String(Ge.nextHour.hour).padStart(2,'0')}:00\u2013${String(Ge.nextHour.hour+1).padStart(2,'0')}:00`:''),badge:"Estimate",value:Ge.nextHour?`${Ge.nextHour.coversLow}\u2013${Ge.nextHour.coversHigh} covers`:Ge.open?'Kitchen closing':'Closed',sub:Ge.nextHour?`${Ge.nextHour.booked} booked + ~${Ge.nextHour.walkIns} walk-ins \xb7 ~${Ge.nextHour.takeaway} takeaway (${Ge.nextHour.takeawayPlaced} placed)`:void 0}),(0,W.jsx)(G,{label:"Rest of today",badge:"Estimate",value:Ge.open?`${Ge.restOfDay.low}\u2013${Ge.restOfDay.high} covers`:'\u2014',sub:Ge.open?`${Ge.restOfDay.booked} booked \xb7 ~${Ge.restOfDay.takeaway} takeaway orders \xb7 ${Ye} walk-in covers seated so far`:void 0}),(0,W.jsx)(G,{label:"Waitlist",value:`${Ke.length} part${1===Ke.length?'y':'ies'}`,sub:`${Ke.reduce((e,s)=>e+s.partySize,0)} covers \xb7 next wait ~${(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)} min (est.)`}),(0,W.jsx)(G,{label:"Takeaway slots",value:K.settings.takeawayPaused?'PAUSED':`${Qe.filter(e=>!e.full).length} open`,sub:`Cap ${K.settings.slotCap} per ${K.settings.slotMinutes} min`,children:(0,W.jsxs)(u.Row,{gap:8,children:[(0,W.jsx)(a.default,{accessibilityLabel:"Pause takeaway slots",value:K.settings.takeawayPaused,onValueChange:e=>y.repo.restaurants.updateSettings(q,{takeawayPaused:e}),trackColor:{true:k.colours.redSolid,false:'#444'}}),(0,W.jsx)(u.T,{size:14,children:K.settings.takeawayPaused?'Resume':'Pause'})]})}),(0,W.jsx)(G,{label:"Walk-ins seated (today)",value:`${Ye} covers`,sub:"Use Walk-in above; or quick-count here without a table",children:(0,W.jsx)(u.Row,{gap:6,children:[1,2,4].map(e=>(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`+${e}`,onPress:()=>y.repo.waitlist.addWalkIn(q,e)},e))})})]}),(0,W.jsxs)(u.Row,{wrap:!0,gap:12,style:{backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,alignItems:'flex-end'},children:[(0,W.jsxs)(o.default,{style:{gap:2,flexBasis:340,flexGrow:1},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Forecast \u2014 suggested actions"}),(0,W.jsx)(u.Badge,{kind:"amber",label:"ESTIMATE"})]}),Ge.suggestions.map((e,s)=>(0,W.jsxs)(u.T,{size:14,children:["\u2022 ",e]},s)),(0,W.jsxs)(u.Muted,{children:[Ge.flags.length?`Calendar flags today: ${Ge.flags.join(', ')} \xb7 `:'',"Baseline v1: confirmed bookings + example weekday/hour averages + expected walk-ins (",Math.round(100*K.settings.walkInShare),"% share). ",w.EXAMPLE_ACCURACY,"."]})]}),(0,W.jsx)(u.Row,{gap:4,style:{alignItems:"flex-end"},children:js.map(e=>{const s=Ge.nextHour?.hour===e.hour;return(0,W.jsxs)(o.default,{style:{alignItems:'center',width:30},children:[(0,W.jsx)(u.T,{size:11,colour:k.colours.muted,children:e.covers}),(0,W.jsxs)(o.default,{style:{height:70,width:18,justifyContent:'flex-end',borderBottomWidth:1,borderColor:k.colours.border},children:[(0,W.jsx)(o.default,{style:{height:e.walkIns/ys*70,backgroundColor:s?k.colours.goldLight:'#6B5A3A'}}),(0,W.jsx)(o.default,{style:{height:e.booked/ys*70,backgroundColor:s?k.colours.gold:'#9C7C45'}})]}),(0,W.jsx)(u.T,{size:11,colour:s?k.colours.gold:k.colours.muted,children:e.hour})]},e.hour)})})]})]}),(0,W.jsxs)(o.default,{style:{flexDirection:_?'row':'column',gap:10,flex:_?1:void 0,minHeight:_?380:void 0},children:[ws,(0,W.jsx)(o.default,{style:{flex:1.5,gap:10},children:ks}),Cs,Ss]})]}),zs=(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10},children:(0,W.jsx)(P.FloorEditor,{rid:q,compact:!Rs,maxH:Math.max(300,Y-330)})});return(0,W.jsxs)(i.SafeAreaView,{style:{flex:1,backgroundColor:k.colours.bg},children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{paddingHorizontal:14,paddingVertical:6,gap:10,borderBottomWidth:1,borderBottomColor:k.colours.border},children:[(0,W.jsx)(c.RestaurantBrand,{rid:K.id,size:48,sub:"Display \xb7 Harbour View, Dunure"}),(0,W.jsx)(o.default,{style:{flex:1}}),Ce?(0,W.jsx)(u.Badge,{kind:"gold",label:"\ud83d\udd12 Privacy on"}):(0,W.jsx)(u.Badge,{kind:"amber",label:"Privacy off"}),us?(0,W.jsx)(H.default,{accessibilityRole:"button",accessibilityLabel:"Open alerts",onPress:()=>Re('board'),children:(0,W.jsx)(u.Badge,{kind:"red",label:`${us} alert${us>1?'s':''}`})}):(0,W.jsx)(u.Badge,{kind:"green",label:"All clear"}),(0,W.jsx)(u.T,{size:20,weight:"bold",colour:k.colours.gold,children:(0,f.hm)(oe)}),(0,W.jsx)(u.Muted,{children:(0,f.niceDate)(oe)}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Demo +15 min",onPress:()=>re(15)})]}),(0,W.jsxs)(o.default,{testID:"front-door-bar",style:{flexDirection:'row',gap:12,paddingHorizontal:14,paddingTop:8,paddingBottom:4},children:[(0,W.jsx)(u.Button,{label:"Walk-in",onPress:Te.openWalkIn,testID:"add-walkin",style:{flex:1,minHeight:72,borderRadius:18}}),(0,W.jsx)(u.Button,{label:"New booking",onPress:Te.openBooking,testID:"add-booking",style:{flex:1,minHeight:72,borderRadius:18}})]}),(0,W.jsxs)(u.Row,{style:{paddingHorizontal:14,paddingVertical:4,gap:6},children:[O.map(e=>{const s=Se===e.id;return(0,W.jsx)(H.default,{testID:`view-${e.id}`,accessibilityRole:"tab",accessibilityLabel:e.label,accessibilityState:{selected:s},onPress:()=>Re(e.id),style:{minHeight:48,paddingHorizontal:18,justifyContent:'center',borderRadius:12,borderBottomWidth:3,borderBottomColor:s?k.colours.gold:'transparent',backgroundColor:s?k.colours.goldTint:'transparent'},children:(0,W.jsx)(u.T,{weight:"semibold",colour:s?k.colours.goldLight:k.colours.muted,children:e.label})},e.id)}),(0,W.jsx)(o.default,{style:{flex:1}}),(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`})]}),'floor'===Se||'timeline'===Se?Rs?'floor'===Se?As:Is:(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{flexGrow:1},children:'floor'===Se?As:Is}):'plan'===Se?zs:Ls,Te.elements,De?(0,W.jsx)(E.TableSheet,{rid:q,name:De,view:cs,plan:$e,todays:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,onClose:()=>Ae(null),onWalkIn:e=>Te.openWalkInAt(e),onMove:e=>Le(e),onDetails:Ve}):null,ze?(0,W.jsx)(E.DetailsPanel,{title:ze.title,onClose:()=>Ee(null),children:ze.body}):null,He?(0,W.jsx)(E.ServiceSummary,{r:K,todays:Ue,orders:X,waitlistAll:Q,walkInCount:te,onClose:()=>Ne(!1)}):null,We?(0,W.jsx)(o.default,{testID:"floor-toast",pointerEvents:"none",style:{position:'absolute',left:0,right:0,bottom:24,alignItems:'center',zIndex:900},children:(0,W.jsx)(o.default,{style:{backgroundColor:k.colours.surface2,borderColor:k.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:10,paddingHorizontal:16,maxWidth:640},children:(0,W.jsx)(u.T,{weight:"semibold",children:We})})}):null,(0,W.jsx)(D.Screensaver,{rid:q,idleMins:ve.idleMins,pinOn:ve.pinOn,pin:ve.pin,tonightCards:ve.tonightCards})]})};var s=_r(d[0]),l=e(s),t=e(_r(d[1])),a=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),n=e(_r(d[5])),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),m=_r(d[11]),b=_r(d[12]),x=_r(d[13]),f=_r(d[14]),j=_r(d[15]),y=_r(d[16]),w=_r(d[17]),k=_r(d[18]),T=_r(d[19]),v=_r(d[20]),C=_r(d[21]),$=_r(d[22]),B=_r(d[23]),S=_r(d[24]),R=_r(d[25]),P=_r(d[26]),M=_r(d[27]),D=_r(d[28]),A=_r(d[29]),I=_r(d[30]),L=_r(d[31]),z=_r(d[32]),E=_r(d[33]),H=e(_r(d[34])),N=_r(d[35]),W=_r(d[36]);const O=[{id:'floor',label:'Floor'},{id:'timeline',label:'Timeline'},{id:'board',label:'Board'},{id:'plan',label:'Edit plan'}],F=e=>(e??'').replace(' (example)','');function V({title:e,right:s,children:l,flex:a=1}){return(0,W.jsxs)(o.default,{style:{flex:a,backgroundColor:k.colours.surface,borderRadius:14,borderWidth:1,borderColor:k.colours.border,overflow:'hidden',minHeight:200},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:k.colours.border,backgroundColor:k.colours.surface2},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:e}),s]}),(0,W.jsx)(t.default,{contentContainerStyle:{padding:10,gap:10},children:l})]})}function G({label:e,value:s,sub:l,badge:t,children:a}){return(0,W.jsxs)(o.default,{style:{flex:1,minWidth:170,backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,gap:2},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,weight:"medium",children:e}),t?(0,W.jsx)(u.Badge,{kind:"amber",label:t}):null]}),(0,W.jsx)(u.T,{size:24,weight:"bold",colour:k.colours.text,children:s}),l?(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,children:l}):null,a]})}const U=e=>'new'===e?'red':'ready'===e?'green':'preparing'===e?'amber':'served'===e?'blue':'neutral'},846,[12,133,253,255,109,269,271,790,855,791,842,793,856,794,795,843,796,857,797,802,858,847,859,860,848,849,850,851,853,852,792,861,862,854,245,863,6]);
|
| 3 |
+
__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,"TABLES",{enumerable:!0,get:function(){return x}}),_e.useTableNames=p,_e.resetTableLive=j,_e.useTableUse=k,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return w}}),_e.TablePicker=C,_e.WalkInSheet=S,_e.AssignTableSheet=v,_e.UndoToast=I,_e.NewBookingSheet=P,_e.useFrontDoor=function(e,s){const[l,o]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1),[a,r]=(0,t.useState)(null),[d,u]=(0,t.useState)(null),c=(0,y.jsxs)(y.Fragment,{children:[l?(0,y.jsx)(S,{wide:s,initialTable:l.table,onClose:()=>o(!1),onSeated:r}):null,n?(0,y.jsx)(P,{wide:s,date:e,onClose:()=>i(!1)}):null,d?(0,y.jsx)(v,{booking:d,onClose:()=>u(null)}):null,a?(0,y.jsx)(I,{booking:a,onDone:()=>r(null)}):null]});return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>i(!0),assignTable:u,elements:c}};var t=_r(_d[0]),s=e(t);_r(_d[1]);var l=e(_r(_d[2])),o=e(_r(_d[3])),n=e(_r(_d[4])),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=_r(_d[11]),h=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]);const x=Array.from({length:12},(e,t)=>String(t+1));function p(e){const t=(0,f.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function j(e,t){(0,f.tablesOf)(t).forEach(t=>f.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function k(e,t){const s=(0,r.useBookings)(e),l=(0,r.useOrders)(e),o=p(e),n=(0,f.useFloor)(t=>t.live[e])??{},i=(0,c.ymd)(t),a={};for(const e of o)a[e]=n[e]?.blocked?{busy:!0,label:'Blocked'}:n[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===i&&e.table)for(const s of(0,f.tablesOf)(e.table))if(a[s])if('seated'===e.status)a[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!a[s].busy){const l=(0,c.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));l>=-15&&l<=90&&(a[s]={...a[s],soon:`Booked ${e.time}`})}for(const e of l)'table'===e.type&&e.tableNo&&a[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!a[e.tableNo].busy&&(a[e.tableNo]={busy:!0,label:'Open order'});return a}const w=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function C({use:e,value:t,onPick:s,big:o,best:i}){const a=Object.keys(e);return(0,y.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"table-picker",children:a.map(a=>{const r=e[a],d=t===a,u=!!i&&(0,f.tablesOf)(i)[0]===a&&!d;return(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Table ${a}, ${r.busy?`in use (${r.label})`:r.soon?`free, ${r.soon}`:'free'}`,accessibilityState:{selected:d},onPress:()=>s(a),style:{width:o?92:64,minHeight:56,borderRadius:12,borderWidth:d?2.5:1.5,padding:6,alignItems:'center',justifyContent:'center',borderColor:d?b.colours.gold:r.busy?b.colours.red:b.colours.green,backgroundColor:d?b.colours.goldTint:r.busy?b.colours.redBg:b.colours.surface2},children:[(0,y.jsx)(h.T,{weight:"bold",size:18,colour:d?b.colours.goldLight:b.colours.text,children:a}),(0,y.jsx)(h.T,{size:11,colour:r.busy?'#FFD9D4':r.soon?'#FFE2A8':'#CFF3D7',center:!0,children:r.busy?'Blocked'===r.label||'Needs clearing'===r.label?r.label:'In use':r.soon??'Free'}),u?(0,y.jsx)(n.default,{testID:"best-table",style:{position:'absolute',top:-8,right:-6,backgroundColor:b.colours.gold,borderRadius:8,paddingHorizontal:5},children:(0,y.jsx)(h.T,{size:10,weight:"bold",colour:b.colours.onGold,children:"BEST"})}):null]},a)})})}const T=[1,2,3,4,5,6,7,8];function S({onClose:e,onSeated:d,wide:x,initialTable:p}){const{rid:w,r:S,now:v}=(0,a.useCtx)(15e3),I=k(w,v),[P,$]=(0,t.useState)(2),[D,F]=(0,t.useState)(!1),[R,W]=(0,t.useState)(p??null),B=(0,f.usePlan)(w),z=(0,r.useBookings)(w),M=s.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,u.suggestTable)(B,z.filter(e=>e.date===(0,c.ymd)(v)),e,P,v,(0,u.turnFor)(P,S.settings.turnMins))?.table??null},[B,z,I,P,v.getTime()]),[N,O]=(0,t.useState)(!1),[A,L]=(0,t.useState)(''),E=(e,t=String(e),s=()=>{F(!1),$(e)})=>{const o='9+'===t?D:!D&&P===e;return(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:x?64:60,height:x?64:56,borderRadius:14,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?b.colours.gold:'transparent'},children:(0,y.jsx)(h.T,{weight:"bold",size:22,colour:o?b.colours.onGold:b.colours.gold,children:t})},t)},_=(0,y.jsxs)(h.Row,{gap:12,style:{justifyContent:'center'},children:[(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One fewer",onPress:()=>$(e=>Math.max(9,e-1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"\u2212"})}),(0,y.jsx)(h.T,{weight:"bold",size:26,children:P}),(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One more",onPress:()=>$(e=>Math.min(40,e+1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"+"})})]}),H=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1:void 0},children:[(0,y.jsx)(h.T,{weight:"semibold",children:"How many people?"}),(0,y.jsxs)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[T.map(e=>E(e)),E(9,'9+',()=>{F(!0),$(e=>e>=9?e:9)})]}),D?_:null]}),U=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1.3:void 0},children:[(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",children:["Table ",(0,y.jsx)(h.T,{colour:b.colours.muted,size:14,children:"(optional)"})]}),R?(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>W(null)}):null]}),(0,y.jsx)(C,{use:I,value:R,onPick:e=>W(R===e?null:e),big:x,best:M}),M&&!R?(0,y.jsxs)(h.Muted,{children:["Best fit for ",P,": Table ",M," (smallest free table, fewest clashes)."]}):null,'staff'!==i.APP_VARIANT?(0,y.jsx)(h.Muted,{children:"Using Wix Tables too? Also mark the table there; this prototype doesn't connect to it."}):null]});return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,c.hm)(v)}`,maxWidth:x?900:void 0,testID:"walkin-sheet",children:[(0,y.jsx)(h.Button,{label:`Seat walk-in \xb7 ${P} ${1===P?'person':'people'}${R?` \xb7 Table ${R}`:''}`,onPress:async()=>{const t=await r.repo.bookings.seatWalkIn(w,P,R??void 0,A);j(w,R??void 0),d(t),e()},testID:"seat-walkin",style:{minHeight:56}}),x?(0,y.jsxs)(h.Row,{gap:16,style:{alignItems:'flex-start'},children:[H,U]}):(0,y.jsxs)(y.Fragment,{children:[H,U]}),N?(0,y.jsx)(o.default,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:A,onChangeText:L,style:h.styles.input,autoFocus:!0}):(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"+ Add a note (optional)",onPress:()=>O(!0)}),(0,y.jsx)(h.Muted,{children:"No name needed. Seated now; counts in today's covers and the forecast."})]})}function v({booking:e,onClose:t}){const{rid:s,now:l}=(0,a.useCtx)(15e3),o=k(s,l);return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:t,title:`Assign table \xb7 ${w(e)}`,testID:"assign-table-sheet",children:[(0,y.jsx)(C,{use:o,onPick:async l=>{await r.repo.bookings.assignTable(e.id,l),j(s,l),t()}}),(0,y.jsx)(h.Muted,{children:"Red tables are in use right now; you can still pick one (e.g. joining a table)."})]})}function I({booking:e,onDone:s}){return(0,t.useEffect)(()=>{const e=setTimeout(s,6e3);return()=>clearTimeout(e)},[e.id]),(0,y.jsx)(n.default,{testID:"walkin-toast",style:{position:'fixed',left:12,right:12,bottom:92,zIndex:1e3,alignItems:'center'},pointerEvents:"box-none",children:(0,y.jsxs)(h.Row,{gap:10,style:{backgroundColor:b.colours.surface2,borderColor:b.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:8,paddingLeft:14,paddingRight:8,maxWidth:520,width:'100%',justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",style:{flex:1},children:[w(e)," seated \xb7 ",e.table?`Table ${e.table}`:'table to assign'," (",e.ref,")"]}),(0,y.jsx)(h.Button,{kind:"secondary",label:"Undo",onPress:()=>{r.repo.bookings.undoWalkIn(e.id),s()},testID:"undo-walkin"})]})})}function P({date:e,onClose:s,wide:l}){const{rid:o,r:n,now:i}=(0,a.useCtx)(6e4),u=(0,r.useBookings)(o),[b,f]=(0,t.useState)(''),[x,p]=(0,t.useState)(2),[j,k]=(0,t.useState)(null),[w,C]=(0,t.useState)(''),T=(0,c.parseYmd)(e),S=(0,d.bookingSlots)(n,T,t=>u.filter(s=>s.date===e&&s.time===t&&'cancelled'!==s.status&&!s.walkIn).reduce((e,t)=>e+t.partySize,0),x,e===(0,c.ymd)(i)?i:(0,c.addMins)(T,0));return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:s,title:`New booking \xb7 ${(0,c.niceDate)(T)}`,maxWidth:l?760:void 0,testID:"booking-sheet",children:[(0,y.jsx)(h.Field,{label:"Name",value:b,onChangeText:f,placeholder:"e.g. Reid"}),(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(h.T,{children:"Party size"}),(0,y.jsx)(h.Stepper,{value:x,onChange:p,min:1,max:20,label:"party size"})]}),(0,y.jsx)(h.Row,{wrap:!0,gap:6,children:S.map(e=>(0,y.jsx)(h.Chip,{label:e.time,sub:`${e.left} left`,disabled:!e.available,selected:j===e.time,onPress:()=>k(e.time)},e.time))}),S.length?null:(0,y.jsx)(h.Muted,{children:"Closed on this day (per listed hours)."}),(0,y.jsx)(h.Field,{label:"Notes",value:w,onChangeText:C,placeholder:"e.g. high chair, window table"}),x>=n.settings.savedCardFromParty?(0,y.jsxs)(h.Muted,{children:["Parties of ",n.settings.savedCardFromParty,"+ need a saved card; the customer gets a link (demo, nothing is sent)."]}):null,(0,y.jsx)(h.Button,{label:"Save booking",disabled:b.trim().length<2||!j,onPress:()=>{r.repo.bookings.create({restaurantId:o,customerId:null,name:b.trim(),partySize:x,date:e,time:j,allergies:[],notes:w.trim(),security:x>=n.settings.savedCardFromParty?'saved-card':'none',depositPaid:0}),s()}})]})}},847,[12,104,245,255,109,787,859,796,794,848,795,797,790,860,6]);
|
| 4 |
+
__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STATUS",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"STAGES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"turnFor",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"startOf",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"durOf",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"endOf",{enumerable:!0,get:function(){return o}}),e.clashes=function(a,s=90){const n=new Set,i=a.filter(t=>d(t)&&t.table);for(let a=0;a<i.length;a++)for(let d=a+1;d<i.length;d++){const c=i[a],u=i[d];(0,t.tablesOf)(c.table).some(a=>(0,t.tablesOf)(u.table).includes(a))&&(l(c)<o(u,s)&&l(u)<o(c,s)&&(n.add(c.id),n.add(u.id)))}return n},e.floorView=function(a,s,n,i,d,u=90){const h={},y=s.filter(t=>t.date===b(d));for(const s of a.tables){const a=i[s.name]??{},b=y.filter(a=>(0,t.tablesOf)(a.table).includes(s.name)),F=b.find(t=>'seated'===t.status),p=b.filter(t=>'confirmed'===t.status).sort((t,a)=>t.time.localeCompare(a.time)).find(t=>f(d,t)>=-20),O=p?Math.round(f(d,p)):void 0,S=n.find(t=>'table'===t.type&&t.tableNo===s.name&&!['closed','cancelled','collected'].includes(t.status));let v='free';a.blocked?v='blocked':F?v=a.stage??'seated':a.dirty?v='dirty':S?v=a.stage??'seated':p&&void 0!==O&&O<=45&&(v='soon');const A=F,T=A?.tags?.find(t=>'VIP'===t)??A?.tags?.find(t=>'Regular'===t)??(A?void 0:p?.tags?.[0]);h[s.name]={table:s,status:v,booking:A,next:p,nextIn:O,covers:A?.partySize??0,orderOnly:!A&&!!S,note:a.note,seatedMins:A?Math.max(0,Math.round((d.getTime()-l(A).getTime())/6e4)):void 0,freeAt:A?o(A,u):void 0,allergy:!!(A?.allergies.length||!A&&p?.allergies.length||S?.allergies.length),vip:T,occasion:A?.occasion??(A?void 0:p?.occasion??c(p?.notes))??c(A?.notes)}}return h},Object.defineProperty(e,"OCCASION_ICON",{enumerable:!0,get:function(){return u}}),e.suggestTable=function(a,s,n,i,c,u,f=90,b){const h=[...a.tables.map(t=>({name:t.name,seats:t.maxSeats,min:t.minSeats,parts:[t.name]})),...a.joins.map(t=>{const s=a.tables.filter(a=>t.tables.includes(a.name));return{name:t.tables.join('+'),seats:s.reduce((t,a)=>t+a.maxSeats,0),min:s.reduce((t,a)=>t+a.minSeats,0),parts:t.tables}})],y=c.getTime()+6e4*u;let F=null;for(const a of h){if(a.seats<i)continue;if(n&&a.parts.some(t=>['blocked'].includes(n[t]?.status)))continue;const u=!!n&&a.parts.some(t=>['seated','mains','dessert','bill','dirty'].includes(n[t]?.status)),h=s.filter(s=>s.id!==b&&d(s)&&(0,t.tablesOf)(s.table).some(t=>a.parts.includes(t))&&l(s).getTime()<y&&o(s,f).getTime()>c.getTime()).length,p=(u?1e3:0)+100*h+10*(a.seats-i)+(i<a.min?5:0)+15*(a.parts.length-1);(!F||p<F.score)&&(F={table:a.name,seats:a.seats,clashes:h+(u?1:0),score:p,why:`${a.seats} seats${h||u?`, ${h+(u?1:0)} clash`:', no clashes'}`})}return F?{table:F.table,seats:F.seats,clashes:F.clashes,why:F.why}:null};var t=r(_d[0]);const a={free:{label:'Free',colour:'#2F7D45',fg:'#E7FBEA'},soon:{label:'Reserved soon',colour:'#3C78B5',fg:'#EAF4FF'},seated:{label:'Seated',colour:'#CFA45F',fg:'#0B0B0B'},mains:{label:'Mains',colour:'#E08A2E',fg:'#0B0B0B'},dessert:{label:'Dessert',colour:'#A77BD0',fg:'#0B0B0B'},bill:{label:'Bill requested',colour:'#D9473A',fg:'#FFFFFF'},dirty:{label:'Needs clearing',colour:'#7A6F5E',fg:'#FFFFFF'},blocked:{label:'Blocked',colour:'#3A3A3A',fg:'#CFCFCF'}},s=['seated','mains','dessert','bill'],n=(t,a=90)=>Math.min(a+60,a+15*Math.max(0,Math.ceil((t-2)/2))),l=t=>'seated'===t.status&&t.seatedAt?new Date(t.seatedAt):new Date(`${t.date}T${t.time}:00`),i=(t,a=90)=>t.durationMins??n(t.partySize,a),o=(t,a=90)=>new Date(l(t).getTime()+6e4*i(t,a)),d=t=>!['cancelled','noshow','finished'].includes(t.status);const c=t=>t?/birthday/i.test(t)?'birthday':/anniversary/i.test(t)?'anniversary':void 0:void 0,u={birthday:'\ud83c\udf82',anniversary:'\ud83d\udc8d',celebration:'\ud83e\udd42'},f=(t,a)=>(new Date(`${a.date}T${a.time}:00`).getTime()-t.getTime())/6e4,b=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},848,[860]);
|
| 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,"snap",{enumerable:!0,get:function(){return c}}),_e.FloorCanvas=function(e){const[x,f]=(0,t.useState)({w:0,h:0}),g=x.w?'width'===e.fit?Math.min(x.w/i.PLAN_W,e.maxH?e.maxH/i.PLAN_H:9):Math.min(x.w/i.PLAN_W,x.h/i.PLAN_H):0,v=e.plan.tables.filter(t=>t.areaId===e.areaId),[y,w]=(0,t.useState)(null),M=(0,t.useRef)(null),j=t=>e.plan.sections.find(e=>e.id===t.sectionId),R=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),C=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{M.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const i=M.current;if(!i)return;const s=n.nativeEvent.pageX-i.x,a=n.nativeEvent.pageY-i.y;Math.abs(s)+Math.abs(a)<6&&!y||('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&w({id:t.id,dx:s,dy:a,kind:o})},onResponderRelease:n=>{const s=M.current;M.current=null;const a=n.nativeEvent.pageX-(s?.x??0),l=n.nativeEvent.pageY-(s?.y??0);if(w(null),Math.abs(a)+Math.abs(l)<6||!g)return void('move'===o&&e.onTap?.(t));const u=a/g,h=l/g;if('edit'===e.mode&&'move'===o)e.onMove?.(t,b(c(t.x+u,e.snapOn),0,i.PLAN_W-t.w),b(c(t.y+h,e.snapOn),0,i.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,b(c(t.w+u,e.snapOn),50,400),b(c(t.h+h,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+u,n=t.y+t.h/2+h,i=v.find(e=>e.id!==t.id&&o>=e.x-10&&o<=e.x+e.w+10&&n>=e.y-10&&n<=e.y+e.h+10);i&&e.onDrop(t,i)}}}),I=e=>e*g,k='width'===e.fit?i.PLAN_H*g||200:void 0;return(0,u.jsx)(n.default,{testID:"floor-canvas",onLayout:e=>f({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:k}],children:g?(0,u.jsxs)(n.default,{style:{width:I(i.PLAN_W),height:I(i.PLAN_H),alignSelf:'center',backgroundColor:'#0F0E0C',borderRadius:16,borderWidth:1,borderColor:a.colours.border,overflow:'hidden'},children:['edit'===e.mode?Array.from({length:i.PLAN_W/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',left:I(t*i.GRID*2),top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},`v${t}`)):null,'edit'===e.mode?Array.from({length:i.PLAN_H/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',top:I(t*i.GRID*2),left:0,right:0,height:1,backgroundColor:'#1E1B16'}},`h${t}`)):null,e.plan.joins.map(e=>{const t=v.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,i]=t,s=o.x+o.w/2,a=o.y+o.h/2,l=i.x+i.w/2,h=i.y+i.h/2,c=Math.hypot(l-s,h-a),b=Math.atan2(h-a,l-s);return(0,u.jsx)(n.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:I((s+l)/2-c/2),top:I((a+h)/2)-3,width:I(c),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${b}rad`}]}},e.id)}),v.map(t=>{const i=e.view?.[t.name],c=i?s.STATUS[i.status]:null,b=y?.id===t.id,x=b&&'resize'===y.kind?Math.max(50,t.w+y.dx/g):t.w,f=b&&'resize'===y.kind?Math.max(50,t.h+y.dy/g):t.h,v=b&&'move'===y.kind?t.x+y.dx/g:t.x,w=b&&'move'===y.kind?t.y+y.dy/g:t.y,M=e.selected===t.id||e.highlight?.includes(t.name),k=j(t),z='edit'===e.mode?'#2A2419':c.colour,$='edit'===e.mode?a.colours.text:c.fg,A='round'===t.shape||'stool'===t.shape?I(Math.min(x,f)/2):I('booth'===t.shape?22:12),S=I(Math.min(x,f))<64,T=Math.max(11,Math.min(22,I(Math.min(x,f))/4)),_='edit'===e.mode?`Table ${t.name}, ${t.shape}, ${t.minSeats}\u2013${t.maxSeats} seats${t.online?', bookable online':''}`:`Table ${t.name}, ${c.label}${void 0!==i?.seatedMins?`, seated ${i.seatedMins} min`:''}${i?.covers?`, ${i.covers} covers`:''}${void 0!==i?.nextIn&&'seated'!==i.status?`, next booking ${i.next?.time}`:''}`,E=void 0!==i?.seatedMins&&i.booking?Math.min(1.2,i.seatedMins/(i.booking.durationMins??(0,s.turnFor)(i.booking.partySize,e.turnBase))):null;return(0,u.jsxs)(o.default.Fragment,{children:[p({...t,w:x,h:f}).map((t,o)=>(0,u.jsx)(n.default,{pointerEvents:"none",style:[{position:'absolute',left:I(v+t.x)-Math.max(4,I(8)),top:I(w+t.y)-Math.max(4,I(8)),width:Math.max(8,I(16)),height:Math.max(8,I(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?a.colours.gold:'rgba(255,255,255,0.25)'},h()]},o)),(0,u.jsxs)(n.default,{testID:`table-${t.name}`,accessibilityRole:"button",accessibilityLabel:_,...C(t,'move'),style:[{position:'absolute',left:I(v),top:I(w),width:I(x),height:I(f),borderRadius:A,backgroundColor:z,alignItems:'center',justifyContent:'center',padding:2,borderWidth:M?3:e.sectionColours&&k?2.5:1.5,borderColor:M?'#FFFFFF':e.sectionColours&&k?k.colour:'edit'===e.mode?a.colours.gold:'rgba(0,0,0,0.35)',borderTopWidth:'booth'===t.shape?I(18):void 0,transform:[{rotate:`${t.rot}deg`},{scale:b?1.06:1}],zIndex:b?50:1,opacity:b&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:b?.6:.3,shadowRadius:b?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},b?null:h()],children:[(0,u.jsxs)(n.default,{style:{alignItems:'center',transform:[{rotate:-t.rot+"deg"}]},pointerEvents:"none",children:[(0,u.jsx)(l.T,{weight:"bold",size:T,colour:$,center:!0,children:t.name}),'edit'===e.mode?S?null:(0,u.jsxs)(l.T,{size:11,colour:a.colours.muted,center:!0,children:[t.minSeats,"\u2013",t.maxSeats,t.online?' \xb7 online':'']}):i?(0,u.jsxs)(u.Fragment,{children:['free'!==i.status||S?null:(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[t.minSeats,"\u2013",t.maxSeats," seats"]}),void 0!==i.seatedMins?(0,u.jsxs)(l.T,{size:12,weight:"semibold",colour:$,center:!0,children:[i.seatedMins,"m \xb7 ",i.covers,"\ud83d\udc65"]}):i.orderOnly?(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Open order"}):null,'soon'===i.status&&i.next?(0,u.jsxs)(l.T,{size:11,weight:"semibold",colour:$,center:!0,children:[i.next.time," \xb7 ",i.nextIn<=0?'due':`${i.nextIn}m`]}):null,'dirty'!==i.status||S?null:(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Clear"}),!S||i.allergy||i.vip?(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[i.allergy?'\u26a0':'',i.vip?'VIP'===i.vip?'\u2605':'\u2665':'',i.occasion?s.OCCASION_ICON[i.occasion]:'',i.note?'\u270e':'']}):null]}):null]}),k&&'live'===e.mode&&e.sectionColours&&!S?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:k.colour,borderRadius:6,paddingHorizontal:3},children:(0,u.jsx)(l.T,{size:9,weight:"bold",colour:"#0B0B0B",children:k.server})}):null,null===E||S?null:(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',left:'15%',right:'15%',bottom:5,height:4,borderRadius:2,backgroundColor:'rgba(0,0,0,0.25)'},children:(0,u.jsx)(n.default,{style:{width:`${Math.min(100,100*E)}%`,height:4,borderRadius:2,backgroundColor:E>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),R(t)&&'edit'===e.mode?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,u.jsx)(l.T,{size:10,colour:a.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===t.id?(0,u.jsx)(n.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...C(t,'resize'),style:{position:'absolute',left:I(v+x)-14,top:I(w+f)-14,width:28,height:28,borderRadius:14,backgroundColor:a.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},t.id)}),0===v.length?(0,u.jsx)(n.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,u.jsxs)(l.T,{center:!0,colour:a.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 tap + Table':'',"."]})}):null]}):null})};var t=r(d[0]),o=e(t);r(d[1]);var n=e(r(d[2])),i=r(d[3]),s=r(d[4]),a=r(d[5]),l=r(d[6]),u=r(d[7]);const h=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),c=(e,t=!0)=>t?Math.round(e/i.GRID)*i.GRID:Math.round(e),b=(e,t,o)=>Math.max(t,Math.min(o,e));function p(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape||'stool'===e.shape){for(let n=0;n<t;n++){const i=2*Math.PI*n/t-Math.PI/2;o.push({x:e.w/2+Math.cos(i)*(e.w/2+11.2),y:e.h/2+Math.sin(i)*(e.h/2+11.2)})}return'stool'===e.shape?[]:o}if('booth'===e.shape){for(let n=0;n<t;n++)o.push({x:e.w*(n+.5)/t,y:e.h+9.6});return o}if('square'===e.shape&&t<=4){return[{x:e.w/2,y:-9.6},{x:e.w/2,y:e.h+9.6},{x:-9.6,y:e.h/2},{x:e.w+9.6,y:e.h/2}].slice(0,t)}const n=Math.ceil(t/2),i=t-n;for(let t=0;t<n;t++)o.push({x:e.w*(t+.5)/n,y:-9.6});for(let t=0;t<i;t++)o.push({x:e.w*(t+.5)/i,y:e.h+9.6});return o}},849,[12,104,109,860,848,797,790,6]);
|
| 6 |
+
__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.AreaTabs=p,_e.FloorEditor=function({rid:e,compact:s,maxH:j}){const f=(0,o.usePlan)(e),y=o.useFloor.getState,w=a=>y().setPlan(e,a),[k,S]=(0,a.useState)(f.areas[0]?.id??''),[T,R]=(0,a.useState)(null),[C,P]=(0,a.useState)(!0),[I,D]=(0,a.useState)(!1),[v,B]=(0,a.useState)(null),[z,M]=(0,a.useState)(''),[$,A]=(0,a.useState)(''),L=f.areas.some(e=>e.id===k)?k:f.areas[0]?.id??'',W=f.tables.find(e=>e.id===T)??null,_=a=>W&&y().updateTable(e,W.id,a),H=()=>{let e=1;const a=new Set(f.tables.map(e=>e.name));for(;a.has(String(e));)e++;return String(e)},F=(e,a)=>{for(let s=50;s+a<=o.PLAN_H;s+=50)for(let l=50;l+e<=o.PLAN_W;l+=50)if(!f.tables.some(t=>t.areaId===L&&l<t.x+t.w+25&&t.x<l+e+25&&s<t.y+t.h+25&&t.y<s+a+25))return{x:l,y:s};return{x:50,y:50}},N=e=>{if(!W||e.id===W.id)return;const a=f.joins.filter(a=>!a.tables.includes(W.name)&&!a.tables.includes(e.name)),s=Array.from(new Set([...f.joins.find(e=>e.tables.includes(W.name))?.tables??[W.name],...f.joins.find(a=>a.tables.includes(e.name))?.tables??[e.name]]));w({...f,joins:[...a,{id:(0,o.fid)('j'),tables:s}]}),D(!1),A(`Joined ${s.join('+')} \u2014 book it as one table.`)},V=W?f.joins.find(e=>e.tables.includes(W.name)):void 0,E=W&&f.tables.some(e=>e.id!==W.id&&e.name===W.name),q=W?(0,h.jsxs)(n.default,{testID:"table-tools",style:{gap:10,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(u.T,{weight:"semibold",colour:c.colours.gold,children:["Table ",W.name]}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Done",onPress:()=>R(null)})]}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Name / no."}),(0,h.jsx)(t.default,{accessibilityLabel:"Table name",value:W.name,onChangeText:e=>_({name:e.replace(/[^A-Za-z0-9-]/g,'').slice(0,6)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}),E?(0,h.jsx)(u.T,{size:13,colour:c.colours.red,children:"Another table already uses this number."}):null,(0,h.jsx)(u.Row,{wrap:!0,gap:6,children:o.SHAPES.map(e=>(0,h.jsx)(u.Chip,{label:e.label,selected:W.shape===e.id,onPress:()=>_({shape:e.id,w:x[e.id][0],h:x[e.id][1],...'stool'===e.id?{minSeats:1,maxSeats:1}:{}})},e.id))}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Min seats"}),(0,h.jsx)(u.Stepper,{value:W.minSeats,onChange:e=>_({minSeats:e,maxSeats:Math.max(e,W.maxSeats)}),min:1,max:20,label:"min seats"})]}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Max seats"}),(0,h.jsx)(u.Stepper,{value:W.maxSeats,onChange:e=>_({maxSeats:e,minSeats:Math.min(e,W.minSeats)}),min:1,max:24,label:"max seats"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f2 15\xb0",accessibilityLabel:"Rotate left",onPress:()=>_({rot:(W.rot-15+360)%360})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f3 15\xb0",accessibilityLabel:"Rotate right",onPress:()=>_({rot:(W.rot+15)%360}),testID:"rotate-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Bigger",onPress:()=>_({w:Math.min(400,W.w+25),h:Math.min(300,W.h+25)})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Smaller",onPress:()=>_({w:Math.max(50,W.w-25),h:Math.max(50,W.h-25)})})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Area"}),f.areas.map(e=>(0,h.jsx)(u.Chip,{label:e.name,selected:W.areaId===e.id,onPress:()=>{_({areaId:e.id}),S(e.id)}},e.id))]}),f.sections.length?(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Server section"}),f.sections.map(e=>(0,h.jsx)(u.Chip,{label:`${e.name} (${e.server})`,selected:W.sectionId===e.id,onPress:()=>_({sectionId:e.id})},e.id))]}):null,(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(n.default,{style:{flex:1},children:[(0,h.jsx)(u.T,{size:14,children:"Bookable online"}),(0,h.jsx)(u.Muted,{children:"For a later Wix Tables / booking-page mapping. Nothing is synced now."})]}),(0,h.jsx)(l.default,{accessibilityLabel:"Bookable online",value:W.online,onValueChange:e=>{_({online:e})},trackColor:{true:c.colours.gold,false:'#444'}})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,label:"Duplicate",onPress:()=>{if(!W)return;const a=F(W.w,W.h),s={...W,id:(0,o.fid)('t'),name:H(),x:a.x,y:a.y};y().addTable(e,s),R(s.id),A(`Duplicated as Table ${s.name}.`)},testID:"dup-table"}),V?(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:`Split ${V.tables.join('+')}`,onPress:()=>{w({...f,joins:f.joins.filter(e=>e.id!==V.id)}),A('Split back into separate tables.')},testID:"split-table"}):(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:I?'Tap a table to join\u2026':'Join with\u2026',onPress:()=>D(!I),testID:"join-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"danger",label:"Delete",onPress:()=>B({kind:'table'}),testID:"delete-table"})]})]}):null,O=(0,h.jsx)(b.FloorCanvas,{plan:f,areaId:L,mode:"edit",fit:"width",maxH:j,selected:T,snapOn:C,highlight:V?.tables,onTap:e=>{I?N(e):R(e.id===T?null:e.id)},onMove:(a,s,l)=>y().updateTable(e,a.id,{x:s,y:l}),onResize:(a,s,l)=>y().updateTable(e,a.id,{w:s,h:l})}),G=f.areas.find(e=>e.id===L),J=Object.fromEntries(f.areas.map(e=>[e.id,String(f.tables.filter(a=>a.areaId===e.id).length)]));return(0,h.jsxs)(n.default,{style:{gap:10},testID:"floor-editor",children:[(0,h.jsx)(p,{plan:f,area:L,onPick:e=>{S(e),R(null)},counts:J}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{label:"+ Table",onPress:()=>{const[a,s]=x.square,l=F(a,s),t={id:(0,o.fid)('t'),name:H(),areaId:L,shape:'square',minSeats:2,maxSeats:4,x:l.x,y:l.y,w:a,h:s,rot:0,online:!0,sectionId:f.sections[0]?.id};y().addTable(e,t),R(t.id),A(`Table ${t.name} added \u2014 drag it into place.`)},testID:"add-table",style:{minWidth:110}}),(0,h.jsxs)(u.Row,{gap:6,style:{paddingHorizontal:6},children:[(0,h.jsx)(l.default,{accessibilityLabel:"Snap to grid",value:C,onValueChange:P,trackColor:{true:c.colours.gold,false:'#444'}}),(0,h.jsx)(u.T,{size:14,children:"Snap to grid"})]})]}),$?(0,h.jsx)(u.T,{size:13,colour:c.colours.goldLight,children:$}):null,s?(0,h.jsxs)(h.Fragment,{children:[O,q]}):(0,h.jsxs)(u.Row,{gap:12,style:{alignItems:'flex-start'},children:[(0,h.jsx)(n.default,{style:{flex:1},children:O}),q?(0,h.jsx)(n.default,{style:{width:320},children:q}):null]}),W?null:(0,h.jsx)(u.Muted,{children:"Tap a table to edit it; drag to move (snaps to the grid); drag the gold dot to resize."}),(0,h.jsxs)(n.default,{style:{gap:6,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsx)(u.T,{weight:"semibold",colour:c.colours.gold,children:"Areas"}),G?(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Rename"}),(0,h.jsx)(t.default,{accessibilityLabel:"Area name",value:G.name,onChangeText:e=>w({...f,areas:f.areas.map(a=>a.id===G.id?{...a,name:e.slice(0,24)}:a)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}):null,(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(t.default,{accessibilityLabel:"New area name",placeholder:"New area, e.g. Function room",placeholderTextColor:"#7D776C",value:z,onChangeText:M,style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]}),(0,h.jsx)(u.Button,{small:!0,label:"+ Area",disabled:z.trim().length<2,onPress:()=>{const e={id:(0,o.fid)('a'),name:z.trim()};w({...f,areas:[...f.areas,e]}),S(e.id),M(''),R(null)},testID:"add-area"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Delete this area",disabled:f.areas.length<2,onPress:()=>B({kind:'area'}),testID:"delete-area"}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Reset to example layout",onPress:()=>B({kind:'reset'})})]}),(0,h.jsxs)(u.Muted,{children:[f.tables.length," tables \xb7 ",f.tables.reduce((e,a)=>e+a.maxSeats,0)," seats \xb7 ",f.tables.filter(e=>e.online).length," bookable online. Example layout made up for the demo; table numbers are the ones you'd match in Wix Tables later (not connected)."]})]}),v?(0,h.jsxs)(u.Sheet,{visible:!0,onClose:()=>B(null),title:'table'===v.kind?`Delete Table ${W?.name}?`:'area'===v.kind?`Delete ${G?.name}?`:'Reset the table plan?',testID:"confirm-sheet",children:[(0,h.jsx)(u.Muted,{children:'table'===v.kind?'It comes off the plan. Bookings keep their table number.':'area'===v.kind?`Its ${J[L]} table(s) move to ${f.areas.find(e=>e.id!==L)?.name}.`:'Puts back the example layout for this venue.'}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.Button,{kind:"danger",label:'reset'===v.kind?'Reset':'Delete',accessibilityLabel:'reset'===v.kind?'Reset':'Confirm delete',testID:"confirm-delete",onPress:()=>{if('table'===v.kind&&W&&(y().removeTable(e,W.id),R(null),A(`Table ${W.name} deleted.`)),'area'===v.kind){const e=f.areas.find(e=>e.id!==L);w({...f,areas:f.areas.filter(e=>e.id!==L),tables:f.tables.map(a=>a.areaId===L?{...a,areaId:e.id}:a)}),S(e.id)}'reset'===v.kind&&(y().resetPlan(e),R(null)),B(null)}}),(0,h.jsx)(u.Button,{kind:"secondary",label:"Cancel",onPress:()=>B(null)})]})]}):null]})};var a=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),t=e(r(d[3])),n=e(r(d[4])),o=r(d[5]),c=r(d[6]),u=r(d[7]),b=r(d[8]),h=r(d[9]);const x={round:[100,100],square:[100,100],rect:[175,100],booth:[200,125],stool:[75,75]};function p({plan:e,area:a,onPick:l,counts:t}){return(0,h.jsx)(u.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:e.areas.map(e=>{const n=e.id===a;return(0,h.jsx)(s.default,{testID:`area-${e.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${e.name}`,accessibilityState:{selected:n},onPress:()=>l(e.id),style:{minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:n?c.colours.gold:c.colours.border,backgroundColor:n?c.colours.gold:c.colours.surface,justifyContent:'center'},children:(0,h.jsxs)(u.T,{weight:"semibold",size:15,colour:n?c.colours.onGold:c.colours.text,children:[e.name,t?.[e.id]?(0,h.jsxs)(u.T,{size:12,colour:n?c.colours.onGold:c.colours.muted,children:[" ",t[e.id]]}):null]})},e.id)})})}},850,[12,245,253,255,109,860,797,790,849,6]);
|
| 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}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return b}}),_e.Timeline=function({plan:e,bookings:p,now:y,privacy:x,onOpen:j,turnBase:v,t0:C,t1:k,height:w}){const M=(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:e.name})))],[e]),T=p.filter(e=>!['cancelled','noshow'].includes(e.status)),R=(0,t.useMemo)(()=>(0,s.clashes)(T,v),[T,v]),z=Math.ceil((k.getTime()-C.getTime())/9e5),$=e=>(e.getTime()-C.getTime())/9e5*h,[_,B]=(0,t.useState)(null),O=(0,t.useRef)(null),E=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,$(y)-120);setTimeout(()=>E.current?.scrollTo({x:e,animated:!1}),50)},[]);const[S,W]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{O.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!O.current)return;const r=o.nativeEvent.pageX-O.current.x,n=o.nativeEvent.pageY-O.current.y;Math.abs(r)+Math.abs(n)>=6&&B({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=O.current;O.current=null,B(null);const l=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(l)+Math.abs(d)<6)return void('move'===t&&j(e));const c=Math.round(l/h);if('stretch'===t){const t=Math.max(30,(0,s.durOf)(e,v)+15*c);return n.repo.bookings.update(e.id,{durationMins:t}),void W(`${(0,u.privName)(e,x)} now ${t} min`)}const f=M.findIndex(t=>t.key===((0,i.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(M.length-1,f+Math.round(d/b))),p={};c&&'confirmed'===e.status&&(p.time=(0,a.hm)((0,a.addMins)((0,s.startOf)(e),15*c))),g!==f&&'__none'!==M[g].key&&(p.table=M[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),W(`${(0,u.privName)(e,x)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):c&&'confirmed'!==e.status&&W('Seated parties can move table, not time.')}}),I=$(y);return(0,c.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,c.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsxs)(d.Row,{gap:8,children:[(0,c.jsx)(d.Badge,{kind:R.size?'red':'green',label:R.size?`${R.size} bookings clash`:'No clashes'}),(0,c.jsx)(d.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})]}),(0,c.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${R.size}`,children:(0,c.jsx)(d.T,{size:13,colour:l.colours.goldLight,children:S})})]}),(0,c.jsx)(r.default,{style:{flex:w?void 0:1,height:w,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:l.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,c.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,c.jsxs)(r.default,{style:{width:f,borderRightWidth:1,borderColor:l.colours.border,backgroundColor:l.colours.surface},children:[(0,c.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:12,colour:l.colours.muted,children:"Table"})}),M.map((e,t)=>(0,c.jsxs)(r.default,{style:{height:b,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:l.colours.gold},children:[(0,c.jsx)(d.T,{size:14,weight:"semibold",children:'__none'===e.key?e.name:`T${e.name}`}),!e.area||0!==t&&M[t-1].area===e.area?null:(0,c.jsx)(d.T,{size:10,colour:l.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,c.jsx)(o.default,{ref:E,horizontal:!0,style:{flex:1},children:(0,c.jsxs)(r.default,{style:{width:z*h},children:[(0,c.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:l.colours.border},children:Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{style:{width:Math.min(4,z-4*t)*h,justifyContent:'center',borderLeftWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:11,colour:l.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,a.hm)((0,a.addMins)(C,60*t))})},t))}),M.map((e,t)=>{return(0,c.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:b,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:'rgba(207,164,95,0.4)'},children:[Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*h,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),(o=e.key,T.filter(e=>'__none'===o?!e.table:(0,i.tablesOf)(e.table).includes(o))).map(e=>{const t=_?.id===e.id?_:null,o=$((0,s.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(h,(0,s.durOf)(e,v)/15*h+('stretch'===t?.kind?t.dx:0)),i=R.has(e.id);return(0,c.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,u.privName)(e,x)}, ${e.partySize}, ${(0,a.hm)((0,s.startOf)(e))}, ${(0,s.durOf)(e,v)} min${i?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:g(e),borderWidth:i?2.5:1,borderColor:i?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?.55:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,c.jsxs)(d.T,{size:12,weight:"semibold",colour:'confirmed'===e.status?'#EAF4FF':'#0B0B0B',numberOfLines:1,children:[i?'\u26a0 ':'',(0,a.hm)((0,s.startOf)(e))," ",(0,u.privName)(e,x)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,c.jsx)(r.default,{testID:`tl-stretch-${e.id}`,accessibilityLabel:"Change length",...D(e,'stretch'),style:{position:'absolute',right:0,top:0,bottom:0,width:14,borderTopRightRadius:8,borderBottomRightRadius:8,backgroundColor:'rgba(0,0,0,0.25)',cursor:'ew-resize',touchAction:'none'}})]},e.id)})]},e.key);var o}),I>=0&&I<=z*h?(0,c.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:I,top:0,bottom:0,width:2,backgroundColor:l.colours.gold,zIndex:30},children:(0,c.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:l.colours.gold,borderRadius:6},children:(0,c.jsx)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,a.hm)(y)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),a=_r(_d[7]),l=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]);const h=30,b=44,f=96,g=e=>'seated'===e.status?'#CFA45F':'finished'===e.status?'#3A352C':e.walkIn?'#B9925A':'#3C78B5'},851,[12,104,133,109,796,860,848,795,797,790,852,6]);
|
| 8 |
+
__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 n}}),Object.defineProperty(e,"pv",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"privName",{enumerable:!0,get:function(){return l}});const n=n=>n.replace(' (example)','').split(/\s+/).filter(Boolean).map(n=>`${n[0].toUpperCase()}.`).join(' '),t=(t,l)=>t?l?n(t):t.replace(' (example)',''):'',l=(n,l)=>n.walkIn?`Walk-in ${n.ref}`:t(n.name,l)},852,[]);
|
| 9 |
+
__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Screensaver=function({rid:e,idleMins:t,pinOn:n,pin:i,tonightCards:s}){const[l,u]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),[p,f]=(0,o.useState)(''),h=(0,o.useRef)(Date.now()),w=(0,o.useRef)(!1),y=(0,o.useRef)(0);w.current=l;const b=6e4*t;(0,o.useEffect)(()=>{if(!x)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return w.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),y.current=n+800,w.current=!1,window.__ccWokeAt=n,u(!1),j.current&&d(!0),void(h.current=Date.now())):n<y.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(h.current=Date.now())},n=['pointerdown','pointerup','mousedown','mouseup','touchstart','touchend','click','keydown','wheel'];n.forEach(e=>window.addEventListener(e,t,{capture:!0,passive:!1}));const o=setInterval(()=>{!w.current&&!D.current&&Date.now()-h.current>=b&&(w.current=!0,u(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[b]);const j=(0,o.useRef)(n);j.current=n;const D=(0,o.useRef)(c);return D.current=c,(0,o.useEffect)(()=>{if(!x)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{}}},[]),c?(0,v.jsx)(k,{pin:i,entry:p,setEntry:f,onOk:()=>{d(!1),f(''),h.current=Date.now()}}):l?(0,v.jsx)(R,{rid:e,tonightCards:s}):null};var t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),i=e(r(_d[3])),s=e(r(_d[4])),l=e(r(_d[5]));r(_d[6]);var u=e(r(_d[7])),c=e(r(_d[8])),d=e(r(_d[9])),p=r(_d[10]),f=r(_d[11]),h=r(_d[12]),w=r(_d[13]),y=r(_d[14]),b=r(_d[15]),v=r(_d[16]);const x='undefined'!=typeof window;function j({w:e,h:t,seed:n}){const l=(0,o.useRef)(new i.default.Value(0)).current,u=e=>{const t=233280*Math.sin(9301*n+49297*e);return t-Math.floor(t)};(0,o.useEffect)(()=>{const e=i.default.loop(i.default.timing(l,{toValue:1,duration:9e3+9e3*u(1),delay:4e3*u(2),easing:s.default.linear,useNativeDriver:!1}));return e.start(),()=>e.stop()},[]);const c=3+5*u(3);return(0,v.jsx)(i.default.View,{pointerEvents:"none",style:{position:'absolute',left:u(4)*e,top:0,width:c,height:c,borderRadius:c,backgroundColor:w.colours.goldLight,shadowColor:w.colours.gold,shadowRadius:6,shadowOpacity:.9,opacity:l.interpolate({inputRange:[0,.15,.8,1],outputRange:[0,.85,.5,0]}),transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[t+20,t*(.15+.3*u(5))]})},{translateX:l.interpolate({inputRange:[0,.5,1],outputRange:[0,60*(u(6)-.5),0]})}]}})}function k({pin:e,entry:t,setEntry:n,onOk:o}){const i=i=>{const s=(t+i).slice(0,4);n(s),4===s.length&&(s===e?o():setTimeout(()=>n(''),300))};return(0,v.jsxs)(c.default,{testID:"wake-pin",style:{position:x?'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,v.jsx)(b.T,{size:22,weight:"semibold",colour:w.colours.gold,children:"Enter staff PIN"}),(0,v.jsxs)(b.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(4-t.length)]}),(0,v.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,v.jsx)(u.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>i(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,v.jsx)(b.T,{size:26,colour:w.colours.gold,children:e})},e))})]})}function R({rid:e,tonightCards:u}){const{width:k,height:R}=(0,d.default)(),D=(0,p.useNow)(1e3),I=(0,y.useBrand)(e),E=(0,f.useOwner)(e=>e.offers),C=(0,p.useEvents)(e),O=(0,t.useSpecials)(t=>t.current[e]??null),T=y.HERO_LOGOS[e]??I.logo,L=(0,o.useRef)(new i.default.Value(0)).current,z=(0,o.useRef)(new i.default.Value(0)).current,V=(0,o.useRef)(new i.default.ValueXY({x:0,y:0})).current;(0,o.useEffect)(()=>{i.default.timing(L,{toValue:1,duration:700,useNativeDriver:!1}).start();const e=i.default.loop(i.default.sequence([i.default.timing(z,{toValue:1,duration:14e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1}),i.default.timing(z,{toValue:0,duration:14e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1})]));e.start();const t=()=>i.default.timing(V,{toValue:{x:(Math.random()-.5)*k*.18,y:(Math.random()-.5)*R*.14},duration:6e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1}).start();t();const n=setInterval(t,2e4);return()=>{e.stop(),clearInterval(n)}},[]);const _=(0,h.ymd)(D),M=O&&(0,n.isToday)(O.postedAt,D)?O:null,S=(0,o.useMemo)(()=>[...M?[{k:'specials',tag:'TODAY\u2019S SPECIALS',title:M.items.length?M.items.slice(0,2).map(e=>e.name.replace(' (sample)','')).join(' \xb7 '):'Fresh on the board today',body:M.items.length?M.items.slice(2).map(e=>e.name.replace(' (sample)','')).join(' \xb7 ')||'Ask your server':'Ask your server about today\u2019s specials'}]:[],...E.filter(e=>e.live).slice(0,2).map(e=>({k:e.id,title:e.title.replace(' (example)',''),body:e.body})),...C.filter(e=>e.date===_).slice(0,1).map(e=>({k:e.id,title:e.title,body:e.description}))].slice(0,3),[E,C,_,M]),N=.42*Math.min(k,R);return(0,v.jsxs)(i.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:x?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#050505',opacity:L,overflow:'hidden',cursor:'pointer'},children:[Array.from({length:18},(e,t)=>(0,v.jsx)(j,{w:k,h:R,seed:t+1},t)),(0,v.jsxs)(i.default.View,{style:{flex:1,alignItems:'center',justifyContent:'center',gap:18,transform:[{translateX:V.x},{translateY:V.y}]},children:[T?(0,v.jsx)(i.default.View,{style:{transform:[{scale:z.interpolate({inputRange:[0,1],outputRange:[1,1.12]})},{translateX:z.interpolate({inputRange:[0,1],outputRange:[-10,10]})}]},children:(0,v.jsx)(l.default,{source:T,style:{width:N,height:N},resizeMode:"contain",accessibilityLabel:`${I.name} logo`})}):(0,v.jsx)(b.T,{size:48,weight:"bold",colour:w.colours.gold,children:I.name}),(0,v.jsx)(b.T,{size:Math.round(.26*N),weight:"semibold",colour:w.colours.text,style:{letterSpacing:4},children:(0,h.hm)(D)}),(0,v.jsx)(b.T,{size:18,colour:w.colours.muted,children:(0,h.niceDate)(D)}),u&&S.length?(0,v.jsx)(c.default,{testID:"tonight-cards",style:{flexDirection:'row',gap:14,flexWrap:'wrap',justifyContent:'center',maxWidth:.86*k},children:S.map(e=>(0,v.jsxs)(c.default,{testID:'specials'===e.k?'specials-card':void 0,style:{width:Math.min(300,.27*k),padding:14,borderRadius:16,borderWidth:1,borderColor:'rgba(207,164,95,0.5)',backgroundColor:'rgba(42,34,22,0.55)',gap:4},children:[(0,v.jsx)(b.T,{size:12,weight:"semibold",colour:w.colours.gold,children:e.tag??'TONIGHT'}),(0,v.jsx)(b.T,{size:17,weight:"semibold",numberOfLines:2,children:e.title}),(0,v.jsx)(b.T,{size:13,colour:w.colours.muted,numberOfLines:3,children:e.body})]},e.k))}):null]}),(0,v.jsx)(c.default,{style:{position:'absolute',bottom:18,left:0,right:0},children:(0,v.jsx)(b.T,{size:13,colour:"#6E675B",center:!0,children:"Touch anywhere to wake"})})]})}},853,[804,805,12,102,206,178,104,245,109,269,796,802,795,797,855,790,6]);
|
| 10 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Card",{enumerable:!0,get:function(){return y}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const r=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,m.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,p.jsxs)(a.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",colour:j.colours.gold,children:"NEXT HOUR"}),(0,p.jsxs)(l.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===r.length?(0,p.jsx)(o.Muted,{children:"No arrivals due in the next hour."}):null,r.map(({b:e,m:t})=>(0,p.jsxs)(a.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?j.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?j.colours.amber:'#3C78B5'},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",children:e.time}),(0,p.jsxs)(o.T,{size:13,children:[(0,i.privName)(e,s)," \xb7 ",e.partySize]}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,p.jsx)(o.T,{size:12,colour:t<0?j.colours.amber:j.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,p.jsx)(o.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,p.jsx)(o.T,{size:12,children:b.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,p.jsxs)(o.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(b.STATUS).map(e=>(0,p.jsxs)(o.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:b.STATUS[e].colour}}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:b.STATUS[e].label})]},e)),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc8d anniversary"})]})},_e.DetailsPanel=function({title:e,children:s,onClose:l}){const[r,a]=(0,t.useState)(20);return(0,t.useEffect)(()=>{const e=Date.now(),t=()=>a(20-Math.floor((Date.now()-e)/1e3)),s=setInterval(t,1e3),l=setTimeout(t,2e4);return()=>{clearInterval(s),clearTimeout(l)}},[]),(0,t.useEffect)(()=>{r<=0&&l()},[r]),(0,p.jsxs)(o.Sheet,{visible:!0,onClose:l,title:e,maxWidth:560,testID:"private-details",children:[(0,p.jsx)(o.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),s,(0,p.jsx)(o.Button,{kind:"secondary",label:"Close now",onPress:l})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return w}}),_e.TableSheet=function({rid:e,name:l,view:h,plan:x,todays:f,now:y,privacy:w,turnBase:v,onClose:T,onWalkIn:S,onMove:k,onDetails:$}){const C=h[l],M=c.useFloor.getState(),[z,I]=(0,t.useState)(!1),[B,D]=(0,t.useState)(C?.note??''),[P,R]=(0,t.useState)(!1);if(!C)return null;const A=C.booking,O=['seated','mains','dessert','bill'].includes(C.status),N=f.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,m.minsBetween)(y,(0,b.startOf)(e)))-Math.abs((0,m.minsBetween)(y,(0,b.startOf)(t)))),W=e=>e.partySize<=C.table.maxSeats,L=(0,b.turnFor)(C.covers||C.table.maxSeats,v);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:T,title:`Table ${l} \xb7 ${b.STATUS[C.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Badge,{kind:"neutral",label:`${C.table.minSeats}\u2013${C.table.maxSeats} seats`}),A?(0,p.jsx)(o.Badge,{kind:"gold",label:`${(0,i.privName)(A,w)} \xb7 ${A.partySize} \xb7 ${C.seatedMins}m`}):null,A?(0,p.jsx)(o.Badge,{kind:C.seatedMins>(0,b.durOf)(A,v)?'red':'neutral',label:`Turn ~${(0,b.durOf)(A,v)} min \xb7 free ~${(0,m.hm)((0,b.endOf)(A,v))} (est.)`}):(0,p.jsx)(o.Badge,{kind:"neutral",label:`Turn estimate for ${C.table.maxSeats}: ~${L} min`}),C.next?(0,p.jsx)(o.Badge,{kind:"blue",label:`Next: ${C.next.time} ${(0,i.privName)(C.next,w)} (${C.next.partySize})`}):null,C.allergy?(0,p.jsx)(o.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),O||'blocked'===C.status?null:(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{label:"Seat walk-in here",onPress:()=>{T(),S(l)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,p.jsx)(o.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>R(!P),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),P?(0,p.jsxs)(a.default,{style:{gap:6},children:[0===N.length?(0,p.jsx)(o.Muted,{children:"No bookings left to seat today."}):null,N.slice(0,8).map(t=>(0,p.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,i.privName)(t,w)} ${t.time}`,onPress:async()=>{await u.repo.bookings.update(t.id,{table:l}),await u.repo.bookings.setStatus(t.id,'seated'),(0,n.resetTableLive)(e,l),T()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:W(t)?j.colours.border:j.colours.amber,backgroundColor:j.colours.surface2},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[t.time," \xb7 ",(0,i.privName)(t,w)," \xb7 ",t.partySize,t.table?` \xb7 booked T${t.table}`:'',t.allergies.length?' \xb7 \u26a0':'']}),W(t)?null:(0,p.jsxs)(o.T,{size:12,colour:j.colours.amber,children:["Bigger than this table (",C.table.maxSeats," max)"]})]},t.id))]}):null,O?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{size:14,colour:j.colours.muted,children:"Course / status"}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:b.STAGES.map(t=>(0,p.jsx)(o.Chip,{label:b.STATUS[t].label,selected:C.status===t,onPress:()=>M.setLive(e,l,{stage:t})},t))}),(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{T(),k(l)},testID:"move-party"}):null,(0,p.jsx)(o.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{A&&await u.repo.bookings.setStatus(A.id,'finished'),M.setLive(e,l,{stage:void 0,dirty:!0}),T()}})]})]}):null,'dirty'===C.status?(0,p.jsx)(o.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{M.setLive(e,l,{dirty:!1}),T()},testID:"mark-clean"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,p.jsx)(o.Button,{kind:"secondary",label:'blocked'===C.status?'Unblock table':'Block table',onPress:()=>{M.setLive(e,l,{blocked:'blocked'!==C.status}),T()},testID:"block-table"}),(0,p.jsx)(o.Button,{kind:"ghost",label:C.note?'Edit note':'+ Note',onPress:()=>I(!z)}),A||C.next?(0,p.jsx)(o.Button,{kind:"ghost",label:"Guest details",onPress:()=>{T(),$(A??C.next)},testID:"guest-details"}):null]}),z?(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Table note",value:B,onChangeText:D,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[o.styles.input,{flex:1}]}),(0,p.jsx)(o.Button,{small:!0,label:"Save",onPress:()=>{M.setLive(e,l,{note:B.trim()||void 0}),I(!1)}})]}):null,w?(0,p.jsx)(o.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,x.joins.some(e=>e.tables.includes(l))?(0,p.jsxs)(o.Muted,{children:["Joins with ",x.joins.find(e=>e.tables.includes(l)).tables.filter(e=>e!==l).join(', ')," for bigger parties (book as ",x.joins.find(e=>e.tables.includes(l)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:l,plan:h,view:f,todays:w,waiting:v,now:T,privacy:S,busy:k,onToast:$}){const[C,M]=(0,t.useState)(''),[z,I]=(0,t.useState)(2),B=(0,c.useFloor)(e=>e.smsLog);return(0,p.jsxs)(y,{title:`Waitlist (${v.length})`,right:(0,p.jsxs)(o.Muted,{children:["new party ~",(0,x.estimateWait)(v.length+1,l.settings.turnMins,k)," min"]}),testID:"waitlist-panel",children:[0===v.length?(0,p.jsx)(o.Muted,{children:"Nobody waiting."}):null,v.map((t,s)=>{const r=(0,b.suggestTable)(h,w,f,t.partySize,T,(0,b.turnFor)(t.partySize,l.settings.turnMins)),y=(0,x.estimateWait)(s+1,l.settings.turnMins,k),v=Math.max(0,(0,m.minsBetween)(new Date(t.joinedAt),T)),C=B.find(s=>s.rid===e&&s.text.includes(`#${t.number} `));return(0,p.jsxs)(a.default,{style:{backgroundColor:j.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:["#",t.number," ",(0,i.pv)(t.name,S)," \xb7 ",t.partySize]}),(0,p.jsxs)(o.T,{size:12,colour:v>y?j.colours.amber:j.colours.muted,children:["waited ",v,"m \xb7 quoted ~",y,"m"]})]}),r?(0,p.jsxs)(o.T,{size:12,colour:r.clashes?j.colours.amber:j.colours.green,children:["Best table: ",r.table," (",r.why,")"]}):(0,p.jsx)(o.T,{size:12,colour:j.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Button,{small:!0,label:C||'notified'===t.status?'Re-send (demo)':'Table ready text (demo)',testID:`sms-${t.number}`,onPress:()=>{c.useFloor.getState().logSms(e,T.toISOString(),`#${t.number} ${t.partySize}: Your table at ${l.name} is ready.`),u.repo.waitlist.setStatus(t.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${l.name} is ready."`)}}),r?(0,p.jsx)(o.Button,{small:!0,kind:"success",label:`Seat at ${r.table}`,onPress:async()=>{await u.repo.waitlist.setStatus(t.id,'seated'),await u.repo.bookings.seatWalkIn(e,t.partySize,r.table,`From waitlist #${t.number}`),(0,n.resetTableLive)(e,r.table),$(`Waitlist #${t.number} seated at ${r.table}`)}}):null,(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>u.repo.waitlist.setStatus(t.id,'removed')})]}),'notified'===t.status?(0,p.jsx)(o.Badge,{kind:"green",label:`Told table ready${C?` ${(0,m.hm)(new Date(C.at))}`:''} (demo)`}):null]},t.id)}),(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[o.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,p.jsx)(s.default,{accessibilityLabel:"Waitlist party size",onPress:()=>I(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(o.T,{weight:"bold",colour:j.colours.gold,children:z})}),(0,p.jsx)(o.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{u.repo.waitlist.join(e,C.trim(),z),M('')}})]})]})},_e.PacePanel=function({r:e,fc:t,todays:s,now:l,walkInCount:r,staffOn:n,onSummary:i}){const u=r+s.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),c=l.getHours(),h=Math.round(t.hours.filter(e=>e.hour<c).reduce((e,t)=>e+t.covers,0)+(t.hours.find(e=>e.hour===c)?.covers??0)*(l.getMinutes()/60)),x=h?u/h:1,f=x>=1.1?j.colours.amber:x>=.85?j.colours.green:j.colours.blue,w=Array.from({length:8},(e,t)=>{const r=(0,m.addMins)(l,15*(t-4)-l.getMinutes()%15),a=(0,m.addMins)(r,15),o=s.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,b.startOf)(e);return t>=r&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:r,covers:o,future:t>=4}}),v=Math.max(4,Math.round(e.settings.capacityPerHour/4)),T=Math.max(v,...w.map(e=>e.covers)),S=w.filter(e=>e.future&&e.covers>v),k=t.nextHour?.covers??0,$=Math.ceil(k/16);return(0,p.jsxs)(y,{title:"Pace & kitchen",right:(0,p.jsx)(o.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,p.jsxs)(a.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${u} vs forecast ${h}`,style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{size:14,children:"Covers so far"}),(0,p.jsxs)(o.T,{weight:"bold",colour:f,children:[u," ",(0,p.jsxs)(o.T,{size:13,colour:j.colours.muted,children:["/ ~",h," forecast"]})]})]}),(0,p.jsx)(a.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,p.jsx)(a.default,{style:{width:`${Math.min(100,75*x)}%`,height:10,borderRadius:5,backgroundColor:f}})}),(0,p.jsxs)(o.Muted,{children:[x>=1.1?'Ahead of forecast':x>=.85?'On pace':'Behind forecast'," \xb7 next hour ~",t.nextHour?`${t.nextHour.coversLow}\u2013${t.nextHour.coversHigh}`:0," covers"]})]}),(0,p.jsx)(o.T,{size:13,colour:j.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,p.jsx)(a.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:w.map((e,t)=>(0,p.jsxs)(a.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,p.jsx)(o.T,{size:10,colour:j.colours.muted,children:e.covers||''}),(0,p.jsx)(a.default,{style:{width:'80%',height:Math.max(2,e.covers/T*40),borderRadius:3,backgroundColor:e.covers>v?j.colours.red:e.future?'#6B5A3A':j.colours.gold}}),(0,p.jsx)(o.T,{size:9,colour:4===t?j.colours.gold:j.colours.muted,children:(0,m.hm)(e.from)})]},t))}),S.map(e=>(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,m.hm)(e.from),"\u2013",(0,m.hm)((0,m.addMins)(e.from,15))," (pace ~",v,") \u2014 stagger seating if you can."]},e.from.getTime())),$>n?(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Next hour ~",k," covers with ",n," on: about ",$-n," more on the floor suggested."]}):(0,p.jsxs)(o.T,{size:13,colour:j.colours.green,children:["Staffing looks OK for the next hour (",n," on)."]}),(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"End-of-service summary",onPress:i,testID:"eos-open"})]})},_e.ServiceSummary=function({r:e,todays:t,orders:s,waitlistAll:l,walkInCount:r,onClose:a}){const n=t.filter(e=>['seated','finished'].includes(e.status)),i=n.reduce((e,t)=>e+t.partySize,0)+r,u=t.filter(e=>e.walkIn),h=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,m.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),b=s.reduce((e,t)=>e+t.paid,0),x=(0,c.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),j=(e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e}),(0,p.jsx)(o.T,{weight:"semibold",children:t})]},e);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[j('Covers served',String(i)),j('Bookings seated',`${n.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),j('Walk-ins',`${u.length} parties \xb7 ${u.reduce((e,t)=>e+t.partySize,0)+r} covers`),j('No-shows',String(t.filter(e=>'noshow'===e.status).length)),j('Average table time',h.length?`${Math.round(h.reduce((e,t)=>e+t,0)/h.length)} min`:'\u2014'),j('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),j('"Table ready" texts',`${x} (demo, none sent)`),j('Taken at the till/app',`${(0,f.gbp)(b)} (demo)`),(0,p.jsx)(o.Muted,{children:"Example data on this device. Nothing is sent anywhere."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return c.tablesOf}});var t=_r(d[0]);_r(d[1]);var s=e(_r(d[2])),l=e(_r(d[3])),r=e(_r(d[4])),a=e(_r(d[5])),o=_r(d[6]),n=_r(d[7]),i=_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]);const y=({title:e,right:t,children:s,testID:l})=>(0,p.jsxs)(a.default,{testID:l,style:{backgroundColor:j.colours.surface,borderRadius:14,borderWidth:1,borderColor:j.colours.border,padding:10,gap:6},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",colour:j.colours.gold,children:e}),t]}),s]});const w=e=>(0,p.jsxs)(a.default,{style:{gap:6},children:[(0,p.jsxs)(o.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,p.jsxs)(o.Muted,{children:[e.time," \xb7 ",e.table?`Table ${e.table}`:'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),e.notes?(0,p.jsxs)(o.T,{children:["Notes: ",e.notes]}):(0,p.jsx)(o.Muted,{children:"No notes."}),e.allergies.length?(0,p.jsx)(a.default,{style:{backgroundColor:j.colours.redBg,borderRadius:8,padding:8},children:(0,p.jsxs)(o.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')]})}):(0,p.jsx)(o.Muted,{children:"No allergies declared."}),(0,p.jsx)(o.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const v=!0},854,[12,104,245,133,255,109,790,847,852,796,860,791,848,795,843,793,797,6]);
|
chef-app/_expo/static/js/web/index-fbb7a768b57e7588ba2174f223b7bfd2.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return'owner'!==u.APP_VARIANT?(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]}):(0,c.jsx)(n.OwnerApp,{})}},780,[785,12,864,787,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OwnerApp=function(){return null}},864,[]);
|
chef-app/_expo/static/js/web/loyalty-3afa3f098d21bb7ab00753ff2e0dcc9d.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var e=_r(d[0]);_r(d[1]);var r,s=_r(d[2]),t=(r=s)&&r.__esModule?r:{default:r},i=_r(d[3]),n=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]);function h(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r),h=(0,l.useCustomer)(),p=(0,l.useStampCard)(r);if(!s)return(0,u.jsx)(n.Screen,{title:"Not found",children:(0,u.jsx)(n.T,{children:"Restaurant not found."})});const f=s.settings.stampTarget,j=p?.stamps??0;return(0,u.jsxs)(n.Screen,{title:"Stamp card",subtitle:`${s.name} \u2014 this card is just for ${s.name}`,children:[(0,u.jsxs)(n.Card,{highlight:c.colours.gold,children:[(0,u.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(n.H2,{children:[j," of ",f," stamps"]}),(0,u.jsxs)(n.T,{colour:c.colours.gold,weight:"semibold",children:["Reward: ",s.settings.stampReward]})]}),(0,u.jsx)(t.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:10,justifyContent:'center',paddingVertical:8},children:Array.from({length:f}).map((e,r)=>(0,u.jsx)(t.default,{accessibilityLabel:r<j?'Stamp collected':'Empty stamp',style:{width:52,height:52,borderRadius:26,borderWidth:2,borderColor:c.colours.gold,backgroundColor:r<j?c.colours.gold:'transparent',alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(n.T,{size:22,colour:r<j?c.colours.onGold:c.colours.border,children:"\u2605"})},r))}),(0,u.jsxs)(n.Muted,{children:["One stamp per paid visit or order over ",(0,o.gbp)(s.settings.stampMinSpend)," \u2014 dine-in, table QR or takeaway. Rewards are funded by ",s.name,"."]}),p?.rewardsAvailable?(0,u.jsx)(n.Banner,{kind:"success",title:`${p.rewardsAvailable} reward${p.rewardsAvailable>1?'s':''} ready: ${s.settings.stampReward}`,children:(0,u.jsx)(n.Button,{small:!0,label:"Use reward (show staff)",onPress:()=>l.repo.loyalty.redeemReward(s.id,h.id)})}):null]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Show this to staff"}),(0,u.jsx)(n.Muted,{children:"Staff scan this on the tablet to add a stamp for dine-in visits not paid by table QR."}),(0,u.jsx)(i.QR,{value:`covercharge:stamp:${s.id}:${h.id}`,size:190}),(0,u.jsx)(n.T,{center:!0,weight:"semibold",children:h.name})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Bring a friend"}),(0,u.jsx)(n.T,{children:"Your referral code"}),(0,u.jsx)(n.T,{size:28,weight:"bold",colour:c.colours.gold,center:!0,children:h.referralCode}),(0,u.jsx)(n.Muted,{children:"When a friend completes their first qualifying paid visit or order, you both get a stamp. One referral reward per new account, phone and card; monthly cap applies."})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"History"}),(p?.history??[]).length?p.history.slice(0,10).map((e,r)=>(0,u.jsxs)(n.Muted,{children:[e.at.slice(0,10)," \xb7 ",e.source]},r)):(0,u.jsx)(n.Muted,{children:"No stamps yet."})]}),(0,u.jsx)(n.Muted,{children:"Rewards are kept on food (Scottish licensing rules restrict drinks promotions). Stamps are never given for reviews."})]})}},765,[785,12,109,806,790,793,796,797,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.QR=function({value:e,size:t=180}){return(0,n.jsx)(o.default,{style:{padding:12,backgroundColor:'#FFFFFF',borderRadius:12,alignSelf:'center',borderWidth:3,borderColor:u.colours.gold},children:(0,n.jsx)(l.default,{value:e,size:t,color:"#0B0B0B",backgroundColor:"#FFFFFF"})})},r(d[0]);var o=e(r(d[1])),l=e(r(d[2])),u=r(d[3]),n=r(d[4])},806,[12,109,807,797,6]);
|
| 3 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},807,[808]);
|
| 4 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function o(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e=r(d[0]),t=r(d[1]),l=o(t),s=o(r(d[2])),n=o(r(d[3])),c=o(r(d[4])),h=r(d[5]);const u=({size:o,backgroundColor:e,logo:l,logoSVG:s,logoSize:n,logoBackgroundColor:u,logoColor:x,logoMargin:f,logoBorderRadius:p,clipPathId:j})=>{const C=(o-n-2*f)/2,y=n+2*f,b=p+f/n*p,k=`clip-logo-background-${j}`,G=`clip-logo-${j}`;return(0,h.jsxs)(t.G,{x:C,y:C,children:[(0,h.jsxs)(t.Defs,{children:[(0,h.jsx)(t.ClipPath,{id:k,children:(0,h.jsx)(t.Rect,{width:y,height:y,rx:b,ry:b})}),(0,h.jsx)(t.ClipPath,{id:G,children:(0,h.jsx)(t.Rect,{width:n,height:n,rx:p,ry:p})})]}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Rect,{width:y,height:y,fill:e,clipPath:`url(#${k})`})}),(0,h.jsxs)(t.G,{x:f,y:f,clipPath:`url(#${G})`,children:[(0,h.jsx)(t.Rect,{width:y-f,height:y-f,fill:u}),s?(0,h.jsx)(c.default,{svg:s,logoSize:n,logoColor:x}):(0,h.jsx)(t.Image,{width:n,height:n,preserveAspectRatio:"xMidYMid slice",href:l,clipPath:`url(#${G})`})]})]})};var x=({value:o="this is a QR code",size:c=100,color:x="black",backgroundColor:f="white",logo:p,logoSVG:j,logoSize:C=.2*c,logoBackgroundColor:y="transparent",logoColor:b,logoMargin:k=2,logoBorderRadius:G=0,quietZone:R=0,enableLinearGradient:w=!1,gradientDirection:P=['0%','0%','100%','100%'],linearGradient:S=['rgb(255,0,0)','rgb(0,255,255)'],ecl:M="M",getRef:z,onError:v,testID:B})=>{const I=(0,e.useId)(),_=(0,e.useMemo)(()=>{try{return(0,n.default)((0,s.default)(o,M),c)}catch(o){if(!v||'function'!=typeof v)throw o;v(o)}},[o,c,M]);if(!_)return null;const{path:D,cellSize:$}=_,O=p||j;return(0,h.jsxs)(l.default,{testID:B,ref:z,viewBox:[-R,-R,c+2*R,c+2*R].join(' '),width:c,height:c,children:[(0,h.jsx)(t.Defs,{children:(0,h.jsxs)(t.LinearGradient,{id:"grad",x1:P[0],y1:P[1],x2:P[2],y2:P[3],children:[(0,h.jsx)(t.Stop,{offset:"0",stopColor:S[0],stopOpacity:"1"}),(0,h.jsx)(t.Stop,{offset:"1",stopColor:S[1],stopOpacity:"1"})]})}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Rect,{x:-R,y:-R,width:c+2*R,height:c+2*R,fill:f})}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Path,{d:D,strokeLinecap:"butt",stroke:w?'url(#grad)':x,strokeWidth:$})}),O&&u({size:c,backgroundColor:f,logo:p,logoSVG:j,logoSize:C,logoBackgroundColor:y,logoColor:b,logoMargin:k,logoBorderRadius:G,clipPathId:I})]})}},808,[12,841,809,838,839,6]);
|
| 5 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},l=(e,t)=>{const l=Array.prototype.slice.call(u.default.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(l.length);return l.reduce((e,t,u)=>(u%n===0?e.push([t]):e[e.length-1].push(t))&&e,[])}},809,[810]);
|
| 6 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]),e=r(d[2]),o=r(d[3]);function c(e,o,c,l,u){const f=[].slice.call(arguments,1),s=f.length,v='function'==typeof f[s-1];if(!v&&!t())throw new Error('Callback required as last argument');if(!v){if(s<1)throw new Error('Too few arguments provided');return 1===s?(c=o,o=l=void 0):2!==s||o.getContext||(l=c,c=o,o=void 0),new Promise(function(t,u){try{const u=n.create(c,l);t(e(u,o,l))}catch(t){u(t)}})}if(s<2)throw new Error('Too few arguments provided');2===s?(u=c,c=o,o=l=void 0):3===s&&(o.getContext&&void 0===u?(u=l,l=void 0):(u=l,l=c,c=o,o=void 0));try{const t=n.create(c,l);u(null,e(t,o,l))}catch(t){u(t)}}_e.create=n.create,_e.toCanvas=c.bind(null,e.render),_e.toDataURL=c.bind(null,e.renderToDataURL),_e.toString=c.bind(null,function(t,n,e){return o.render(t,e)})},810,[811,812,835,837]);
|
| 7 |
+
__d(function(g,r,i,a,m,e,d){m.exports=function(){return'function'==typeof Promise&&Promise.prototype&&Promise.prototype.then}},811,[]);
|
| 8 |
+
__d(function(g,_r,_i,a,m,e,d){const t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),s=_r(d[4]),i=_r(d[5]),f=_r(d[6]),c=_r(d[7]),l=_r(d[8]),u=_r(d[9]),h=_r(d[10]),w=_r(d[11]),C=_r(d[12]);function y(t,o){const n=t.size,r=i.getPositions(o);for(let o=0;o<r.length;o++){const s=r[o][0],i=r[o][1];for(let o=-1;o<=7;o++)if(!(s+o<=-1||n<=s+o))for(let r=-1;r<=7;r++)i+r<=-1||n<=i+r||(o>=0&&o<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===o||6===o)||o>=2&&o<=4&&r>=2&&r<=4?t.set(s+o,i+r,!0,!0):t.set(s+o,i+r,!1,!0))}}function S(t){const o=t.size;for(let n=8;n<o-8;n++){const o=n%2==0;t.set(n,6,o,!0),t.set(6,n,o,!0)}}function p(t,o){const n=s.getPositions(o);for(let o=0;o<n.length;o++){const r=n[o][0],s=n[o][1];for(let o=-2;o<=2;o++)for(let n=-2;n<=2;n++)-2===o||2===o||-2===n||2===n||0===o&&0===n?t.set(r+o,s+n,!0,!0):t.set(r+o,s+n,!1,!0)}}function v(t,o){const n=t.size,r=u.getEncodedBits(o);let s,i,f;for(let o=0;o<18;o++)s=Math.floor(o/3),i=o%3+n-8-3,f=1==(r>>o&1),t.set(s,i,f,!0),t.set(i,s,f,!0)}function B(t,o,n){const r=t.size,s=h.getEncodedBits(o,n);let i,f;for(i=0;i<15;i++)f=1==(s>>i&1),i<6?t.set(i,8,f,!0):i<8?t.set(i+1,8,f,!0):t.set(r-15+i,8,f,!0),i<8?t.set(8,r-i-1,f,!0):i<9?t.set(8,15-i-1+1,f,!0):t.set(8,15-i-1,f,!0);t.set(r-8,8,1,!0)}function b(t,o){const n=t.size;let r=-1,s=n-1,i=7,f=0;for(let c=n-1;c>0;c-=2)for(6===c&&c--;;){for(let n=0;n<2;n++)if(!t.isReserved(s,c-n)){let r=!1;f<o.length&&(r=1==(o[f]>>>i&1)),t.set(s,c-n,r),i--,-1===i&&(f++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function M(o,r,s){const i=new n;s.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),w.getCharCountIndicator(t.mode,o)),t.write(i)});const f=8*(t.getSymbolTotalCodewords(o)-c.getTotalCodewordsCount(o,r));for(i.getLengthInBits()+4<=f&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const l=(f-i.getLengthInBits())/8;for(let t=0;t<l;t++)i.put(t%2?17:236,8);return I(i,o,r)}function I(o,n,r){const s=t.getSymbolTotalCodewords(n),i=s-c.getTotalCodewordsCount(n,r),f=c.getBlocksCount(n,r),u=f-s%f,h=Math.floor(s/f),w=Math.floor(i/f),C=w+1,y=h-w,S=new l(y);let p=0;const v=new Array(f),B=new Array(f);let b=0;const M=new Uint8Array(o.buffer);for(let t=0;t<f;t++){const o=t<u?w:C;v[t]=M.slice(p,p+o),B[t]=S.encode(v[t]),p+=o,b=Math.max(b,o)}const I=new Uint8Array(s);let A,E,T=0;for(A=0;A<b;A++)for(E=0;E<f;E++)A<v[E].length&&(I[T++]=v[E][A]);for(A=0;A<y;A++)for(E=0;E<f;E++)I[T++]=B[E][A];return I}function A(o,n,s,i){let c;if(Array.isArray(o))c=C.fromArray(o);else{if('string'!=typeof o)throw new Error('Invalid data');{let t=n;if(!t){const n=C.rawSplit(o);t=u.getBestVersionForData(n,s)}c=C.fromString(o,t||40)}}const l=u.getBestVersionForData(c,s);if(!l)throw new Error('The amount of data is too big to be stored in a QR Code');if(n){if(n<l)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+l+'.\n')}else n=l;const h=M(n,s,c),w=t.getSymbolSize(n),I=new r(w);return y(I,n),S(I),p(I,n),B(I,s,0),n>=7&&v(I,n),b(I,h),isNaN(i)&&(i=f.getBestMask(I,B.bind(null,I,s))),f.applyMask(i,I),B(I,s,i),{modules:I,version:n,errorCorrectionLevel:s,maskPattern:i,segments:c}}e.create=function(n,r){if(void 0===n||''===n)throw new Error('No input text');let s,i,c=o.M;return void 0!==r&&(c=o.from(r.errorCorrectionLevel,o.M),s=u.from(r.version),i=f.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),A(n,s,c,i)}},812,[813,814,815,816,817,818,819,820,821,824,828,825,829]);
|
| 9 |
+
__d(function(g,r,i,a,m,e,d){let n;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return 4*n+17},e.getSymbolTotalCodewords=function(n){return o[n]},e.getBCHDigit=function(n){let o=0;for(;0!==n;)o++,n>>>=1;return o},e.setToSJISFunction=function(o){if('function'!=typeof o)throw new Error('"toSJISFunc" is not a valid function.');n=o},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(o){return n(o)}},813,[]);
|
| 10 |
+
__d(function(g,r,i,a,m,_e,d){function t(t){if('string'!=typeof t)throw new Error('Param is not a string');switch(t.toLowerCase()){case'l':case'low':return _e.L;case'm':case'medium':return _e.M;case'q':case'quartile':return _e.Q;case'h':case'high':return _e.H;default:throw new Error('Unknown EC Level: '+t)}}_e.L={bit:1},_e.M={bit:0},_e.Q={bit:3},_e.H={bit:2},_e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},_e.from=function(e,n){if(_e.isValid(e))return e;try{return t(e)}catch(t){return n}}},814,[]);
|
| 11 |
+
__d(function(g,r,_i,a,m,e,d){function t(){this.buffer=[],this.length=0}t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let h=0;h<n;h++)this.putBit(1==(t>>>n-h-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},m.exports=t},815,[]);
|
| 12 |
+
__d(function(g,r,i,a,m,e,d){function t(t){if(!t||t<1)throw new Error('BitMatrix size must be defined and greater than 0');this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}t.prototype.set=function(t,s,n,o){const h=t*this.size+s;this.data[h]=n,o&&(this.reservedBit[h]=!0)},t.prototype.get=function(t,s){return this.data[t*this.size+s]},t.prototype.xor=function(t,s,n){this.data[t*this.size+s]^=n},t.prototype.isReserved=function(t,s){return this.reservedBit[t*this.size+s]},m.exports=t},816,[]);
|
| 13 |
+
__d(function(g,r,_i,a,m,e,d){const o=r(d[0]).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,s=o(t),l=145===s?26:2*Math.ceil((s-13)/(2*n-2)),f=[s-7];for(let o=1;o<n-1;o++)f[o]=f[o-1]-l;return f.push(6),f.reverse()},e.getPositions=function(o){const t=[],n=e.getRowColCoords(o),s=n.length;for(let o=0;o<s;o++)for(let l=0;l<s;l++)0===o&&0===l||0===o&&l===s-1||o===s-1&&0===l||t.push([n[o],n[l]]);return t}},817,[813]);
|
| 14 |
+
__d(function(g,r,i,a,m,e,d){const n=r(d[0]).getSymbolSize;e.getPositions=function(t){const o=n(t);return[[0,0],[o-7,0],[0,o-7]]}},818,[813]);
|
| 15 |
+
__d(function(g,r,_i,a,m,e,d){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,s=40,l=10;function o(t,n,s){switch(t){case e.Patterns.PATTERN000:return(n+s)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return s%3==0;case e.Patterns.PATTERN011:return(n+s)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2==0;case e.Patterns.PATTERN101:return n*s%2+n*s%3==0;case e.Patterns.PATTERN110:return(n*s%2+n*s%3)%2==0;case e.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2==0;default:throw new Error('bad maskPattern:'+t)}}e.isValid=function(t){return null!=t&&''!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(n){const s=n.size;let l=0,o=0,P=0,T=null,c=null;for(let u=0;u<s;u++){o=P=0,T=c=null;for(let N=0;N<s;N++){let s=n.get(u,N);s===T?o++:(o>=5&&(l+=t+(o-5)),T=s,o=1),s=n.get(N,u),s===c?P++:(P>=5&&(l+=t+(P-5)),c=s,P=1)}o>=5&&(l+=t+(o-5)),P>=5&&(l+=t+(P-5))}return l},e.getPenaltyN2=function(t){const s=t.size;let l=0;for(let n=0;n<s-1;n++)for(let o=0;o<s-1;o++){const s=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==s&&0!==s||l++}return l*n},e.getPenaltyN3=function(t){const n=t.size;let l=0,o=0,P=0;for(let s=0;s<n;s++){o=P=0;for(let T=0;T<n;T++)o=o<<1&2047|t.get(s,T),T>=10&&(1488===o||93===o)&&l++,P=P<<1&2047|t.get(T,s),T>=10&&(1488===P||93===P)&&l++}return l*s},e.getPenaltyN4=function(t){let n=0;const s=t.data.length;for(let l=0;l<s;l++)n+=t.data[l];return Math.abs(Math.ceil(100*n/s/5)-10)*l},e.applyMask=function(t,n){const s=n.size;for(let l=0;l<s;l++)for(let P=0;P<s;P++)n.isReserved(P,l)||n.xor(P,l,o(t,P,l))},e.getBestMask=function(t,n){const s=Object.keys(e.Patterns).length;let l=0,o=1/0;for(let P=0;P<s;P++){n(P),e.applyMask(P,t);const s=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(P,t),s<o&&(o=s,l=P)}return l}},819,[]);
|
| 16 |
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],u=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(u,c){switch(c){case t.L:return n[4*(u-1)+0];case t.M:return n[4*(u-1)+1];case t.Q:return n[4*(u-1)+2];case t.H:return n[4*(u-1)+3];default:return}},e.getTotalCodewordsCount=function(n,c){switch(c){case t.L:return u[4*(n-1)+0];case t.M:return u[4*(n-1)+1];case t.Q:return u[4*(n-1)+2];case t.H:return u[4*(n-1)+3];default:return}}},820,[814]);
|
| 17 |
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error('Encoder not initialized');const o=new Uint8Array(n.length+this.degree);o.set(n);const s=t.mod(o,this.genPoly),h=this.degree-s.length;if(h>0){const t=new Uint8Array(this.degree);return t.set(s,h),t}return s},m.exports=n},821,[822]);
|
| 18 |
+
__d(function(g,r,_i,a,m,e,d){const n=r(d[0]);e.mul=function(t,l){const o=new Uint8Array(t.length+l.length-1);for(let u=0;u<t.length;u++)for(let f=0;f<l.length;f++)o[u+f]^=n.mul(t[u],l[f]);return o},e.mod=function(t,l){let o=new Uint8Array(t);for(;o.length-l.length>=0;){const t=o[0];for(let u=0;u<l.length;u++)o[u]^=n.mul(l[u],t);let u=0;for(;u<o.length&&0===o[u];)u++;o=o.slice(u)}return o},e.generateECPolynomial=function(t){let l=new Uint8Array([1]);for(let o=0;o<t;o++)l=e.mul(l,new Uint8Array([1,n.exp(o)]));return l}},822,[823]);
|
| 19 |
+
__d(function(g,r,_i,a,m,e,d){const n=new Uint8Array(512),t=new Uint8Array(256);!(function(){let o=1;for(let u=0;u<255;u++)n[u]=o,t[o]=u,o<<=1,256&o&&(o^=285);for(let t=255;t<512;t++)n[t]=n[t-255]})(),e.log=function(n){if(n<1)throw new Error('log('+n+')');return t[n]},e.exp=function(t){return n[t]},e.mul=function(o,u){return 0===o||0===u?0:n[t[o]+t[u]]}},823,[]);
|
| 20 |
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),f=r(_d[3]),u=r(_d[4]),c=t.getBCHDigit(7973);function s(t,n,o){for(let f=1;f<=40;f++)if(n<=e.getCapacity(f,o,t))return f}function l(t,n){return f.getCharCountIndicator(t,n)+4}function d(t,n){let o=0;return t.forEach(function(t){const f=l(t.mode,n);o+=f+t.getBitsLength()}),o}function C(t,n){for(let o=1;o<=40;o++){if(d(t,o)<=e.getCapacity(o,n,f.MIXED))return o}}e.from=function(t,n){return u.isValid(t)?parseInt(t,10):n},e.getCapacity=function(o,c,s){if(!u.isValid(o))throw new Error('Invalid QR Code version');void 0===s&&(s=f.BYTE);const d=8*(t.getSymbolTotalCodewords(o)-n.getTotalCodewordsCount(o,c));if(s===f.MIXED)return d;const C=d-l(s,o);switch(s){case f.NUMERIC:return Math.floor(C/10*3);case f.ALPHANUMERIC:return Math.floor(C/11*2);case f.KANJI:return Math.floor(C/13);case f.BYTE:default:return Math.floor(C/8)}},e.getBestVersionForData=function(t,n){let f;const u=o.from(n,o.M);if(Array.isArray(t)){if(t.length>1)return C(t,u);if(0===t.length)return 1;f=t[0]}else f=t;return s(f.mode,f.getLength(),u)},e.getEncodedBits=function(n){if(!u.isValid(n)||n<7)throw new Error('Invalid QR Code version');let o=n<<12;for(;t.getBCHDigit(o)-c>=0;)o^=7973<<t.getBCHDigit(o)-c;return n<<12|o}},824,[813,820,814,825,826]);
|
| 21 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]);function e(t){if('string'!=typeof t)throw new Error('Param is not a string');switch(t.toLowerCase()){case'numeric':return _e.NUMERIC;case'alphanumeric':return _e.ALPHANUMERIC;case'kanji':return _e.KANJI;case'byte':return _e.BYTE;default:throw new Error('Unknown mode: '+t)}}_e.NUMERIC={id:'Numeric',bit:1,ccBits:[10,12,14]},_e.ALPHANUMERIC={id:'Alphanumeric',bit:2,ccBits:[9,11,13]},_e.BYTE={id:'Byte',bit:4,ccBits:[8,16,16]},_e.KANJI={id:'Kanji',bit:8,ccBits:[8,10,12]},_e.MIXED={bit:-1},_e.getCharCountIndicator=function(n,e){if(!n.ccBits)throw new Error('Invalid mode: '+n);if(!t.isValid(e))throw new Error('Invalid version: '+e);return e>=1&&e<10?n.ccBits[0]:e<27?n.ccBits[1]:n.ccBits[2]},_e.getBestModeForData=function(t){return n.testNumeric(t)?_e.NUMERIC:n.testAlphanumeric(t)?_e.ALPHANUMERIC:n.testKanji(t)?_e.KANJI:_e.BYTE},_e.toString=function(t){if(t&&t.id)return t.id;throw new Error('Invalid mode')},_e.isValid=function(t){return t&&t.bit&&t.ccBits},_e.from=function(t,n){if(_e.isValid(t))return t;try{return e(t)}catch(t){return n}}},825,[826,827]);
|
| 22 |
+
__d(function(g,r,i,a,m,e,d){e.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}},826,[]);
|
| 23 |
+
__d(function(g,r,i,a,m,e,d){let u="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";u=u.replace(/u/g,'\\u');const n='(?:(?![A-Z0-9 $%*+\\-./:]|'+u+')(?:.|[\r\n]))+';e.KANJI=new RegExp(u,'g'),e.BYTE_KANJI=new RegExp('[^A-Z0-9 $%*+\\-./:]+','g'),e.BYTE=new RegExp(n,'g'),e.NUMERIC=new RegExp('[0-9]+','g'),e.ALPHANUMERIC=new RegExp('[A-Z $%*+\\-./:]+','g');const t=new RegExp('^'+u+'$'),E=new RegExp("^[0-9]+$"),A=new RegExp('^[A-Z0-9 $%*+\\-./:]+$');e.testKanji=function(u){return t.test(u)},e.testNumeric=function(u){return E.test(u)},e.testAlphanumeric=function(u){return A.test(u)}},827,[]);
|
| 24 |
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=t.getBCHDigit(1335);e.getEncodedBits=function(o,c){const B=o.bit<<3|c;let d=B<<10;for(;t.getBCHDigit(d)-n>=0;)d^=1335<<t.getBCHDigit(d)-n;return 21522^(B<<10|d)}},828,[813]);
|
| 25 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6]),h=r(d[7]);function i(t){return unescape(encodeURIComponent(t)).length}function f(t,n,o){const u=[];let s;for(;null!==(s=t.exec(o));)u.push({data:s[0],index:s.index,mode:n,length:s[0].length});return u}function E(n){const o=f(l.NUMERIC,t.NUMERIC,n),u=f(l.ALPHANUMERIC,t.ALPHANUMERIC,n);let s,h;c.isKanjiModeEnabled()?(s=f(l.BYTE,t.BYTE,n),h=f(l.KANJI,t.KANJI,n)):(s=f(l.BYTE_KANJI,t.BYTE,n),h=[]);return o.concat(u,s,h).sort(function(t,n){return t.index-n.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function A(l,c){switch(c){case t.NUMERIC:return n.getBitsLength(l);case t.ALPHANUMERIC:return o.getBitsLength(l);case t.KANJI:return s.getBitsLength(l);case t.BYTE:return u.getBitsLength(l)}}function I(t){return t.reduce(function(t,n){const o=t.length-1>=0?t[t.length-1]:null;return o&&o.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function C(n){const o=[];for(let u=0;u<n.length;u++){const s=n[u];switch(s.mode){case t.NUMERIC:o.push([s,{data:s.data,mode:t.ALPHANUMERIC,length:s.length},{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.ALPHANUMERIC:o.push([s,{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.KANJI:o.push([s,{data:s.data,mode:t.BYTE,length:i(s.data)}]);break;case t.BYTE:o.push([{data:s.data,mode:t.BYTE,length:i(s.data)}])}}return o}function p(n,o){const u={},s={start:{}};let l=['start'];for(let c=0;c<n.length;c++){const h=n[c],i=[];for(let n=0;n<h.length;n++){const f=h[n],E=''+c+n;i.push(E),u[E]={node:f,lastCount:0},s[E]={};for(let n=0;n<l.length;n++){const c=l[n];u[c]&&u[c].node.mode===f.mode?(s[c][E]=A(u[c].lastCount+f.length,f.mode)-A(u[c].lastCount,f.mode),u[c].lastCount+=f.length):(u[c]&&(u[c].lastCount=f.length),s[c][E]=A(f.length,f.mode)+4+t.getCharCountIndicator(f.mode,o))}}l=i}for(let t=0;t<l.length;t++)s[l[t]].end=0;return{map:s,table:u}}function B(l,h){let i;const f=t.getBestModeForData(l);if(i=t.from(h,f),i!==t.BYTE&&i.bit<f.bit)throw new Error('"'+l+"\" cannot be encoded with mode "+t.toString(i)+'.\n Suggested mode is: '+t.toString(f));switch(i!==t.KANJI||c.isKanjiModeEnabled()||(i=t.BYTE),i){case t.NUMERIC:return new n(l);case t.ALPHANUMERIC:return new o(l);case t.KANJI:return new s(l);case t.BYTE:return new u(l)}}e.fromArray=function(t){return t.reduce(function(t,n){return'string'==typeof n?t.push(B(n,null)):n.data&&t.push(B(n.data,n.mode)),t},[])},e.fromString=function(t,n){const o=p(C(E(t,c.isKanjiModeEnabled())),n),u=h.find_path(o.map,'start','end'),s=[];for(let t=1;t<u.length-1;t++)s.push(o.table[u[t]].node);return e.fromArray(I(s))},e.rawSplit=function(t){return e.fromArray(E(t,c.isKanjiModeEnabled()))}},829,[825,830,831,832,833,827,813,834]);
|
| 26 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.NUMERIC,this.data=n.toString()}n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,o,s;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),s=parseInt(o,10),t.put(s,10);const i=this.data.length-n;i>0&&(o=this.data.substr(n),s=parseInt(o,10),t.put(s,3*i+1))},m.exports=n},830,[825]);
|
| 27 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' ','$','%','*','+','-','.','/',':'];function i(n){this.mode=t.ALPHANUMERIC,this.data=n}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let h=45*n.indexOf(this.data[i]);h+=n.indexOf(this.data[i+1]),t.put(h,11)}this.data.length%2&&t.put(n.indexOf(this.data[i]),6)},m.exports=i},831,[825]);
|
| 28 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.BYTE,this.data='string'==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,o=this.data.length;n<o;n++)t.put(this.data[n],8)},m.exports=n},832,[825]);
|
| 29 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]);function i(n){this.mode=t.KANJI,this.data=n}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i<this.data.length;i++){let o=n.toSJIS(this.data[i]);if(o>=33088&&o<=40956)o-=33088;else{if(!(o>=57408&&o<=60351))throw new Error('Invalid SJIS character: '+this.data[i]+"\nMake sure your charset is UTF-8");o-=49472}o=192*(o>>>8&255)+(255&o),t.put(o,13)}},m.exports=i},833,[825,813]);
|
| 30 |
+
__d(function(g,r,i,_a,m,e,_d){'use strict';var t={single_source_shortest_paths:function(o,s,u){var n={},a={};a[s]=0;var h,f,p,_,c,v,d,l=t.PriorityQueue.make();for(l.push(s,0);!l.empty();)for(p in f=(h=l.pop()).value,_=h.cost,c=o[f]||{})c.hasOwnProperty(p)&&(v=_+c[p],d=a[p],(void 0===a[p]||d>v)&&(a[p]=v,l.push(p,v),n[p]=f));if(void 0!==u&&void 0===a[u]){var y=['Could not find a path from ',s,' to ',u,'.'].join('');throw new Error(y)}return n},extract_shortest_path_from_predecessor_list:function(t,o){for(var s=[],u=o;u;)s.push(u),t[u],u=t[u];return s.reverse(),s},find_path:function(o,s,u){var n=t.single_source_shortest_paths(o,s,u);return t.extract_shortest_path_from_predecessor_list(n,u)},PriorityQueue:{make:function(o){var s,u=t.PriorityQueue,n={};for(s in o=o||{},u)u.hasOwnProperty(s)&&(n[s]=u[s]);return n.queue=[],n.sorter=o.sorter||u.default_sorter,n},default_sorter:function(t,o){return t.cost-o.cost},push:function(t,o){var s={value:t,cost:o};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==m&&(m.exports=t)},834,[]);
|
| 31 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]);function e(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+'px',e.style.width=n+'px'}function n(){try{return document.createElement('canvas')}catch(t){throw new Error('You need to specify a canvas element')}}_e.render=function(o,c,s){let u=s,h=c;void 0!==u||c&&c.getContext||(u=c,c=void 0),c||(h=n()),u=t.getOptions(u);const l=t.getImageWidth(o.modules.size,u),p=h.getContext('2d'),y=p.createImageData(l,l);return t.qrToImageData(y.data,o,u),e(p,h,l),p.putImageData(y,0,0),h},_e.renderToDataURL=function(t,e,n){let o=n;void 0!==o||e&&e.getContext||(o=e,e=void 0),o||(o={});const c=_e.render(t,e,o),s=o.type||'image/png',u=o.rendererOpts||{};return c.toDataURL(s,u.quality)}},835,[836]);
|
| 32 |
+
__d(function(g,r,_i,a,m,e,d){function t(t){if('number'==typeof t&&(t=t.toString()),'string'!=typeof t)throw new Error('Color should be defined as hex string');let o=t.slice().replace('#','').split('');if(o.length<3||5===o.length||o.length>8)throw new Error('Invalid hex color: '+t);3!==o.length&&4!==o.length||(o=Array.prototype.concat.apply([],o.map(function(t){return[t,t]}))),6===o.length&&o.push('F','F');const n=parseInt(o.join(''),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:'#'+o.slice(0,6).join('')}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=void 0===o.margin||null===o.margin||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,l=o.scale||4;return{width:i,scale:i?4:l,margin:n,color:{dark:t(o.color.dark||'#000000ff'),light:t(o.color.light||'#ffffffff')},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(t,o){return o.width&&o.width>=t+2*o.margin?o.width/(t+2*o.margin):o.scale},e.getImageWidth=function(t,o){const n=e.getScale(t,o);return Math.floor((t+2*o.margin)*n)},e.qrToImageData=function(t,o,n){const i=o.modules.size,l=o.modules.data,c=e.getScale(i,n),f=Math.floor((i+2*n.margin)*c),h=n.margin*c,s=[n.color.light,n.color.dark];for(let o=0;o<f;o++)for(let u=0;u<f;u++){let p=4*(o*f+u),w=n.color.light;if(o>=h&&u>=h&&o<f-h&&u<f-h){w=s[l[Math.floor((o-h)/c)*i+Math.floor((u-h)/c)]?1:0]}t[p++]=w.r,t[p++]=w.g,t[p++]=w.b,t[p]=w.a}}},836,[]);
|
| 33 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function o(t,o){const n=t.a/255,i=o+'="'+t.hex+'"';return n<1?i+' '+o+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function n(t,o,n){let i=t+o;return void 0!==n&&(i+=' '+n),i}function i(t,o,i){let l='',h=0,s=!1,c=0;for(let u=0;u<t.length;u++){const f=Math.floor(u%o),w=Math.floor(u/o);f||s||(s=!0),t[u]?(c++,u>0&&f>0&&t[u-1]||(l+=s?n('M',f+i,.5+w+i):n('m',h,0),h=0,s=!1),f+1<o&&t[u+1]||(l+=n('h',c),c=0)):h++}return l}e.render=function(n,l,h){const s=t.getOptions(l),c=n.modules.size,u=n.modules.data,f=c+2*s.margin,w=s.color.light.a?'<path '+o(s.color.light,'fill')+' d="M0 0h'+f+'v'+f+'H0z"/>':'',p='<path '+o(s.color.dark,'stroke')+' d="'+i(u,c,s.margin)+'"/>',v="viewBox=\"0 0 "+f+' '+f+'"',x='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':'')+v+' shape-rendering="crispEdges">'+w+p+'</svg>\n';return'function'==typeof h&&h(null,x),x}},837,[836]);
|
| 34 |
+
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=(t,n)=>{const l=n/t.length;let c='';return t.forEach((n,u)=>{let o=!1;n.forEach((n,f)=>{n?(o||(c+=`M${l*f} ${l/2+l*u} `,o=!0),o&&f===t.length-1&&(c+=`L${l*(f+1)} ${l/2+l*u} `)):o&&(c+=`L${l*f} ${l/2+l*u} `,o=!1)})}),{cellSize:l,path:c}}},838,[]);
|
| 35 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}}),r(d[0]);var t=r(d[1]),n=r(d[2]),o=r(d[3]);var s=({svg:s,logoSize:l,logoColor:u})=>{if((0,n.isString)(s)){const u=(0,n.isUrlString)(s)?s:`data:image/svg+xml;base64,${window.btoa(s)}`;return(0,o.jsx)(t.Image,{href:encodeURI(u),width:l,height:l})}const c=s;return(0,o.jsx)(c,{fill:u,width:l,height:l})}},839,[12,841,840,6]);
|
| 36 |
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return'string'==typeof t}Object.defineProperty(e,'__esModule',{value:!0}),e.isString=t,e.isUrlString=function(n){return t(n)&&n.startsWith('http')}},840,[]);
|
chef-app/_expo/static/js/web/profile-b0183082b0dcf2e0d1b983ab023ecb11.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var e=_r(d[0]);_r(d[1]);var r,l=_r(d[2]),s=(r=l)&&r.__esModule?r:{default:r},t=_r(d[3]),n=_r(d[4]),a=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]);function p(){const r=(0,u.useCustomer)(),l=(0,u.useStore)((0,c.useShallow)(e=>e.orders.filter(r=>r.customerId===e.customer.id))),p=(0,u.useStore)((0,c.useShallow)(e=>e.bookings.filter(r=>r.customerId===e.customer.id))),b=(0,u.useStore)(e=>e.restaurants),y=e=>b.find(r=>r.id===e)?.name??e;return(0,h.jsxs)(t.Screen,{title:"Your account",subtitle:"One Cover Charge account for every restaurant",children:[(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.Field,{label:"Name",value:r.name,onChangeText:e=>u.repo.customers.update({name:e})}),(0,h.jsx)(t.Field,{label:"Email",value:r.email,keyboardType:"email-address",onChangeText:e=>u.repo.customers.update({email:e})}),(0,h.jsx)(t.Field,{label:"Mobile",value:r.phone,keyboardType:"phone-pad",onChangeText:e=>u.repo.customers.update({phone:e})}),(0,h.jsxs)(t.Muted,{children:["Referral code: ",r.referralCode]})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Allergies & severity"}),(0,h.jsx)(t.Muted,{children:"Stored once and shared with a restaurant only when you order or book there. You confirm them on every order, table session and booking."}),(0,h.jsx)(t.Toggle,{label:"I consent to Cover Charge storing my allergy information (health data, UK GDPR)",value:r.allergyConsent,onChange:e=>u.repo.customers.update({allergyConsent:e})}),r.allergyConsent?null:(0,h.jsx)(t.Banner,{kind:"warn",children:"Without consent your allergies won\u2019t be stored \u2014 tell staff directly."}),n.ALLERGENS.map(e=>{const l=r.allergies.find(r=>r.allergen===e.id);return(0,h.jsxs)(s.default,{style:{gap:6,paddingVertical:6},children:[(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(t.T,{weight:l?'semibold':'regular',children:e.label}),l?(0,h.jsx)(t.Badge,{kind:"red",label:"Declared"}):null]}),(0,h.jsxs)(t.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(t.Chip,{label:"None",selected:!l,onPress:()=>u.repo.customers.setAllergy(e.id,null),disabled:!r.allergyConsent&&!l}),n.SEVERITIES.map(s=>(0,h.jsx)(t.Chip,{label:s.label,selected:l?.severity===s.id,disabled:!r.allergyConsent,onPress:()=>u.repo.customers.setAllergy(e.id,s.id)},s.id))]})]},e.id)})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your orders"}),l.length?l.map(r=>(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(t.T,{style:{flex:1},children:[r.ref," \xb7 ",y(r.restaurantId)," \xb7 ",'table'===r.type?`Table ${r.tableNo}`:'Takeaway']}),(0,h.jsx)(t.Button,{small:!0,kind:"secondary",label:`${r.status} \xb7 ${(0,a.gbp)(r.subtotal+r.tip)}`,onPress:()=>e.router.push(`/customer/order/${r.id}`)})]},r.id)):(0,h.jsx)(t.Muted,{children:"No orders yet."})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your bookings"}),p.length?p.map(e=>(0,h.jsxs)(t.T,{children:[e.ref," \xb7 ",y(e.restaurantId)," \xb7 ",(0,o.niceDate)((0,o.parseYmd)(e.date))," ",e.time," \xb7 ",e.partySize," people \xb7 ",e.status]},e.id)):(0,h.jsx)(t.Muted,{children:"No bookings yet."})]}),(0,h.jsx)(t.Muted,{children:"Account deletion and data export would live here (Apple 5.1.1(v); Google web deletion link)."})]})}},774,[785,12,109,790,791,793,795,796,845,6]);
|
chef-app/_expo/static/js/web/waitlist-66e55b1e298508430a6f018b8afdee7b.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return h}});var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),a=_r(d[3]),r=_r(d[4]),o=_r(d[5]),u=_r(d[6]),l=_r(d[7]),c=_r(d[8]);function h(){const{rid:h}=(0,t.useLocalSearchParams)(),j=(0,u.useRestaurant)(h),x=(0,u.useCustomer)(),b=(0,u.useWaitlist)(h),y=(0,u.useBookings)(h),f=(0,u.useOrders)(h),w=(0,u.useEvents)(h),p=(0,u.useNow)(15e3),[M,S]=(0,s.useState)(2),[v,P]=(0,s.useState)(x.name);if(!j)return(0,c.jsx)(n.Screen,{title:"Not found",children:(0,c.jsx)(n.T,{children:"Restaurant not found."})});const T=b.filter(t=>'waiting'===t.status||'notified'===t.status).sort((t,s)=>t.number-s.number),k=T.find(t=>t.customerId===x.id),B=(0,r.forecastToday)(j,y,f,w,p),C=B.nextHour?Math.min(1.6,Math.max(.8,B.nextHour.covers/(.75*j.settings.capacityPerHour))):1;if(k){const t=T.indexOf(k)+1;return(0,c.jsxs)(n.Screen,{title:"You\u2019re on the waitlist",subtitle:j.name,children:[(0,c.jsxs)(n.Card,{highlight:l.colours.gold,children:[(0,c.jsx)(n.Muted,{children:"Your queue number"}),(0,c.jsxs)(n.T,{size:56,weight:"bold",colour:l.colours.gold,children:["#",k.number]}),(0,c.jsx)(n.T,{children:1===t?'You\u2019re next':`${t-1} part${t-1==1?'y':'ies'} ahead of you`}),(0,c.jsxs)(n.T,{weight:"semibold",children:["Estimated wait: about ",(0,o.estimateWait)(t,j.settings.turnMins,C)," minutes"]}),(0,c.jsxs)(n.Muted,{children:["Estimate only \u2014 based on tables in use, typical turn times and today\u2019s forecast. Joined ",(0,a.minsBetween)(new Date(k.joinedAt),p)," min ago."]})]}),'notified'===k.status?(0,c.jsx)(n.Banner,{kind:"success",title:"Your table is ready!",children:"Please come to the door within 5 minutes to keep your table."}):(0,c.jsx)(n.Banner,{kind:"info",children:"We\u2019ll notify you when your table is ready (push/SMS simulated in this prototype)."}),(0,c.jsx)(n.Button,{kind:"secondary",label:"Leave the waitlist",onPress:()=>u.repo.waitlist.setStatus(k.id,'removed')})]})}return(0,c.jsxs)(n.Screen,{title:"Join the waitlist",subtitle:j.name,children:[(0,c.jsxs)(n.Card,{children:[(0,c.jsxs)(n.H2,{children:[T.length," part",1===T.length?'y':'ies'," waiting"]}),(0,c.jsxs)(n.Muted,{children:["Estimated wait if you join now: about ",(0,o.estimateWait)(T.length+1,j.settings.turnMins,C)," minutes (estimate)."]})]}),(0,c.jsx)(n.Field,{label:"Name",value:v,onChangeText:P}),(0,c.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(n.T,{weight:"semibold",children:"Party size"}),(0,c.jsx)(n.Stepper,{value:M,onChange:S,min:1,max:12,label:"party size"})]}),(0,c.jsx)(n.Button,{label:"Join the queue",disabled:v.trim().length<2,onPress:()=>u.repo.waitlist.join(j.id,v,M,x.id),testID:"join-waitlist"}),(0,c.jsx)(n.Muted,{children:"Waitlist messages are service messages only \u2014 no marketing."})]})}},769,[785,12,790,795,842,843,796,797,6]);
|
chef-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg
ADDED
|
chef-app/index.html
CHANGED
|
@@ -42,7 +42,7 @@
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/chef-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
-
<script src="/chef-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/chef-app/_expo/static/js/web/__common-
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
|
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/chef-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
+
<script src="/chef-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/chef-app/_expo/static/js/web/__common-b7c06dc0c9f4ad0c0d56c33437571b54.js" defer></script><script src="/chef-app/_expo/static/js/web/entry-bb1562f619d10ba0f9a22b5cff5b52e3.js" defer></script>
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
chef-app/sw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
// The Anchorage · Head Chef service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
-
const V = "cc-chef-
|
| 3 |
const BASE = "/chef-app/";
|
| 4 |
-
const PRECACHE = ["/chef-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/chef-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/chef-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/chef-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/chef-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/chef-app/_expo/static/js/web/__common-
|
| 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 |
// The Anchorage · Head Chef service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
+
const V = "cc-chef-6d5d47a6fc";
|
| 3 |
const BASE = "/chef-app/";
|
| 4 |
+
const PRECACHE = ["/chef-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/chef-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/chef-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/chef-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/chef-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/chef-app/_expo/static/js/web/__common-b7c06dc0c9f4ad0c0d56c33437571b54.js", "/chef-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js", "/chef-app/_expo/static/js/web/_layout-81b36bfeddca0b4e38b5954ffb5293f2.js", "/chef-app/_expo/static/js/web/basket-08b87f6408ab6870cfda24769972c955.js", "/chef-app/_expo/static/js/web/book-73d16fd431095875bb01cc0a0c784d3b.js", "/chef-app/_expo/static/js/web/demo-2aeda33db335ba3a45d18733444a4df6.js", "/chef-app/_expo/static/js/web/entry-bb1562f619d10ba0f9a22b5cff5b52e3.js", "/chef-app/_expo/static/js/web/feedback-c3022e0683297c445b34cc46bbd3da7c.js", "/chef-app/_expo/static/js/web/gift-0647b216e00344da5b09e74268994259.js", "/chef-app/_expo/static/js/web/index-2126b5aa7e82751237c9d2717f57d66f.js", "/chef-app/_expo/static/js/web/index-262c67710af9665f3d517bccf3c36b47.js", "/chef-app/_expo/static/js/web/index-3ce55512f207e0f4e938fcea314e34d2.js", "/chef-app/_expo/static/js/web/index-42c772ae8e6fc8ffb457607b71499331.js", "/chef-app/_expo/static/js/web/index-74ed5e3887809c4259d725a2965aa3f3.js", "/chef-app/_expo/static/js/web/index-99af37ed24577194995c700759e20e13.js", "/chef-app/_expo/static/js/web/index-cd1a75d1c6392ea7f363e8d3491f1093.js", "/chef-app/_expo/static/js/web/index-e57a61ccf8b16e38bf91548a01cebbf1.js", "/chef-app/_expo/static/js/web/index-fbb7a768b57e7588ba2174f223b7bfd2.js", "/chef-app/_expo/static/js/web/lost-7b007fea2d20e11c896c10e43db314be.js", "/chef-app/_expo/static/js/web/loyalty-3afa3f098d21bb7ab00753ff2e0dcc9d.js", "/chef-app/_expo/static/js/web/merch-14abbe5512f1b6eed03bc33e186d67f4.js", "/chef-app/_expo/static/js/web/offers-5900fcc1d50a10eb3a8ff2fd4b42777f.js", "/chef-app/_expo/static/js/web/profile-b0183082b0dcf2e0d1b983ab023ecb11.js", "/chef-app/_expo/static/js/web/refer-0e20085c049a276476e1c515770e9648.js", "/chef-app/_expo/static/js/web/waitlist-66e55b1e298508430a6f018b8afdee7b.js", "/chef-app/_expo/static/js/web/whatson-7bba1c8989b9be2fc455c8ddd8bbc99d.js", "/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/chef-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/chef-app/assets/assets/brand/saltmarsh.84acbc30d810d7a1cd3bbeb7b62651e8.png", "/chef-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/chef-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/chef-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/chef-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/chef-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/chef-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/chef-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/chef-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/chef-app/brand-logo.png", "/chef-app/favicon.ico", "/chef-app/icon-192.png", "/chef-app/icon-512.png", "/chef-app/icon-maskable-512.png", "/chef-app/manifest.webmanifest", "/chef-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);
|
customer-app/_expo/static/js/web/__common-52a49e9076da5e6246f0b3bc8aa4a0c8.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
customer-app/_expo/static/js/web/_layout-40923b7d6a3d0851d16f012e9082d331.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 E}});var t=r(_d[0]),s=r(_d[1]),o=(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[2])),n=r(_d[3]),u=r(_d[4]),c=e(r(_d[5])),d=e(r(_d[6]));r(_d[7]);var l=e(r(_d[8])),f=e(r(_d[9])),p=r(_d[10]),h=r(_d[11]),y=r(_d[12]),b=r(_d[13]),O=r(_d[14]),S=r(_d[15]),_=r(_d[16]),j=r(_d[17]);const w=r(_d[18]),P=r(_d[19]),v=r(_d[20]),A=r(_d[21]);function E(){const[e]=(0,t.useFonts)({Poppins_400Regular:w,Poppins_500Medium:P,Poppins_600SemiBold:v,Poppins_700Bold:A}),[E,x]=(0,u.useState)(b.useStore.persist.hasHydrated()),[H,k]=(0,u.useState)(S.useOwner.persist.hasHydrated()),F=E&&H;(0,u.useEffect)(()=>{const e=b.useStore.persist.onFinishHydration(()=>x(!0)),t=S.useOwner.persist.onFinishHydration(()=>k(!0));return b.useStore.persist.hasHydrated()&&x(!0),S.useOwner.persist.hasHydrated()&&k(!0),()=>{e(),t()}},[]),(0,u.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===b.useStore.persist.getOptions().name&&b.useStore.persist.rehydrate(),e.key===O.useFloor.persist.getOptions().name&&O.useFloor.persist.rehydrate()};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]);const M=e&&F,T=(0,s.usePathname)(),C=M&&!(0,h.isAllowedPath)(T||'/');return(0,u.useEffect)(()=>{if(!C)return;const e=setTimeout(()=>s.router.replace(h.ENTRY[h.APP_VARIANT]),0);return()=>clearTimeout(e)},[C,T]),(0,u.useEffect)(()=>{M&&o.hideAsync().catch(()=>{})},[M]),M?(0,j.jsxs)(y.SafeAreaProvider,{children:[(0,j.jsx)(n.StatusBar,{style:"light"}),(0,j.jsx)(s.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:_.colours.bg}}}),C?(0,j.jsx)(f.default,{style:[l.default.absoluteFill,{backgroundColor:_.colours.bg}]}):null]}):(0,j.jsxs)(f.default,{style:{flex:1,backgroundColor:_.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[(0,j.jsx)(d.default,{source:p.HERO_LOGOS.anchorage,accessibilityLabel:"The Anchorage logo",style:{width:180,height:180},resizeMode:"contain"}),(0,j.jsx)(c.default,{color:_.colours.gold})]})}o.preventAutoHideAsync().catch(()=>{})},783,[888,785,915,549,12,228,178,104,28,109,856,787,271,796,861,804,797,6,917,918,919,920]);
|
| 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])},888,[889,912,914]);
|
| 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)}}},889,[283,890,893,907,908,909,910,911]);
|
| 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}},890,[283,891]);
|
| 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}},891,[892]);
|
| 6 |
+
__d(function(g,r,i,a,m,e,d){},892,[]);
|
| 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)}},893,[894,283,890,907,908]);
|
| 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]}})})},894,[895,896,906]);
|
| 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()}})}},895,[896,900,905]);
|
| 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}}},896,[283,214,897,901,902,903,904,900,905]);
|
| 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}},897,[283,898,181,94,899,900]);
|
| 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])},898,[557]);
|
| 13 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}}),r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e};function c(e){const t=n.pickScale(e.scales,s.default.get()),c=1===t?'':'@'+t+'x',o=e.type?`.${e.type}`:'';return e.httpServerLocation.replace(/\.\.\//g,'_')+'/'+e.name+c+o}class n{constructor(e,t,s){this.serverUrl=e||'https://expo.dev',this.jsbundleUrl=null,this.asset=s}isLoadedFromServer(){return!0}isLoadedFromFileSystem(){return!1}defaultAsset(){return this.assetServerURL()}assetServerURL(){const e=new URL(c(this.asset),this.serverUrl);return e.searchParams.set('platform',"web"),e.searchParams.set('hash',this.asset.hash),this.fromSource(e.toString().replace(e.origin,''))}fromSource(e){return{__packager_asset:!0,width:this.asset.width??void 0,height:this.asset.height??void 0,uri:e,scale:n.pickScale(this.asset.scales,s.default.get())}}static pickScale(e,t){for(const s of e)if(s>=t)return s;return e[e.length-1]||1}}},899,[283,181]);
|
| 14 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IS_ENV_WITH_LOCAL_ASSETS",{enumerable:!0,get:function(){return t}}),e.getLocalAssets=function(){return{}},e.getManifest2=function(){return{}},Object.defineProperty(e,"manifestBaseUrl",{enumerable:!0,get:function(){return n}});const t=!1;const n=null},900,[]);
|
| 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}},901,[]);
|
| 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}},902,[]);
|
| 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])},903,[901]);
|
| 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}},904,[]);
|
| 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},905,[214,899]);
|
| 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])},906,[12,896]);
|
| 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}},907,[894,283]);
|
| 22 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fontSourceFromFace=function(n){const{path:o,display:s}=n,u=(0,l.resolveFaceWeight)(n),c=(0,l.resolveFaceStyle)(n);if(o instanceof t.Asset)return{uri:o.uri,...void 0!==u?{weight:u}:null,...void 0!==c?{style:c}:null,...void 0!==s?{display:s}:null};const y='string'==typeof o||'number'==typeof o?{uri:o}:o;return{...y,weight:u,style:c,display:s??y.display}};var t=r(d[0]),l=r(d[1])},908,[894,907]);
|
| 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}},909,[890]);
|
| 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])},910,[283,890,893,891]);
|
| 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})({})},911,[]);
|
| 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]))},912,[283,35,913]);
|
| 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')},913,[283]);
|
| 28 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},914,[12,889]);
|
| 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]}})})},915,[916]);
|
| 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(){}},916,[]);
|
| 31 |
+
__d(function(e,o,s,p,t,a,n){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},917,[]);
|
| 32 |
+
__d(function(o,s,e,p,t,c,d){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},918,[]);
|
| 33 |
+
__d(function(o,s,e,p,t,d,f){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},919,[]);
|
| 34 |
+
__d(function(o,s,e,p,t,d,n){"use strict";t.exports="/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},920,[]);
|
customer-app/_expo/static/js/web/basket-2b7132442dd9b45a229362d18bb3b379.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 j}});var e,l=_r(d[0]),t=_r(d[1]),n=_r(d[2]),s=(e=n)&&e.__esModule?e:{default:e},a=_r(d[3]),r=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),b=_r(d[10]),m=_r(d[11]),y=_r(d[12]);function j(){const e=(0,h.useBasket)(),n=(0,h.useRestaurant)(e.restaurantId??void 0),j=(0,h.useStore)(e=>e.menu),x=(0,h.useCustomer)(),f=(0,h.useOrders)(n?.id),k=(0,h.useStore)(e=>e.setLineQty),p=(0,h.useStore)(e=>e.overrideLine),w=(0,h.useStore)(e=>e.startBasket),v=(0,h.useNow)(15e3),[C,B]=(0,t.useState)(null),[S,P]=(0,t.useState)(!1),[T,$]=(0,t.useState)(''),[O,L]=(0,t.useState)(!1),[R,I]=(0,t.useState)(null),[M,N]=(0,t.useState)(!1),F=(0,t.useMemo)(()=>(0,b.linesFromBasket)(e,j,x.allergies),[e,j,x.allergies]);if(!n||!e.lines.length)return(0,y.jsxs)(r.Screen,{title:"Your basket",children:[(0,y.jsx)(r.Muted,{children:"Your basket is empty."}),(0,y.jsx)(r.Button,{label:"Browse restaurants",onPress:()=>l.router.replace('/customer')})]});const _='table'===e.mode,z=(0,c.takeawaySlots)(n,f,v),D=F.reduce((e,l)=>e+l.unitPrice*l.qty,0),A=F.some(e=>e.contains.length&&!e.overridden),E=e.lines.filter(e=>{const l=j.find(l=>l.id===e.itemId);return!l||l.soldOut||!l.signOff}),Y=!_&&!C,q=!_&&n.settings.takeawayPaused,H=!A&&!E.length&&S&&!Y&&!q,K=async e=>{const t=await h.repo.orders.placeFromBasket({slotTime:_?void 0:C,tip:0,giftCardCode:e?.giftCardCode,notes:T,paidNow:!_});L(!1),l.router.replace(`/customer/order/${t.id}`)},Q=e.lines.find(e=>e.key===R),G=Q?F[e.lines.indexOf(Q)]:void 0;return(0,y.jsxs)(r.Screen,{title:"Your basket",subtitle:`${n.name} \xb7 ${_?`Table ${e.tableNo} (order at table)`:'Takeaway \u2014 collection'}`,footer:(0,y.jsxs)(s.default,{style:{gap:8},children:[(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(r.T,{weight:"semibold",children:"Subtotal"}),(0,y.jsx)(r.T,{weight:"bold",size:20,colour:m.colours.gold,children:(0,i.gbp)(D)})]}),A?(0,y.jsx)(r.T,{size:14,colour:m.colours.red,children:"Resolve the blocked allergy item(s) before continuing."}):S?Y&&!q?(0,y.jsx)(r.T,{size:14,colour:m.colours.amber,children:"Choose a collection time."}):null:(0,y.jsx)(r.T,{size:14,colour:m.colours.amber,children:"Confirm your allergies to continue."}),_?(0,y.jsx)(r.Button,{label:"Send order to the kitchen",disabled:!H,onPress:()=>K(),testID:"send-table-order"}):(0,y.jsx)(r.Button,{label:`Continue to payment \xb7 ${(0,i.gbp)(D)}`,disabled:!H,onPress:()=>L(!0),testID:"checkout"})]}),children:[(_||e.tableNo,null),_?(0,y.jsx)(r.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,n.fictional?null:(0,y.jsx)(r.ExampleAllergenNotice,{}),F.map((l,t)=>{const n=e.lines[t],a=l.contains.length&&!l.overridden;return(0,y.jsxs)(r.Card,{highlight:l.contains.length?m.colours.red:l.may.length?m.colours.amber:void 0,children:[(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,y.jsxs)(s.default,{style:{flex:1,paddingRight:8},children:[(0,y.jsx)(r.T,{weight:"semibold",children:l.name}),l.choices.length?(0,y.jsx)(r.Muted,{children:l.choices.join(' \xb7 ')}):null,l.notes?(0,y.jsxs)(r.Muted,{children:["Note: ",l.notes]}):null]}),(0,y.jsx)(r.T,{weight:"semibold",children:(0,i.gbp)(l.unitPrice*l.qty)})]}),a?(0,y.jsxs)(r.Banner,{kind:"danger",title:`BLOCKED \u2014 contains ${l.contains.map(o.allergenLabel).join(', ')}`,children:[(0,y.jsx)(r.T,{size:14,colour:"#FFE3DF",children:`Conflicts with your declared ${x.allergies.filter(e=>l.contains.includes(e.allergen)).map(e=>`${(0,o.allergenLabel)(e.allergen)} (${(0,o.severityLabel)(e.severity)})`).join(', ')}.`}),(0,y.jsxs)(r.Row,{gap:8,style:{marginTop:6},children:[(0,y.jsx)(r.Button,{small:!0,kind:"secondary",label:"Remove",onPress:()=>k(n.key,0)}),(0,y.jsx)(r.Button,{small:!0,kind:"danger",label:"Override\u2026",onPress:()=>{N(!1),I(n.key)}})]})]}):l.contains.length?(0,y.jsx)(r.Banner,{kind:"danger",title:`Allergy override recorded \u2014 contains ${l.contains.map(o.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,y.jsx)(r.Banner,{kind:"warn",title:`May contain ${l.may.map(o.allergenLabel).join(', ')}`,children:"Cross-contact risk (e.g. shared fryer). Please check with staff."}):null,E.includes(n)?(0,y.jsx)(r.Badge,{kind:"amber",label:"No longer available online \u2014 please remove"}):null,(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>k(n.key,0)}),(0,y.jsx)(r.Stepper,{value:n.qty,onChange:e=>k(n.key,e),min:1,label:l.name})]})]},n.key)}),(0,y.jsx)(r.Button,{kind:"ghost",label:"+ Add more items",onPress:()=>l.router.push(`/customer/${n.id}`)}),_?null:(0,y.jsxs)(r.Card,{children:[(0,y.jsxs)(r.H2,{children:["Collection time \u2014 ",(0,u.niceDate)(v)]}),q?(0,y.jsx)(r.Banner,{kind:"warn",title:"Takeaway paused",children:"The restaurant has paused takeaway slots for now. Please try again later or book a table."}):0===z.length?(0,y.jsx)(r.Banner,{kind:"warn",children:"No collection slots left today."}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(r.Muted,{children:["15-minute slots, max ",n.settings.slotCap," orders each so the kitchen isn\u2019t overloaded."]}),(0,y.jsx)(r.Row,{wrap:!0,gap:6,children:z.slice(0,16).map(e=>(0,y.jsx)(r.Chip,{label:e.label,sub:e.full?'Full':e.cap-e.taken+" left",disabled:e.full,selected:C===e.time.toISOString(),onPress:()=>B(e.time.toISOString())},e.label))})]})]}),(0,y.jsxs)(r.Card,{highlight:S?void 0:m.colours.amber,children:[(0,y.jsx)(r.H2,{children:"Confirm allergies for this order"}),(0,y.jsx)(r.Row,{wrap:!0,gap:6,children:x.allergies.length?x.allergies.map(e=>(0,y.jsx)(r.Badge,{kind:"red",label:`${(0,o.allergenLabel)(e.allergen)} \u2014 ${(0,o.severityLabel)(e.severity)}`},e.allergen)):(0,y.jsx)(r.Muted,{children:"No allergies declared on your profile."})}),(0,y.jsx)(r.Toggle,{label:x.allergies.length?'Yes, these are correct for everyone this order is for':'I confirm no one in this order has a food allergy',value:S,onChange:P}),(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Edit allergies in profile",onPress:()=>l.router.push('/customer/profile')})]}),(0,y.jsx)(r.Field,{label:"Order notes (optional)",value:T,onChangeText:$,placeholder:"e.g. cutlery please"}),_?(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Switch to takeaway instead",onPress:()=>w(n.id,'takeaway')}):null,(0,y.jsx)(a.MockPay,{visible:O,onClose:()=>L(!1),amount:D,restaurantId:n.id,onPaid:e=>K({giftCardCode:e.giftCardCode}),title:"Pay for your takeaway"}),(0,y.jsxs)(r.Sheet,{visible:!!Q,onClose:()=>I(null),title:"Allergy override",children:[G?(0,y.jsx)(r.Banner,{kind:"danger",title:`${G.name} contains ${G.contains.map(o.allergenLabel).join(', ')}`,children:"Only continue if this item is for someone without this allergy, or you have spoken to staff."}):null,(0,y.jsx)(r.Toggle,{label:"I understand and want to add it anyway",value:M,onChange:N}),(0,y.jsx)(r.Button,{kind:"danger",disabled:!M,label:"Confirm override",onPress:()=>{Q&&G&&p(Q.key,G.contains),I(null)}})]})]})}},771,[785,12,109,789,790,791,793,794,795,796,845,797,6]);
|
customer-app/_expo/static/js/web/entry-f1c6a1da80b60e7480866755232908a5.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
customer-app/_expo/static/js/web/index-00d06db77562b3402bcb1797b945656d.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 o}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function o(){return(0,n.canShow)('display')?(0,c.jsx)(u.DisplayBoard,{}):(0,c.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},777,[785,12,787,847,6]);
|
| 2 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisplayBoard=function(){const{width:e,height:Y}=(0,n.default)(),_=e>=1e3,q=(0,T.useOwner)(e=>e.site),K=(0,y.useRestaurant)(q),X=(0,y.useOrders)(q),J=(0,y.useBookings)(q),Q=(0,y.useWaitlist)(q),Z=(0,y.useEvents)(q),ee=(0,y.useRatings)(q),se=(0,y.useAudit)(q),le=(0,y.useStore)(e=>e.menu),te=(0,y.useStore)(e=>e.walkIns[q]??0),ae=(0,y.useStore)(e=>e.alertAcks),re=((0,y.useStore)(e=>e.customer),(0,y.useStore)(e=>e.skipMinutes)),oe=(0,y.useNow)(5e3),ne=(0,T.useOwner)(e=>e.staff),ie=(0,T.useOwner)(e=>e.attendance),de=(0,T.useOwner)(e=>e.shifts),ue=(0,T.useOwner)(e=>e.chat),[ce,ge]=(0,s.useState)(!0);l.default.useEffect(()=>{(0,$.ensureAttendance)((0,f.ymd)(oe),oe),(0,v.ensureChat)(oe)},[(0,f.ymd)(oe)]);const he=ie.filter(e=>e.in&&!e.out&&oe.getTime()-new Date(e.in).getTime()<72e6&&oe.getTime()>=new Date(e.in).getTime()),pe=he.length?he.map(e=>F(ne.find(s=>s.id===e.staffId)?.name)).filter(Boolean):['Duty Manager'],[me,be]=(0,s.useState)(null),xe=me&&pe.includes(me)?me:pe[0],[fe,je]=(0,s.useState)(''),[ye,we]=(0,s.useState)('2'),ke=(0,f.ymd)(oe),Te=(0,C.useFrontDoor)(ke,e>Y),ve=(0,B.useDisplaySettings)(q),Ce=ve.privacy,$e=(0,B.usePlan)(q),Be=(0,B.useFloor)(e=>e.live[q]),[Se,Re]=(0,s.useState)('floor'),[Pe,Me]=(0,s.useState)(''),[De,Ae]=(0,s.useState)(null),[Ie,Le]=(0,s.useState)(null),[ze,Ee]=(0,s.useState)(null),[He,Ne]=(0,s.useState)(!1),[We,Oe]=(0,s.useState)(null);l.default.useEffect(()=>{if(!We)return;const e=setTimeout(()=>Oe(null),4500);return()=>clearTimeout(e)},[We]);const Fe=(e,s)=>Ee({title:e,body:s}),Ve=e=>Fe(`Guest details \xb7 ${e.time}`,(0,E.bookingDetails)(e)),Ge=(0,s.useMemo)(()=>(0,p.forecastToday)(K,J,X,Z,oe),[K,J,X,Z,oe.getTime()/6e4|0]),Ue=J.filter(e=>e.date===ke).sort((e,s)=>e.time.localeCompare(s.time)),Ye=te+Ue.filter(e=>e.walkIn&&['seated','finished'].includes(e.status)).reduce((e,s)=>e+s.partySize,0),qe=Ue.filter(e=>!e.walkIn&&'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ke=Q.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),Xe=X.filter(e=>!['collected','closed','cancelled'].includes(e.status)).sort((e,s)=>Number('new'===s.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(s.slotTime??s.createdAt)),Je=X.filter(e=>['collected','closed'].includes(e.status)).length,Qe=(0,x.takeawaySlots)(K,X,oe),Ze=Ge.nextHour?Math.min(1.6,Math.max(.8,Ge.nextHour.covers/(.75*K.settings.capacityPerHour))):1,es=(e,s)=>!!(0,z.statusBlock)(e,s,(0,z.linkedBooking)(e,J)),ss=e=>{const s=(0,z.nextStep)(e,(0,z.linkedBooking)(e,J));return!(!s||'table'===s&&!['ready','served'].includes(e.status))},ls=Xe.filter(e=>e.allergies.length&&ss(e)),ts=Ue.filter(e=>e.allergies.length&&!e.allergyAck&&['confirmed','seated'].includes(e.status)&&!Xe.some(s=>s.allergies.length&&(0,z.linkedBooking)(s,[e]))),as=Xe.flatMap(e=>(0,b.readinessFor)(e,K,oe).map(s=>({...s,order:e}))),rs=as.filter(e=>'due'===e.state||'overdue'===e.state),os=as.filter(e=>'upcoming'===e.state).sort((e,s)=>e.due.getTime()-s.due.getTime()),ns=ee.filter(e=>e.stars<=2&&!ae[`rating:${e.id}`]),is=Xe.filter(e=>'new'===e.status&&!e.allergies.length&&(0,f.minsBetween)(new Date(e.createdAt),oe)>=0),ds=le.filter(e=>e.restaurantId===q&&e.soldOut),us=(se.filter(e=>'stamp'===e.kind||'giftcard'===e.kind).slice(0,4),ls.length+ts.length+rs.length+ns.length+is.length),cs=(0,s.useMemo)(()=>(0,S.floorView)($e,J,X,Be??{},oe,K.settings.turnMins),[$e,J,X,Be,oe.getTime()]),gs=$e.areas.some(e=>e.id===Pe)?Pe:$e.areas[0]?.id??'',hs=Object.fromEntries($e.areas.map(e=>{const s=$e.tables.filter(s=>s.areaId===e.id);return[e.id,`${s.filter(e=>'free'===cs[e.name]?.status).length}/${s.length} free`]})),ps=(0,I.hoursFor)(K,oe),ms=ps?(0,f.addMins)(ps.open,-ps.open.getMinutes()):new Date(`${ke}T12:00:00`),bs=ps?(0,f.addMins)(ps.close,120):new Date(`${ke}T23:00:00`),xs=async(e,s)=>{const l=cs[e]?.booking;if(!l||e===s)return;const t=cs[s]?.status;if(t&&!['free','soon'].includes(t))return void Oe('dirty'===t?`Table ${s} needs clearing first.`:`Table ${s} is ${S.STATUS[t].label.toLowerCase()} \u2014 pick a free table.`);await y.repo.bookings.update(l.id,{table:s});const a=Be?.[e]?.stage;B.useFloor.getState().setLive(q,s,{stage:a??'seated',dirty:!1}),B.useFloor.getState().setLive(q,e,{stage:void 0,dirty:!0}),Oe(`${(0,A.privName)(l,Ce)} moved Table ${e} \u2192 ${s}. Table ${e} needs clearing.`)},fs=e=>Fe(`Order ${e.ref} \xb7 details`,(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(e.customerName)}),e.allergies.length?(0,W.jsxs)(u.T,{weight:"bold",colour:k.colours.red,children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}):(0,W.jsx)(u.Muted,{children:"No allergies declared."}),e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{colour:k.colours.red,children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.notes?` \xb7 \u201c${e.notes}\u201d`:'']},s))]})),js=Ge.hours,ys=Math.max(K.settings.capacityPerHour,...js.map(e=>e.coversHigh)),ws=(0,W.jsxs)(V,{title:`Bookings & waitlist \xb7 ${(0,f.niceDate)(oe)}`,right:(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`}),children:[0===Ue.length?(0,W.jsx)(u.Muted,{children:"No bookings today."}):null,Ue.map(e=>{const s='confirmed'===e.status&&(0,f.minsBetween)(new Date(`${e.date}T${e.time}:00`),oe)>15;return(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10,opacity:['finished','noshow','cancelled'].includes(e.status)?.5:1,borderColor:e.allergies.length?k.colours.red:s?k.colours.amber:k.colours.border}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:[e.time," \xb7 ",Ce?`${(0,A.privName)(e,!0)} \xb7 ${e.partySize}`:(0,C.walkInLabel)(e)]}),(0,W.jsx)(u.Badge,{kind:'seated'===e.status?'green':'noshow'===e.status?'red':'neutral',label:'noshow'===e.status?'No-show':e.status})]}),(0,W.jsxs)(u.Muted,{children:[e.table?`Table ${e.table}`:e.walkIn?'Table to assign':'Table TBC',e.walkIn?` \xb7 ${e.ref}`:'','none'!==e.security?" \xb7 "+('deposit'===e.security?'Deposit':'Card saved'):'',e.notes?Ce?' \xb7 \u270e':` \xb7 ${e.notes}`:'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:"\u26a0 Allergy"}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>Ve(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsx)(u.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,W.jsx)(u.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,s?(0,W.jsx)(u.T,{size:13,colour:k.colours.amber,children:"Running late \u2014 15+ min past booking time"}):null,!e.table&&e.walkIn&&'seated'===e.status?(0,W.jsx)(u.Button,{label:"Assign table",onPress:()=>Te.assignTable(e)}):null,'confirmed'===e.status?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.bookings.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>y.repo.bookings.setStatus(e.id,'noshow')})]}):'seated'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Finished",onPress:()=>y.repo.bookings.setStatus(e.id,'finished')}):null]},e.id)}),(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',marginTop:6},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.gold,children:["Waitlist (",Ke.length,")"]}),(0,W.jsxs)(u.Muted,{children:["~",(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)," min for a new party (est.)"]})]}),Ke.map((e,s)=>(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:["#",e.number," ",(0,A.pv)(e.name,Ce)," \xb7 ",e.partySize]}),(0,W.jsxs)(u.Muted,{children:["waiting ",(0,f.minsBetween)(new Date(e.joinedAt),oe)," min \xb7 est. ",(0,j.estimateWait)(s+1,K.settings.turnMins,Ze)," min"]})]}),'notified'===e.status?(0,W.jsx)(u.Badge,{kind:"green",label:"Notified \u2014 table ready"}):null,(0,W.jsxs)(u.Row,{gap:6,children:['waiting'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>y.repo.waitlist.setStatus(e.id,'notified')}):null,(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.waitlist.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>y.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:fe,onChangeText:je,style:[u.styles.input,{flex:1,paddingVertical:6}]}),(0,W.jsx)(r.default,{accessibilityLabel:"Party size",value:ye,onChangeText:we,keyboardType:"number-pad",style:[u.styles.input,{width:50,paddingVertical:6}]}),(0,W.jsx)(u.Button,{small:!0,label:"Add",disabled:fe.trim().length<2,onPress:()=>{y.repo.waitlist.join(q,fe.trim(),Math.max(1,Number(ye)||2)),je('')}})]})]}),ks=(0,W.jsxs)(V,{title:"Live orders & kitchen tickets",right:(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Chip,{label:"Tickets",selected:ce,onPress:()=>ge(!0)}),(0,W.jsx)(u.Chip,{label:"Full orders",selected:!ce,onPress:()=>ge(!1)})]}),children:[(0,W.jsxs)(u.Muted,{children:[Xe.length," live \xb7 ",Je," done today"]}),0===Xe.length?(0,W.jsx)(u.Muted,{children:"No live orders."}):null,ce?(0,W.jsxs)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[Xe.filter(e=>['new','acknowledged','preparing'].includes(e.status)).map(e=>{const s=Math.max(0,(0,f.minsBetween)(new Date(e.createdAt),oe)),l=s>=20?k.colours.red:s>=12?k.colours.amber:k.colours.green;return(0,W.jsxs)(o.default,{testID:`ticket-${e.ref}`,style:{width:210,backgroundColor:'#F4EFE3',borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:e.allergies.length?k.colours.red:l},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",colour:"#111",children:'table'===e.type?`TABLE ${e.tableNo}`:`TAKEAWAY ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`}),(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:s>=20?'#B3261E':'#333',children:[s,"m"]})]}),(0,W.jsxs)(u.T,{size:12,colour:"#444",children:[e.ref," \xb7 ",e.status.toUpperCase()]}),e.allergies.length?(0,W.jsx)(o.default,{style:{backgroundColor:'#B3261E',borderRadius:4,padding:4},children:(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:"#fff",children:["\u26a0 ",Ce?'ALLERGY \u2014 see details':e.allergies.map(e=>(0,h.allergenLabel)(e.allergen)).join(', ').toUpperCase()]})}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,weight:"semibold",colour:"#111",children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'']},s)),e.lines.some(e=>e.notes)?(0,W.jsx)(u.T,{size:12,colour:"#444",children:Ce?'Notes \u2014 see details':`Notes: ${e.lines.filter(e=>e.notes).map(e=>e.notes).join(' \xb7 ')}`}):null,Ce&&(e.allergies.length||e.lines.some(e=>e.notes))?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Details",onPress:()=>fs(e)}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:'takeaway'===e.type?'Ready':'Food out',disabled:es(e,'takeaway'===e.type?'ready':'served'),onPress:()=>y.repo.orders.setStatus(e.id,'takeaway'===e.type?'ready':'served',xe)}):null]},e.id)}),Xe.filter(e=>['ready','served'].includes(e.status)).map(e=>(0,W.jsxs)(o.default,{style:{width:210,backgroundColor:k.colours.surface2,borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:k.colours.green},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",children:'table'===e.type?`Table ${e.tableNo}`:`Takeaway ${e.ref}`}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce),'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':'']}),e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",testID:`collected-${e.ref}`,disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]},e.id))]}):null,ce?null:Xe.map(e=>{const s=e.allergies.length>0&&ss(e),l=e.lines.filter(e=>e.overridden),t=e.lines.filter(e=>e.contains.length||e.may.length);return(0,W.jsxs)(o.default,{testID:`order-${e.ref}`,style:[u.styles.card,{padding:10,borderColor:s?k.colours.red:'ready'===e.status?k.colours.green:k.colours.border,borderWidth:s?2:1}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"bold",children:e.ref}),(0,W.jsx)(u.Badge,{kind:'takeaway'===e.type?'gold':'blue',label:'takeaway'===e.type?`Takeaway \xb7 ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`:`Table ${e.tableNo}`})]}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce)," \xb7 ",(0,m.gbp)(e.subtotal)," \xb7 ",e.paid>=e.total?'Paid (demo)':e.paid>0?`Part paid ${(0,m.gbp)(e.paid)}`:'Unpaid \u2014 bill at end',e.customerSignal?" \xb7 "+('here'===e.customerSignal?'CUSTOMER IS HERE':'Customer on the way'):'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:s?'\u26a0 Allergy: sign-off needed':'\u26a0 Allergy (signed off)'}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>fs(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.redBg,borderRadius:8,padding:8,borderLeftWidth:5,borderLeftColor:k.colours.red},children:[(0,W.jsxs)(u.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}),l.length?(0,W.jsxs)(u.T,{size:14,weight:"semibold",colour:"#FFE3DF",children:["Customer OVERRODE block on: ",l.map(e=>`${e.name} [contains ${e.contains.map(h.allergenLabel).join(', ')}]`).join('; ')]}):null,t.filter(e=>!e.overridden&&e.may.length).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:"#FFE2A8",children:["May contain: ",e.name," [",e.may.map(h.allergenLabel).join(', '),"]"]},s))]}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.choices.length?` \u2014 ${e.choices.join(', ')}`:'',e.notes?Ce?' \xb7 \u270e':` \xb7 \u201c${e.notes}\u201d`:'']},s)),(0,W.jsxs)(u.Row,{wrap:!0,gap:6,children:['new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start preparing",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status&&'takeaway'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",disabled:es(e,'ready'),onPress:()=>y.repo.orders.setStatus(e.id,'ready',xe)}):null,'preparing'===e.status&&'table'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Food out",disabled:es(e,'served'),onPress:()=>y.repo.orders.setStatus(e.id,'served',xe)}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]})]},e.id)})]}),Ts=({colour:e,title:s,children:l})=>(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.surface2,borderRadius:10,padding:10,borderLeftWidth:6,borderLeftColor:e,gap:4},children:[(0,W.jsx)(u.T,{weight:"bold",colour:e,children:s}),l]}),vs={cook:'START COOKING',bag:'BAG IT',ready:'READY'},Cs=(0,W.jsxs)(V,{title:"Allergy & takeaway alerts",right:(0,W.jsx)(u.Badge,{kind:us?'red':'green',label:`${us} need action`}),children:[ls.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 ${e.ref} ${'table'===e.type?`(Table ${e.tableNo})`:'(takeaway)'}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>fs(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),Ce?null:e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:k.colours.red,weight:"semibold",children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0})]},e.id)),ts.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 booking ${e.time} ${(0,A.privName)(e,Ce)} (${e.partySize})`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>Ve(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),(0,W.jsx)(L.BookingAllergyChain,{b:e,me:xe})]},e.id)),rs.map(e=>(0,W.jsxs)(Ts,{colour:'overdue'===e.state?k.colours.red:k.colours.amber,title:`${vs[e.stage]} \u2014 ${e.order.ref} \xb7 pickup ${(0,f.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,W.jsx)(u.T,{size:14,children:e.detail}),(0,W.jsxs)(u.Muted,{children:["Due ",(0,f.hm)(e.due)," (slot \u2212 prep \u2212 ",K.settings.bufferMins," min buffer)",e.order.allergies.length?' \xb7 \u26a0 allergy order':'']}),'ready'===e.stage?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>y.repo.orders.setStatus(e.orderId,'ready',xe)}):(0,W.jsx)(u.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:es(e.order,'preparing'),onPress:()=>y.repo.orders.acknowledgeReadiness(e.orderId,e.stage,xe)})]},e.id)),is.map(e=>(0,W.jsx)(Ts,{colour:k.colours.amber,title:`New order ${e.ref} \u2014 not yet acknowledged`,children:(0,W.jsx)(u.Button,{small:!0,label:"Acknowledge",onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)})},e.id)),ns.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`LOW RATING ${e.stars}/5 \u2014 ${e.context}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show comment",onPress:()=>Fe(`Rating ${e.stars}/5`,(0,W.jsxs)(u.T,{children:[F(e.customerName),e.comment?`: \u201c${e.comment}\u201d`:'']}))}):(0,W.jsxs)(u.T,{size:15,children:[e.customerName,e.comment?`: \u201c${e.comment}\u201d`:'']}),(0,W.jsx)(u.Muted,{children:"Manager: speak to the guest while they\u2019re still here."}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`Handled \u2014 ${xe}`,onPress:()=>y.repo.alerts.acknowledge(`rating:${e.id}`,xe)})]},e.id)),0===us?(0,W.jsx)(u.Muted,{children:"No alerts need action."}):null,os.length?(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Upcoming takeaway timings"}),os.slice(0,6).map(e=>(0,W.jsxs)(u.T,{size:14,children:[(0,f.hm)(e.due)," \xb7 ",vs[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,f.hm)(new Date(e.order.slotTime)),")"]},e.id))]}):null,ds.length?(0,W.jsx)(Ts,{colour:k.colours.muted,title:"Sold out",children:(0,W.jsx)(u.T,{size:14,children:ds.map(e=>e.name).join(', ')})}):null,(0,W.jsxs)(o.default,{style:{gap:2,marginTop:6},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Allergy log"}),Ce?(0,W.jsxs)(u.Muted,{children:[se.filter(e=>'allergy'===e.kind).length," entries today \u2014 full log in the Managers app (privacy mode)."]}):se.filter(e=>'allergy'===e.kind).slice(0,5).map(e=>(0,W.jsxs)(u.T,{size:13,colour:"#FFD9D4",children:[(0,f.hm)(new Date(e.at))," \xb7 ",e.text]},e.id))]})]}),$s=de.filter(e=>e.day===(0,$.weekday)(oe)&&!he.some(s=>s.staffId===e.staffId)&&60*e.start>60*oe.getHours()+oe.getMinutes()).sort((e,s)=>e.start-s.start),Bs=ue.filter(e=>'all'===e.ch&&!e.removed).sort((e,s)=>Number(!!s.pinned)-Number(!!e.pinned)||s.at.localeCompare(e.at)).slice(0,6),Ss=(0,W.jsxs)(o.default,{style:{flex:.8,gap:10},children:[(0,W.jsxs)(V,{title:"Who's on",right:(0,W.jsx)(u.Badge,{kind:"green",label:`${he.length} clocked in`}),children:[0===he.length?(0,W.jsx)(u.Muted,{children:"Nobody clocked in yet."}):null,he.map(e=>{const s=ne.find(s=>s.id===e.staffId),l=de.find(s=>s.staffId===e.staffId&&s.day===(0,$.weekday)(oe));return(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(N.StaffAvatar,{id:e.staffId,size:34}),(0,W.jsxs)(o.default,{style:{flex:1},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(s?.name)}),(0,W.jsxs)(u.Muted,{children:[s?.job,l?` \xb7 rota ${(0,$.fmtH)(l.start)}\u2013${(0,$.fmtH)(l.end)}`:'']})]}),(0,W.jsx)(u.Badge,{kind:"green",label:`in ${(0,f.hm)(new Date(e.in))}`})]},e.id)}),$s.map(e=>(0,W.jsxs)(u.Muted,{children:["Due in ",(0,$.fmtH)(e.start),": ",F(ne.find(s=>s.id===e.staffId)?.name)]},e.id))]}),(0,W.jsxs)(V,{title:"Staff announcements",right:(0,W.jsx)(u.Muted,{children:"All staff chat"}),children:[0===Bs.length?(0,W.jsx)(u.Muted,{children:"No announcements."}):null,Bs.map(e=>(0,W.jsxs)(o.default,{style:{gap:2,borderLeftWidth:3,borderLeftColor:e.pinned?k.colours.gold:k.colours.border,paddingLeft:8},children:[(0,W.jsxs)(u.T,{size:12,colour:e.pinned?k.colours.gold:k.colours.muted,children:[e.pinned?'\ud83d\udccc ':'','system'===e.from?'Cover Charge':F(ne.find(s=>s.id===e.from)?.name)," \xb7 ",(0,f.hm)(new Date(e.at))]}),(0,W.jsx)(u.T,{size:14,children:e.text??(e.photo?`Photo: ${e.photo.caption}`:'')})]},e.id)),(0,W.jsx)(u.Muted,{children:"Read-only on the display. Post from Cover Charge for Staff or Cover Charge for Managers."})]})]}),Rs=_||e>=900,Ps=(0,W.jsx)(E.WaitlistPanel,{rid:q,r:K,plan:$e,view:cs,todays:Ue,waiting:Ke,now:oe,privacy:Ce,busy:Ze,onToast:Oe}),Ms=(0,W.jsx)(E.PacePanel,{r:K,fc:Ge,todays:Ue,now:oe,walkInCount:te,staffOn:he.length||1,onSummary:()=>Ne(!0)}),Ds=s=>Rs?(0,W.jsx)(t.default,{style:{width:e>=1200?340:300,flexGrow:0},contentContainerStyle:{gap:10,paddingBottom:20},children:s}):(0,W.jsx)(o.default,{style:{gap:10},children:s}),As=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsxs)(o.default,{style:{flex:1,gap:6,minHeight:Rs?void 0:420},children:[(0,W.jsx)(E.ArrivalsStrip,{todays:Ue,now:oe,privacy:Ce}),(0,W.jsx)(P.AreaTabs,{plan:$e,area:gs,onPick:Me,counts:hs}),Ie?(0,W.jsxs)(u.Row,{gap:8,style:{backgroundColor:k.colours.goldTint,borderRadius:10,padding:8},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Ie,": tap the new table (or drag it there)."]}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Le(null)})]}):null,(0,W.jsx)(o.default,{style:{flex:1,minHeight:Rs?300:Math.min(520,.62*e)},children:(0,W.jsx)(R.FloorCanvas,{plan:$e,areaId:gs,mode:"live",fit:"contain",view:cs,privacy:Ce,sectionColours:!0,turnBase:K.settings.turnMins,highlight:Ie?[Ie]:void 0,onTap:e=>{Ie?(e.name!==Ie&&xs(Ie,e.name),Le(null)):Ae(e.name)},onDrop:(e,s)=>xs(e.name,s.name)})}),(0,W.jsx)(E.Legend,{})]}),Ds((0,W.jsxs)(W.Fragment,{children:[Ps,Ms]}))]}),Is=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsx)(o.default,{style:{flex:1,minHeight:420},children:(0,W.jsx)(M.Timeline,{plan:$e,bookings:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,t0:ms,t1:bs,onOpen:e=>{const s=(0,B.tablesOf)(e.table)[0];s&&cs[s]?Ae(s):Ve(e)}})}),Ds((0,W.jsx)(W.Fragment,{children:Ps}))]}),Ls=(0,W.jsxs)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10,flexGrow:1},scrollEnabled:!_,children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{gap:6},children:[(0,W.jsx)(u.Muted,{children:"Signing off as (who's on):"}),pe.map(e=>(0,W.jsx)(u.Chip,{label:e,selected:xe===e,onPress:()=>be(e)},e))]}),(0,W.jsxs)(o.default,{testID:"forecast-strip",style:{gap:8},children:[(0,W.jsxs)(u.Row,{wrap:!0,gap:8,style:{alignItems:'stretch'},children:[(0,W.jsx)(G,{label:"Next hour"+(Ge.nextHour?` \xb7 ${String(Ge.nextHour.hour).padStart(2,'0')}:00\u2013${String(Ge.nextHour.hour+1).padStart(2,'0')}:00`:''),badge:"Estimate",value:Ge.nextHour?`${Ge.nextHour.coversLow}\u2013${Ge.nextHour.coversHigh} covers`:Ge.open?'Kitchen closing':'Closed',sub:Ge.nextHour?`${Ge.nextHour.booked} booked + ~${Ge.nextHour.walkIns} walk-ins \xb7 ~${Ge.nextHour.takeaway} takeaway (${Ge.nextHour.takeawayPlaced} placed)`:void 0}),(0,W.jsx)(G,{label:"Rest of today",badge:"Estimate",value:Ge.open?`${Ge.restOfDay.low}\u2013${Ge.restOfDay.high} covers`:'\u2014',sub:Ge.open?`${Ge.restOfDay.booked} booked \xb7 ~${Ge.restOfDay.takeaway} takeaway orders \xb7 ${Ye} walk-in covers seated so far`:void 0}),(0,W.jsx)(G,{label:"Waitlist",value:`${Ke.length} part${1===Ke.length?'y':'ies'}`,sub:`${Ke.reduce((e,s)=>e+s.partySize,0)} covers \xb7 next wait ~${(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)} min (est.)`}),(0,W.jsx)(G,{label:"Takeaway slots",value:K.settings.takeawayPaused?'PAUSED':`${Qe.filter(e=>!e.full).length} open`,sub:`Cap ${K.settings.slotCap} per ${K.settings.slotMinutes} min`,children:(0,W.jsxs)(u.Row,{gap:8,children:[(0,W.jsx)(a.default,{accessibilityLabel:"Pause takeaway slots",value:K.settings.takeawayPaused,onValueChange:e=>y.repo.restaurants.updateSettings(q,{takeawayPaused:e}),trackColor:{true:k.colours.redSolid,false:'#444'}}),(0,W.jsx)(u.T,{size:14,children:K.settings.takeawayPaused?'Resume':'Pause'})]})}),(0,W.jsx)(G,{label:"Walk-ins seated (today)",value:`${Ye} covers`,sub:"Use Walk-in above; or quick-count here without a table",children:(0,W.jsx)(u.Row,{gap:6,children:[1,2,4].map(e=>(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`+${e}`,onPress:()=>y.repo.waitlist.addWalkIn(q,e)},e))})})]}),(0,W.jsxs)(u.Row,{wrap:!0,gap:12,style:{backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,alignItems:'flex-end'},children:[(0,W.jsxs)(o.default,{style:{gap:2,flexBasis:340,flexGrow:1},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Forecast \u2014 suggested actions"}),(0,W.jsx)(u.Badge,{kind:"amber",label:"ESTIMATE"})]}),Ge.suggestions.map((e,s)=>(0,W.jsxs)(u.T,{size:14,children:["\u2022 ",e]},s)),(0,W.jsxs)(u.Muted,{children:[Ge.flags.length?`Calendar flags today: ${Ge.flags.join(', ')} \xb7 `:'',"Baseline v1: confirmed bookings + example weekday/hour averages + expected walk-ins (",Math.round(100*K.settings.walkInShare),"% share). ",w.EXAMPLE_ACCURACY,"."]})]}),(0,W.jsx)(u.Row,{gap:4,style:{alignItems:"flex-end"},children:js.map(e=>{const s=Ge.nextHour?.hour===e.hour;return(0,W.jsxs)(o.default,{style:{alignItems:'center',width:30},children:[(0,W.jsx)(u.T,{size:11,colour:k.colours.muted,children:e.covers}),(0,W.jsxs)(o.default,{style:{height:70,width:18,justifyContent:'flex-end',borderBottomWidth:1,borderColor:k.colours.border},children:[(0,W.jsx)(o.default,{style:{height:e.walkIns/ys*70,backgroundColor:s?k.colours.goldLight:'#6B5A3A'}}),(0,W.jsx)(o.default,{style:{height:e.booked/ys*70,backgroundColor:s?k.colours.gold:'#9C7C45'}})]}),(0,W.jsx)(u.T,{size:11,colour:s?k.colours.gold:k.colours.muted,children:e.hour})]},e.hour)})})]})]}),(0,W.jsxs)(o.default,{style:{flexDirection:_?'row':'column',gap:10,flex:_?1:void 0,minHeight:_?380:void 0},children:[ws,(0,W.jsx)(o.default,{style:{flex:1.5,gap:10},children:ks}),Cs,Ss]})]}),zs=(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10},children:(0,W.jsx)(P.FloorEditor,{rid:q,compact:!Rs,maxH:Math.max(300,Y-330)})});return(0,W.jsxs)(i.SafeAreaView,{style:{flex:1,backgroundColor:k.colours.bg},children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{paddingHorizontal:14,paddingVertical:6,gap:10,borderBottomWidth:1,borderBottomColor:k.colours.border},children:[(0,W.jsx)(c.RestaurantBrand,{rid:K.id,size:48,sub:"Display \xb7 Harbour View, Dunure"}),(0,W.jsx)(o.default,{style:{flex:1}}),Ce?(0,W.jsx)(u.Badge,{kind:"gold",label:"\ud83d\udd12 Privacy on"}):(0,W.jsx)(u.Badge,{kind:"amber",label:"Privacy off"}),us?(0,W.jsx)(H.default,{accessibilityRole:"button",accessibilityLabel:"Open alerts",onPress:()=>Re('board'),children:(0,W.jsx)(u.Badge,{kind:"red",label:`${us} alert${us>1?'s':''}`})}):(0,W.jsx)(u.Badge,{kind:"green",label:"All clear"}),(0,W.jsx)(u.T,{size:20,weight:"bold",colour:k.colours.gold,children:(0,f.hm)(oe)}),(0,W.jsx)(u.Muted,{children:(0,f.niceDate)(oe)}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Demo +15 min",onPress:()=>re(15)})]}),(0,W.jsxs)(o.default,{testID:"front-door-bar",style:{flexDirection:'row',gap:12,paddingHorizontal:14,paddingTop:8,paddingBottom:4},children:[(0,W.jsx)(u.Button,{label:"Walk-in",onPress:Te.openWalkIn,testID:"add-walkin",style:{flex:1,minHeight:72,borderRadius:18}}),(0,W.jsx)(u.Button,{label:"New booking",onPress:Te.openBooking,testID:"add-booking",style:{flex:1,minHeight:72,borderRadius:18}})]}),(0,W.jsxs)(u.Row,{style:{paddingHorizontal:14,paddingVertical:4,gap:6},children:[O.map(e=>{const s=Se===e.id;return(0,W.jsx)(H.default,{testID:`view-${e.id}`,accessibilityRole:"tab",accessibilityLabel:e.label,accessibilityState:{selected:s},onPress:()=>Re(e.id),style:{minHeight:48,paddingHorizontal:18,justifyContent:'center',borderRadius:12,borderBottomWidth:3,borderBottomColor:s?k.colours.gold:'transparent',backgroundColor:s?k.colours.goldTint:'transparent'},children:(0,W.jsx)(u.T,{weight:"semibold",colour:s?k.colours.goldLight:k.colours.muted,children:e.label})},e.id)}),(0,W.jsx)(o.default,{style:{flex:1}}),(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`})]}),'floor'===Se||'timeline'===Se?Rs?'floor'===Se?As:Is:(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{flexGrow:1},children:'floor'===Se?As:Is}):'plan'===Se?zs:Ls,Te.elements,De?(0,W.jsx)(E.TableSheet,{rid:q,name:De,view:cs,plan:$e,todays:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,onClose:()=>Ae(null),onWalkIn:e=>Te.openWalkInAt(e),onMove:e=>Le(e),onDetails:Ve}):null,ze?(0,W.jsx)(E.DetailsPanel,{title:ze.title,onClose:()=>Ee(null),children:ze.body}):null,He?(0,W.jsx)(E.ServiceSummary,{r:K,todays:Ue,orders:X,waitlistAll:Q,walkInCount:te,onClose:()=>Ne(!1)}):null,We?(0,W.jsx)(o.default,{testID:"floor-toast",pointerEvents:"none",style:{position:'absolute',left:0,right:0,bottom:24,alignItems:'center',zIndex:900},children:(0,W.jsx)(o.default,{style:{backgroundColor:k.colours.surface2,borderColor:k.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:10,paddingHorizontal:16,maxWidth:640},children:(0,W.jsx)(u.T,{weight:"semibold",children:We})})}):null,(0,W.jsx)(D.Screensaver,{rid:q,idleMins:ve.idleMins,pinOn:ve.pinOn,pin:ve.pin,tonightCards:ve.tonightCards})]})};var s=_r(d[0]),l=e(s),t=e(_r(d[1])),a=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),n=e(_r(d[5])),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),m=_r(d[11]),b=_r(d[12]),x=_r(d[13]),f=_r(d[14]),j=_r(d[15]),y=_r(d[16]),w=_r(d[17]),k=_r(d[18]),T=_r(d[19]),v=_r(d[20]),C=_r(d[21]),$=_r(d[22]),B=_r(d[23]),S=_r(d[24]),R=_r(d[25]),P=_r(d[26]),M=_r(d[27]),D=_r(d[28]),A=_r(d[29]),I=_r(d[30]),L=_r(d[31]),z=_r(d[32]),E=_r(d[33]),H=e(_r(d[34])),N=_r(d[35]),W=_r(d[36]);const O=[{id:'floor',label:'Floor'},{id:'timeline',label:'Timeline'},{id:'board',label:'Board'},{id:'plan',label:'Edit plan'}],F=e=>(e??'').replace(' (example)','');function V({title:e,right:s,children:l,flex:a=1}){return(0,W.jsxs)(o.default,{style:{flex:a,backgroundColor:k.colours.surface,borderRadius:14,borderWidth:1,borderColor:k.colours.border,overflow:'hidden',minHeight:200},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:k.colours.border,backgroundColor:k.colours.surface2},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:e}),s]}),(0,W.jsx)(t.default,{contentContainerStyle:{padding:10,gap:10},children:l})]})}function G({label:e,value:s,sub:l,badge:t,children:a}){return(0,W.jsxs)(o.default,{style:{flex:1,minWidth:170,backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,gap:2},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,weight:"medium",children:e}),t?(0,W.jsx)(u.Badge,{kind:"amber",label:t}):null]}),(0,W.jsx)(u.T,{size:24,weight:"bold",colour:k.colours.text,children:s}),l?(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,children:l}):null,a]})}const U=e=>'new'===e?'red':'ready'===e?'green':'preparing'===e?'amber':'served'===e?'blue':'neutral'},847,[12,133,253,255,109,269,271,790,856,791,843,793,857,794,795,844,796,858,797,804,859,848,860,861,849,850,851,852,854,853,792,862,863,855,245,864,6]);
|
| 3 |
+
__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,"TABLES",{enumerable:!0,get:function(){return x}}),_e.useTableNames=p,_e.resetTableLive=j,_e.useTableUse=k,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return w}}),_e.TablePicker=C,_e.WalkInSheet=S,_e.AssignTableSheet=v,_e.UndoToast=I,_e.NewBookingSheet=P,_e.useFrontDoor=function(e,s){const[l,o]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1),[a,r]=(0,t.useState)(null),[d,u]=(0,t.useState)(null),c=(0,y.jsxs)(y.Fragment,{children:[l?(0,y.jsx)(S,{wide:s,initialTable:l.table,onClose:()=>o(!1),onSeated:r}):null,n?(0,y.jsx)(P,{wide:s,date:e,onClose:()=>i(!1)}):null,d?(0,y.jsx)(v,{booking:d,onClose:()=>u(null)}):null,a?(0,y.jsx)(I,{booking:a,onDone:()=>r(null)}):null]});return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>i(!0),assignTable:u,elements:c}};var t=_r(_d[0]),s=e(t);_r(_d[1]);var l=e(_r(_d[2])),o=e(_r(_d[3])),n=e(_r(_d[4])),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=_r(_d[11]),h=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]);const x=Array.from({length:12},(e,t)=>String(t+1));function p(e){const t=(0,f.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function j(e,t){(0,f.tablesOf)(t).forEach(t=>f.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function k(e,t){const s=(0,r.useBookings)(e),l=(0,r.useOrders)(e),o=p(e),n=(0,f.useFloor)(t=>t.live[e])??{},i=(0,c.ymd)(t),a={};for(const e of o)a[e]=n[e]?.blocked?{busy:!0,label:'Blocked'}:n[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===i&&e.table)for(const s of(0,f.tablesOf)(e.table))if(a[s])if('seated'===e.status)a[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!a[s].busy){const l=(0,c.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));l>=-15&&l<=90&&(a[s]={...a[s],soon:`Booked ${e.time}`})}for(const e of l)'table'===e.type&&e.tableNo&&a[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!a[e.tableNo].busy&&(a[e.tableNo]={busy:!0,label:'Open order'});return a}const w=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function C({use:e,value:t,onPick:s,big:o,best:i}){const a=Object.keys(e);return(0,y.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"table-picker",children:a.map(a=>{const r=e[a],d=t===a,u=!!i&&(0,f.tablesOf)(i)[0]===a&&!d;return(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Table ${a}, ${r.busy?`in use (${r.label})`:r.soon?`free, ${r.soon}`:'free'}`,accessibilityState:{selected:d},onPress:()=>s(a),style:{width:o?92:64,minHeight:56,borderRadius:12,borderWidth:d?2.5:1.5,padding:6,alignItems:'center',justifyContent:'center',borderColor:d?b.colours.gold:r.busy?b.colours.red:b.colours.green,backgroundColor:d?b.colours.goldTint:r.busy?b.colours.redBg:b.colours.surface2},children:[(0,y.jsx)(h.T,{weight:"bold",size:18,colour:d?b.colours.goldLight:b.colours.text,children:a}),(0,y.jsx)(h.T,{size:11,colour:r.busy?'#FFD9D4':r.soon?'#FFE2A8':'#CFF3D7',center:!0,children:r.busy?'Blocked'===r.label||'Needs clearing'===r.label?r.label:'In use':r.soon??'Free'}),u?(0,y.jsx)(n.default,{testID:"best-table",style:{position:'absolute',top:-8,right:-6,backgroundColor:b.colours.gold,borderRadius:8,paddingHorizontal:5},children:(0,y.jsx)(h.T,{size:10,weight:"bold",colour:b.colours.onGold,children:"BEST"})}):null]},a)})})}const T=[1,2,3,4,5,6,7,8];function S({onClose:e,onSeated:d,wide:x,initialTable:p}){const{rid:w,r:S,now:v}=(0,a.useCtx)(15e3),I=k(w,v),[P,$]=(0,t.useState)(2),[D,F]=(0,t.useState)(!1),[R,W]=(0,t.useState)(p??null),B=(0,f.usePlan)(w),z=(0,r.useBookings)(w),M=s.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,u.suggestTable)(B,z.filter(e=>e.date===(0,c.ymd)(v)),e,P,v,(0,u.turnFor)(P,S.settings.turnMins))?.table??null},[B,z,I,P,v.getTime()]),[N,O]=(0,t.useState)(!1),[A,L]=(0,t.useState)(''),E=(e,t=String(e),s=()=>{F(!1),$(e)})=>{const o='9+'===t?D:!D&&P===e;return(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:x?64:60,height:x?64:56,borderRadius:14,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?b.colours.gold:'transparent'},children:(0,y.jsx)(h.T,{weight:"bold",size:22,colour:o?b.colours.onGold:b.colours.gold,children:t})},t)},_=(0,y.jsxs)(h.Row,{gap:12,style:{justifyContent:'center'},children:[(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One fewer",onPress:()=>$(e=>Math.max(9,e-1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"\u2212"})}),(0,y.jsx)(h.T,{weight:"bold",size:26,children:P}),(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One more",onPress:()=>$(e=>Math.min(40,e+1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"+"})})]}),H=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1:void 0},children:[(0,y.jsx)(h.T,{weight:"semibold",children:"How many people?"}),(0,y.jsxs)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[T.map(e=>E(e)),E(9,'9+',()=>{F(!0),$(e=>e>=9?e:9)})]}),D?_:null]}),U=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1.3:void 0},children:[(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",children:["Table ",(0,y.jsx)(h.T,{colour:b.colours.muted,size:14,children:"(optional)"})]}),R?(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>W(null)}):null]}),(0,y.jsx)(C,{use:I,value:R,onPick:e=>W(R===e?null:e),big:x,best:M}),M&&!R?(0,y.jsxs)(h.Muted,{children:["Best fit for ",P,": Table ",M," (smallest free table, fewest clashes)."]}):null,'staff'!==i.APP_VARIANT?(0,y.jsx)(h.Muted,{children:"Using Wix Tables too? Also mark the table there; this prototype doesn't connect to it."}):null]});return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,c.hm)(v)}`,maxWidth:x?900:void 0,testID:"walkin-sheet",children:[(0,y.jsx)(h.Button,{label:`Seat walk-in \xb7 ${P} ${1===P?'person':'people'}${R?` \xb7 Table ${R}`:''}`,onPress:async()=>{const t=await r.repo.bookings.seatWalkIn(w,P,R??void 0,A);j(w,R??void 0),d(t),e()},testID:"seat-walkin",style:{minHeight:56}}),x?(0,y.jsxs)(h.Row,{gap:16,style:{alignItems:'flex-start'},children:[H,U]}):(0,y.jsxs)(y.Fragment,{children:[H,U]}),N?(0,y.jsx)(o.default,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:A,onChangeText:L,style:h.styles.input,autoFocus:!0}):(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"+ Add a note (optional)",onPress:()=>O(!0)}),(0,y.jsx)(h.Muted,{children:"No name needed. Seated now; counts in today's covers and the forecast."})]})}function v({booking:e,onClose:t}){const{rid:s,now:l}=(0,a.useCtx)(15e3),o=k(s,l);return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:t,title:`Assign table \xb7 ${w(e)}`,testID:"assign-table-sheet",children:[(0,y.jsx)(C,{use:o,onPick:async l=>{await r.repo.bookings.assignTable(e.id,l),j(s,l),t()}}),(0,y.jsx)(h.Muted,{children:"Red tables are in use right now; you can still pick one (e.g. joining a table)."})]})}function I({booking:e,onDone:s}){return(0,t.useEffect)(()=>{const e=setTimeout(s,6e3);return()=>clearTimeout(e)},[e.id]),(0,y.jsx)(n.default,{testID:"walkin-toast",style:{position:'fixed',left:12,right:12,bottom:92,zIndex:1e3,alignItems:'center'},pointerEvents:"box-none",children:(0,y.jsxs)(h.Row,{gap:10,style:{backgroundColor:b.colours.surface2,borderColor:b.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:8,paddingLeft:14,paddingRight:8,maxWidth:520,width:'100%',justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",style:{flex:1},children:[w(e)," seated \xb7 ",e.table?`Table ${e.table}`:'table to assign'," (",e.ref,")"]}),(0,y.jsx)(h.Button,{kind:"secondary",label:"Undo",onPress:()=>{r.repo.bookings.undoWalkIn(e.id),s()},testID:"undo-walkin"})]})})}function P({date:e,onClose:s,wide:l}){const{rid:o,r:n,now:i}=(0,a.useCtx)(6e4),u=(0,r.useBookings)(o),[b,f]=(0,t.useState)(''),[x,p]=(0,t.useState)(2),[j,k]=(0,t.useState)(null),[w,C]=(0,t.useState)(''),T=(0,c.parseYmd)(e),S=(0,d.bookingSlots)(n,T,t=>u.filter(s=>s.date===e&&s.time===t&&'cancelled'!==s.status&&!s.walkIn).reduce((e,t)=>e+t.partySize,0),x,e===(0,c.ymd)(i)?i:(0,c.addMins)(T,0));return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:s,title:`New booking \xb7 ${(0,c.niceDate)(T)}`,maxWidth:l?760:void 0,testID:"booking-sheet",children:[(0,y.jsx)(h.Field,{label:"Name",value:b,onChangeText:f,placeholder:"e.g. Reid"}),(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(h.T,{children:"Party size"}),(0,y.jsx)(h.Stepper,{value:x,onChange:p,min:1,max:20,label:"party size"})]}),(0,y.jsx)(h.Row,{wrap:!0,gap:6,children:S.map(e=>(0,y.jsx)(h.Chip,{label:e.time,sub:`${e.left} left`,disabled:!e.available,selected:j===e.time,onPress:()=>k(e.time)},e.time))}),S.length?null:(0,y.jsx)(h.Muted,{children:"Closed on this day (per listed hours)."}),(0,y.jsx)(h.Field,{label:"Notes",value:w,onChangeText:C,placeholder:"e.g. high chair, window table"}),x>=n.settings.savedCardFromParty?(0,y.jsxs)(h.Muted,{children:["Parties of ",n.settings.savedCardFromParty,"+ need a saved card; the customer gets a link (demo, nothing is sent)."]}):null,(0,y.jsx)(h.Button,{label:"Save booking",disabled:b.trim().length<2||!j,onPress:()=>{r.repo.bookings.create({restaurantId:o,customerId:null,name:b.trim(),partySize:x,date:e,time:j,allergies:[],notes:w.trim(),security:x>=n.settings.savedCardFromParty?'saved-card':'none',depositPaid:0}),s()}})]})}},848,[12,104,245,255,109,787,860,796,794,849,795,797,790,861,6]);
|
| 4 |
+
__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STATUS",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"STAGES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"turnFor",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"startOf",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"durOf",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"endOf",{enumerable:!0,get:function(){return o}}),e.clashes=function(a,s=90){const n=new Set,i=a.filter(t=>d(t)&&t.table);for(let a=0;a<i.length;a++)for(let d=a+1;d<i.length;d++){const c=i[a],u=i[d];(0,t.tablesOf)(c.table).some(a=>(0,t.tablesOf)(u.table).includes(a))&&(l(c)<o(u,s)&&l(u)<o(c,s)&&(n.add(c.id),n.add(u.id)))}return n},e.floorView=function(a,s,n,i,d,u=90){const h={},y=s.filter(t=>t.date===b(d));for(const s of a.tables){const a=i[s.name]??{},b=y.filter(a=>(0,t.tablesOf)(a.table).includes(s.name)),F=b.find(t=>'seated'===t.status),p=b.filter(t=>'confirmed'===t.status).sort((t,a)=>t.time.localeCompare(a.time)).find(t=>f(d,t)>=-20),O=p?Math.round(f(d,p)):void 0,S=n.find(t=>'table'===t.type&&t.tableNo===s.name&&!['closed','cancelled','collected'].includes(t.status));let v='free';a.blocked?v='blocked':F?v=a.stage??'seated':a.dirty?v='dirty':S?v=a.stage??'seated':p&&void 0!==O&&O<=45&&(v='soon');const A=F,T=A?.tags?.find(t=>'VIP'===t)??A?.tags?.find(t=>'Regular'===t)??(A?void 0:p?.tags?.[0]);h[s.name]={table:s,status:v,booking:A,next:p,nextIn:O,covers:A?.partySize??0,orderOnly:!A&&!!S,note:a.note,seatedMins:A?Math.max(0,Math.round((d.getTime()-l(A).getTime())/6e4)):void 0,freeAt:A?o(A,u):void 0,allergy:!!(A?.allergies.length||!A&&p?.allergies.length||S?.allergies.length),vip:T,occasion:A?.occasion??(A?void 0:p?.occasion??c(p?.notes))??c(A?.notes)}}return h},Object.defineProperty(e,"OCCASION_ICON",{enumerable:!0,get:function(){return u}}),e.suggestTable=function(a,s,n,i,c,u,f=90,b){const h=[...a.tables.map(t=>({name:t.name,seats:t.maxSeats,min:t.minSeats,parts:[t.name]})),...a.joins.map(t=>{const s=a.tables.filter(a=>t.tables.includes(a.name));return{name:t.tables.join('+'),seats:s.reduce((t,a)=>t+a.maxSeats,0),min:s.reduce((t,a)=>t+a.minSeats,0),parts:t.tables}})],y=c.getTime()+6e4*u;let F=null;for(const a of h){if(a.seats<i)continue;if(n&&a.parts.some(t=>['blocked'].includes(n[t]?.status)))continue;const u=!!n&&a.parts.some(t=>['seated','mains','dessert','bill','dirty'].includes(n[t]?.status)),h=s.filter(s=>s.id!==b&&d(s)&&(0,t.tablesOf)(s.table).some(t=>a.parts.includes(t))&&l(s).getTime()<y&&o(s,f).getTime()>c.getTime()).length,p=(u?1e3:0)+100*h+10*(a.seats-i)+(i<a.min?5:0)+15*(a.parts.length-1);(!F||p<F.score)&&(F={table:a.name,seats:a.seats,clashes:h+(u?1:0),score:p,why:`${a.seats} seats${h||u?`, ${h+(u?1:0)} clash`:', no clashes'}`})}return F?{table:F.table,seats:F.seats,clashes:F.clashes,why:F.why}:null};var t=r(_d[0]);const a={free:{label:'Free',colour:'#2F7D45',fg:'#E7FBEA'},soon:{label:'Reserved soon',colour:'#3C78B5',fg:'#EAF4FF'},seated:{label:'Seated',colour:'#CFA45F',fg:'#0B0B0B'},mains:{label:'Mains',colour:'#E08A2E',fg:'#0B0B0B'},dessert:{label:'Dessert',colour:'#A77BD0',fg:'#0B0B0B'},bill:{label:'Bill requested',colour:'#D9473A',fg:'#FFFFFF'},dirty:{label:'Needs clearing',colour:'#7A6F5E',fg:'#FFFFFF'},blocked:{label:'Blocked',colour:'#3A3A3A',fg:'#CFCFCF'}},s=['seated','mains','dessert','bill'],n=(t,a=90)=>Math.min(a+60,a+15*Math.max(0,Math.ceil((t-2)/2))),l=t=>'seated'===t.status&&t.seatedAt?new Date(t.seatedAt):new Date(`${t.date}T${t.time}:00`),i=(t,a=90)=>t.durationMins??n(t.partySize,a),o=(t,a=90)=>new Date(l(t).getTime()+6e4*i(t,a)),d=t=>!['cancelled','noshow','finished'].includes(t.status);const c=t=>t?/birthday/i.test(t)?'birthday':/anniversary/i.test(t)?'anniversary':void 0:void 0,u={birthday:'\ud83c\udf82',anniversary:'\ud83d\udc8d',celebration:'\ud83e\udd42'},f=(t,a)=>(new Date(`${a.date}T${a.time}:00`).getTime()-t.getTime())/6e4,b=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},849,[861]);
|
| 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,"snap",{enumerable:!0,get:function(){return c}}),_e.FloorCanvas=function(e){const[x,f]=(0,t.useState)({w:0,h:0}),g=x.w?'width'===e.fit?Math.min(x.w/i.PLAN_W,e.maxH?e.maxH/i.PLAN_H:9):Math.min(x.w/i.PLAN_W,x.h/i.PLAN_H):0,v=e.plan.tables.filter(t=>t.areaId===e.areaId),[y,w]=(0,t.useState)(null),M=(0,t.useRef)(null),j=t=>e.plan.sections.find(e=>e.id===t.sectionId),R=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),C=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{M.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const i=M.current;if(!i)return;const s=n.nativeEvent.pageX-i.x,a=n.nativeEvent.pageY-i.y;Math.abs(s)+Math.abs(a)<6&&!y||('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&w({id:t.id,dx:s,dy:a,kind:o})},onResponderRelease:n=>{const s=M.current;M.current=null;const a=n.nativeEvent.pageX-(s?.x??0),l=n.nativeEvent.pageY-(s?.y??0);if(w(null),Math.abs(a)+Math.abs(l)<6||!g)return void('move'===o&&e.onTap?.(t));const u=a/g,h=l/g;if('edit'===e.mode&&'move'===o)e.onMove?.(t,b(c(t.x+u,e.snapOn),0,i.PLAN_W-t.w),b(c(t.y+h,e.snapOn),0,i.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,b(c(t.w+u,e.snapOn),50,400),b(c(t.h+h,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+u,n=t.y+t.h/2+h,i=v.find(e=>e.id!==t.id&&o>=e.x-10&&o<=e.x+e.w+10&&n>=e.y-10&&n<=e.y+e.h+10);i&&e.onDrop(t,i)}}}),I=e=>e*g,k='width'===e.fit?i.PLAN_H*g||200:void 0;return(0,u.jsx)(n.default,{testID:"floor-canvas",onLayout:e=>f({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:k}],children:g?(0,u.jsxs)(n.default,{style:{width:I(i.PLAN_W),height:I(i.PLAN_H),alignSelf:'center',backgroundColor:'#0F0E0C',borderRadius:16,borderWidth:1,borderColor:a.colours.border,overflow:'hidden'},children:['edit'===e.mode?Array.from({length:i.PLAN_W/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',left:I(t*i.GRID*2),top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},`v${t}`)):null,'edit'===e.mode?Array.from({length:i.PLAN_H/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',top:I(t*i.GRID*2),left:0,right:0,height:1,backgroundColor:'#1E1B16'}},`h${t}`)):null,e.plan.joins.map(e=>{const t=v.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,i]=t,s=o.x+o.w/2,a=o.y+o.h/2,l=i.x+i.w/2,h=i.y+i.h/2,c=Math.hypot(l-s,h-a),b=Math.atan2(h-a,l-s);return(0,u.jsx)(n.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:I((s+l)/2-c/2),top:I((a+h)/2)-3,width:I(c),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${b}rad`}]}},e.id)}),v.map(t=>{const i=e.view?.[t.name],c=i?s.STATUS[i.status]:null,b=y?.id===t.id,x=b&&'resize'===y.kind?Math.max(50,t.w+y.dx/g):t.w,f=b&&'resize'===y.kind?Math.max(50,t.h+y.dy/g):t.h,v=b&&'move'===y.kind?t.x+y.dx/g:t.x,w=b&&'move'===y.kind?t.y+y.dy/g:t.y,M=e.selected===t.id||e.highlight?.includes(t.name),k=j(t),z='edit'===e.mode?'#2A2419':c.colour,$='edit'===e.mode?a.colours.text:c.fg,A='round'===t.shape||'stool'===t.shape?I(Math.min(x,f)/2):I('booth'===t.shape?22:12),S=I(Math.min(x,f))<64,T=Math.max(11,Math.min(22,I(Math.min(x,f))/4)),_='edit'===e.mode?`Table ${t.name}, ${t.shape}, ${t.minSeats}\u2013${t.maxSeats} seats${t.online?', bookable online':''}`:`Table ${t.name}, ${c.label}${void 0!==i?.seatedMins?`, seated ${i.seatedMins} min`:''}${i?.covers?`, ${i.covers} covers`:''}${void 0!==i?.nextIn&&'seated'!==i.status?`, next booking ${i.next?.time}`:''}`,E=void 0!==i?.seatedMins&&i.booking?Math.min(1.2,i.seatedMins/(i.booking.durationMins??(0,s.turnFor)(i.booking.partySize,e.turnBase))):null;return(0,u.jsxs)(o.default.Fragment,{children:[p({...t,w:x,h:f}).map((t,o)=>(0,u.jsx)(n.default,{pointerEvents:"none",style:[{position:'absolute',left:I(v+t.x)-Math.max(4,I(8)),top:I(w+t.y)-Math.max(4,I(8)),width:Math.max(8,I(16)),height:Math.max(8,I(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?a.colours.gold:'rgba(255,255,255,0.25)'},h()]},o)),(0,u.jsxs)(n.default,{testID:`table-${t.name}`,accessibilityRole:"button",accessibilityLabel:_,...C(t,'move'),style:[{position:'absolute',left:I(v),top:I(w),width:I(x),height:I(f),borderRadius:A,backgroundColor:z,alignItems:'center',justifyContent:'center',padding:2,borderWidth:M?3:e.sectionColours&&k?2.5:1.5,borderColor:M?'#FFFFFF':e.sectionColours&&k?k.colour:'edit'===e.mode?a.colours.gold:'rgba(0,0,0,0.35)',borderTopWidth:'booth'===t.shape?I(18):void 0,transform:[{rotate:`${t.rot}deg`},{scale:b?1.06:1}],zIndex:b?50:1,opacity:b&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:b?.6:.3,shadowRadius:b?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},b?null:h()],children:[(0,u.jsxs)(n.default,{style:{alignItems:'center',transform:[{rotate:-t.rot+"deg"}]},pointerEvents:"none",children:[(0,u.jsx)(l.T,{weight:"bold",size:T,colour:$,center:!0,children:t.name}),'edit'===e.mode?S?null:(0,u.jsxs)(l.T,{size:11,colour:a.colours.muted,center:!0,children:[t.minSeats,"\u2013",t.maxSeats,t.online?' \xb7 online':'']}):i?(0,u.jsxs)(u.Fragment,{children:['free'!==i.status||S?null:(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[t.minSeats,"\u2013",t.maxSeats," seats"]}),void 0!==i.seatedMins?(0,u.jsxs)(l.T,{size:12,weight:"semibold",colour:$,center:!0,children:[i.seatedMins,"m \xb7 ",i.covers,"\ud83d\udc65"]}):i.orderOnly?(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Open order"}):null,'soon'===i.status&&i.next?(0,u.jsxs)(l.T,{size:11,weight:"semibold",colour:$,center:!0,children:[i.next.time," \xb7 ",i.nextIn<=0?'due':`${i.nextIn}m`]}):null,'dirty'!==i.status||S?null:(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Clear"}),!S||i.allergy||i.vip?(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[i.allergy?'\u26a0':'',i.vip?'VIP'===i.vip?'\u2605':'\u2665':'',i.occasion?s.OCCASION_ICON[i.occasion]:'',i.note?'\u270e':'']}):null]}):null]}),k&&'live'===e.mode&&e.sectionColours&&!S?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:k.colour,borderRadius:6,paddingHorizontal:3},children:(0,u.jsx)(l.T,{size:9,weight:"bold",colour:"#0B0B0B",children:k.server})}):null,null===E||S?null:(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',left:'15%',right:'15%',bottom:5,height:4,borderRadius:2,backgroundColor:'rgba(0,0,0,0.25)'},children:(0,u.jsx)(n.default,{style:{width:`${Math.min(100,100*E)}%`,height:4,borderRadius:2,backgroundColor:E>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),R(t)&&'edit'===e.mode?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,u.jsx)(l.T,{size:10,colour:a.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===t.id?(0,u.jsx)(n.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...C(t,'resize'),style:{position:'absolute',left:I(v+x)-14,top:I(w+f)-14,width:28,height:28,borderRadius:14,backgroundColor:a.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},t.id)}),0===v.length?(0,u.jsx)(n.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,u.jsxs)(l.T,{center:!0,colour:a.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 tap + Table':'',"."]})}):null]}):null})};var t=r(d[0]),o=e(t);r(d[1]);var n=e(r(d[2])),i=r(d[3]),s=r(d[4]),a=r(d[5]),l=r(d[6]),u=r(d[7]);const h=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),c=(e,t=!0)=>t?Math.round(e/i.GRID)*i.GRID:Math.round(e),b=(e,t,o)=>Math.max(t,Math.min(o,e));function p(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape||'stool'===e.shape){for(let n=0;n<t;n++){const i=2*Math.PI*n/t-Math.PI/2;o.push({x:e.w/2+Math.cos(i)*(e.w/2+11.2),y:e.h/2+Math.sin(i)*(e.h/2+11.2)})}return'stool'===e.shape?[]:o}if('booth'===e.shape){for(let n=0;n<t;n++)o.push({x:e.w*(n+.5)/t,y:e.h+9.6});return o}if('square'===e.shape&&t<=4){return[{x:e.w/2,y:-9.6},{x:e.w/2,y:e.h+9.6},{x:-9.6,y:e.h/2},{x:e.w+9.6,y:e.h/2}].slice(0,t)}const n=Math.ceil(t/2),i=t-n;for(let t=0;t<n;t++)o.push({x:e.w*(t+.5)/n,y:-9.6});for(let t=0;t<i;t++)o.push({x:e.w*(t+.5)/i,y:e.h+9.6});return o}},850,[12,104,109,861,849,797,790,6]);
|
| 6 |
+
__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.AreaTabs=p,_e.FloorEditor=function({rid:e,compact:s,maxH:j}){const f=(0,o.usePlan)(e),y=o.useFloor.getState,w=a=>y().setPlan(e,a),[k,S]=(0,a.useState)(f.areas[0]?.id??''),[T,R]=(0,a.useState)(null),[C,P]=(0,a.useState)(!0),[I,D]=(0,a.useState)(!1),[v,B]=(0,a.useState)(null),[z,M]=(0,a.useState)(''),[$,A]=(0,a.useState)(''),L=f.areas.some(e=>e.id===k)?k:f.areas[0]?.id??'',W=f.tables.find(e=>e.id===T)??null,_=a=>W&&y().updateTable(e,W.id,a),H=()=>{let e=1;const a=new Set(f.tables.map(e=>e.name));for(;a.has(String(e));)e++;return String(e)},F=(e,a)=>{for(let s=50;s+a<=o.PLAN_H;s+=50)for(let l=50;l+e<=o.PLAN_W;l+=50)if(!f.tables.some(t=>t.areaId===L&&l<t.x+t.w+25&&t.x<l+e+25&&s<t.y+t.h+25&&t.y<s+a+25))return{x:l,y:s};return{x:50,y:50}},N=e=>{if(!W||e.id===W.id)return;const a=f.joins.filter(a=>!a.tables.includes(W.name)&&!a.tables.includes(e.name)),s=Array.from(new Set([...f.joins.find(e=>e.tables.includes(W.name))?.tables??[W.name],...f.joins.find(a=>a.tables.includes(e.name))?.tables??[e.name]]));w({...f,joins:[...a,{id:(0,o.fid)('j'),tables:s}]}),D(!1),A(`Joined ${s.join('+')} \u2014 book it as one table.`)},V=W?f.joins.find(e=>e.tables.includes(W.name)):void 0,E=W&&f.tables.some(e=>e.id!==W.id&&e.name===W.name),q=W?(0,h.jsxs)(n.default,{testID:"table-tools",style:{gap:10,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(u.T,{weight:"semibold",colour:c.colours.gold,children:["Table ",W.name]}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Done",onPress:()=>R(null)})]}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Name / no."}),(0,h.jsx)(t.default,{accessibilityLabel:"Table name",value:W.name,onChangeText:e=>_({name:e.replace(/[^A-Za-z0-9-]/g,'').slice(0,6)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}),E?(0,h.jsx)(u.T,{size:13,colour:c.colours.red,children:"Another table already uses this number."}):null,(0,h.jsx)(u.Row,{wrap:!0,gap:6,children:o.SHAPES.map(e=>(0,h.jsx)(u.Chip,{label:e.label,selected:W.shape===e.id,onPress:()=>_({shape:e.id,w:x[e.id][0],h:x[e.id][1],...'stool'===e.id?{minSeats:1,maxSeats:1}:{}})},e.id))}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Min seats"}),(0,h.jsx)(u.Stepper,{value:W.minSeats,onChange:e=>_({minSeats:e,maxSeats:Math.max(e,W.maxSeats)}),min:1,max:20,label:"min seats"})]}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Max seats"}),(0,h.jsx)(u.Stepper,{value:W.maxSeats,onChange:e=>_({maxSeats:e,minSeats:Math.min(e,W.minSeats)}),min:1,max:24,label:"max seats"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f2 15\xb0",accessibilityLabel:"Rotate left",onPress:()=>_({rot:(W.rot-15+360)%360})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f3 15\xb0",accessibilityLabel:"Rotate right",onPress:()=>_({rot:(W.rot+15)%360}),testID:"rotate-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Bigger",onPress:()=>_({w:Math.min(400,W.w+25),h:Math.min(300,W.h+25)})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Smaller",onPress:()=>_({w:Math.max(50,W.w-25),h:Math.max(50,W.h-25)})})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Area"}),f.areas.map(e=>(0,h.jsx)(u.Chip,{label:e.name,selected:W.areaId===e.id,onPress:()=>{_({areaId:e.id}),S(e.id)}},e.id))]}),f.sections.length?(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Server section"}),f.sections.map(e=>(0,h.jsx)(u.Chip,{label:`${e.name} (${e.server})`,selected:W.sectionId===e.id,onPress:()=>_({sectionId:e.id})},e.id))]}):null,(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(n.default,{style:{flex:1},children:[(0,h.jsx)(u.T,{size:14,children:"Bookable online"}),(0,h.jsx)(u.Muted,{children:"For a later Wix Tables / booking-page mapping. Nothing is synced now."})]}),(0,h.jsx)(l.default,{accessibilityLabel:"Bookable online",value:W.online,onValueChange:e=>{_({online:e})},trackColor:{true:c.colours.gold,false:'#444'}})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,label:"Duplicate",onPress:()=>{if(!W)return;const a=F(W.w,W.h),s={...W,id:(0,o.fid)('t'),name:H(),x:a.x,y:a.y};y().addTable(e,s),R(s.id),A(`Duplicated as Table ${s.name}.`)},testID:"dup-table"}),V?(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:`Split ${V.tables.join('+')}`,onPress:()=>{w({...f,joins:f.joins.filter(e=>e.id!==V.id)}),A('Split back into separate tables.')},testID:"split-table"}):(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:I?'Tap a table to join\u2026':'Join with\u2026',onPress:()=>D(!I),testID:"join-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"danger",label:"Delete",onPress:()=>B({kind:'table'}),testID:"delete-table"})]})]}):null,O=(0,h.jsx)(b.FloorCanvas,{plan:f,areaId:L,mode:"edit",fit:"width",maxH:j,selected:T,snapOn:C,highlight:V?.tables,onTap:e=>{I?N(e):R(e.id===T?null:e.id)},onMove:(a,s,l)=>y().updateTable(e,a.id,{x:s,y:l}),onResize:(a,s,l)=>y().updateTable(e,a.id,{w:s,h:l})}),G=f.areas.find(e=>e.id===L),J=Object.fromEntries(f.areas.map(e=>[e.id,String(f.tables.filter(a=>a.areaId===e.id).length)]));return(0,h.jsxs)(n.default,{style:{gap:10},testID:"floor-editor",children:[(0,h.jsx)(p,{plan:f,area:L,onPick:e=>{S(e),R(null)},counts:J}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{label:"+ Table",onPress:()=>{const[a,s]=x.square,l=F(a,s),t={id:(0,o.fid)('t'),name:H(),areaId:L,shape:'square',minSeats:2,maxSeats:4,x:l.x,y:l.y,w:a,h:s,rot:0,online:!0,sectionId:f.sections[0]?.id};y().addTable(e,t),R(t.id),A(`Table ${t.name} added \u2014 drag it into place.`)},testID:"add-table",style:{minWidth:110}}),(0,h.jsxs)(u.Row,{gap:6,style:{paddingHorizontal:6},children:[(0,h.jsx)(l.default,{accessibilityLabel:"Snap to grid",value:C,onValueChange:P,trackColor:{true:c.colours.gold,false:'#444'}}),(0,h.jsx)(u.T,{size:14,children:"Snap to grid"})]})]}),$?(0,h.jsx)(u.T,{size:13,colour:c.colours.goldLight,children:$}):null,s?(0,h.jsxs)(h.Fragment,{children:[O,q]}):(0,h.jsxs)(u.Row,{gap:12,style:{alignItems:'flex-start'},children:[(0,h.jsx)(n.default,{style:{flex:1},children:O}),q?(0,h.jsx)(n.default,{style:{width:320},children:q}):null]}),W?null:(0,h.jsx)(u.Muted,{children:"Tap a table to edit it; drag to move (snaps to the grid); drag the gold dot to resize."}),(0,h.jsxs)(n.default,{style:{gap:6,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsx)(u.T,{weight:"semibold",colour:c.colours.gold,children:"Areas"}),G?(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Rename"}),(0,h.jsx)(t.default,{accessibilityLabel:"Area name",value:G.name,onChangeText:e=>w({...f,areas:f.areas.map(a=>a.id===G.id?{...a,name:e.slice(0,24)}:a)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}):null,(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(t.default,{accessibilityLabel:"New area name",placeholder:"New area, e.g. Function room",placeholderTextColor:"#7D776C",value:z,onChangeText:M,style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]}),(0,h.jsx)(u.Button,{small:!0,label:"+ Area",disabled:z.trim().length<2,onPress:()=>{const e={id:(0,o.fid)('a'),name:z.trim()};w({...f,areas:[...f.areas,e]}),S(e.id),M(''),R(null)},testID:"add-area"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Delete this area",disabled:f.areas.length<2,onPress:()=>B({kind:'area'}),testID:"delete-area"}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Reset to example layout",onPress:()=>B({kind:'reset'})})]}),(0,h.jsxs)(u.Muted,{children:[f.tables.length," tables \xb7 ",f.tables.reduce((e,a)=>e+a.maxSeats,0)," seats \xb7 ",f.tables.filter(e=>e.online).length," bookable online. Example layout made up for the demo; table numbers are the ones you'd match in Wix Tables later (not connected)."]})]}),v?(0,h.jsxs)(u.Sheet,{visible:!0,onClose:()=>B(null),title:'table'===v.kind?`Delete Table ${W?.name}?`:'area'===v.kind?`Delete ${G?.name}?`:'Reset the table plan?',testID:"confirm-sheet",children:[(0,h.jsx)(u.Muted,{children:'table'===v.kind?'It comes off the plan. Bookings keep their table number.':'area'===v.kind?`Its ${J[L]} table(s) move to ${f.areas.find(e=>e.id!==L)?.name}.`:'Puts back the example layout for this venue.'}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.Button,{kind:"danger",label:'reset'===v.kind?'Reset':'Delete',accessibilityLabel:'reset'===v.kind?'Reset':'Confirm delete',testID:"confirm-delete",onPress:()=>{if('table'===v.kind&&W&&(y().removeTable(e,W.id),R(null),A(`Table ${W.name} deleted.`)),'area'===v.kind){const e=f.areas.find(e=>e.id!==L);w({...f,areas:f.areas.filter(e=>e.id!==L),tables:f.tables.map(a=>a.areaId===L?{...a,areaId:e.id}:a)}),S(e.id)}'reset'===v.kind&&(y().resetPlan(e),R(null)),B(null)}}),(0,h.jsx)(u.Button,{kind:"secondary",label:"Cancel",onPress:()=>B(null)})]})]}):null]})};var a=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),t=e(r(d[3])),n=e(r(d[4])),o=r(d[5]),c=r(d[6]),u=r(d[7]),b=r(d[8]),h=r(d[9]);const x={round:[100,100],square:[100,100],rect:[175,100],booth:[200,125],stool:[75,75]};function p({plan:e,area:a,onPick:l,counts:t}){return(0,h.jsx)(u.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:e.areas.map(e=>{const n=e.id===a;return(0,h.jsx)(s.default,{testID:`area-${e.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${e.name}`,accessibilityState:{selected:n},onPress:()=>l(e.id),style:{minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:n?c.colours.gold:c.colours.border,backgroundColor:n?c.colours.gold:c.colours.surface,justifyContent:'center'},children:(0,h.jsxs)(u.T,{weight:"semibold",size:15,colour:n?c.colours.onGold:c.colours.text,children:[e.name,t?.[e.id]?(0,h.jsxs)(u.T,{size:12,colour:n?c.colours.onGold:c.colours.muted,children:[" ",t[e.id]]}):null]})},e.id)})})}},851,[12,245,253,255,109,861,797,790,850,6]);
|
| 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}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return b}}),_e.Timeline=function({plan:e,bookings:p,now:y,privacy:x,onOpen:j,turnBase:v,t0:C,t1:k,height:w}){const M=(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:e.name})))],[e]),T=p.filter(e=>!['cancelled','noshow'].includes(e.status)),R=(0,t.useMemo)(()=>(0,s.clashes)(T,v),[T,v]),z=Math.ceil((k.getTime()-C.getTime())/9e5),$=e=>(e.getTime()-C.getTime())/9e5*h,[_,B]=(0,t.useState)(null),O=(0,t.useRef)(null),E=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,$(y)-120);setTimeout(()=>E.current?.scrollTo({x:e,animated:!1}),50)},[]);const[S,W]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{O.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!O.current)return;const r=o.nativeEvent.pageX-O.current.x,n=o.nativeEvent.pageY-O.current.y;Math.abs(r)+Math.abs(n)>=6&&B({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=O.current;O.current=null,B(null);const l=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(l)+Math.abs(d)<6)return void('move'===t&&j(e));const c=Math.round(l/h);if('stretch'===t){const t=Math.max(30,(0,s.durOf)(e,v)+15*c);return n.repo.bookings.update(e.id,{durationMins:t}),void W(`${(0,u.privName)(e,x)} now ${t} min`)}const f=M.findIndex(t=>t.key===((0,i.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(M.length-1,f+Math.round(d/b))),p={};c&&'confirmed'===e.status&&(p.time=(0,a.hm)((0,a.addMins)((0,s.startOf)(e),15*c))),g!==f&&'__none'!==M[g].key&&(p.table=M[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),W(`${(0,u.privName)(e,x)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):c&&'confirmed'!==e.status&&W('Seated parties can move table, not time.')}}),I=$(y);return(0,c.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,c.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsxs)(d.Row,{gap:8,children:[(0,c.jsx)(d.Badge,{kind:R.size?'red':'green',label:R.size?`${R.size} bookings clash`:'No clashes'}),(0,c.jsx)(d.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})]}),(0,c.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${R.size}`,children:(0,c.jsx)(d.T,{size:13,colour:l.colours.goldLight,children:S})})]}),(0,c.jsx)(r.default,{style:{flex:w?void 0:1,height:w,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:l.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,c.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,c.jsxs)(r.default,{style:{width:f,borderRightWidth:1,borderColor:l.colours.border,backgroundColor:l.colours.surface},children:[(0,c.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:12,colour:l.colours.muted,children:"Table"})}),M.map((e,t)=>(0,c.jsxs)(r.default,{style:{height:b,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:l.colours.gold},children:[(0,c.jsx)(d.T,{size:14,weight:"semibold",children:'__none'===e.key?e.name:`T${e.name}`}),!e.area||0!==t&&M[t-1].area===e.area?null:(0,c.jsx)(d.T,{size:10,colour:l.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,c.jsx)(o.default,{ref:E,horizontal:!0,style:{flex:1},children:(0,c.jsxs)(r.default,{style:{width:z*h},children:[(0,c.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:l.colours.border},children:Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{style:{width:Math.min(4,z-4*t)*h,justifyContent:'center',borderLeftWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:11,colour:l.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,a.hm)((0,a.addMins)(C,60*t))})},t))}),M.map((e,t)=>{return(0,c.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:b,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:'rgba(207,164,95,0.4)'},children:[Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*h,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),(o=e.key,T.filter(e=>'__none'===o?!e.table:(0,i.tablesOf)(e.table).includes(o))).map(e=>{const t=_?.id===e.id?_:null,o=$((0,s.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(h,(0,s.durOf)(e,v)/15*h+('stretch'===t?.kind?t.dx:0)),i=R.has(e.id);return(0,c.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,u.privName)(e,x)}, ${e.partySize}, ${(0,a.hm)((0,s.startOf)(e))}, ${(0,s.durOf)(e,v)} min${i?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:g(e),borderWidth:i?2.5:1,borderColor:i?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?.55:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,c.jsxs)(d.T,{size:12,weight:"semibold",colour:'confirmed'===e.status?'#EAF4FF':'#0B0B0B',numberOfLines:1,children:[i?'\u26a0 ':'',(0,a.hm)((0,s.startOf)(e))," ",(0,u.privName)(e,x)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,c.jsx)(r.default,{testID:`tl-stretch-${e.id}`,accessibilityLabel:"Change length",...D(e,'stretch'),style:{position:'absolute',right:0,top:0,bottom:0,width:14,borderTopRightRadius:8,borderBottomRightRadius:8,backgroundColor:'rgba(0,0,0,0.25)',cursor:'ew-resize',touchAction:'none'}})]},e.id)})]},e.key);var o}),I>=0&&I<=z*h?(0,c.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:I,top:0,bottom:0,width:2,backgroundColor:l.colours.gold,zIndex:30},children:(0,c.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:l.colours.gold,borderRadius:6},children:(0,c.jsx)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,a.hm)(y)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),a=_r(_d[7]),l=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]);const h=30,b=44,f=96,g=e=>'seated'===e.status?'#CFA45F':'finished'===e.status?'#3A352C':e.walkIn?'#B9925A':'#3C78B5'},852,[12,104,133,109,796,861,849,795,797,790,853,6]);
|
| 8 |
+
__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 n}}),Object.defineProperty(e,"pv",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"privName",{enumerable:!0,get:function(){return l}});const n=n=>n.replace(' (example)','').split(/\s+/).filter(Boolean).map(n=>`${n[0].toUpperCase()}.`).join(' '),t=(t,l)=>t?l?n(t):t.replace(' (example)',''):'',l=(n,l)=>n.walkIn?`Walk-in ${n.ref}`:t(n.name,l)},853,[]);
|
| 9 |
+
__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Screensaver=function({rid:e,idleMins:t,pinOn:n,pin:i,tonightCards:s}){const[l,u]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),[p,f]=(0,o.useState)(''),h=(0,o.useRef)(Date.now()),w=(0,o.useRef)(!1),y=(0,o.useRef)(0);w.current=l;const b=6e4*t;(0,o.useEffect)(()=>{if(!x)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return w.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),y.current=n+800,w.current=!1,window.__ccWokeAt=n,u(!1),j.current&&d(!0),void(h.current=Date.now())):n<y.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(h.current=Date.now())},n=['pointerdown','pointerup','mousedown','mouseup','touchstart','touchend','click','keydown','wheel'];n.forEach(e=>window.addEventListener(e,t,{capture:!0,passive:!1}));const o=setInterval(()=>{!w.current&&!D.current&&Date.now()-h.current>=b&&(w.current=!0,u(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[b]);const j=(0,o.useRef)(n);j.current=n;const D=(0,o.useRef)(c);return D.current=c,(0,o.useEffect)(()=>{if(!x)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{}}},[]),c?(0,v.jsx)(k,{pin:i,entry:p,setEntry:f,onOk:()=>{d(!1),f(''),h.current=Date.now()}}):l?(0,v.jsx)(R,{rid:e,tonightCards:s}):null};var t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),i=e(r(_d[3])),s=e(r(_d[4])),l=e(r(_d[5]));r(_d[6]);var u=e(r(_d[7])),c=e(r(_d[8])),d=e(r(_d[9])),p=r(_d[10]),f=r(_d[11]),h=r(_d[12]),w=r(_d[13]),y=r(_d[14]),b=r(_d[15]),v=r(_d[16]);const x='undefined'!=typeof window;function j({w:e,h:t,seed:n}){const l=(0,o.useRef)(new i.default.Value(0)).current,u=e=>{const t=233280*Math.sin(9301*n+49297*e);return t-Math.floor(t)};(0,o.useEffect)(()=>{const e=i.default.loop(i.default.timing(l,{toValue:1,duration:9e3+9e3*u(1),delay:4e3*u(2),easing:s.default.linear,useNativeDriver:!1}));return e.start(),()=>e.stop()},[]);const c=3+5*u(3);return(0,v.jsx)(i.default.View,{pointerEvents:"none",style:{position:'absolute',left:u(4)*e,top:0,width:c,height:c,borderRadius:c,backgroundColor:w.colours.goldLight,shadowColor:w.colours.gold,shadowRadius:6,shadowOpacity:.9,opacity:l.interpolate({inputRange:[0,.15,.8,1],outputRange:[0,.85,.5,0]}),transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[t+20,t*(.15+.3*u(5))]})},{translateX:l.interpolate({inputRange:[0,.5,1],outputRange:[0,60*(u(6)-.5),0]})}]}})}function k({pin:e,entry:t,setEntry:n,onOk:o}){const i=i=>{const s=(t+i).slice(0,4);n(s),4===s.length&&(s===e?o():setTimeout(()=>n(''),300))};return(0,v.jsxs)(c.default,{testID:"wake-pin",style:{position:x?'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,v.jsx)(b.T,{size:22,weight:"semibold",colour:w.colours.gold,children:"Enter staff PIN"}),(0,v.jsxs)(b.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(4-t.length)]}),(0,v.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,v.jsx)(u.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>i(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,v.jsx)(b.T,{size:26,colour:w.colours.gold,children:e})},e))})]})}function R({rid:e,tonightCards:u}){const{width:k,height:R}=(0,d.default)(),D=(0,p.useNow)(1e3),I=(0,y.useBrand)(e),E=(0,f.useOwner)(e=>e.offers),C=(0,p.useEvents)(e),O=(0,t.useSpecials)(t=>t.current[e]??null),T=y.HERO_LOGOS[e]??I.logo,L=(0,o.useRef)(new i.default.Value(0)).current,z=(0,o.useRef)(new i.default.Value(0)).current,V=(0,o.useRef)(new i.default.ValueXY({x:0,y:0})).current;(0,o.useEffect)(()=>{i.default.timing(L,{toValue:1,duration:700,useNativeDriver:!1}).start();const e=i.default.loop(i.default.sequence([i.default.timing(z,{toValue:1,duration:14e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1}),i.default.timing(z,{toValue:0,duration:14e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1})]));e.start();const t=()=>i.default.timing(V,{toValue:{x:(Math.random()-.5)*k*.18,y:(Math.random()-.5)*R*.14},duration:6e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1}).start();t();const n=setInterval(t,2e4);return()=>{e.stop(),clearInterval(n)}},[]);const _=(0,h.ymd)(D),M=O&&(0,n.isToday)(O.postedAt,D)?O:null,S=(0,o.useMemo)(()=>[...M?[{k:'specials',tag:'TODAY\u2019S SPECIALS',title:M.items.length?M.items.slice(0,2).map(e=>e.name.replace(' (sample)','')).join(' \xb7 '):'Fresh on the board today',body:M.items.length?M.items.slice(2).map(e=>e.name.replace(' (sample)','')).join(' \xb7 ')||'Ask your server':'Ask your server about today\u2019s specials'}]:[],...E.filter(e=>e.live).slice(0,2).map(e=>({k:e.id,title:e.title.replace(' (example)',''),body:e.body})),...C.filter(e=>e.date===_).slice(0,1).map(e=>({k:e.id,title:e.title,body:e.description}))].slice(0,3),[E,C,_,M]),N=.42*Math.min(k,R);return(0,v.jsxs)(i.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:x?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#050505',opacity:L,overflow:'hidden',cursor:'pointer'},children:[Array.from({length:18},(e,t)=>(0,v.jsx)(j,{w:k,h:R,seed:t+1},t)),(0,v.jsxs)(i.default.View,{style:{flex:1,alignItems:'center',justifyContent:'center',gap:18,transform:[{translateX:V.x},{translateY:V.y}]},children:[T?(0,v.jsx)(i.default.View,{style:{transform:[{scale:z.interpolate({inputRange:[0,1],outputRange:[1,1.12]})},{translateX:z.interpolate({inputRange:[0,1],outputRange:[-10,10]})}]},children:(0,v.jsx)(l.default,{source:T,style:{width:N,height:N},resizeMode:"contain",accessibilityLabel:`${I.name} logo`})}):(0,v.jsx)(b.T,{size:48,weight:"bold",colour:w.colours.gold,children:I.name}),(0,v.jsx)(b.T,{size:Math.round(.26*N),weight:"semibold",colour:w.colours.text,style:{letterSpacing:4},children:(0,h.hm)(D)}),(0,v.jsx)(b.T,{size:18,colour:w.colours.muted,children:(0,h.niceDate)(D)}),u&&S.length?(0,v.jsx)(c.default,{testID:"tonight-cards",style:{flexDirection:'row',gap:14,flexWrap:'wrap',justifyContent:'center',maxWidth:.86*k},children:S.map(e=>(0,v.jsxs)(c.default,{testID:'specials'===e.k?'specials-card':void 0,style:{width:Math.min(300,.27*k),padding:14,borderRadius:16,borderWidth:1,borderColor:'rgba(207,164,95,0.5)',backgroundColor:'rgba(42,34,22,0.55)',gap:4},children:[(0,v.jsx)(b.T,{size:12,weight:"semibold",colour:w.colours.gold,children:e.tag??'TONIGHT'}),(0,v.jsx)(b.T,{size:17,weight:"semibold",numberOfLines:2,children:e.title}),(0,v.jsx)(b.T,{size:13,colour:w.colours.muted,numberOfLines:3,children:e.body})]},e.k))}):null]}),(0,v.jsx)(c.default,{style:{position:'absolute',bottom:18,left:0,right:0},children:(0,v.jsx)(b.T,{size:13,colour:"#6E675B",center:!0,children:"Touch anywhere to wake"})})]})}},854,[805,806,12,102,206,178,104,245,109,269,796,804,795,797,856,790,6]);
|
| 10 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Card",{enumerable:!0,get:function(){return y}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const r=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,m.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,p.jsxs)(a.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",colour:j.colours.gold,children:"NEXT HOUR"}),(0,p.jsxs)(l.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===r.length?(0,p.jsx)(o.Muted,{children:"No arrivals due in the next hour."}):null,r.map(({b:e,m:t})=>(0,p.jsxs)(a.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?j.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?j.colours.amber:'#3C78B5'},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",children:e.time}),(0,p.jsxs)(o.T,{size:13,children:[(0,i.privName)(e,s)," \xb7 ",e.partySize]}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,p.jsx)(o.T,{size:12,colour:t<0?j.colours.amber:j.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,p.jsx)(o.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,p.jsx)(o.T,{size:12,children:b.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,p.jsxs)(o.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(b.STATUS).map(e=>(0,p.jsxs)(o.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:b.STATUS[e].colour}}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:b.STATUS[e].label})]},e)),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc8d anniversary"})]})},_e.DetailsPanel=function({title:e,children:s,onClose:l}){const[r,a]=(0,t.useState)(20);return(0,t.useEffect)(()=>{const e=Date.now(),t=()=>a(20-Math.floor((Date.now()-e)/1e3)),s=setInterval(t,1e3),l=setTimeout(t,2e4);return()=>{clearInterval(s),clearTimeout(l)}},[]),(0,t.useEffect)(()=>{r<=0&&l()},[r]),(0,p.jsxs)(o.Sheet,{visible:!0,onClose:l,title:e,maxWidth:560,testID:"private-details",children:[(0,p.jsx)(o.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),s,(0,p.jsx)(o.Button,{kind:"secondary",label:"Close now",onPress:l})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return w}}),_e.TableSheet=function({rid:e,name:l,view:h,plan:x,todays:f,now:y,privacy:w,turnBase:v,onClose:T,onWalkIn:S,onMove:k,onDetails:$}){const C=h[l],M=c.useFloor.getState(),[z,I]=(0,t.useState)(!1),[B,D]=(0,t.useState)(C?.note??''),[P,R]=(0,t.useState)(!1);if(!C)return null;const A=C.booking,O=['seated','mains','dessert','bill'].includes(C.status),N=f.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,m.minsBetween)(y,(0,b.startOf)(e)))-Math.abs((0,m.minsBetween)(y,(0,b.startOf)(t)))),W=e=>e.partySize<=C.table.maxSeats,L=(0,b.turnFor)(C.covers||C.table.maxSeats,v);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:T,title:`Table ${l} \xb7 ${b.STATUS[C.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Badge,{kind:"neutral",label:`${C.table.minSeats}\u2013${C.table.maxSeats} seats`}),A?(0,p.jsx)(o.Badge,{kind:"gold",label:`${(0,i.privName)(A,w)} \xb7 ${A.partySize} \xb7 ${C.seatedMins}m`}):null,A?(0,p.jsx)(o.Badge,{kind:C.seatedMins>(0,b.durOf)(A,v)?'red':'neutral',label:`Turn ~${(0,b.durOf)(A,v)} min \xb7 free ~${(0,m.hm)((0,b.endOf)(A,v))} (est.)`}):(0,p.jsx)(o.Badge,{kind:"neutral",label:`Turn estimate for ${C.table.maxSeats}: ~${L} min`}),C.next?(0,p.jsx)(o.Badge,{kind:"blue",label:`Next: ${C.next.time} ${(0,i.privName)(C.next,w)} (${C.next.partySize})`}):null,C.allergy?(0,p.jsx)(o.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),O||'blocked'===C.status?null:(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{label:"Seat walk-in here",onPress:()=>{T(),S(l)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,p.jsx)(o.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>R(!P),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),P?(0,p.jsxs)(a.default,{style:{gap:6},children:[0===N.length?(0,p.jsx)(o.Muted,{children:"No bookings left to seat today."}):null,N.slice(0,8).map(t=>(0,p.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,i.privName)(t,w)} ${t.time}`,onPress:async()=>{await u.repo.bookings.update(t.id,{table:l}),await u.repo.bookings.setStatus(t.id,'seated'),(0,n.resetTableLive)(e,l),T()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:W(t)?j.colours.border:j.colours.amber,backgroundColor:j.colours.surface2},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[t.time," \xb7 ",(0,i.privName)(t,w)," \xb7 ",t.partySize,t.table?` \xb7 booked T${t.table}`:'',t.allergies.length?' \xb7 \u26a0':'']}),W(t)?null:(0,p.jsxs)(o.T,{size:12,colour:j.colours.amber,children:["Bigger than this table (",C.table.maxSeats," max)"]})]},t.id))]}):null,O?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{size:14,colour:j.colours.muted,children:"Course / status"}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:b.STAGES.map(t=>(0,p.jsx)(o.Chip,{label:b.STATUS[t].label,selected:C.status===t,onPress:()=>M.setLive(e,l,{stage:t})},t))}),(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{T(),k(l)},testID:"move-party"}):null,(0,p.jsx)(o.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{A&&await u.repo.bookings.setStatus(A.id,'finished'),M.setLive(e,l,{stage:void 0,dirty:!0}),T()}})]})]}):null,'dirty'===C.status?(0,p.jsx)(o.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{M.setLive(e,l,{dirty:!1}),T()},testID:"mark-clean"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,p.jsx)(o.Button,{kind:"secondary",label:'blocked'===C.status?'Unblock table':'Block table',onPress:()=>{M.setLive(e,l,{blocked:'blocked'!==C.status}),T()},testID:"block-table"}),(0,p.jsx)(o.Button,{kind:"ghost",label:C.note?'Edit note':'+ Note',onPress:()=>I(!z)}),A||C.next?(0,p.jsx)(o.Button,{kind:"ghost",label:"Guest details",onPress:()=>{T(),$(A??C.next)},testID:"guest-details"}):null]}),z?(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Table note",value:B,onChangeText:D,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[o.styles.input,{flex:1}]}),(0,p.jsx)(o.Button,{small:!0,label:"Save",onPress:()=>{M.setLive(e,l,{note:B.trim()||void 0}),I(!1)}})]}):null,w?(0,p.jsx)(o.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,x.joins.some(e=>e.tables.includes(l))?(0,p.jsxs)(o.Muted,{children:["Joins with ",x.joins.find(e=>e.tables.includes(l)).tables.filter(e=>e!==l).join(', ')," for bigger parties (book as ",x.joins.find(e=>e.tables.includes(l)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:l,plan:h,view:f,todays:w,waiting:v,now:T,privacy:S,busy:k,onToast:$}){const[C,M]=(0,t.useState)(''),[z,I]=(0,t.useState)(2),B=(0,c.useFloor)(e=>e.smsLog);return(0,p.jsxs)(y,{title:`Waitlist (${v.length})`,right:(0,p.jsxs)(o.Muted,{children:["new party ~",(0,x.estimateWait)(v.length+1,l.settings.turnMins,k)," min"]}),testID:"waitlist-panel",children:[0===v.length?(0,p.jsx)(o.Muted,{children:"Nobody waiting."}):null,v.map((t,s)=>{const r=(0,b.suggestTable)(h,w,f,t.partySize,T,(0,b.turnFor)(t.partySize,l.settings.turnMins)),y=(0,x.estimateWait)(s+1,l.settings.turnMins,k),v=Math.max(0,(0,m.minsBetween)(new Date(t.joinedAt),T)),C=B.find(s=>s.rid===e&&s.text.includes(`#${t.number} `));return(0,p.jsxs)(a.default,{style:{backgroundColor:j.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:["#",t.number," ",(0,i.pv)(t.name,S)," \xb7 ",t.partySize]}),(0,p.jsxs)(o.T,{size:12,colour:v>y?j.colours.amber:j.colours.muted,children:["waited ",v,"m \xb7 quoted ~",y,"m"]})]}),r?(0,p.jsxs)(o.T,{size:12,colour:r.clashes?j.colours.amber:j.colours.green,children:["Best table: ",r.table," (",r.why,")"]}):(0,p.jsx)(o.T,{size:12,colour:j.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Button,{small:!0,label:C||'notified'===t.status?'Re-send (demo)':'Table ready text (demo)',testID:`sms-${t.number}`,onPress:()=>{c.useFloor.getState().logSms(e,T.toISOString(),`#${t.number} ${t.partySize}: Your table at ${l.name} is ready.`),u.repo.waitlist.setStatus(t.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${l.name} is ready."`)}}),r?(0,p.jsx)(o.Button,{small:!0,kind:"success",label:`Seat at ${r.table}`,onPress:async()=>{await u.repo.waitlist.setStatus(t.id,'seated'),await u.repo.bookings.seatWalkIn(e,t.partySize,r.table,`From waitlist #${t.number}`),(0,n.resetTableLive)(e,r.table),$(`Waitlist #${t.number} seated at ${r.table}`)}}):null,(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>u.repo.waitlist.setStatus(t.id,'removed')})]}),'notified'===t.status?(0,p.jsx)(o.Badge,{kind:"green",label:`Told table ready${C?` ${(0,m.hm)(new Date(C.at))}`:''} (demo)`}):null]},t.id)}),(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[o.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,p.jsx)(s.default,{accessibilityLabel:"Waitlist party size",onPress:()=>I(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(o.T,{weight:"bold",colour:j.colours.gold,children:z})}),(0,p.jsx)(o.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{u.repo.waitlist.join(e,C.trim(),z),M('')}})]})]})},_e.PacePanel=function({r:e,fc:t,todays:s,now:l,walkInCount:r,staffOn:n,onSummary:i}){const u=r+s.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),c=l.getHours(),h=Math.round(t.hours.filter(e=>e.hour<c).reduce((e,t)=>e+t.covers,0)+(t.hours.find(e=>e.hour===c)?.covers??0)*(l.getMinutes()/60)),x=h?u/h:1,f=x>=1.1?j.colours.amber:x>=.85?j.colours.green:j.colours.blue,w=Array.from({length:8},(e,t)=>{const r=(0,m.addMins)(l,15*(t-4)-l.getMinutes()%15),a=(0,m.addMins)(r,15),o=s.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,b.startOf)(e);return t>=r&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:r,covers:o,future:t>=4}}),v=Math.max(4,Math.round(e.settings.capacityPerHour/4)),T=Math.max(v,...w.map(e=>e.covers)),S=w.filter(e=>e.future&&e.covers>v),k=t.nextHour?.covers??0,$=Math.ceil(k/16);return(0,p.jsxs)(y,{title:"Pace & kitchen",right:(0,p.jsx)(o.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,p.jsxs)(a.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${u} vs forecast ${h}`,style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{size:14,children:"Covers so far"}),(0,p.jsxs)(o.T,{weight:"bold",colour:f,children:[u," ",(0,p.jsxs)(o.T,{size:13,colour:j.colours.muted,children:["/ ~",h," forecast"]})]})]}),(0,p.jsx)(a.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,p.jsx)(a.default,{style:{width:`${Math.min(100,75*x)}%`,height:10,borderRadius:5,backgroundColor:f}})}),(0,p.jsxs)(o.Muted,{children:[x>=1.1?'Ahead of forecast':x>=.85?'On pace':'Behind forecast'," \xb7 next hour ~",t.nextHour?`${t.nextHour.coversLow}\u2013${t.nextHour.coversHigh}`:0," covers"]})]}),(0,p.jsx)(o.T,{size:13,colour:j.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,p.jsx)(a.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:w.map((e,t)=>(0,p.jsxs)(a.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,p.jsx)(o.T,{size:10,colour:j.colours.muted,children:e.covers||''}),(0,p.jsx)(a.default,{style:{width:'80%',height:Math.max(2,e.covers/T*40),borderRadius:3,backgroundColor:e.covers>v?j.colours.red:e.future?'#6B5A3A':j.colours.gold}}),(0,p.jsx)(o.T,{size:9,colour:4===t?j.colours.gold:j.colours.muted,children:(0,m.hm)(e.from)})]},t))}),S.map(e=>(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,m.hm)(e.from),"\u2013",(0,m.hm)((0,m.addMins)(e.from,15))," (pace ~",v,") \u2014 stagger seating if you can."]},e.from.getTime())),$>n?(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Next hour ~",k," covers with ",n," on: about ",$-n," more on the floor suggested."]}):(0,p.jsxs)(o.T,{size:13,colour:j.colours.green,children:["Staffing looks OK for the next hour (",n," on)."]}),(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"End-of-service summary",onPress:i,testID:"eos-open"})]})},_e.ServiceSummary=function({r:e,todays:t,orders:s,waitlistAll:l,walkInCount:r,onClose:a}){const n=t.filter(e=>['seated','finished'].includes(e.status)),i=n.reduce((e,t)=>e+t.partySize,0)+r,u=t.filter(e=>e.walkIn),h=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,m.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),b=s.reduce((e,t)=>e+t.paid,0),x=(0,c.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),j=(e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e}),(0,p.jsx)(o.T,{weight:"semibold",children:t})]},e);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[j('Covers served',String(i)),j('Bookings seated',`${n.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),j('Walk-ins',`${u.length} parties \xb7 ${u.reduce((e,t)=>e+t.partySize,0)+r} covers`),j('No-shows',String(t.filter(e=>'noshow'===e.status).length)),j('Average table time',h.length?`${Math.round(h.reduce((e,t)=>e+t,0)/h.length)} min`:'\u2014'),j('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),j('"Table ready" texts',`${x} (demo, none sent)`),j('Taken at the till/app',`${(0,f.gbp)(b)} (demo)`),(0,p.jsx)(o.Muted,{children:"Example data on this device. Nothing is sent anywhere."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return c.tablesOf}});var t=_r(d[0]);_r(d[1]);var s=e(_r(d[2])),l=e(_r(d[3])),r=e(_r(d[4])),a=e(_r(d[5])),o=_r(d[6]),n=_r(d[7]),i=_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]);const y=({title:e,right:t,children:s,testID:l})=>(0,p.jsxs)(a.default,{testID:l,style:{backgroundColor:j.colours.surface,borderRadius:14,borderWidth:1,borderColor:j.colours.border,padding:10,gap:6},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",colour:j.colours.gold,children:e}),t]}),s]});const w=e=>(0,p.jsxs)(a.default,{style:{gap:6},children:[(0,p.jsxs)(o.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,p.jsxs)(o.Muted,{children:[e.time," \xb7 ",e.table?`Table ${e.table}`:'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),e.notes?(0,p.jsxs)(o.T,{children:["Notes: ",e.notes]}):(0,p.jsx)(o.Muted,{children:"No notes."}),e.allergies.length?(0,p.jsx)(a.default,{style:{backgroundColor:j.colours.redBg,borderRadius:8,padding:8},children:(0,p.jsxs)(o.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')]})}):(0,p.jsx)(o.Muted,{children:"No allergies declared."}),(0,p.jsx)(o.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const v=!0},855,[12,104,245,133,255,109,790,848,853,796,861,791,849,795,844,793,797,6]);
|
customer-app/_expo/static/js/web/index-19e91eebe2265fb3fefa525477cea205.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
customer-app/_expo/static/js/web/index-34fcf613bc0bc58ae7f62714d63f3bed.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 S}});var l=_r(_d[0]),s=_r(_d[1]),t=e(_r(_d[2])),n=e(_r(_d[3])),r=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]),m=_r(_d[13]),f=_r(_d[14]),y=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),k=_r(_d[18]);const w=[{id:'main',label:'Main menu'},{id:'specials',label:'Specials'},{id:'takeaway',label:'Takeaway'}];function S(){const{rid:e}=(0,l.useLocalSearchParams)(),S=(0,b.useRestaurant)(e),A=(0,b.useMenu)(e),P=(0,b.useCustomer)(),B=(0,b.useBasket)(),O=(0,b.useStore)(e=>e.startBasket),C=(0,b.useNow)(3e4),[R,T]=(0,s.useState)('All'),[M,$]=(0,s.useState)(null),[I,v]=(0,s.useState)(!1),[D,N]=(0,s.useState)(!1),[H,_]=(0,s.useState)('main'),L=(0,x.useSpecials)(l=>l.current[e]??null),F=!!L&&(0,j.isToday)(L.postedAt,C),W=(0,f.useOwner)(e=>e.offers.filter(e=>e.live).length),z=(0,b.useStore)(l=>l.stampCards.find(s=>s.restaurantId===e&&s.customerId===l.customer.id));if(!S)return(0,k.jsx)(i.Screen,{title:"Not found",children:(0,k.jsx)(i.T,{children:"Restaurant not found."})});const G=B.restaurantId===S.id&&'table'===B.mode,K=S.sections.length?S.sections:Array.from(new Set(A.map(e=>e.section))),Q=e=>!(e.soldOut||!e.signOff||null===e.price),Y=A.filter(e=>('All'===R||e.section===R)&&('takeaway'!==H||Q(e))),E=(0,u.hoursFor)(S,C),V=e=>()=>l.router.push(`/customer/${S.id}${e}`),q=[{icon:'\ud83e\udd61',label:'Takeaway',sub:'Order to collect',on:()=>{T('All'),_('takeaway'),G&&O(S.id,'takeaway')}},{icon:'\ud83d\udcf1',label:'Order at table',sub:'Scan the QR',on:()=>N(!0)},{icon:'\ud83d\udcc5',label:'Book a table',on:V('/book')},{icon:'\u23f3',label:'Waitlist',sub:'Walk in',on:V('/waitlist')},{icon:'\u2b50',label:'Stamp card',sub:`${z?.stamps??0} of ${S.settings.stampTarget}`,on:V('/loyalty')},{icon:'\ud83e\udd1d',label:'Bring a friend',on:V('/refer')},{icon:'\ud83c\udf81',label:'Gift cards',on:V('/gift')},{icon:'\u26a0\ufe0f',label:'My allergens',sub:P.allergies.length?`${P.allergies.length} declared`:'None declared',on:()=>l.router.push('/customer/profile')},{icon:'\ud83c\udff7\ufe0f',label:'Offers',sub:P.marketingOptIn[S.id]?'Opted in':'Opt in',on:V('/offers'),badge:W?String(W):void 0},{icon:'\ud83c\udf89',label:"What's on",on:V('/whatson')},{icon:'\ud83d\udcac',label:'Feedback',sub:'Private',on:V('/feedback')},{icon:'\ud83e\udde3',label:'Lost property',on:V('/lost')},{icon:'\ud83d\udecd\ufe0f',label:'Shop',sub:'Merch',on:V('/merch')}];return(0,k.jsxs)(i.Screen,{title:S.name,subtitle:`${S.location}${S.phone?` \xb7 ${S.phone}`:''}`,back:'customer'!==m.APP_VARIANT,right:(0,k.jsxs)(i.Row,{children:[(0,k.jsx)(o.BasketButton,{}),(0,k.jsx)(i.Button,{small:!0,kind:"ghost",label:"Account",onPress:()=>l.router.push('/customer/profile')})]}),children:[S.fictional?(0,k.jsx)(i.Banner,{kind:"warn",title:"Fictional demo restaurant",children:"Shown only to demonstrate multi-restaurant support."}):null,G?(0,k.jsx)(i.Banner,{kind:"success",title:`Ordering at Table ${B.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,k.jsx)(i.Card,{children:(0,k.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsxs)(n.default,{style:{flex:1},children:[(0,k.jsx)(i.T,{weight:"semibold",children:"Takeaway \u2014 collection"}),(0,k.jsxs)(i.Muted,{children:[E?`Kitchen today ${S.kitchenHours[C.getDay()][0]}\u2013${S.kitchenHours[C.getDay()][1]}`:'Kitchen closed today',S.settings.takeawayPaused?' \xb7 slots paused by the restaurant':'']})]}),(0,k.jsx)(i.Badge,{kind:S.settings.takeawayPaused||!E?'amber':'green',label:S.settings.takeawayPaused?'Paused':E?'Taking orders':'Closed'})]})}),S.fictional?(0,k.jsx)(i.Row,{wrap:!0,gap:8,children:q.slice(2,7).map(e=>(0,k.jsx)(i.Button,{small:!0,kind:"secondary",label:e.label,onPress:e.on},e.label))}):(0,k.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:q.map(e=>(0,k.jsx)(p.HubTile,{icon:e.icon,label:e.label,sub:e.sub,badge:e.badge,onPress:e.on},e.label))}),G?(0,k.jsx)(i.Button,{small:!0,kind:"danger",label:"Call staff",onPress:()=>v(!0)}):null,I?(0,k.jsx)(i.Banner,{kind:"success",children:"A member of staff is on their way to your table (demo)."}):null,S.hoursNote?(0,k.jsx)(i.Muted,{children:S.hoursNote}):null,S.fictional?null:(0,k.jsx)(i.ExampleAllergenNotice,{}),(0,k.jsx)(i.Muted,{children:"Menu dishes and prices from The Anchorage\u2019s public menu (PDF). Items marked \u26a0 conflict with your declared allergies."}),(0,k.jsx)(n.default,{accessibilityRole:"tablist",testID:"menu-tabs",style:{flexDirection:'row',gap:6,backgroundColor:h.colours.surface,borderRadius:14,borderWidth:1,borderColor:h.colours.border,padding:4},children:w.map(e=>{const l=H===e.id;return(0,k.jsxs)(t.default,{testID:`menu-tab-${e.id}`,accessibilityRole:"tab",accessibilityState:{selected:l},"aria-selected":l,accessibilityLabel:'specials'===e.id&&F?'Specials, updated today':e.label,onPress:()=>_(e.id),style:{flex:1,minHeight:44,borderRadius:10,alignItems:'center',justifyContent:'center',paddingHorizontal:4,backgroundColor:l?h.colours.gold:'transparent'},children:[(0,k.jsx)(i.T,{size:14,weight:"semibold",colour:l?h.colours.onGold:h.colours.text,center:!0,children:e.label}),'specials'===e.id&&F&&!l?(0,k.jsx)(n.default,{style:{position:'absolute',top:6,right:8,width:7,height:7,borderRadius:4,backgroundColor:h.colours.gold}}):null]},e.id)})}),'specials'===H?(0,k.jsx)(y.SpecialsTab,{rid:S.id,declared:P.allergies,now:C}):null,'takeaway'===H?(0,k.jsx)(i.Muted,{children:"Order to collect. Only dishes available to order online are shown; pick a collection slot at checkout."}):null,'specials'!==H?(0,k.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,k.jsx)(i.Chip,{label:"All",selected:'All'===R,onPress:()=>T('All')}),K.map(e=>(0,k.jsx)(i.Chip,{label:e,selected:R===e,onPress:()=>T(e)},e))]}):null,'specials'!==H?K.filter(e=>('All'===R||e===R)&&Y.some(l=>l.section===e)).map(e=>(0,k.jsxs)(n.default,{style:{gap:10},children:[(0,k.jsx)(i.H2,{style:{color:h.colours.gold,marginTop:6},children:e}),Y.filter(l=>l.section===e).map(e=>{const s=(0,d.conflictsFor)(e.allergens,P.allergies),o=e.soldOut||!e.signOff||null===e.price;return(0,k.jsxs)(i.Card,{highlight:s.contains.length?h.colours.red:s.may.length?h.colours.amber:void 0,children:[(0,k.jsxs)(t.default,{accessibilityRole:"button",onPress:()=>{B.restaurantId&&B.restaurantId===S.id||O(S.id,'takeaway'),l.router.push(`/customer/${S.id}/dish/${e.id}`)},children:[(0,k.jsxs)(i.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,k.jsx)(i.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,k.jsx)(i.T,{weight:"semibold",colour:h.colours.gold,children:null===e.price?e.priceNote??'\u2014':(0,c.gbp)(e.price)})]}),(0,k.jsx)(i.Muted,{numberOfLines:2,children:e.description})]}),(0,k.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.dietary.map(e=>(0,k.jsx)(i.Badge,{kind:"green",label:e},e)),e.special?(0,k.jsx)(i.Badge,{kind:"gold",label:"Special"}):null,e.soldOut?(0,k.jsx)(i.Badge,{kind:"neutral",label:"Sold out"}):null,e.signOff?null:(0,k.jsx)(i.Badge,{kind:"amber",label:"Awaiting allergen sign-off"}),s.contains.length?(0,k.jsx)(i.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):s.may.length?(0,k.jsx)(i.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null]}),(0,k.jsx)(r.AllergenChips,{map:e.allergens,declared:P.allergies}),M===e.id?(0,k.jsx)(r.AllergenPanel,{item:e,map:e.allergens,declared:P.allergies}):null,(0,k.jsxs)(i.Row,{gap:8,children:[(0,k.jsx)(i.Button,{small:!0,kind:"ghost",label:M===e.id?'Hide allergen panel':'Allergen panel',onPress:()=>$(M===e.id?null:e.id)}),(0,k.jsx)(n.default,{style:{flex:1}}),(0,k.jsx)(i.Button,{small:!0,label:o?e.soldOut?'Sold out':'Not available online':'Choose',disabled:o,onPress:()=>{B.restaurantId&&B.restaurantId===S.id||O(S.id,'takeaway'),l.router.push(`/customer/${S.id}/dish/${e.id}`)}})]})]},e.id)})]},e)):null,(0,k.jsx)(i.Muted,{children:"Drinks list coming soon. Ask your server for today\u2019s drinks."}),(0,k.jsx)(i.Muted,{children:"All payments in this app are demo only: Demo, no real payment."}),(0,k.jsx)(p.LauncherLine,{}),(0,k.jsxs)(i.Sheet,{visible:D,onClose:()=>N(!1),title:"Order at your table",children:[(0,k.jsx)(i.Muted,{children:"Scan the QR code on your table with your phone camera, or pick your table number (demo)."}),(0,k.jsx)(i.Row,{wrap:!0,gap:6,children:Array.from({length:12},(e,l)=>String(l+1)).map(e=>(0,k.jsx)(i.Button,{small:!0,kind:"secondary",label:`Table ${e}`,onPress:()=>{N(!1),O(S.id,'table',e)}},e))}),(0,k.jsx)(i.Muted,{children:"Orders go straight to the kitchen. You pay from your order page (Demo, no real payment)."})]})]})}},763,[785,12,245,109,798,799,790,791,793,792,796,797,803,787,804,801,805,806,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"photoSource",{enumerable:!0,get:function(){return C}}),_e.BoardPhoto=T,_e.PhotoZoom=k,_e.SpecialRow=M,_e.SpecialsTab=function({rid:e,declared:s,now:l}){const n=(0,p.useSpecials)(t=>t.current[e]??null),[o,u]=(0,t.useState)(null);if(!n)return(0,b.jsx)(h.Card,{children:(0,b.jsxs)(c.default,{testID:"specials-empty",style:{alignItems:'center',gap:6,paddingVertical:18},children:[(0,b.jsx)(h.T,{size:34,children:"\ud83e\uddd1\u200d\ud83c\udf73"}),(0,b.jsx)(h.T,{weight:"semibold",size:18,center:!0,children:"Today\u2019s specials are on their way"}),(0,b.jsx)(h.Muted,{center:!0,children:"The kitchen posts the specials board here as soon as it\u2019s written up. Check back soon, or ask a member of staff."})]})});const f=n.allergenCheck;return(0,b.jsxs)(c.default,{style:{gap:10},testID:"specials-tab",children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsx)(c.default,{testID:"specials-updated",style:{flex:1},children:(0,b.jsx)(h.T,{weight:"semibold",colour:j.colours.goldLight,children:(0,x.freshness)(n,l)})}),(0,x.isToday)(n.postedAt,l)?(0,b.jsx)(h.Badge,{kind:"green",label:"Today"}):(0,b.jsx)(h.Badge,{kind:"amber",label:"Not updated today"})]}),(0,x.isToday)(n.postedAt,l)?null:(0,b.jsx)(h.Muted,{children:"These are the most recent specials posted. Today\u2019s may differ, so please ask."}),n.photo?(0,b.jsxs)(c.default,{style:{gap:4},children:[(0,b.jsx)(T,{photo:n.photo,testID:"specials-photo",onPress:()=>u(n.photo)}),(0,b.jsx)(h.Muted,{center:!0,children:"Tap the photo to zoom"})]}):null,n.items.map(e=>(0,b.jsx)(M,{it:e,declared:s,signedBy:f?.by},e.id)),f?(0,b.jsxs)(h.Muted,{children:["Allergens for the typed specials were checked by ",f.by.replace(' (example)','')," at ",(0,y.hm)(new Date(f.at)),". Example data in this prototype."]}):null,n.photo&&!n.items.length?(0,b.jsx)(h.Muted,{children:"For allergens in these specials, please ask a member of staff before you order."}):null,(0,b.jsx)(h.Muted,{children:"Specials are served in the restaurant while they last. Ask your server to order one."}),(0,b.jsx)(k,{photo:o,onClose:()=>u(null)})]})};var t=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),n=e(r(d[3])),o=e(r(d[4])),c=e(r(d[5])),u=r(d[6]),h=r(d[7]),p=r(d[8]),f=r(d[9]),x=r(d[10]),y=r(d[11]),j=r(d[12]),b=r(d[13]);const w=r(d[14]),C=e=>e===x.SAMPLE_PHOTO?w:{uri:e};function T({photo:e,width:l,onPress:o,testID:u,label:h="Photo of the specials board"}){const[p,f]=(0,t.useState)(.75);(0,t.useEffect)(()=>{e!==x.SAMPLE_PHOTO?s.default.getSize(e,(e,t)=>e&&t&&f(e/t),()=>{}):f(.75)},[e]);const y=(0,b.jsx)(s.default,{source:C(e),resizeMode:"contain",accessibilityLabel:h,style:{width:l??'100%',aspectRatio:p,borderRadius:12,backgroundColor:'#1b1f1d'}});return o?(0,b.jsx)(n.default,{testID:u,accessibilityRole:"button",accessibilityLabel:`${h}. Tap to zoom`,onPress:o,children:y}):(0,b.jsx)(c.default,{testID:u,children:y})}function k({photo:e,onClose:s}){const[u,p]=(0,t.useState)(!1);return(0,t.useEffect)(()=>p(!1),[e]),(0,b.jsx)(l.default,{visible:!!e,transparent:!0,animationType:"fade",onRequestClose:s,children:(0,b.jsxs)(c.default,{testID:"specials-zoom",style:{flex:1,backgroundColor:'rgba(5,5,5,0.97)'},children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between',padding:12},children:[(0,b.jsx)(h.Button,{small:!0,kind:"secondary",label:u?'Zoom out':'Zoom in',onPress:()=>p(!u)}),(0,b.jsx)(h.Button,{small:!0,label:"Close",accessibilityLabel:"Close photo",onPress:s})]}),(0,b.jsx)(o.default,{horizontal:u,contentContainerStyle:{padding:12,alignItems:'center',justifyContent:'center',flexGrow:1},children:(0,b.jsx)(o.default,{contentContainerStyle:{alignItems:'center'},children:e?(0,b.jsx)(n.default,{onPress:()=>p(!u),accessibilityLabel:u?'Zoom out':'Zoom in',children:(0,b.jsx)(T,{photo:e,width:u?820:360})}):null})})]})})}function M({it:e,declared:t,signedBy:s}){const l=(0,f.conflictsFor)(e.allergens,t);return(0,b.jsx)(h.Card,{highlight:l.contains.length?j.colours.red:l.may.length?j.colours.amber:void 0,children:(0,b.jsxs)(c.default,{testID:"special-item",style:{gap:6},children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,b.jsx)(h.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,b.jsx)(h.T,{weight:"semibold",colour:j.colours.gold,children:(0,x.priceText)(e.price)})]}),e.description?(0,b.jsx)(h.Muted,{children:e.description}):null,l.contains.length?(0,b.jsx)(h.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):l.may.length?(0,b.jsx)(h.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null,e.noAllergens&&!Object.keys(e.allergens).length?(0,b.jsx)(h.Muted,{children:"None of the 14 allergens listed"}):(0,b.jsx)(u.AllergenChips,{map:e.allergens,declared:t}),s?(0,b.jsxs)(h.Muted,{children:["Allergens checked by ",s.replace(' (example)','')]}):null]})})}},801,[12,178,238,245,133,109,798,790,805,791,806,795,797,6,802]);
|
| 3 |
+
__d(function(g,r,i,a,m,e,d){"use strict";m.exports={uri:"/customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg",width:900,height:1200,toString(){return this.uri}}},802,[]);
|
customer-app/_expo/static/js/web/index-40f95cd6322320cbf9524c02b0284dba.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e=_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]);function x(){const r=(0,u.useStore)(e=>e.restaurants),s=(0,u.useCustomer)(),x=(0,u.useNow)(3e4);return(0,j.jsxs)(l.Screen,{title:"Restaurants",subtitle:"Book, order and pay at local restaurants",right:(0,j.jsxs)(l.Row,{children:[(0,j.jsx)(n.BasketButton,{}),(0,j.jsx)(l.Button,{small:!0,kind:"ghost",label:"Profile",onPress:()=>e.router.push('/customer/profile')})]}),children:[(0,j.jsxs)(l.Card,{onPress:()=>e.router.push('/customer/profile'),children:[(0,j.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.T,{weight:"semibold",children:["Hello, ",s.name.split(' ')[0]]}),(0,j.jsx)(l.Muted,{children:"Edit profile \u203a"})]}),(0,j.jsx)(l.Muted,{children:"Your allergies (stored once, confirmed on every order and booking):"}),(0,j.jsx)(l.Row,{wrap:!0,gap:6,children:s.allergies.length?s.allergies.map(e=>(0,j.jsx)(l.Badge,{kind:"red",label:`${(0,o.allergenLabel)(e.allergen)} \u2014 ${(0,o.severityLabel)(e.severity)}`},e.allergen)):(0,j.jsx)(l.Muted,{children:"None declared"})})]}),r.map(r=>{const s=(0,a.hoursFor)(r,x);return(0,j.jsxs)(l.Card,{onPress:()=>e.router.push(`/customer/${r.id}`),highlight:'anchorage'===r.id?c.colours.gold:void 0,children:[(0,j.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(l.H2,{style:{flex:1},children:r.name}),r.fictional?(0,j.jsx)(l.Badge,{kind:"amber",label:"FICTIONAL DEMO"}):(0,j.jsx)(l.Badge,{kind:"gold",label:"PILOT"})]}),(0,j.jsx)(l.Muted,{children:r.tagline}),(0,j.jsx)(l.Muted,{children:r.location}),(0,j.jsx)(l.T,{size:14,colour:s?c.colours.green:c.colours.amber,children:s?`Kitchen today ${r.kitchenHours[x.getDay()][0]}\u2013${r.kitchenHours[x.getDay()][1]}`:'Kitchen closed today (hours not listed)'})]},r.id)}),(0,j.jsx)(l.Banner,{kind:"info",children:"Each restaurant has its own menu, stamp card and gift cards. Saltmarsh Kitchen and Brae Bakehouse are fictional."}),(0,j.jsx)(h.LauncherLine,{}),(0,j.jsx)(t.default,{style:{height:8}})]})}},772,[785,12,109,799,790,791,792,796,797,803,6]);
|
customer-app/_expo/static/js/web/index-f4304d490b72825b88900169751ec98b.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return'owner'!==u.APP_VARIANT?(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]}):(0,c.jsx)(n.OwnerApp,{})}},780,[785,12,865,787,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OwnerApp=function(){return null}},865,[]);
|
customer-app/_expo/static/js/web/lost-254ada7b9fc10346689d98d894e24ca3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),r=_r(d[3]),l=_r(d[4]),o=_r(d[5]);function u(){const{rid:u}=(0,t.useLocalSearchParams)(),h=(0,r.useRestaurant)(u),c=(0,r.useCustomer)(),x=(0,r.useNow)(6e4),j=(0,l.useOwner)(t=>t.lost),p=(0,l.useOwner)(t=>t.lostReports),[f,w]=(0,n.useState)(''),[y,b]=(0,n.useState)(''),[S,C]=(0,n.useState)(''),[R,O]=(0,n.useState)(!1);if(!h)return(0,o.jsx)(s.Screen,{title:"Not found",children:(0,o.jsx)(s.T,{children:"Restaurant not found."})});const T=p.filter(t=>t.contact.includes(c.email));return(0,o.jsxs)(s.Screen,{title:"Lost property",subtitle:h.name,children:[(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Recently handed in"}),j.filter(t=>'held'===t.status).map(t=>(0,o.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,o.jsx)(s.T,{style:{flex:1},children:t.item}),(0,o.jsx)(s.Muted,{children:t.foundAt.slice(0,10)})]},t.id)),j.some(t=>'held'===t.status)?null:(0,o.jsx)(s.Muted,{children:"Nothing handed in right now."}),(0,o.jsx)(s.Muted,{children:"To collect, bring ID or describe the item to staff. Items are kept for 3 months."})]}),R?(0,o.jsxs)(s.Banner,{kind:"success",children:["Report sent to ",h.name,". They'll be in touch if it turns up (demo: nothing is sent)."]}):null,(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Lost something?"}),(0,o.jsx)(s.Field,{label:"What did you lose?",value:f,onChangeText:w,placeholder:"e.g. Grey scarf"}),(0,o.jsx)(s.Field,{label:"When were you in?",value:y,onChangeText:b,placeholder:"e.g. Saturday evening"}),(0,o.jsx)(s.Field,{label:"Where were you sitting? (optional)",value:S,onChangeText:C,placeholder:"e.g. By the window"}),(0,o.jsxs)(s.Muted,{children:["We'll share your name and email (",c.email,") with ",h.name," for this report only."]}),(0,o.jsx)(s.Button,{label:"Send report",disabled:f.trim().length<2||y.trim().length<2,onPress:()=>{l.useOwner.getState().setOwner({lostReports:[{id:`lr-${Date.now()}`,item:f.trim(),when:y.trim(),where:S.trim()||'Not sure',contact:`${c.name} \xb7 ${c.email}`,at:x.toISOString(),status:'open'},...l.useOwner.getState().lostReports]}),w(''),b(''),C(''),O(!0)}})]}),T.length?(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Your reports"}),T.map(t=>(0,o.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,o.jsxs)(s.T,{style:{flex:1},children:[t.item," \xb7 ",t.when]}),(0,o.jsx)(s.Badge,{kind:'matched'===t.status?'green':'open'===t.status?'amber':'neutral',label:'matched'===t.status?'Found!':'open'===t.status?'Looking':'Closed'})]},t.id))]}):null]})}},764,[785,12,790,796,804,6]);
|
customer-app/_expo/static/js/web/loyalty-b4cf2f88c2062e44f0bc0b1af86851e7.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var e=_r(d[0]);_r(d[1]);var r,s=_r(d[2]),t=(r=s)&&r.__esModule?r:{default:r},i=_r(d[3]),n=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]);function h(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r),h=(0,l.useCustomer)(),p=(0,l.useStampCard)(r);if(!s)return(0,u.jsx)(n.Screen,{title:"Not found",children:(0,u.jsx)(n.T,{children:"Restaurant not found."})});const f=s.settings.stampTarget,j=p?.stamps??0;return(0,u.jsxs)(n.Screen,{title:"Stamp card",subtitle:`${s.name} \u2014 this card is just for ${s.name}`,children:[(0,u.jsxs)(n.Card,{highlight:c.colours.gold,children:[(0,u.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(n.H2,{children:[j," of ",f," stamps"]}),(0,u.jsxs)(n.T,{colour:c.colours.gold,weight:"semibold",children:["Reward: ",s.settings.stampReward]})]}),(0,u.jsx)(t.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:10,justifyContent:'center',paddingVertical:8},children:Array.from({length:f}).map((e,r)=>(0,u.jsx)(t.default,{accessibilityLabel:r<j?'Stamp collected':'Empty stamp',style:{width:52,height:52,borderRadius:26,borderWidth:2,borderColor:c.colours.gold,backgroundColor:r<j?c.colours.gold:'transparent',alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(n.T,{size:22,colour:r<j?c.colours.onGold:c.colours.border,children:"\u2605"})},r))}),(0,u.jsxs)(n.Muted,{children:["One stamp per paid visit or order over ",(0,o.gbp)(s.settings.stampMinSpend)," \u2014 dine-in, table QR or takeaway. Rewards are funded by ",s.name,"."]}),p?.rewardsAvailable?(0,u.jsx)(n.Banner,{kind:"success",title:`${p.rewardsAvailable} reward${p.rewardsAvailable>1?'s':''} ready: ${s.settings.stampReward}`,children:(0,u.jsx)(n.Button,{small:!0,label:"Use reward (show staff)",onPress:()=>l.repo.loyalty.redeemReward(s.id,h.id)})}):null]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Show this to staff"}),(0,u.jsx)(n.Muted,{children:"Staff scan this on the tablet to add a stamp for dine-in visits not paid by table QR."}),(0,u.jsx)(i.QR,{value:`covercharge:stamp:${s.id}:${h.id}`,size:190}),(0,u.jsx)(n.T,{center:!0,weight:"semibold",children:h.name})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Bring a friend"}),(0,u.jsx)(n.T,{children:"Your referral code"}),(0,u.jsx)(n.T,{size:28,weight:"bold",colour:c.colours.gold,center:!0,children:h.referralCode}),(0,u.jsx)(n.Muted,{children:"When a friend completes their first qualifying paid visit or order, you both get a stamp. One referral reward per new account, phone and card; monthly cap applies."})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"History"}),(p?.history??[]).length?p.history.slice(0,10).map((e,r)=>(0,u.jsxs)(n.Muted,{children:[e.at.slice(0,10)," \xb7 ",e.source]},r)):(0,u.jsx)(n.Muted,{children:"No stamps yet."})]}),(0,u.jsx)(n.Muted,{children:"Rewards are kept on food (Scottish licensing rules restrict drinks promotions). Stamps are never given for reviews."})]})}},765,[785,12,109,807,790,793,796,797,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.QR=function({value:e,size:t=180}){return(0,n.jsx)(o.default,{style:{padding:12,backgroundColor:'#FFFFFF',borderRadius:12,alignSelf:'center',borderWidth:3,borderColor:u.colours.gold},children:(0,n.jsx)(l.default,{value:e,size:t,color:"#0B0B0B",backgroundColor:"#FFFFFF"})})},r(d[0]);var o=e(r(d[1])),l=e(r(d[2])),u=r(d[3]),n=r(d[4])},807,[12,109,808,797,6]);
|
| 3 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},808,[809]);
|
| 4 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function o(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e=r(d[0]),t=r(d[1]),l=o(t),s=o(r(d[2])),n=o(r(d[3])),c=o(r(d[4])),h=r(d[5]);const u=({size:o,backgroundColor:e,logo:l,logoSVG:s,logoSize:n,logoBackgroundColor:u,logoColor:x,logoMargin:f,logoBorderRadius:p,clipPathId:j})=>{const C=(o-n-2*f)/2,y=n+2*f,b=p+f/n*p,k=`clip-logo-background-${j}`,G=`clip-logo-${j}`;return(0,h.jsxs)(t.G,{x:C,y:C,children:[(0,h.jsxs)(t.Defs,{children:[(0,h.jsx)(t.ClipPath,{id:k,children:(0,h.jsx)(t.Rect,{width:y,height:y,rx:b,ry:b})}),(0,h.jsx)(t.ClipPath,{id:G,children:(0,h.jsx)(t.Rect,{width:n,height:n,rx:p,ry:p})})]}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Rect,{width:y,height:y,fill:e,clipPath:`url(#${k})`})}),(0,h.jsxs)(t.G,{x:f,y:f,clipPath:`url(#${G})`,children:[(0,h.jsx)(t.Rect,{width:y-f,height:y-f,fill:u}),s?(0,h.jsx)(c.default,{svg:s,logoSize:n,logoColor:x}):(0,h.jsx)(t.Image,{width:n,height:n,preserveAspectRatio:"xMidYMid slice",href:l,clipPath:`url(#${G})`})]})]})};var x=({value:o="this is a QR code",size:c=100,color:x="black",backgroundColor:f="white",logo:p,logoSVG:j,logoSize:C=.2*c,logoBackgroundColor:y="transparent",logoColor:b,logoMargin:k=2,logoBorderRadius:G=0,quietZone:R=0,enableLinearGradient:w=!1,gradientDirection:P=['0%','0%','100%','100%'],linearGradient:S=['rgb(255,0,0)','rgb(0,255,255)'],ecl:M="M",getRef:z,onError:v,testID:B})=>{const I=(0,e.useId)(),_=(0,e.useMemo)(()=>{try{return(0,n.default)((0,s.default)(o,M),c)}catch(o){if(!v||'function'!=typeof v)throw o;v(o)}},[o,c,M]);if(!_)return null;const{path:D,cellSize:$}=_,O=p||j;return(0,h.jsxs)(l.default,{testID:B,ref:z,viewBox:[-R,-R,c+2*R,c+2*R].join(' '),width:c,height:c,children:[(0,h.jsx)(t.Defs,{children:(0,h.jsxs)(t.LinearGradient,{id:"grad",x1:P[0],y1:P[1],x2:P[2],y2:P[3],children:[(0,h.jsx)(t.Stop,{offset:"0",stopColor:S[0],stopOpacity:"1"}),(0,h.jsx)(t.Stop,{offset:"1",stopColor:S[1],stopOpacity:"1"})]})}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Rect,{x:-R,y:-R,width:c+2*R,height:c+2*R,fill:f})}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Path,{d:D,strokeLinecap:"butt",stroke:w?'url(#grad)':x,strokeWidth:$})}),O&&u({size:c,backgroundColor:f,logo:p,logoSVG:j,logoSize:C,logoBackgroundColor:y,logoColor:b,logoMargin:k,logoBorderRadius:G,clipPathId:I})]})}},809,[12,842,810,839,840,6]);
|
| 5 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},l=(e,t)=>{const l=Array.prototype.slice.call(u.default.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(l.length);return l.reduce((e,t,u)=>(u%n===0?e.push([t]):e[e.length-1].push(t))&&e,[])}},810,[811]);
|
| 6 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]),e=r(d[2]),o=r(d[3]);function c(e,o,c,l,u){const f=[].slice.call(arguments,1),s=f.length,v='function'==typeof f[s-1];if(!v&&!t())throw new Error('Callback required as last argument');if(!v){if(s<1)throw new Error('Too few arguments provided');return 1===s?(c=o,o=l=void 0):2!==s||o.getContext||(l=c,c=o,o=void 0),new Promise(function(t,u){try{const u=n.create(c,l);t(e(u,o,l))}catch(t){u(t)}})}if(s<2)throw new Error('Too few arguments provided');2===s?(u=c,c=o,o=l=void 0):3===s&&(o.getContext&&void 0===u?(u=l,l=void 0):(u=l,l=c,c=o,o=void 0));try{const t=n.create(c,l);u(null,e(t,o,l))}catch(t){u(t)}}_e.create=n.create,_e.toCanvas=c.bind(null,e.render),_e.toDataURL=c.bind(null,e.renderToDataURL),_e.toString=c.bind(null,function(t,n,e){return o.render(t,e)})},811,[812,813,836,838]);
|
| 7 |
+
__d(function(g,r,i,a,m,e,d){m.exports=function(){return'function'==typeof Promise&&Promise.prototype&&Promise.prototype.then}},812,[]);
|
| 8 |
+
__d(function(g,_r,_i,a,m,e,d){const t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),s=_r(d[4]),i=_r(d[5]),f=_r(d[6]),c=_r(d[7]),l=_r(d[8]),u=_r(d[9]),h=_r(d[10]),w=_r(d[11]),C=_r(d[12]);function y(t,o){const n=t.size,r=i.getPositions(o);for(let o=0;o<r.length;o++){const s=r[o][0],i=r[o][1];for(let o=-1;o<=7;o++)if(!(s+o<=-1||n<=s+o))for(let r=-1;r<=7;r++)i+r<=-1||n<=i+r||(o>=0&&o<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===o||6===o)||o>=2&&o<=4&&r>=2&&r<=4?t.set(s+o,i+r,!0,!0):t.set(s+o,i+r,!1,!0))}}function S(t){const o=t.size;for(let n=8;n<o-8;n++){const o=n%2==0;t.set(n,6,o,!0),t.set(6,n,o,!0)}}function p(t,o){const n=s.getPositions(o);for(let o=0;o<n.length;o++){const r=n[o][0],s=n[o][1];for(let o=-2;o<=2;o++)for(let n=-2;n<=2;n++)-2===o||2===o||-2===n||2===n||0===o&&0===n?t.set(r+o,s+n,!0,!0):t.set(r+o,s+n,!1,!0)}}function v(t,o){const n=t.size,r=u.getEncodedBits(o);let s,i,f;for(let o=0;o<18;o++)s=Math.floor(o/3),i=o%3+n-8-3,f=1==(r>>o&1),t.set(s,i,f,!0),t.set(i,s,f,!0)}function B(t,o,n){const r=t.size,s=h.getEncodedBits(o,n);let i,f;for(i=0;i<15;i++)f=1==(s>>i&1),i<6?t.set(i,8,f,!0):i<8?t.set(i+1,8,f,!0):t.set(r-15+i,8,f,!0),i<8?t.set(8,r-i-1,f,!0):i<9?t.set(8,15-i-1+1,f,!0):t.set(8,15-i-1,f,!0);t.set(r-8,8,1,!0)}function b(t,o){const n=t.size;let r=-1,s=n-1,i=7,f=0;for(let c=n-1;c>0;c-=2)for(6===c&&c--;;){for(let n=0;n<2;n++)if(!t.isReserved(s,c-n)){let r=!1;f<o.length&&(r=1==(o[f]>>>i&1)),t.set(s,c-n,r),i--,-1===i&&(f++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function M(o,r,s){const i=new n;s.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),w.getCharCountIndicator(t.mode,o)),t.write(i)});const f=8*(t.getSymbolTotalCodewords(o)-c.getTotalCodewordsCount(o,r));for(i.getLengthInBits()+4<=f&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const l=(f-i.getLengthInBits())/8;for(let t=0;t<l;t++)i.put(t%2?17:236,8);return I(i,o,r)}function I(o,n,r){const s=t.getSymbolTotalCodewords(n),i=s-c.getTotalCodewordsCount(n,r),f=c.getBlocksCount(n,r),u=f-s%f,h=Math.floor(s/f),w=Math.floor(i/f),C=w+1,y=h-w,S=new l(y);let p=0;const v=new Array(f),B=new Array(f);let b=0;const M=new Uint8Array(o.buffer);for(let t=0;t<f;t++){const o=t<u?w:C;v[t]=M.slice(p,p+o),B[t]=S.encode(v[t]),p+=o,b=Math.max(b,o)}const I=new Uint8Array(s);let A,E,T=0;for(A=0;A<b;A++)for(E=0;E<f;E++)A<v[E].length&&(I[T++]=v[E][A]);for(A=0;A<y;A++)for(E=0;E<f;E++)I[T++]=B[E][A];return I}function A(o,n,s,i){let c;if(Array.isArray(o))c=C.fromArray(o);else{if('string'!=typeof o)throw new Error('Invalid data');{let t=n;if(!t){const n=C.rawSplit(o);t=u.getBestVersionForData(n,s)}c=C.fromString(o,t||40)}}const l=u.getBestVersionForData(c,s);if(!l)throw new Error('The amount of data is too big to be stored in a QR Code');if(n){if(n<l)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+l+'.\n')}else n=l;const h=M(n,s,c),w=t.getSymbolSize(n),I=new r(w);return y(I,n),S(I),p(I,n),B(I,s,0),n>=7&&v(I,n),b(I,h),isNaN(i)&&(i=f.getBestMask(I,B.bind(null,I,s))),f.applyMask(i,I),B(I,s,i),{modules:I,version:n,errorCorrectionLevel:s,maskPattern:i,segments:c}}e.create=function(n,r){if(void 0===n||''===n)throw new Error('No input text');let s,i,c=o.M;return void 0!==r&&(c=o.from(r.errorCorrectionLevel,o.M),s=u.from(r.version),i=f.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),A(n,s,c,i)}},813,[814,815,816,817,818,819,820,821,822,825,829,826,830]);
|
| 9 |
+
__d(function(g,r,i,a,m,e,d){let n;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return 4*n+17},e.getSymbolTotalCodewords=function(n){return o[n]},e.getBCHDigit=function(n){let o=0;for(;0!==n;)o++,n>>>=1;return o},e.setToSJISFunction=function(o){if('function'!=typeof o)throw new Error('"toSJISFunc" is not a valid function.');n=o},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(o){return n(o)}},814,[]);
|
| 10 |
+
__d(function(g,r,i,a,m,_e,d){function t(t){if('string'!=typeof t)throw new Error('Param is not a string');switch(t.toLowerCase()){case'l':case'low':return _e.L;case'm':case'medium':return _e.M;case'q':case'quartile':return _e.Q;case'h':case'high':return _e.H;default:throw new Error('Unknown EC Level: '+t)}}_e.L={bit:1},_e.M={bit:0},_e.Q={bit:3},_e.H={bit:2},_e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},_e.from=function(e,n){if(_e.isValid(e))return e;try{return t(e)}catch(t){return n}}},815,[]);
|
| 11 |
+
__d(function(g,r,_i,a,m,e,d){function t(){this.buffer=[],this.length=0}t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let h=0;h<n;h++)this.putBit(1==(t>>>n-h-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},m.exports=t},816,[]);
|
| 12 |
+
__d(function(g,r,i,a,m,e,d){function t(t){if(!t||t<1)throw new Error('BitMatrix size must be defined and greater than 0');this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}t.prototype.set=function(t,s,n,o){const h=t*this.size+s;this.data[h]=n,o&&(this.reservedBit[h]=!0)},t.prototype.get=function(t,s){return this.data[t*this.size+s]},t.prototype.xor=function(t,s,n){this.data[t*this.size+s]^=n},t.prototype.isReserved=function(t,s){return this.reservedBit[t*this.size+s]},m.exports=t},817,[]);
|
| 13 |
+
__d(function(g,r,_i,a,m,e,d){const o=r(d[0]).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,s=o(t),l=145===s?26:2*Math.ceil((s-13)/(2*n-2)),f=[s-7];for(let o=1;o<n-1;o++)f[o]=f[o-1]-l;return f.push(6),f.reverse()},e.getPositions=function(o){const t=[],n=e.getRowColCoords(o),s=n.length;for(let o=0;o<s;o++)for(let l=0;l<s;l++)0===o&&0===l||0===o&&l===s-1||o===s-1&&0===l||t.push([n[o],n[l]]);return t}},818,[814]);
|
| 14 |
+
__d(function(g,r,i,a,m,e,d){const n=r(d[0]).getSymbolSize;e.getPositions=function(t){const o=n(t);return[[0,0],[o-7,0],[0,o-7]]}},819,[814]);
|
| 15 |
+
__d(function(g,r,_i,a,m,e,d){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,s=40,l=10;function o(t,n,s){switch(t){case e.Patterns.PATTERN000:return(n+s)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return s%3==0;case e.Patterns.PATTERN011:return(n+s)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2==0;case e.Patterns.PATTERN101:return n*s%2+n*s%3==0;case e.Patterns.PATTERN110:return(n*s%2+n*s%3)%2==0;case e.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2==0;default:throw new Error('bad maskPattern:'+t)}}e.isValid=function(t){return null!=t&&''!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(n){const s=n.size;let l=0,o=0,P=0,T=null,c=null;for(let u=0;u<s;u++){o=P=0,T=c=null;for(let N=0;N<s;N++){let s=n.get(u,N);s===T?o++:(o>=5&&(l+=t+(o-5)),T=s,o=1),s=n.get(N,u),s===c?P++:(P>=5&&(l+=t+(P-5)),c=s,P=1)}o>=5&&(l+=t+(o-5)),P>=5&&(l+=t+(P-5))}return l},e.getPenaltyN2=function(t){const s=t.size;let l=0;for(let n=0;n<s-1;n++)for(let o=0;o<s-1;o++){const s=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==s&&0!==s||l++}return l*n},e.getPenaltyN3=function(t){const n=t.size;let l=0,o=0,P=0;for(let s=0;s<n;s++){o=P=0;for(let T=0;T<n;T++)o=o<<1&2047|t.get(s,T),T>=10&&(1488===o||93===o)&&l++,P=P<<1&2047|t.get(T,s),T>=10&&(1488===P||93===P)&&l++}return l*s},e.getPenaltyN4=function(t){let n=0;const s=t.data.length;for(let l=0;l<s;l++)n+=t.data[l];return Math.abs(Math.ceil(100*n/s/5)-10)*l},e.applyMask=function(t,n){const s=n.size;for(let l=0;l<s;l++)for(let P=0;P<s;P++)n.isReserved(P,l)||n.xor(P,l,o(t,P,l))},e.getBestMask=function(t,n){const s=Object.keys(e.Patterns).length;let l=0,o=1/0;for(let P=0;P<s;P++){n(P),e.applyMask(P,t);const s=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(P,t),s<o&&(o=s,l=P)}return l}},820,[]);
|
| 16 |
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],u=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(u,c){switch(c){case t.L:return n[4*(u-1)+0];case t.M:return n[4*(u-1)+1];case t.Q:return n[4*(u-1)+2];case t.H:return n[4*(u-1)+3];default:return}},e.getTotalCodewordsCount=function(n,c){switch(c){case t.L:return u[4*(n-1)+0];case t.M:return u[4*(n-1)+1];case t.Q:return u[4*(n-1)+2];case t.H:return u[4*(n-1)+3];default:return}}},821,[815]);
|
| 17 |
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error('Encoder not initialized');const o=new Uint8Array(n.length+this.degree);o.set(n);const s=t.mod(o,this.genPoly),h=this.degree-s.length;if(h>0){const t=new Uint8Array(this.degree);return t.set(s,h),t}return s},m.exports=n},822,[823]);
|
| 18 |
+
__d(function(g,r,_i,a,m,e,d){const n=r(d[0]);e.mul=function(t,l){const o=new Uint8Array(t.length+l.length-1);for(let u=0;u<t.length;u++)for(let f=0;f<l.length;f++)o[u+f]^=n.mul(t[u],l[f]);return o},e.mod=function(t,l){let o=new Uint8Array(t);for(;o.length-l.length>=0;){const t=o[0];for(let u=0;u<l.length;u++)o[u]^=n.mul(l[u],t);let u=0;for(;u<o.length&&0===o[u];)u++;o=o.slice(u)}return o},e.generateECPolynomial=function(t){let l=new Uint8Array([1]);for(let o=0;o<t;o++)l=e.mul(l,new Uint8Array([1,n.exp(o)]));return l}},823,[824]);
|
| 19 |
+
__d(function(g,r,_i,a,m,e,d){const n=new Uint8Array(512),t=new Uint8Array(256);!(function(){let o=1;for(let u=0;u<255;u++)n[u]=o,t[o]=u,o<<=1,256&o&&(o^=285);for(let t=255;t<512;t++)n[t]=n[t-255]})(),e.log=function(n){if(n<1)throw new Error('log('+n+')');return t[n]},e.exp=function(t){return n[t]},e.mul=function(o,u){return 0===o||0===u?0:n[t[o]+t[u]]}},824,[]);
|
| 20 |
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),f=r(_d[3]),u=r(_d[4]),c=t.getBCHDigit(7973);function s(t,n,o){for(let f=1;f<=40;f++)if(n<=e.getCapacity(f,o,t))return f}function l(t,n){return f.getCharCountIndicator(t,n)+4}function d(t,n){let o=0;return t.forEach(function(t){const f=l(t.mode,n);o+=f+t.getBitsLength()}),o}function C(t,n){for(let o=1;o<=40;o++){if(d(t,o)<=e.getCapacity(o,n,f.MIXED))return o}}e.from=function(t,n){return u.isValid(t)?parseInt(t,10):n},e.getCapacity=function(o,c,s){if(!u.isValid(o))throw new Error('Invalid QR Code version');void 0===s&&(s=f.BYTE);const d=8*(t.getSymbolTotalCodewords(o)-n.getTotalCodewordsCount(o,c));if(s===f.MIXED)return d;const C=d-l(s,o);switch(s){case f.NUMERIC:return Math.floor(C/10*3);case f.ALPHANUMERIC:return Math.floor(C/11*2);case f.KANJI:return Math.floor(C/13);case f.BYTE:default:return Math.floor(C/8)}},e.getBestVersionForData=function(t,n){let f;const u=o.from(n,o.M);if(Array.isArray(t)){if(t.length>1)return C(t,u);if(0===t.length)return 1;f=t[0]}else f=t;return s(f.mode,f.getLength(),u)},e.getEncodedBits=function(n){if(!u.isValid(n)||n<7)throw new Error('Invalid QR Code version');let o=n<<12;for(;t.getBCHDigit(o)-c>=0;)o^=7973<<t.getBCHDigit(o)-c;return n<<12|o}},825,[814,821,815,826,827]);
|
| 21 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]);function e(t){if('string'!=typeof t)throw new Error('Param is not a string');switch(t.toLowerCase()){case'numeric':return _e.NUMERIC;case'alphanumeric':return _e.ALPHANUMERIC;case'kanji':return _e.KANJI;case'byte':return _e.BYTE;default:throw new Error('Unknown mode: '+t)}}_e.NUMERIC={id:'Numeric',bit:1,ccBits:[10,12,14]},_e.ALPHANUMERIC={id:'Alphanumeric',bit:2,ccBits:[9,11,13]},_e.BYTE={id:'Byte',bit:4,ccBits:[8,16,16]},_e.KANJI={id:'Kanji',bit:8,ccBits:[8,10,12]},_e.MIXED={bit:-1},_e.getCharCountIndicator=function(n,e){if(!n.ccBits)throw new Error('Invalid mode: '+n);if(!t.isValid(e))throw new Error('Invalid version: '+e);return e>=1&&e<10?n.ccBits[0]:e<27?n.ccBits[1]:n.ccBits[2]},_e.getBestModeForData=function(t){return n.testNumeric(t)?_e.NUMERIC:n.testAlphanumeric(t)?_e.ALPHANUMERIC:n.testKanji(t)?_e.KANJI:_e.BYTE},_e.toString=function(t){if(t&&t.id)return t.id;throw new Error('Invalid mode')},_e.isValid=function(t){return t&&t.bit&&t.ccBits},_e.from=function(t,n){if(_e.isValid(t))return t;try{return e(t)}catch(t){return n}}},826,[827,828]);
|
| 22 |
+
__d(function(g,r,i,a,m,e,d){e.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}},827,[]);
|
| 23 |
+
__d(function(g,r,i,a,m,e,d){let u="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";u=u.replace(/u/g,'\\u');const n='(?:(?![A-Z0-9 $%*+\\-./:]|'+u+')(?:.|[\r\n]))+';e.KANJI=new RegExp(u,'g'),e.BYTE_KANJI=new RegExp('[^A-Z0-9 $%*+\\-./:]+','g'),e.BYTE=new RegExp(n,'g'),e.NUMERIC=new RegExp('[0-9]+','g'),e.ALPHANUMERIC=new RegExp('[A-Z $%*+\\-./:]+','g');const t=new RegExp('^'+u+'$'),E=new RegExp("^[0-9]+$"),A=new RegExp('^[A-Z0-9 $%*+\\-./:]+$');e.testKanji=function(u){return t.test(u)},e.testNumeric=function(u){return E.test(u)},e.testAlphanumeric=function(u){return A.test(u)}},828,[]);
|
| 24 |
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=t.getBCHDigit(1335);e.getEncodedBits=function(o,c){const B=o.bit<<3|c;let d=B<<10;for(;t.getBCHDigit(d)-n>=0;)d^=1335<<t.getBCHDigit(d)-n;return 21522^(B<<10|d)}},829,[814]);
|
| 25 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6]),h=r(d[7]);function i(t){return unescape(encodeURIComponent(t)).length}function f(t,n,o){const u=[];let s;for(;null!==(s=t.exec(o));)u.push({data:s[0],index:s.index,mode:n,length:s[0].length});return u}function E(n){const o=f(l.NUMERIC,t.NUMERIC,n),u=f(l.ALPHANUMERIC,t.ALPHANUMERIC,n);let s,h;c.isKanjiModeEnabled()?(s=f(l.BYTE,t.BYTE,n),h=f(l.KANJI,t.KANJI,n)):(s=f(l.BYTE_KANJI,t.BYTE,n),h=[]);return o.concat(u,s,h).sort(function(t,n){return t.index-n.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function A(l,c){switch(c){case t.NUMERIC:return n.getBitsLength(l);case t.ALPHANUMERIC:return o.getBitsLength(l);case t.KANJI:return s.getBitsLength(l);case t.BYTE:return u.getBitsLength(l)}}function I(t){return t.reduce(function(t,n){const o=t.length-1>=0?t[t.length-1]:null;return o&&o.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function C(n){const o=[];for(let u=0;u<n.length;u++){const s=n[u];switch(s.mode){case t.NUMERIC:o.push([s,{data:s.data,mode:t.ALPHANUMERIC,length:s.length},{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.ALPHANUMERIC:o.push([s,{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.KANJI:o.push([s,{data:s.data,mode:t.BYTE,length:i(s.data)}]);break;case t.BYTE:o.push([{data:s.data,mode:t.BYTE,length:i(s.data)}])}}return o}function p(n,o){const u={},s={start:{}};let l=['start'];for(let c=0;c<n.length;c++){const h=n[c],i=[];for(let n=0;n<h.length;n++){const f=h[n],E=''+c+n;i.push(E),u[E]={node:f,lastCount:0},s[E]={};for(let n=0;n<l.length;n++){const c=l[n];u[c]&&u[c].node.mode===f.mode?(s[c][E]=A(u[c].lastCount+f.length,f.mode)-A(u[c].lastCount,f.mode),u[c].lastCount+=f.length):(u[c]&&(u[c].lastCount=f.length),s[c][E]=A(f.length,f.mode)+4+t.getCharCountIndicator(f.mode,o))}}l=i}for(let t=0;t<l.length;t++)s[l[t]].end=0;return{map:s,table:u}}function B(l,h){let i;const f=t.getBestModeForData(l);if(i=t.from(h,f),i!==t.BYTE&&i.bit<f.bit)throw new Error('"'+l+"\" cannot be encoded with mode "+t.toString(i)+'.\n Suggested mode is: '+t.toString(f));switch(i!==t.KANJI||c.isKanjiModeEnabled()||(i=t.BYTE),i){case t.NUMERIC:return new n(l);case t.ALPHANUMERIC:return new o(l);case t.KANJI:return new s(l);case t.BYTE:return new u(l)}}e.fromArray=function(t){return t.reduce(function(t,n){return'string'==typeof n?t.push(B(n,null)):n.data&&t.push(B(n.data,n.mode)),t},[])},e.fromString=function(t,n){const o=p(C(E(t,c.isKanjiModeEnabled())),n),u=h.find_path(o.map,'start','end'),s=[];for(let t=1;t<u.length-1;t++)s.push(o.table[u[t]].node);return e.fromArray(I(s))},e.rawSplit=function(t){return e.fromArray(E(t,c.isKanjiModeEnabled()))}},830,[826,831,832,833,834,828,814,835]);
|
| 26 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.NUMERIC,this.data=n.toString()}n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,o,s;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),s=parseInt(o,10),t.put(s,10);const i=this.data.length-n;i>0&&(o=this.data.substr(n),s=parseInt(o,10),t.put(s,3*i+1))},m.exports=n},831,[826]);
|
| 27 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' ','$','%','*','+','-','.','/',':'];function i(n){this.mode=t.ALPHANUMERIC,this.data=n}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let h=45*n.indexOf(this.data[i]);h+=n.indexOf(this.data[i+1]),t.put(h,11)}this.data.length%2&&t.put(n.indexOf(this.data[i]),6)},m.exports=i},832,[826]);
|
| 28 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.BYTE,this.data='string'==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,o=this.data.length;n<o;n++)t.put(this.data[n],8)},m.exports=n},833,[826]);
|
| 29 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]);function i(n){this.mode=t.KANJI,this.data=n}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i<this.data.length;i++){let o=n.toSJIS(this.data[i]);if(o>=33088&&o<=40956)o-=33088;else{if(!(o>=57408&&o<=60351))throw new Error('Invalid SJIS character: '+this.data[i]+"\nMake sure your charset is UTF-8");o-=49472}o=192*(o>>>8&255)+(255&o),t.put(o,13)}},m.exports=i},834,[826,814]);
|
| 30 |
+
__d(function(g,r,i,_a,m,e,_d){'use strict';var t={single_source_shortest_paths:function(o,s,u){var n={},a={};a[s]=0;var h,f,p,_,c,v,d,l=t.PriorityQueue.make();for(l.push(s,0);!l.empty();)for(p in f=(h=l.pop()).value,_=h.cost,c=o[f]||{})c.hasOwnProperty(p)&&(v=_+c[p],d=a[p],(void 0===a[p]||d>v)&&(a[p]=v,l.push(p,v),n[p]=f));if(void 0!==u&&void 0===a[u]){var y=['Could not find a path from ',s,' to ',u,'.'].join('');throw new Error(y)}return n},extract_shortest_path_from_predecessor_list:function(t,o){for(var s=[],u=o;u;)s.push(u),t[u],u=t[u];return s.reverse(),s},find_path:function(o,s,u){var n=t.single_source_shortest_paths(o,s,u);return t.extract_shortest_path_from_predecessor_list(n,u)},PriorityQueue:{make:function(o){var s,u=t.PriorityQueue,n={};for(s in o=o||{},u)u.hasOwnProperty(s)&&(n[s]=u[s]);return n.queue=[],n.sorter=o.sorter||u.default_sorter,n},default_sorter:function(t,o){return t.cost-o.cost},push:function(t,o){var s={value:t,cost:o};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==m&&(m.exports=t)},835,[]);
|
| 31 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]);function e(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+'px',e.style.width=n+'px'}function n(){try{return document.createElement('canvas')}catch(t){throw new Error('You need to specify a canvas element')}}_e.render=function(o,c,s){let u=s,h=c;void 0!==u||c&&c.getContext||(u=c,c=void 0),c||(h=n()),u=t.getOptions(u);const l=t.getImageWidth(o.modules.size,u),p=h.getContext('2d'),y=p.createImageData(l,l);return t.qrToImageData(y.data,o,u),e(p,h,l),p.putImageData(y,0,0),h},_e.renderToDataURL=function(t,e,n){let o=n;void 0!==o||e&&e.getContext||(o=e,e=void 0),o||(o={});const c=_e.render(t,e,o),s=o.type||'image/png',u=o.rendererOpts||{};return c.toDataURL(s,u.quality)}},836,[837]);
|
| 32 |
+
__d(function(g,r,_i,a,m,e,d){function t(t){if('number'==typeof t&&(t=t.toString()),'string'!=typeof t)throw new Error('Color should be defined as hex string');let o=t.slice().replace('#','').split('');if(o.length<3||5===o.length||o.length>8)throw new Error('Invalid hex color: '+t);3!==o.length&&4!==o.length||(o=Array.prototype.concat.apply([],o.map(function(t){return[t,t]}))),6===o.length&&o.push('F','F');const n=parseInt(o.join(''),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:'#'+o.slice(0,6).join('')}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=void 0===o.margin||null===o.margin||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,l=o.scale||4;return{width:i,scale:i?4:l,margin:n,color:{dark:t(o.color.dark||'#000000ff'),light:t(o.color.light||'#ffffffff')},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(t,o){return o.width&&o.width>=t+2*o.margin?o.width/(t+2*o.margin):o.scale},e.getImageWidth=function(t,o){const n=e.getScale(t,o);return Math.floor((t+2*o.margin)*n)},e.qrToImageData=function(t,o,n){const i=o.modules.size,l=o.modules.data,c=e.getScale(i,n),f=Math.floor((i+2*n.margin)*c),h=n.margin*c,s=[n.color.light,n.color.dark];for(let o=0;o<f;o++)for(let u=0;u<f;u++){let p=4*(o*f+u),w=n.color.light;if(o>=h&&u>=h&&o<f-h&&u<f-h){w=s[l[Math.floor((o-h)/c)*i+Math.floor((u-h)/c)]?1:0]}t[p++]=w.r,t[p++]=w.g,t[p++]=w.b,t[p]=w.a}}},837,[]);
|
| 33 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function o(t,o){const n=t.a/255,i=o+'="'+t.hex+'"';return n<1?i+' '+o+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function n(t,o,n){let i=t+o;return void 0!==n&&(i+=' '+n),i}function i(t,o,i){let l='',h=0,s=!1,c=0;for(let u=0;u<t.length;u++){const f=Math.floor(u%o),w=Math.floor(u/o);f||s||(s=!0),t[u]?(c++,u>0&&f>0&&t[u-1]||(l+=s?n('M',f+i,.5+w+i):n('m',h,0),h=0,s=!1),f+1<o&&t[u+1]||(l+=n('h',c),c=0)):h++}return l}e.render=function(n,l,h){const s=t.getOptions(l),c=n.modules.size,u=n.modules.data,f=c+2*s.margin,w=s.color.light.a?'<path '+o(s.color.light,'fill')+' d="M0 0h'+f+'v'+f+'H0z"/>':'',p='<path '+o(s.color.dark,'stroke')+' d="'+i(u,c,s.margin)+'"/>',v="viewBox=\"0 0 "+f+' '+f+'"',x='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':'')+v+' shape-rendering="crispEdges">'+w+p+'</svg>\n';return'function'==typeof h&&h(null,x),x}},838,[837]);
|
| 34 |
+
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=(t,n)=>{const l=n/t.length;let c='';return t.forEach((n,u)=>{let o=!1;n.forEach((n,f)=>{n?(o||(c+=`M${l*f} ${l/2+l*u} `,o=!0),o&&f===t.length-1&&(c+=`L${l*(f+1)} ${l/2+l*u} `)):o&&(c+=`L${l*f} ${l/2+l*u} `,o=!1)})}),{cellSize:l,path:c}}},839,[]);
|
| 35 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}}),r(d[0]);var t=r(d[1]),n=r(d[2]),o=r(d[3]);var s=({svg:s,logoSize:l,logoColor:u})=>{if((0,n.isString)(s)){const u=(0,n.isUrlString)(s)?s:`data:image/svg+xml;base64,${window.btoa(s)}`;return(0,o.jsx)(t.Image,{href:encodeURI(u),width:l,height:l})}const c=s;return(0,o.jsx)(c,{fill:u,width:l,height:l})}},840,[12,842,841,6]);
|
| 36 |
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return'string'==typeof t}Object.defineProperty(e,'__esModule',{value:!0}),e.isString=t,e.isUrlString=function(n){return t(n)&&n.startsWith('http')}},841,[]);
|
customer-app/_expo/static/js/web/merch-83b3de1a838e4dd4728123294fac8f36.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e,t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),l=(e=s)&&e.__esModule?e:{default:e},r=_r(d[3]),o=_r(d[4]),c=_r(d[5]),u=_r(d[6]),m=_r(d[7]),h=_r(d[8]),j=_r(d[9]),p=_r(d[10]);function x(){const{rid:e}=(0,t.useLocalSearchParams)(),s=(0,c.useRestaurant)(e),x=(0,c.useCustomer)(),b=(0,c.useNow)(6e4),f=(0,u.useOwner)(e=>e.merch),[y,w]=(0,n.useState)({}),[k,S]=(0,n.useState)(null),[C,$]=(0,n.useState)(null);if(!s)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Restaurant not found."})});const v=f.find(e=>e.id===k),O=e=>y[e]??1;return(0,p.jsxs)(o.Screen,{title:"Shop",subtitle:`${s.name} merch \xb7 collect in the restaurant`,children:[C?(0,p.jsxs)(o.Banner,{kind:"success",title:"Order placed (demo)",children:[C," Collect it at the bar on your next visit."]}):null,f.filter(e=>e.live||0===e.stock).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(l.default,{style:{flex:1},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),(0,p.jsx)(o.T,{colour:j.colours.gold,weight:"semibold",children:(0,m.gbp)(e.price)})]}),0!==e.stock&&e.live?e.stock<8?(0,p.jsx)(o.Badge,{kind:"amber",label:`${e.stock} left`}):null:(0,p.jsx)(o.Badge,{kind:"neutral",label:"Sold out"})]}),e.live&&e.stock>0?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:O(e.id),min:1,max:Math.min(5,e.stock),onChange:t=>w({...y,[e.id]:t}),label:`${e.name} quantity`}),(0,p.jsx)(o.Button,{small:!0,label:`Buy \xb7 ${(0,m.gbp)(e.price*O(e.id))}`,onPress:()=>S(e.id)})]}):null]},e.id)),(0,p.jsxs)(o.Muted,{children:["Collection only in this prototype. Prices set by ",s.name,"."]}),v?(0,p.jsx)(r.MockPay,{visible:!0,onClose:()=>S(null),amount:v.price*O(v.id),restaurantId:s.id,allowGiftCard:!1,title:`Buy ${v.name}`,onPaid:()=>{const e=u.useOwner.getState();e.setOwner({merch:e.merch.map(e=>e.id===v.id?{...e,stock:Math.max(0,e.stock-O(v.id))}:e),merchOrders:[{id:`mo-${Date.now()}`,productId:v.id,qty:O(v.id),customer:x.name,at:(0,h.ymd)(b),status:'new'},...e.merchOrders]}),$(`${O(v.id)} \xd7 ${v.name}, ${(0,m.gbp)(v.price*O(v.id))}.`),S(null)}}):null]})}},766,[785,12,109,789,790,796,804,793,795,797,6]);
|
customer-app/_expo/static/js/web/offers-e468fdf2d44335b7725e9cc9534ba97f.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var n=_r(d[0]);_r(d[1]);var t=_r(d[2]),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),o=_r(d[6]),c=_r(d[7]);function f(){const{rid:f}=(0,n.useLocalSearchParams)(),u=(0,s.useRestaurant)(f),h=(0,s.useCustomer)(),j=(0,r.useOwner)(n=>n.offers);if(!u)return(0,c.jsx)(t.Screen,{title:"Not found",children:(0,c.jsx)(t.T,{children:"Restaurant not found."})});const x=!!h.marketingOptIn[u.id],b=j.filter(n=>n.live),p=b.filter(n=>'special'===n.kind),y=b.filter(n=>'offer'===n.kind);return(0,c.jsxs)(t.Screen,{title:"Specials & offers",subtitle:u.name,children:[(0,c.jsxs)(t.Card,{highlight:x?o.colours.green:o.colours.gold,children:[(0,c.jsx)(t.Toggle,{label:`Send me offers from ${u.name}`,value:x,onChange:n=>s.repo.customers.update({marketingOptIn:{...h.marketingOptIn,[u.id]:n}})}),(0,c.jsx)(t.Muted,{children:x?'You can switch this off any time. We only use it for this restaurant.':'Off by default. Turn on to see member offers and get the occasional notification (max one a week). You can switch it off any time.'})]}),(0,c.jsx)(t.H2,{children:"Today's specials"}),p.length?p.map(n=>(0,c.jsxs)(t.Card,{children:[(0,c.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,c.jsx)(t.Badge,{kind:"gold",label:"Special"})]}),(0,c.jsx)(t.Muted,{children:n.body})]},n.id)):(0,c.jsx)(t.Muted,{children:"No specials on the board right now."}),(0,c.jsx)(t.H2,{children:"Member offers"}),x?y.length?y.map(n=>(0,c.jsxs)(t.Card,{children:[(0,c.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,c.jsx)(t.Badge,{kind:"green",label:"Offer"})]}),(0,c.jsx)(t.Muted,{children:n.body}),n.until?(0,c.jsxs)(t.Muted,{children:["Until ",(0,l.niceDate)((0,l.parseYmd)(n.until))]}):null]},n.id)):(0,c.jsx)(t.Muted,{children:"No offers right now."}):(0,c.jsxs)(t.Banner,{kind:"info",children:["Turn on offers above to see ",y.length," member offer",1===y.length?'':'s',"."]}),(0,c.jsxs)(t.Muted,{children:["Offers are set by ",u.name,". Drinks promotions follow Scottish licensing rules. Demo: no notifications are sent."]})]})}},767,[785,12,790,796,804,795,797,6]);
|
customer-app/_expo/static/js/web/profile-73c051c1dbf6dad5751e1adc512639c1.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var e=_r(d[0]);_r(d[1]);var r,l=_r(d[2]),s=(r=l)&&r.__esModule?r:{default:r},t=_r(d[3]),n=_r(d[4]),a=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]);function p(){const r=(0,u.useCustomer)(),l=(0,u.useStore)((0,c.useShallow)(e=>e.orders.filter(r=>r.customerId===e.customer.id))),p=(0,u.useStore)((0,c.useShallow)(e=>e.bookings.filter(r=>r.customerId===e.customer.id))),b=(0,u.useStore)(e=>e.restaurants),y=e=>b.find(r=>r.id===e)?.name??e;return(0,h.jsxs)(t.Screen,{title:"Your account",subtitle:"One Cover Charge account for every restaurant",children:[(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.Field,{label:"Name",value:r.name,onChangeText:e=>u.repo.customers.update({name:e})}),(0,h.jsx)(t.Field,{label:"Email",value:r.email,keyboardType:"email-address",onChangeText:e=>u.repo.customers.update({email:e})}),(0,h.jsx)(t.Field,{label:"Mobile",value:r.phone,keyboardType:"phone-pad",onChangeText:e=>u.repo.customers.update({phone:e})}),(0,h.jsxs)(t.Muted,{children:["Referral code: ",r.referralCode]})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Allergies & severity"}),(0,h.jsx)(t.Muted,{children:"Stored once and shared with a restaurant only when you order or book there. You confirm them on every order, table session and booking."}),(0,h.jsx)(t.Toggle,{label:"I consent to Cover Charge storing my allergy information (health data, UK GDPR)",value:r.allergyConsent,onChange:e=>u.repo.customers.update({allergyConsent:e})}),r.allergyConsent?null:(0,h.jsx)(t.Banner,{kind:"warn",children:"Without consent your allergies won\u2019t be stored \u2014 tell staff directly."}),n.ALLERGENS.map(e=>{const l=r.allergies.find(r=>r.allergen===e.id);return(0,h.jsxs)(s.default,{style:{gap:6,paddingVertical:6},children:[(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(t.T,{weight:l?'semibold':'regular',children:e.label}),l?(0,h.jsx)(t.Badge,{kind:"red",label:"Declared"}):null]}),(0,h.jsxs)(t.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(t.Chip,{label:"None",selected:!l,onPress:()=>u.repo.customers.setAllergy(e.id,null),disabled:!r.allergyConsent&&!l}),n.SEVERITIES.map(s=>(0,h.jsx)(t.Chip,{label:s.label,selected:l?.severity===s.id,disabled:!r.allergyConsent,onPress:()=>u.repo.customers.setAllergy(e.id,s.id)},s.id))]})]},e.id)})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your orders"}),l.length?l.map(r=>(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(t.T,{style:{flex:1},children:[r.ref," \xb7 ",y(r.restaurantId)," \xb7 ",'table'===r.type?`Table ${r.tableNo}`:'Takeaway']}),(0,h.jsx)(t.Button,{small:!0,kind:"secondary",label:`${r.status} \xb7 ${(0,a.gbp)(r.subtotal+r.tip)}`,onPress:()=>e.router.push(`/customer/order/${r.id}`)})]},r.id)):(0,h.jsx)(t.Muted,{children:"No orders yet."})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your bookings"}),p.length?p.map(e=>(0,h.jsxs)(t.T,{children:[e.ref," \xb7 ",y(e.restaurantId)," \xb7 ",(0,o.niceDate)((0,o.parseYmd)(e.date))," ",e.time," \xb7 ",e.partySize," people \xb7 ",e.status]},e.id)):(0,h.jsx)(t.Muted,{children:"No bookings yet."})]}),(0,h.jsx)(t.Muted,{children:"Account deletion and data export would live here (Apple 5.1.1(v); Google web deletion link)."})]})}},774,[785,12,109,790,791,793,795,796,846,6]);
|
customer-app/_expo/static/js/web/refer-f700617b9f3c45564500cdd90f403d95.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var r=_r(d[0]),n=_r(d[1]),s=_r(d[2]),t=_r(d[3]),l=_r(d[4]),o=_r(d[5]),u=_r(d[6]);function c(){const{rid:c}=(0,r.useLocalSearchParams)(),h=(0,t.useRestaurant)(c),f=(0,t.useCustomer)(),j=(0,l.useOwner)(r=>r.referral),x=(0,l.useOwner)(r=>r.referrals),[p,w]=(0,n.useState)(!1);if(!h)return(0,u.jsx)(s.Screen,{title:"Not found",children:(0,u.jsx)(s.T,{children:"Restaurant not found."})});const b=x.filter(r=>r.referrer===f.name);return(0,u.jsxs)(s.Screen,{title:"Bring a friend",subtitle:h.name,children:[j.active?null:(0,u.jsxs)(s.Banner,{kind:"info",children:[h.name," isn't running referrals right now."]}),(0,u.jsxs)(s.Card,{highlight:o.colours.gold,children:[(0,u.jsxs)(s.H2,{children:["You get: ",j.giverReward]}),(0,u.jsxs)(s.T,{children:["Your friend gets: ",j.friendReward]}),(0,u.jsx)(s.Muted,{children:"When your friend makes their first paid visit or order."}),(0,u.jsx)(s.T,{size:30,weight:"bold",colour:o.colours.gold,center:!0,children:f.referralCode}),(0,u.jsx)(s.Button,{label:"Share my code",disabled:!j.active,onPress:()=>w(!0)}),p?(0,u.jsx)(s.Muted,{center:!0,children:"Demo: in the real app this opens your phone's share sheet. Nothing is sent from here."}):null]}),(0,u.jsxs)(s.Card,{children:[(0,u.jsx)(s.H2,{children:"Your referrals"}),b.length?b.map(r=>(0,u.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsx)(s.T,{style:{flex:1},children:r.friend}),(0,u.jsx)(s.Badge,{kind:'rewarded'===r.status?'green':'amber',label:r.status})]},r.id)):(0,u.jsx)(s.Muted,{children:"No referrals yet."})]}),(0,u.jsx)(s.Muted,{children:"One reward per new account, phone and card. Monthly cap applies. Rewards are on food, not drinks."})]})}},768,[785,12,790,796,804,797,6]);
|
customer-app/_expo/static/js/web/waitlist-1ddc562d54c8a687874413b16b0e57b2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return h}});var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),a=_r(d[3]),r=_r(d[4]),o=_r(d[5]),u=_r(d[6]),l=_r(d[7]),c=_r(d[8]);function h(){const{rid:h}=(0,t.useLocalSearchParams)(),j=(0,u.useRestaurant)(h),x=(0,u.useCustomer)(),b=(0,u.useWaitlist)(h),y=(0,u.useBookings)(h),f=(0,u.useOrders)(h),w=(0,u.useEvents)(h),p=(0,u.useNow)(15e3),[M,S]=(0,s.useState)(2),[v,P]=(0,s.useState)(x.name);if(!j)return(0,c.jsx)(n.Screen,{title:"Not found",children:(0,c.jsx)(n.T,{children:"Restaurant not found."})});const T=b.filter(t=>'waiting'===t.status||'notified'===t.status).sort((t,s)=>t.number-s.number),k=T.find(t=>t.customerId===x.id),B=(0,r.forecastToday)(j,y,f,w,p),C=B.nextHour?Math.min(1.6,Math.max(.8,B.nextHour.covers/(.75*j.settings.capacityPerHour))):1;if(k){const t=T.indexOf(k)+1;return(0,c.jsxs)(n.Screen,{title:"You\u2019re on the waitlist",subtitle:j.name,children:[(0,c.jsxs)(n.Card,{highlight:l.colours.gold,children:[(0,c.jsx)(n.Muted,{children:"Your queue number"}),(0,c.jsxs)(n.T,{size:56,weight:"bold",colour:l.colours.gold,children:["#",k.number]}),(0,c.jsx)(n.T,{children:1===t?'You\u2019re next':`${t-1} part${t-1==1?'y':'ies'} ahead of you`}),(0,c.jsxs)(n.T,{weight:"semibold",children:["Estimated wait: about ",(0,o.estimateWait)(t,j.settings.turnMins,C)," minutes"]}),(0,c.jsxs)(n.Muted,{children:["Estimate only \u2014 based on tables in use, typical turn times and today\u2019s forecast. Joined ",(0,a.minsBetween)(new Date(k.joinedAt),p)," min ago."]})]}),'notified'===k.status?(0,c.jsx)(n.Banner,{kind:"success",title:"Your table is ready!",children:"Please come to the door within 5 minutes to keep your table."}):(0,c.jsx)(n.Banner,{kind:"info",children:"We\u2019ll notify you when your table is ready (push/SMS simulated in this prototype)."}),(0,c.jsx)(n.Button,{kind:"secondary",label:"Leave the waitlist",onPress:()=>u.repo.waitlist.setStatus(k.id,'removed')})]})}return(0,c.jsxs)(n.Screen,{title:"Join the waitlist",subtitle:j.name,children:[(0,c.jsxs)(n.Card,{children:[(0,c.jsxs)(n.H2,{children:[T.length," part",1===T.length?'y':'ies'," waiting"]}),(0,c.jsxs)(n.Muted,{children:["Estimated wait if you join now: about ",(0,o.estimateWait)(T.length+1,j.settings.turnMins,C)," minutes (estimate)."]})]}),(0,c.jsx)(n.Field,{label:"Name",value:v,onChangeText:P}),(0,c.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(n.T,{weight:"semibold",children:"Party size"}),(0,c.jsx)(n.Stepper,{value:M,onChange:S,min:1,max:12,label:"party size"})]}),(0,c.jsx)(n.Button,{label:"Join the queue",disabled:v.trim().length<2,onPress:()=>u.repo.waitlist.join(j.id,v,M,x.id),testID:"join-waitlist"}),(0,c.jsx)(n.Muted,{children:"Waitlist messages are service messages only \u2014 no marketing."})]})}},769,[785,12,790,795,843,844,796,797,6]);
|
customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg
ADDED
|
customer-app/index.html
CHANGED
|
@@ -42,7 +42,7 @@
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/customer-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
-
<script src="/customer-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/customer-app/_expo/static/js/web/__common-
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
|
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/customer-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
+
<script src="/customer-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/customer-app/_expo/static/js/web/__common-52a49e9076da5e6246f0b3bc8aa4a0c8.js" defer></script><script src="/customer-app/_expo/static/js/web/entry-f1c6a1da80b60e7480866755232908a5.js" defer></script>
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
customer-app/sw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
// The Anchorage service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
-
const V = "cc-customer-
|
| 3 |
const BASE = "/customer-app/";
|
| 4 |
-
const PRECACHE = ["/customer-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/customer-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/customer-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/customer-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/customer-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/customer-app/_expo/static/js/web/__common-
|
| 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 |
// The Anchorage service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
+
const V = "cc-customer-ddfbe2eb05";
|
| 3 |
const BASE = "/customer-app/";
|
| 4 |
+
const PRECACHE = ["/customer-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/customer-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/customer-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/customer-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/customer-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/customer-app/_expo/static/js/web/__common-52a49e9076da5e6246f0b3bc8aa4a0c8.js", "/customer-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js", "/customer-app/_expo/static/js/web/_layout-40923b7d6a3d0851d16f012e9082d331.js", "/customer-app/_expo/static/js/web/basket-2b7132442dd9b45a229362d18bb3b379.js", "/customer-app/_expo/static/js/web/book-73d16fd431095875bb01cc0a0c784d3b.js", "/customer-app/_expo/static/js/web/demo-2aeda33db335ba3a45d18733444a4df6.js", "/customer-app/_expo/static/js/web/entry-f1c6a1da80b60e7480866755232908a5.js", "/customer-app/_expo/static/js/web/feedback-c3022e0683297c445b34cc46bbd3da7c.js", "/customer-app/_expo/static/js/web/gift-0647b216e00344da5b09e74268994259.js", "/customer-app/_expo/static/js/web/index-00d06db77562b3402bcb1797b945656d.js", "/customer-app/_expo/static/js/web/index-19e91eebe2265fb3fefa525477cea205.js", "/customer-app/_expo/static/js/web/index-34fcf613bc0bc58ae7f62714d63f3bed.js", "/customer-app/_expo/static/js/web/index-3ce55512f207e0f4e938fcea314e34d2.js", "/customer-app/_expo/static/js/web/index-40f95cd6322320cbf9524c02b0284dba.js", "/customer-app/_expo/static/js/web/index-42c772ae8e6fc8ffb457607b71499331.js", "/customer-app/_expo/static/js/web/index-74ed5e3887809c4259d725a2965aa3f3.js", "/customer-app/_expo/static/js/web/index-e57a61ccf8b16e38bf91548a01cebbf1.js", "/customer-app/_expo/static/js/web/index-f4304d490b72825b88900169751ec98b.js", "/customer-app/_expo/static/js/web/lost-254ada7b9fc10346689d98d894e24ca3.js", "/customer-app/_expo/static/js/web/loyalty-b4cf2f88c2062e44f0bc0b1af86851e7.js", "/customer-app/_expo/static/js/web/merch-83b3de1a838e4dd4728123294fac8f36.js", "/customer-app/_expo/static/js/web/offers-e468fdf2d44335b7725e9cc9534ba97f.js", "/customer-app/_expo/static/js/web/profile-73c051c1dbf6dad5751e1adc512639c1.js", "/customer-app/_expo/static/js/web/refer-f700617b9f3c45564500cdd90f403d95.js", "/customer-app/_expo/static/js/web/waitlist-1ddc562d54c8a687874413b16b0e57b2.js", "/customer-app/_expo/static/js/web/whatson-7bba1c8989b9be2fc455c8ddd8bbc99d.js", "/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/customer-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/customer-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/customer-app/assets/assets/brand/saltmarsh.84acbc30d810d7a1cd3bbeb7b62651e8.png", "/customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/customer-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/customer-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/customer-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/customer-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/customer-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/customer-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/customer-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/customer-app/brand-logo.png", "/customer-app/favicon.ico", "/customer-app/icon-192.png", "/customer-app/icon-512.png", "/customer-app/icon-maskable-512.png", "/customer-app/manifest.webmanifest", "/customer-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);
|
display-app/_expo/static/js/web/__common-f0ad3b75a38e1fa43d43bd8b57dbdc9e.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
display-app/_expo/static/js/web/_layout-b9e85ed4c34fabeb7e33c986346746fc.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 E}});var t=r(_d[0]),s=r(_d[1]),o=(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[2])),n=r(_d[3]),u=r(_d[4]),c=e(r(_d[5])),d=e(r(_d[6]));r(_d[7]);var l=e(r(_d[8])),f=e(r(_d[9])),p=r(_d[10]),h=r(_d[11]),y=r(_d[12]),b=r(_d[13]),O=r(_d[14]),S=r(_d[15]),_=r(_d[16]),j=r(_d[17]);const w=r(_d[18]),P=r(_d[19]),v=r(_d[20]),A=r(_d[21]);function E(){const[e]=(0,t.useFonts)({Poppins_400Regular:w,Poppins_500Medium:P,Poppins_600SemiBold:v,Poppins_700Bold:A}),[E,x]=(0,u.useState)(b.useStore.persist.hasHydrated()),[H,k]=(0,u.useState)(S.useOwner.persist.hasHydrated()),F=E&&H;(0,u.useEffect)(()=>{const e=b.useStore.persist.onFinishHydration(()=>x(!0)),t=S.useOwner.persist.onFinishHydration(()=>k(!0));return b.useStore.persist.hasHydrated()&&x(!0),S.useOwner.persist.hasHydrated()&&k(!0),()=>{e(),t()}},[]),(0,u.useEffect)(()=>{if('undefined'==typeof window)return;const e=e=>{e.key===b.useStore.persist.getOptions().name&&b.useStore.persist.rehydrate(),e.key===O.useFloor.persist.getOptions().name&&O.useFloor.persist.rehydrate()};return window.addEventListener('storage',e),()=>window.removeEventListener('storage',e)},[]);const M=e&&F,T=(0,s.usePathname)(),C=M&&!(0,h.isAllowedPath)(T||'/');return(0,u.useEffect)(()=>{if(!C)return;const e=setTimeout(()=>s.router.replace(h.ENTRY[h.APP_VARIANT]),0);return()=>clearTimeout(e)},[C,T]),(0,u.useEffect)(()=>{M&&o.hideAsync().catch(()=>{})},[M]),M?(0,j.jsxs)(y.SafeAreaProvider,{children:[(0,j.jsx)(n.StatusBar,{style:"light"}),(0,j.jsx)(s.Stack,{screenOptions:{headerShown:!1,contentStyle:{backgroundColor:_.colours.bg}}}),C?(0,j.jsx)(f.default,{style:[l.default.absoluteFill,{backgroundColor:_.colours.bg}]}):null]}):(0,j.jsxs)(f.default,{style:{flex:1,backgroundColor:_.colours.bg,alignItems:'center',justifyContent:'center',gap:18},children:[(0,j.jsx)(d.default,{source:p.HERO_LOGOS.anchorage,accessibilityLabel:"The Anchorage logo",style:{width:180,height:180},resizeMode:"contain"}),(0,j.jsx)(c.default,{color:_.colours.gold})]})}o.preventAutoHideAsync().catch(()=>{})},783,[888,785,915,549,12,228,178,104,28,109,856,787,271,796,861,804,797,6,917,918,919,920]);
|
| 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])},888,[889,912,914]);
|
| 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)}}},889,[283,890,893,907,908,909,910,911]);
|
| 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}},890,[283,891]);
|
| 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}},891,[892]);
|
| 6 |
+
__d(function(g,r,i,a,m,e,d){},892,[]);
|
| 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)}},893,[894,283,890,907,908]);
|
| 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]}})})},894,[895,896,906]);
|
| 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()}})}},895,[896,900,905]);
|
| 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}}},896,[283,214,897,901,902,903,904,900,905]);
|
| 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}},897,[283,898,181,94,899,900]);
|
| 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])},898,[557]);
|
| 13 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}}),r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e};function c(e){const t=n.pickScale(e.scales,s.default.get()),c=1===t?'':'@'+t+'x',o=e.type?`.${e.type}`:'';return e.httpServerLocation.replace(/\.\.\//g,'_')+'/'+e.name+c+o}class n{constructor(e,t,s){this.serverUrl=e||'https://expo.dev',this.jsbundleUrl=null,this.asset=s}isLoadedFromServer(){return!0}isLoadedFromFileSystem(){return!1}defaultAsset(){return this.assetServerURL()}assetServerURL(){const e=new URL(c(this.asset),this.serverUrl);return e.searchParams.set('platform',"web"),e.searchParams.set('hash',this.asset.hash),this.fromSource(e.toString().replace(e.origin,''))}fromSource(e){return{__packager_asset:!0,width:this.asset.width??void 0,height:this.asset.height??void 0,uri:e,scale:n.pickScale(this.asset.scales,s.default.get())}}static pickScale(e,t){for(const s of e)if(s>=t)return s;return e[e.length-1]||1}}},899,[283,181]);
|
| 14 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IS_ENV_WITH_LOCAL_ASSETS",{enumerable:!0,get:function(){return t}}),e.getLocalAssets=function(){return{}},e.getManifest2=function(){return{}},Object.defineProperty(e,"manifestBaseUrl",{enumerable:!0,get:function(){return n}});const t=!1;const n=null},900,[]);
|
| 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}},901,[]);
|
| 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}},902,[]);
|
| 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])},903,[901]);
|
| 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}},904,[]);
|
| 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},905,[214,899]);
|
| 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])},906,[12,896]);
|
| 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}},907,[894,283]);
|
| 22 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fontSourceFromFace=function(n){const{path:o,display:s}=n,u=(0,l.resolveFaceWeight)(n),c=(0,l.resolveFaceStyle)(n);if(o instanceof t.Asset)return{uri:o.uri,...void 0!==u?{weight:u}:null,...void 0!==c?{style:c}:null,...void 0!==s?{display:s}:null};const y='string'==typeof o||'number'==typeof o?{uri:o}:o;return{...y,weight:u,style:c,display:s??y.display}};var t=r(d[0]),l=r(d[1])},908,[894,907]);
|
| 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}},909,[890]);
|
| 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])},910,[283,890,893,891]);
|
| 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})({})},911,[]);
|
| 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]))},912,[283,35,913]);
|
| 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')},913,[283]);
|
| 28 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);function o(t){return'string'==typeof t?(0,n.isLoaded)(t):Array.isArray(t)?t.every(t=>{const o=t?.fontFamily;return'string'==typeof o&&(0,n.isLoaded)(o)}):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const u='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(u){const[s,c]=(0,t.useState)(o(u)),[f,y]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(u).then(()=>{t&&c(!0)}).catch(n=>{t&&y(n)}),()=>{t=!1}},[]),[s,f]}},914,[12,889]);
|
| 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]}})})},915,[916]);
|
| 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(){}},916,[]);
|
| 31 |
+
__d(function(e,s,o,p,t,a,n){"use strict";t.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf"},917,[]);
|
| 32 |
+
__d(function(s,o,p,e,d,t,c){"use strict";d.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf"},918,[]);
|
| 33 |
+
__d(function(o,s,p,e,d,t,f){"use strict";d.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf"},919,[]);
|
| 34 |
+
__d(function(o,s,p,d,e,t,n){"use strict";e.exports="/display-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf"},920,[]);
|
display-app/_expo/static/js/web/basket-2b7132442dd9b45a229362d18bb3b379.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 j}});var e,l=_r(d[0]),t=_r(d[1]),n=_r(d[2]),s=(e=n)&&e.__esModule?e:{default:e},a=_r(d[3]),r=_r(d[4]),o=_r(d[5]),i=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),b=_r(d[10]),m=_r(d[11]),y=_r(d[12]);function j(){const e=(0,h.useBasket)(),n=(0,h.useRestaurant)(e.restaurantId??void 0),j=(0,h.useStore)(e=>e.menu),x=(0,h.useCustomer)(),f=(0,h.useOrders)(n?.id),k=(0,h.useStore)(e=>e.setLineQty),p=(0,h.useStore)(e=>e.overrideLine),w=(0,h.useStore)(e=>e.startBasket),v=(0,h.useNow)(15e3),[C,B]=(0,t.useState)(null),[S,P]=(0,t.useState)(!1),[T,$]=(0,t.useState)(''),[O,L]=(0,t.useState)(!1),[R,I]=(0,t.useState)(null),[M,N]=(0,t.useState)(!1),F=(0,t.useMemo)(()=>(0,b.linesFromBasket)(e,j,x.allergies),[e,j,x.allergies]);if(!n||!e.lines.length)return(0,y.jsxs)(r.Screen,{title:"Your basket",children:[(0,y.jsx)(r.Muted,{children:"Your basket is empty."}),(0,y.jsx)(r.Button,{label:"Browse restaurants",onPress:()=>l.router.replace('/customer')})]});const _='table'===e.mode,z=(0,c.takeawaySlots)(n,f,v),D=F.reduce((e,l)=>e+l.unitPrice*l.qty,0),A=F.some(e=>e.contains.length&&!e.overridden),E=e.lines.filter(e=>{const l=j.find(l=>l.id===e.itemId);return!l||l.soldOut||!l.signOff}),Y=!_&&!C,q=!_&&n.settings.takeawayPaused,H=!A&&!E.length&&S&&!Y&&!q,K=async e=>{const t=await h.repo.orders.placeFromBasket({slotTime:_?void 0:C,tip:0,giftCardCode:e?.giftCardCode,notes:T,paidNow:!_});L(!1),l.router.replace(`/customer/order/${t.id}`)},Q=e.lines.find(e=>e.key===R),G=Q?F[e.lines.indexOf(Q)]:void 0;return(0,y.jsxs)(r.Screen,{title:"Your basket",subtitle:`${n.name} \xb7 ${_?`Table ${e.tableNo} (order at table)`:'Takeaway \u2014 collection'}`,footer:(0,y.jsxs)(s.default,{style:{gap:8},children:[(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(r.T,{weight:"semibold",children:"Subtotal"}),(0,y.jsx)(r.T,{weight:"bold",size:20,colour:m.colours.gold,children:(0,i.gbp)(D)})]}),A?(0,y.jsx)(r.T,{size:14,colour:m.colours.red,children:"Resolve the blocked allergy item(s) before continuing."}):S?Y&&!q?(0,y.jsx)(r.T,{size:14,colour:m.colours.amber,children:"Choose a collection time."}):null:(0,y.jsx)(r.T,{size:14,colour:m.colours.amber,children:"Confirm your allergies to continue."}),_?(0,y.jsx)(r.Button,{label:"Send order to the kitchen",disabled:!H,onPress:()=>K(),testID:"send-table-order"}):(0,y.jsx)(r.Button,{label:`Continue to payment \xb7 ${(0,i.gbp)(D)}`,disabled:!H,onPress:()=>L(!0),testID:"checkout"})]}),children:[(_||e.tableNo,null),_?(0,y.jsx)(r.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,n.fictional?null:(0,y.jsx)(r.ExampleAllergenNotice,{}),F.map((l,t)=>{const n=e.lines[t],a=l.contains.length&&!l.overridden;return(0,y.jsxs)(r.Card,{highlight:l.contains.length?m.colours.red:l.may.length?m.colours.amber:void 0,children:[(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,y.jsxs)(s.default,{style:{flex:1,paddingRight:8},children:[(0,y.jsx)(r.T,{weight:"semibold",children:l.name}),l.choices.length?(0,y.jsx)(r.Muted,{children:l.choices.join(' \xb7 ')}):null,l.notes?(0,y.jsxs)(r.Muted,{children:["Note: ",l.notes]}):null]}),(0,y.jsx)(r.T,{weight:"semibold",children:(0,i.gbp)(l.unitPrice*l.qty)})]}),a?(0,y.jsxs)(r.Banner,{kind:"danger",title:`BLOCKED \u2014 contains ${l.contains.map(o.allergenLabel).join(', ')}`,children:[(0,y.jsx)(r.T,{size:14,colour:"#FFE3DF",children:`Conflicts with your declared ${x.allergies.filter(e=>l.contains.includes(e.allergen)).map(e=>`${(0,o.allergenLabel)(e.allergen)} (${(0,o.severityLabel)(e.severity)})`).join(', ')}.`}),(0,y.jsxs)(r.Row,{gap:8,style:{marginTop:6},children:[(0,y.jsx)(r.Button,{small:!0,kind:"secondary",label:"Remove",onPress:()=>k(n.key,0)}),(0,y.jsx)(r.Button,{small:!0,kind:"danger",label:"Override\u2026",onPress:()=>{N(!1),I(n.key)}})]})]}):l.contains.length?(0,y.jsx)(r.Banner,{kind:"danger",title:`Allergy override recorded \u2014 contains ${l.contains.map(o.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,y.jsx)(r.Banner,{kind:"warn",title:`May contain ${l.may.map(o.allergenLabel).join(', ')}`,children:"Cross-contact risk (e.g. shared fryer). Please check with staff."}):null,E.includes(n)?(0,y.jsx)(r.Badge,{kind:"amber",label:"No longer available online \u2014 please remove"}):null,(0,y.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>k(n.key,0)}),(0,y.jsx)(r.Stepper,{value:n.qty,onChange:e=>k(n.key,e),min:1,label:l.name})]})]},n.key)}),(0,y.jsx)(r.Button,{kind:"ghost",label:"+ Add more items",onPress:()=>l.router.push(`/customer/${n.id}`)}),_?null:(0,y.jsxs)(r.Card,{children:[(0,y.jsxs)(r.H2,{children:["Collection time \u2014 ",(0,u.niceDate)(v)]}),q?(0,y.jsx)(r.Banner,{kind:"warn",title:"Takeaway paused",children:"The restaurant has paused takeaway slots for now. Please try again later or book a table."}):0===z.length?(0,y.jsx)(r.Banner,{kind:"warn",children:"No collection slots left today."}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(r.Muted,{children:["15-minute slots, max ",n.settings.slotCap," orders each so the kitchen isn\u2019t overloaded."]}),(0,y.jsx)(r.Row,{wrap:!0,gap:6,children:z.slice(0,16).map(e=>(0,y.jsx)(r.Chip,{label:e.label,sub:e.full?'Full':e.cap-e.taken+" left",disabled:e.full,selected:C===e.time.toISOString(),onPress:()=>B(e.time.toISOString())},e.label))})]})]}),(0,y.jsxs)(r.Card,{highlight:S?void 0:m.colours.amber,children:[(0,y.jsx)(r.H2,{children:"Confirm allergies for this order"}),(0,y.jsx)(r.Row,{wrap:!0,gap:6,children:x.allergies.length?x.allergies.map(e=>(0,y.jsx)(r.Badge,{kind:"red",label:`${(0,o.allergenLabel)(e.allergen)} \u2014 ${(0,o.severityLabel)(e.severity)}`},e.allergen)):(0,y.jsx)(r.Muted,{children:"No allergies declared on your profile."})}),(0,y.jsx)(r.Toggle,{label:x.allergies.length?'Yes, these are correct for everyone this order is for':'I confirm no one in this order has a food allergy',value:S,onChange:P}),(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Edit allergies in profile",onPress:()=>l.router.push('/customer/profile')})]}),(0,y.jsx)(r.Field,{label:"Order notes (optional)",value:T,onChangeText:$,placeholder:"e.g. cutlery please"}),_?(0,y.jsx)(r.Button,{small:!0,kind:"ghost",label:"Switch to takeaway instead",onPress:()=>w(n.id,'takeaway')}):null,(0,y.jsx)(a.MockPay,{visible:O,onClose:()=>L(!1),amount:D,restaurantId:n.id,onPaid:e=>K({giftCardCode:e.giftCardCode}),title:"Pay for your takeaway"}),(0,y.jsxs)(r.Sheet,{visible:!!Q,onClose:()=>I(null),title:"Allergy override",children:[G?(0,y.jsx)(r.Banner,{kind:"danger",title:`${G.name} contains ${G.contains.map(o.allergenLabel).join(', ')}`,children:"Only continue if this item is for someone without this allergy, or you have spoken to staff."}):null,(0,y.jsx)(r.Toggle,{label:"I understand and want to add it anyway",value:M,onChange:N}),(0,y.jsx)(r.Button,{kind:"danger",disabled:!M,label:"Confirm override",onPress:()=>{Q&&G&&p(Q.key,G.contains),I(null)}})]})]})}},771,[785,12,109,789,790,791,793,794,795,796,845,797,6]);
|
display-app/_expo/static/js/web/entry-5ed8dee5553bc4d4dc05cd9d17403942.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
display-app/_expo/static/js/web/index-00d06db77562b3402bcb1797b945656d.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 o}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function o(){return(0,n.canShow)('display')?(0,c.jsx)(u.DisplayBoard,{}):(0,c.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},777,[785,12,787,847,6]);
|
| 2 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisplayBoard=function(){const{width:e,height:Y}=(0,n.default)(),_=e>=1e3,q=(0,T.useOwner)(e=>e.site),K=(0,y.useRestaurant)(q),X=(0,y.useOrders)(q),J=(0,y.useBookings)(q),Q=(0,y.useWaitlist)(q),Z=(0,y.useEvents)(q),ee=(0,y.useRatings)(q),se=(0,y.useAudit)(q),le=(0,y.useStore)(e=>e.menu),te=(0,y.useStore)(e=>e.walkIns[q]??0),ae=(0,y.useStore)(e=>e.alertAcks),re=((0,y.useStore)(e=>e.customer),(0,y.useStore)(e=>e.skipMinutes)),oe=(0,y.useNow)(5e3),ne=(0,T.useOwner)(e=>e.staff),ie=(0,T.useOwner)(e=>e.attendance),de=(0,T.useOwner)(e=>e.shifts),ue=(0,T.useOwner)(e=>e.chat),[ce,ge]=(0,s.useState)(!0);l.default.useEffect(()=>{(0,$.ensureAttendance)((0,f.ymd)(oe),oe),(0,v.ensureChat)(oe)},[(0,f.ymd)(oe)]);const he=ie.filter(e=>e.in&&!e.out&&oe.getTime()-new Date(e.in).getTime()<72e6&&oe.getTime()>=new Date(e.in).getTime()),pe=he.length?he.map(e=>F(ne.find(s=>s.id===e.staffId)?.name)).filter(Boolean):['Duty Manager'],[me,be]=(0,s.useState)(null),xe=me&&pe.includes(me)?me:pe[0],[fe,je]=(0,s.useState)(''),[ye,we]=(0,s.useState)('2'),ke=(0,f.ymd)(oe),Te=(0,C.useFrontDoor)(ke,e>Y),ve=(0,B.useDisplaySettings)(q),Ce=ve.privacy,$e=(0,B.usePlan)(q),Be=(0,B.useFloor)(e=>e.live[q]),[Se,Re]=(0,s.useState)('floor'),[Pe,Me]=(0,s.useState)(''),[De,Ae]=(0,s.useState)(null),[Ie,Le]=(0,s.useState)(null),[ze,Ee]=(0,s.useState)(null),[He,Ne]=(0,s.useState)(!1),[We,Oe]=(0,s.useState)(null);l.default.useEffect(()=>{if(!We)return;const e=setTimeout(()=>Oe(null),4500);return()=>clearTimeout(e)},[We]);const Fe=(e,s)=>Ee({title:e,body:s}),Ve=e=>Fe(`Guest details \xb7 ${e.time}`,(0,E.bookingDetails)(e)),Ge=(0,s.useMemo)(()=>(0,p.forecastToday)(K,J,X,Z,oe),[K,J,X,Z,oe.getTime()/6e4|0]),Ue=J.filter(e=>e.date===ke).sort((e,s)=>e.time.localeCompare(s.time)),Ye=te+Ue.filter(e=>e.walkIn&&['seated','finished'].includes(e.status)).reduce((e,s)=>e+s.partySize,0),qe=Ue.filter(e=>!e.walkIn&&'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ke=Q.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),Xe=X.filter(e=>!['collected','closed','cancelled'].includes(e.status)).sort((e,s)=>Number('new'===s.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(s.slotTime??s.createdAt)),Je=X.filter(e=>['collected','closed'].includes(e.status)).length,Qe=(0,x.takeawaySlots)(K,X,oe),Ze=Ge.nextHour?Math.min(1.6,Math.max(.8,Ge.nextHour.covers/(.75*K.settings.capacityPerHour))):1,es=(e,s)=>!!(0,z.statusBlock)(e,s,(0,z.linkedBooking)(e,J)),ss=e=>{const s=(0,z.nextStep)(e,(0,z.linkedBooking)(e,J));return!(!s||'table'===s&&!['ready','served'].includes(e.status))},ls=Xe.filter(e=>e.allergies.length&&ss(e)),ts=Ue.filter(e=>e.allergies.length&&!e.allergyAck&&['confirmed','seated'].includes(e.status)&&!Xe.some(s=>s.allergies.length&&(0,z.linkedBooking)(s,[e]))),as=Xe.flatMap(e=>(0,b.readinessFor)(e,K,oe).map(s=>({...s,order:e}))),rs=as.filter(e=>'due'===e.state||'overdue'===e.state),os=as.filter(e=>'upcoming'===e.state).sort((e,s)=>e.due.getTime()-s.due.getTime()),ns=ee.filter(e=>e.stars<=2&&!ae[`rating:${e.id}`]),is=Xe.filter(e=>'new'===e.status&&!e.allergies.length&&(0,f.minsBetween)(new Date(e.createdAt),oe)>=0),ds=le.filter(e=>e.restaurantId===q&&e.soldOut),us=(se.filter(e=>'stamp'===e.kind||'giftcard'===e.kind).slice(0,4),ls.length+ts.length+rs.length+ns.length+is.length),cs=(0,s.useMemo)(()=>(0,S.floorView)($e,J,X,Be??{},oe,K.settings.turnMins),[$e,J,X,Be,oe.getTime()]),gs=$e.areas.some(e=>e.id===Pe)?Pe:$e.areas[0]?.id??'',hs=Object.fromEntries($e.areas.map(e=>{const s=$e.tables.filter(s=>s.areaId===e.id);return[e.id,`${s.filter(e=>'free'===cs[e.name]?.status).length}/${s.length} free`]})),ps=(0,I.hoursFor)(K,oe),ms=ps?(0,f.addMins)(ps.open,-ps.open.getMinutes()):new Date(`${ke}T12:00:00`),bs=ps?(0,f.addMins)(ps.close,120):new Date(`${ke}T23:00:00`),xs=async(e,s)=>{const l=cs[e]?.booking;if(!l||e===s)return;const t=cs[s]?.status;if(t&&!['free','soon'].includes(t))return void Oe('dirty'===t?`Table ${s} needs clearing first.`:`Table ${s} is ${S.STATUS[t].label.toLowerCase()} \u2014 pick a free table.`);await y.repo.bookings.update(l.id,{table:s});const a=Be?.[e]?.stage;B.useFloor.getState().setLive(q,s,{stage:a??'seated',dirty:!1}),B.useFloor.getState().setLive(q,e,{stage:void 0,dirty:!0}),Oe(`${(0,A.privName)(l,Ce)} moved Table ${e} \u2192 ${s}. Table ${e} needs clearing.`)},fs=e=>Fe(`Order ${e.ref} \xb7 details`,(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(e.customerName)}),e.allergies.length?(0,W.jsxs)(u.T,{weight:"bold",colour:k.colours.red,children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}):(0,W.jsx)(u.Muted,{children:"No allergies declared."}),e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{colour:k.colours.red,children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.notes?` \xb7 \u201c${e.notes}\u201d`:'']},s))]})),js=Ge.hours,ys=Math.max(K.settings.capacityPerHour,...js.map(e=>e.coversHigh)),ws=(0,W.jsxs)(V,{title:`Bookings & waitlist \xb7 ${(0,f.niceDate)(oe)}`,right:(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`}),children:[0===Ue.length?(0,W.jsx)(u.Muted,{children:"No bookings today."}):null,Ue.map(e=>{const s='confirmed'===e.status&&(0,f.minsBetween)(new Date(`${e.date}T${e.time}:00`),oe)>15;return(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10,opacity:['finished','noshow','cancelled'].includes(e.status)?.5:1,borderColor:e.allergies.length?k.colours.red:s?k.colours.amber:k.colours.border}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:[e.time," \xb7 ",Ce?`${(0,A.privName)(e,!0)} \xb7 ${e.partySize}`:(0,C.walkInLabel)(e)]}),(0,W.jsx)(u.Badge,{kind:'seated'===e.status?'green':'noshow'===e.status?'red':'neutral',label:'noshow'===e.status?'No-show':e.status})]}),(0,W.jsxs)(u.Muted,{children:[e.table?`Table ${e.table}`:e.walkIn?'Table to assign':'Table TBC',e.walkIn?` \xb7 ${e.ref}`:'','none'!==e.security?" \xb7 "+('deposit'===e.security?'Deposit':'Card saved'):'',e.notes?Ce?' \xb7 \u270e':` \xb7 ${e.notes}`:'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:"\u26a0 Allergy"}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>Ve(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsx)(u.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,W.jsx)(u.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,s?(0,W.jsx)(u.T,{size:13,colour:k.colours.amber,children:"Running late \u2014 15+ min past booking time"}):null,!e.table&&e.walkIn&&'seated'===e.status?(0,W.jsx)(u.Button,{label:"Assign table",onPress:()=>Te.assignTable(e)}):null,'confirmed'===e.status?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.bookings.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>y.repo.bookings.setStatus(e.id,'noshow')})]}):'seated'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Finished",onPress:()=>y.repo.bookings.setStatus(e.id,'finished')}):null]},e.id)}),(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',marginTop:6},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.gold,children:["Waitlist (",Ke.length,")"]}),(0,W.jsxs)(u.Muted,{children:["~",(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)," min for a new party (est.)"]})]}),Ke.map((e,s)=>(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:["#",e.number," ",(0,A.pv)(e.name,Ce)," \xb7 ",e.partySize]}),(0,W.jsxs)(u.Muted,{children:["waiting ",(0,f.minsBetween)(new Date(e.joinedAt),oe)," min \xb7 est. ",(0,j.estimateWait)(s+1,K.settings.turnMins,Ze)," min"]})]}),'notified'===e.status?(0,W.jsx)(u.Badge,{kind:"green",label:"Notified \u2014 table ready"}):null,(0,W.jsxs)(u.Row,{gap:6,children:['waiting'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>y.repo.waitlist.setStatus(e.id,'notified')}):null,(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.waitlist.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>y.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:fe,onChangeText:je,style:[u.styles.input,{flex:1,paddingVertical:6}]}),(0,W.jsx)(r.default,{accessibilityLabel:"Party size",value:ye,onChangeText:we,keyboardType:"number-pad",style:[u.styles.input,{width:50,paddingVertical:6}]}),(0,W.jsx)(u.Button,{small:!0,label:"Add",disabled:fe.trim().length<2,onPress:()=>{y.repo.waitlist.join(q,fe.trim(),Math.max(1,Number(ye)||2)),je('')}})]})]}),ks=(0,W.jsxs)(V,{title:"Live orders & kitchen tickets",right:(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Chip,{label:"Tickets",selected:ce,onPress:()=>ge(!0)}),(0,W.jsx)(u.Chip,{label:"Full orders",selected:!ce,onPress:()=>ge(!1)})]}),children:[(0,W.jsxs)(u.Muted,{children:[Xe.length," live \xb7 ",Je," done today"]}),0===Xe.length?(0,W.jsx)(u.Muted,{children:"No live orders."}):null,ce?(0,W.jsxs)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[Xe.filter(e=>['new','acknowledged','preparing'].includes(e.status)).map(e=>{const s=Math.max(0,(0,f.minsBetween)(new Date(e.createdAt),oe)),l=s>=20?k.colours.red:s>=12?k.colours.amber:k.colours.green;return(0,W.jsxs)(o.default,{testID:`ticket-${e.ref}`,style:{width:210,backgroundColor:'#F4EFE3',borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:e.allergies.length?k.colours.red:l},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",colour:"#111",children:'table'===e.type?`TABLE ${e.tableNo}`:`TAKEAWAY ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`}),(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:s>=20?'#B3261E':'#333',children:[s,"m"]})]}),(0,W.jsxs)(u.T,{size:12,colour:"#444",children:[e.ref," \xb7 ",e.status.toUpperCase()]}),e.allergies.length?(0,W.jsx)(o.default,{style:{backgroundColor:'#B3261E',borderRadius:4,padding:4},children:(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:"#fff",children:["\u26a0 ",Ce?'ALLERGY \u2014 see details':e.allergies.map(e=>(0,h.allergenLabel)(e.allergen)).join(', ').toUpperCase()]})}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,weight:"semibold",colour:"#111",children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'']},s)),e.lines.some(e=>e.notes)?(0,W.jsx)(u.T,{size:12,colour:"#444",children:Ce?'Notes \u2014 see details':`Notes: ${e.lines.filter(e=>e.notes).map(e=>e.notes).join(' \xb7 ')}`}):null,Ce&&(e.allergies.length||e.lines.some(e=>e.notes))?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Details",onPress:()=>fs(e)}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:'takeaway'===e.type?'Ready':'Food out',disabled:es(e,'takeaway'===e.type?'ready':'served'),onPress:()=>y.repo.orders.setStatus(e.id,'takeaway'===e.type?'ready':'served',xe)}):null]},e.id)}),Xe.filter(e=>['ready','served'].includes(e.status)).map(e=>(0,W.jsxs)(o.default,{style:{width:210,backgroundColor:k.colours.surface2,borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:k.colours.green},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",children:'table'===e.type?`Table ${e.tableNo}`:`Takeaway ${e.ref}`}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce),'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':'']}),e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",testID:`collected-${e.ref}`,disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]},e.id))]}):null,ce?null:Xe.map(e=>{const s=e.allergies.length>0&&ss(e),l=e.lines.filter(e=>e.overridden),t=e.lines.filter(e=>e.contains.length||e.may.length);return(0,W.jsxs)(o.default,{testID:`order-${e.ref}`,style:[u.styles.card,{padding:10,borderColor:s?k.colours.red:'ready'===e.status?k.colours.green:k.colours.border,borderWidth:s?2:1}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"bold",children:e.ref}),(0,W.jsx)(u.Badge,{kind:'takeaway'===e.type?'gold':'blue',label:'takeaway'===e.type?`Takeaway \xb7 ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`:`Table ${e.tableNo}`})]}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce)," \xb7 ",(0,m.gbp)(e.subtotal)," \xb7 ",e.paid>=e.total?'Paid (demo)':e.paid>0?`Part paid ${(0,m.gbp)(e.paid)}`:'Unpaid \u2014 bill at end',e.customerSignal?" \xb7 "+('here'===e.customerSignal?'CUSTOMER IS HERE':'Customer on the way'):'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:s?'\u26a0 Allergy: sign-off needed':'\u26a0 Allergy (signed off)'}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>fs(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.redBg,borderRadius:8,padding:8,borderLeftWidth:5,borderLeftColor:k.colours.red},children:[(0,W.jsxs)(u.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}),l.length?(0,W.jsxs)(u.T,{size:14,weight:"semibold",colour:"#FFE3DF",children:["Customer OVERRODE block on: ",l.map(e=>`${e.name} [contains ${e.contains.map(h.allergenLabel).join(', ')}]`).join('; ')]}):null,t.filter(e=>!e.overridden&&e.may.length).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:"#FFE2A8",children:["May contain: ",e.name," [",e.may.map(h.allergenLabel).join(', '),"]"]},s))]}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.choices.length?` \u2014 ${e.choices.join(', ')}`:'',e.notes?Ce?' \xb7 \u270e':` \xb7 \u201c${e.notes}\u201d`:'']},s)),(0,W.jsxs)(u.Row,{wrap:!0,gap:6,children:['new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start preparing",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status&&'takeaway'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",disabled:es(e,'ready'),onPress:()=>y.repo.orders.setStatus(e.id,'ready',xe)}):null,'preparing'===e.status&&'table'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Food out",disabled:es(e,'served'),onPress:()=>y.repo.orders.setStatus(e.id,'served',xe)}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]})]},e.id)})]}),Ts=({colour:e,title:s,children:l})=>(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.surface2,borderRadius:10,padding:10,borderLeftWidth:6,borderLeftColor:e,gap:4},children:[(0,W.jsx)(u.T,{weight:"bold",colour:e,children:s}),l]}),vs={cook:'START COOKING',bag:'BAG IT',ready:'READY'},Cs=(0,W.jsxs)(V,{title:"Allergy & takeaway alerts",right:(0,W.jsx)(u.Badge,{kind:us?'red':'green',label:`${us} need action`}),children:[ls.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 ${e.ref} ${'table'===e.type?`(Table ${e.tableNo})`:'(takeaway)'}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>fs(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),Ce?null:e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:k.colours.red,weight:"semibold",children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0})]},e.id)),ts.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 booking ${e.time} ${(0,A.privName)(e,Ce)} (${e.partySize})`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>Ve(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),(0,W.jsx)(L.BookingAllergyChain,{b:e,me:xe})]},e.id)),rs.map(e=>(0,W.jsxs)(Ts,{colour:'overdue'===e.state?k.colours.red:k.colours.amber,title:`${vs[e.stage]} \u2014 ${e.order.ref} \xb7 pickup ${(0,f.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,W.jsx)(u.T,{size:14,children:e.detail}),(0,W.jsxs)(u.Muted,{children:["Due ",(0,f.hm)(e.due)," (slot \u2212 prep \u2212 ",K.settings.bufferMins," min buffer)",e.order.allergies.length?' \xb7 \u26a0 allergy order':'']}),'ready'===e.stage?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>y.repo.orders.setStatus(e.orderId,'ready',xe)}):(0,W.jsx)(u.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:es(e.order,'preparing'),onPress:()=>y.repo.orders.acknowledgeReadiness(e.orderId,e.stage,xe)})]},e.id)),is.map(e=>(0,W.jsx)(Ts,{colour:k.colours.amber,title:`New order ${e.ref} \u2014 not yet acknowledged`,children:(0,W.jsx)(u.Button,{small:!0,label:"Acknowledge",onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)})},e.id)),ns.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`LOW RATING ${e.stars}/5 \u2014 ${e.context}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show comment",onPress:()=>Fe(`Rating ${e.stars}/5`,(0,W.jsxs)(u.T,{children:[F(e.customerName),e.comment?`: \u201c${e.comment}\u201d`:'']}))}):(0,W.jsxs)(u.T,{size:15,children:[e.customerName,e.comment?`: \u201c${e.comment}\u201d`:'']}),(0,W.jsx)(u.Muted,{children:"Manager: speak to the guest while they\u2019re still here."}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`Handled \u2014 ${xe}`,onPress:()=>y.repo.alerts.acknowledge(`rating:${e.id}`,xe)})]},e.id)),0===us?(0,W.jsx)(u.Muted,{children:"No alerts need action."}):null,os.length?(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Upcoming takeaway timings"}),os.slice(0,6).map(e=>(0,W.jsxs)(u.T,{size:14,children:[(0,f.hm)(e.due)," \xb7 ",vs[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,f.hm)(new Date(e.order.slotTime)),")"]},e.id))]}):null,ds.length?(0,W.jsx)(Ts,{colour:k.colours.muted,title:"Sold out",children:(0,W.jsx)(u.T,{size:14,children:ds.map(e=>e.name).join(', ')})}):null,(0,W.jsxs)(o.default,{style:{gap:2,marginTop:6},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Allergy log"}),Ce?(0,W.jsxs)(u.Muted,{children:[se.filter(e=>'allergy'===e.kind).length," entries today \u2014 full log in the Managers app (privacy mode)."]}):se.filter(e=>'allergy'===e.kind).slice(0,5).map(e=>(0,W.jsxs)(u.T,{size:13,colour:"#FFD9D4",children:[(0,f.hm)(new Date(e.at))," \xb7 ",e.text]},e.id))]})]}),$s=de.filter(e=>e.day===(0,$.weekday)(oe)&&!he.some(s=>s.staffId===e.staffId)&&60*e.start>60*oe.getHours()+oe.getMinutes()).sort((e,s)=>e.start-s.start),Bs=ue.filter(e=>'all'===e.ch&&!e.removed).sort((e,s)=>Number(!!s.pinned)-Number(!!e.pinned)||s.at.localeCompare(e.at)).slice(0,6),Ss=(0,W.jsxs)(o.default,{style:{flex:.8,gap:10},children:[(0,W.jsxs)(V,{title:"Who's on",right:(0,W.jsx)(u.Badge,{kind:"green",label:`${he.length} clocked in`}),children:[0===he.length?(0,W.jsx)(u.Muted,{children:"Nobody clocked in yet."}):null,he.map(e=>{const s=ne.find(s=>s.id===e.staffId),l=de.find(s=>s.staffId===e.staffId&&s.day===(0,$.weekday)(oe));return(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(N.StaffAvatar,{id:e.staffId,size:34}),(0,W.jsxs)(o.default,{style:{flex:1},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(s?.name)}),(0,W.jsxs)(u.Muted,{children:[s?.job,l?` \xb7 rota ${(0,$.fmtH)(l.start)}\u2013${(0,$.fmtH)(l.end)}`:'']})]}),(0,W.jsx)(u.Badge,{kind:"green",label:`in ${(0,f.hm)(new Date(e.in))}`})]},e.id)}),$s.map(e=>(0,W.jsxs)(u.Muted,{children:["Due in ",(0,$.fmtH)(e.start),": ",F(ne.find(s=>s.id===e.staffId)?.name)]},e.id))]}),(0,W.jsxs)(V,{title:"Staff announcements",right:(0,W.jsx)(u.Muted,{children:"All staff chat"}),children:[0===Bs.length?(0,W.jsx)(u.Muted,{children:"No announcements."}):null,Bs.map(e=>(0,W.jsxs)(o.default,{style:{gap:2,borderLeftWidth:3,borderLeftColor:e.pinned?k.colours.gold:k.colours.border,paddingLeft:8},children:[(0,W.jsxs)(u.T,{size:12,colour:e.pinned?k.colours.gold:k.colours.muted,children:[e.pinned?'\ud83d\udccc ':'','system'===e.from?'Cover Charge':F(ne.find(s=>s.id===e.from)?.name)," \xb7 ",(0,f.hm)(new Date(e.at))]}),(0,W.jsx)(u.T,{size:14,children:e.text??(e.photo?`Photo: ${e.photo.caption}`:'')})]},e.id)),(0,W.jsx)(u.Muted,{children:"Read-only on the display. Post from Cover Charge for Staff or Cover Charge for Managers."})]})]}),Rs=_||e>=900,Ps=(0,W.jsx)(E.WaitlistPanel,{rid:q,r:K,plan:$e,view:cs,todays:Ue,waiting:Ke,now:oe,privacy:Ce,busy:Ze,onToast:Oe}),Ms=(0,W.jsx)(E.PacePanel,{r:K,fc:Ge,todays:Ue,now:oe,walkInCount:te,staffOn:he.length||1,onSummary:()=>Ne(!0)}),Ds=s=>Rs?(0,W.jsx)(t.default,{style:{width:e>=1200?340:300,flexGrow:0},contentContainerStyle:{gap:10,paddingBottom:20},children:s}):(0,W.jsx)(o.default,{style:{gap:10},children:s}),As=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsxs)(o.default,{style:{flex:1,gap:6,minHeight:Rs?void 0:420},children:[(0,W.jsx)(E.ArrivalsStrip,{todays:Ue,now:oe,privacy:Ce}),(0,W.jsx)(P.AreaTabs,{plan:$e,area:gs,onPick:Me,counts:hs}),Ie?(0,W.jsxs)(u.Row,{gap:8,style:{backgroundColor:k.colours.goldTint,borderRadius:10,padding:8},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Ie,": tap the new table (or drag it there)."]}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Le(null)})]}):null,(0,W.jsx)(o.default,{style:{flex:1,minHeight:Rs?300:Math.min(520,.62*e)},children:(0,W.jsx)(R.FloorCanvas,{plan:$e,areaId:gs,mode:"live",fit:"contain",view:cs,privacy:Ce,sectionColours:!0,turnBase:K.settings.turnMins,highlight:Ie?[Ie]:void 0,onTap:e=>{Ie?(e.name!==Ie&&xs(Ie,e.name),Le(null)):Ae(e.name)},onDrop:(e,s)=>xs(e.name,s.name)})}),(0,W.jsx)(E.Legend,{})]}),Ds((0,W.jsxs)(W.Fragment,{children:[Ps,Ms]}))]}),Is=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsx)(o.default,{style:{flex:1,minHeight:420},children:(0,W.jsx)(M.Timeline,{plan:$e,bookings:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,t0:ms,t1:bs,onOpen:e=>{const s=(0,B.tablesOf)(e.table)[0];s&&cs[s]?Ae(s):Ve(e)}})}),Ds((0,W.jsx)(W.Fragment,{children:Ps}))]}),Ls=(0,W.jsxs)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10,flexGrow:1},scrollEnabled:!_,children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{gap:6},children:[(0,W.jsx)(u.Muted,{children:"Signing off as (who's on):"}),pe.map(e=>(0,W.jsx)(u.Chip,{label:e,selected:xe===e,onPress:()=>be(e)},e))]}),(0,W.jsxs)(o.default,{testID:"forecast-strip",style:{gap:8},children:[(0,W.jsxs)(u.Row,{wrap:!0,gap:8,style:{alignItems:'stretch'},children:[(0,W.jsx)(G,{label:"Next hour"+(Ge.nextHour?` \xb7 ${String(Ge.nextHour.hour).padStart(2,'0')}:00\u2013${String(Ge.nextHour.hour+1).padStart(2,'0')}:00`:''),badge:"Estimate",value:Ge.nextHour?`${Ge.nextHour.coversLow}\u2013${Ge.nextHour.coversHigh} covers`:Ge.open?'Kitchen closing':'Closed',sub:Ge.nextHour?`${Ge.nextHour.booked} booked + ~${Ge.nextHour.walkIns} walk-ins \xb7 ~${Ge.nextHour.takeaway} takeaway (${Ge.nextHour.takeawayPlaced} placed)`:void 0}),(0,W.jsx)(G,{label:"Rest of today",badge:"Estimate",value:Ge.open?`${Ge.restOfDay.low}\u2013${Ge.restOfDay.high} covers`:'\u2014',sub:Ge.open?`${Ge.restOfDay.booked} booked \xb7 ~${Ge.restOfDay.takeaway} takeaway orders \xb7 ${Ye} walk-in covers seated so far`:void 0}),(0,W.jsx)(G,{label:"Waitlist",value:`${Ke.length} part${1===Ke.length?'y':'ies'}`,sub:`${Ke.reduce((e,s)=>e+s.partySize,0)} covers \xb7 next wait ~${(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)} min (est.)`}),(0,W.jsx)(G,{label:"Takeaway slots",value:K.settings.takeawayPaused?'PAUSED':`${Qe.filter(e=>!e.full).length} open`,sub:`Cap ${K.settings.slotCap} per ${K.settings.slotMinutes} min`,children:(0,W.jsxs)(u.Row,{gap:8,children:[(0,W.jsx)(a.default,{accessibilityLabel:"Pause takeaway slots",value:K.settings.takeawayPaused,onValueChange:e=>y.repo.restaurants.updateSettings(q,{takeawayPaused:e}),trackColor:{true:k.colours.redSolid,false:'#444'}}),(0,W.jsx)(u.T,{size:14,children:K.settings.takeawayPaused?'Resume':'Pause'})]})}),(0,W.jsx)(G,{label:"Walk-ins seated (today)",value:`${Ye} covers`,sub:"Use Walk-in above; or quick-count here without a table",children:(0,W.jsx)(u.Row,{gap:6,children:[1,2,4].map(e=>(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`+${e}`,onPress:()=>y.repo.waitlist.addWalkIn(q,e)},e))})})]}),(0,W.jsxs)(u.Row,{wrap:!0,gap:12,style:{backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,alignItems:'flex-end'},children:[(0,W.jsxs)(o.default,{style:{gap:2,flexBasis:340,flexGrow:1},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Forecast \u2014 suggested actions"}),(0,W.jsx)(u.Badge,{kind:"amber",label:"ESTIMATE"})]}),Ge.suggestions.map((e,s)=>(0,W.jsxs)(u.T,{size:14,children:["\u2022 ",e]},s)),(0,W.jsxs)(u.Muted,{children:[Ge.flags.length?`Calendar flags today: ${Ge.flags.join(', ')} \xb7 `:'',"Baseline v1: confirmed bookings + example weekday/hour averages + expected walk-ins (",Math.round(100*K.settings.walkInShare),"% share). ",w.EXAMPLE_ACCURACY,"."]})]}),(0,W.jsx)(u.Row,{gap:4,style:{alignItems:"flex-end"},children:js.map(e=>{const s=Ge.nextHour?.hour===e.hour;return(0,W.jsxs)(o.default,{style:{alignItems:'center',width:30},children:[(0,W.jsx)(u.T,{size:11,colour:k.colours.muted,children:e.covers}),(0,W.jsxs)(o.default,{style:{height:70,width:18,justifyContent:'flex-end',borderBottomWidth:1,borderColor:k.colours.border},children:[(0,W.jsx)(o.default,{style:{height:e.walkIns/ys*70,backgroundColor:s?k.colours.goldLight:'#6B5A3A'}}),(0,W.jsx)(o.default,{style:{height:e.booked/ys*70,backgroundColor:s?k.colours.gold:'#9C7C45'}})]}),(0,W.jsx)(u.T,{size:11,colour:s?k.colours.gold:k.colours.muted,children:e.hour})]},e.hour)})})]})]}),(0,W.jsxs)(o.default,{style:{flexDirection:_?'row':'column',gap:10,flex:_?1:void 0,minHeight:_?380:void 0},children:[ws,(0,W.jsx)(o.default,{style:{flex:1.5,gap:10},children:ks}),Cs,Ss]})]}),zs=(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10},children:(0,W.jsx)(P.FloorEditor,{rid:q,compact:!Rs,maxH:Math.max(300,Y-330)})});return(0,W.jsxs)(i.SafeAreaView,{style:{flex:1,backgroundColor:k.colours.bg},children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{paddingHorizontal:14,paddingVertical:6,gap:10,borderBottomWidth:1,borderBottomColor:k.colours.border},children:[(0,W.jsx)(c.RestaurantBrand,{rid:K.id,size:48,sub:"Display \xb7 Harbour View, Dunure"}),(0,W.jsx)(o.default,{style:{flex:1}}),Ce?(0,W.jsx)(u.Badge,{kind:"gold",label:"\ud83d\udd12 Privacy on"}):(0,W.jsx)(u.Badge,{kind:"amber",label:"Privacy off"}),us?(0,W.jsx)(H.default,{accessibilityRole:"button",accessibilityLabel:"Open alerts",onPress:()=>Re('board'),children:(0,W.jsx)(u.Badge,{kind:"red",label:`${us} alert${us>1?'s':''}`})}):(0,W.jsx)(u.Badge,{kind:"green",label:"All clear"}),(0,W.jsx)(u.T,{size:20,weight:"bold",colour:k.colours.gold,children:(0,f.hm)(oe)}),(0,W.jsx)(u.Muted,{children:(0,f.niceDate)(oe)}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Demo +15 min",onPress:()=>re(15)})]}),(0,W.jsxs)(o.default,{testID:"front-door-bar",style:{flexDirection:'row',gap:12,paddingHorizontal:14,paddingTop:8,paddingBottom:4},children:[(0,W.jsx)(u.Button,{label:"Walk-in",onPress:Te.openWalkIn,testID:"add-walkin",style:{flex:1,minHeight:72,borderRadius:18}}),(0,W.jsx)(u.Button,{label:"New booking",onPress:Te.openBooking,testID:"add-booking",style:{flex:1,minHeight:72,borderRadius:18}})]}),(0,W.jsxs)(u.Row,{style:{paddingHorizontal:14,paddingVertical:4,gap:6},children:[O.map(e=>{const s=Se===e.id;return(0,W.jsx)(H.default,{testID:`view-${e.id}`,accessibilityRole:"tab",accessibilityLabel:e.label,accessibilityState:{selected:s},onPress:()=>Re(e.id),style:{minHeight:48,paddingHorizontal:18,justifyContent:'center',borderRadius:12,borderBottomWidth:3,borderBottomColor:s?k.colours.gold:'transparent',backgroundColor:s?k.colours.goldTint:'transparent'},children:(0,W.jsx)(u.T,{weight:"semibold",colour:s?k.colours.goldLight:k.colours.muted,children:e.label})},e.id)}),(0,W.jsx)(o.default,{style:{flex:1}}),(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`})]}),'floor'===Se||'timeline'===Se?Rs?'floor'===Se?As:Is:(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{flexGrow:1},children:'floor'===Se?As:Is}):'plan'===Se?zs:Ls,Te.elements,De?(0,W.jsx)(E.TableSheet,{rid:q,name:De,view:cs,plan:$e,todays:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,onClose:()=>Ae(null),onWalkIn:e=>Te.openWalkInAt(e),onMove:e=>Le(e),onDetails:Ve}):null,ze?(0,W.jsx)(E.DetailsPanel,{title:ze.title,onClose:()=>Ee(null),children:ze.body}):null,He?(0,W.jsx)(E.ServiceSummary,{r:K,todays:Ue,orders:X,waitlistAll:Q,walkInCount:te,onClose:()=>Ne(!1)}):null,We?(0,W.jsx)(o.default,{testID:"floor-toast",pointerEvents:"none",style:{position:'absolute',left:0,right:0,bottom:24,alignItems:'center',zIndex:900},children:(0,W.jsx)(o.default,{style:{backgroundColor:k.colours.surface2,borderColor:k.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:10,paddingHorizontal:16,maxWidth:640},children:(0,W.jsx)(u.T,{weight:"semibold",children:We})})}):null,(0,W.jsx)(D.Screensaver,{rid:q,idleMins:ve.idleMins,pinOn:ve.pinOn,pin:ve.pin,tonightCards:ve.tonightCards})]})};var s=_r(d[0]),l=e(s),t=e(_r(d[1])),a=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),n=e(_r(d[5])),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),m=_r(d[11]),b=_r(d[12]),x=_r(d[13]),f=_r(d[14]),j=_r(d[15]),y=_r(d[16]),w=_r(d[17]),k=_r(d[18]),T=_r(d[19]),v=_r(d[20]),C=_r(d[21]),$=_r(d[22]),B=_r(d[23]),S=_r(d[24]),R=_r(d[25]),P=_r(d[26]),M=_r(d[27]),D=_r(d[28]),A=_r(d[29]),I=_r(d[30]),L=_r(d[31]),z=_r(d[32]),E=_r(d[33]),H=e(_r(d[34])),N=_r(d[35]),W=_r(d[36]);const O=[{id:'floor',label:'Floor'},{id:'timeline',label:'Timeline'},{id:'board',label:'Board'},{id:'plan',label:'Edit plan'}],F=e=>(e??'').replace(' (example)','');function V({title:e,right:s,children:l,flex:a=1}){return(0,W.jsxs)(o.default,{style:{flex:a,backgroundColor:k.colours.surface,borderRadius:14,borderWidth:1,borderColor:k.colours.border,overflow:'hidden',minHeight:200},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:k.colours.border,backgroundColor:k.colours.surface2},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:e}),s]}),(0,W.jsx)(t.default,{contentContainerStyle:{padding:10,gap:10},children:l})]})}function G({label:e,value:s,sub:l,badge:t,children:a}){return(0,W.jsxs)(o.default,{style:{flex:1,minWidth:170,backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,gap:2},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,weight:"medium",children:e}),t?(0,W.jsx)(u.Badge,{kind:"amber",label:t}):null]}),(0,W.jsx)(u.T,{size:24,weight:"bold",colour:k.colours.text,children:s}),l?(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,children:l}):null,a]})}const U=e=>'new'===e?'red':'ready'===e?'green':'preparing'===e?'amber':'served'===e?'blue':'neutral'},847,[12,133,253,255,109,269,271,790,856,791,843,793,857,794,795,844,796,858,797,804,859,848,860,861,849,850,851,852,854,853,792,862,863,855,245,864,6]);
|
| 3 |
+
__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,"TABLES",{enumerable:!0,get:function(){return x}}),_e.useTableNames=p,_e.resetTableLive=j,_e.useTableUse=k,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return w}}),_e.TablePicker=C,_e.WalkInSheet=S,_e.AssignTableSheet=v,_e.UndoToast=I,_e.NewBookingSheet=P,_e.useFrontDoor=function(e,s){const[l,o]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1),[a,r]=(0,t.useState)(null),[d,u]=(0,t.useState)(null),c=(0,y.jsxs)(y.Fragment,{children:[l?(0,y.jsx)(S,{wide:s,initialTable:l.table,onClose:()=>o(!1),onSeated:r}):null,n?(0,y.jsx)(P,{wide:s,date:e,onClose:()=>i(!1)}):null,d?(0,y.jsx)(v,{booking:d,onClose:()=>u(null)}):null,a?(0,y.jsx)(I,{booking:a,onDone:()=>r(null)}):null]});return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>i(!0),assignTable:u,elements:c}};var t=_r(_d[0]),s=e(t);_r(_d[1]);var l=e(_r(_d[2])),o=e(_r(_d[3])),n=e(_r(_d[4])),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=_r(_d[11]),h=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]);const x=Array.from({length:12},(e,t)=>String(t+1));function p(e){const t=(0,f.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function j(e,t){(0,f.tablesOf)(t).forEach(t=>f.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function k(e,t){const s=(0,r.useBookings)(e),l=(0,r.useOrders)(e),o=p(e),n=(0,f.useFloor)(t=>t.live[e])??{},i=(0,c.ymd)(t),a={};for(const e of o)a[e]=n[e]?.blocked?{busy:!0,label:'Blocked'}:n[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===i&&e.table)for(const s of(0,f.tablesOf)(e.table))if(a[s])if('seated'===e.status)a[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!a[s].busy){const l=(0,c.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));l>=-15&&l<=90&&(a[s]={...a[s],soon:`Booked ${e.time}`})}for(const e of l)'table'===e.type&&e.tableNo&&a[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!a[e.tableNo].busy&&(a[e.tableNo]={busy:!0,label:'Open order'});return a}const w=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function C({use:e,value:t,onPick:s,big:o,best:i}){const a=Object.keys(e);return(0,y.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"table-picker",children:a.map(a=>{const r=e[a],d=t===a,u=!!i&&(0,f.tablesOf)(i)[0]===a&&!d;return(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Table ${a}, ${r.busy?`in use (${r.label})`:r.soon?`free, ${r.soon}`:'free'}`,accessibilityState:{selected:d},onPress:()=>s(a),style:{width:o?92:64,minHeight:56,borderRadius:12,borderWidth:d?2.5:1.5,padding:6,alignItems:'center',justifyContent:'center',borderColor:d?b.colours.gold:r.busy?b.colours.red:b.colours.green,backgroundColor:d?b.colours.goldTint:r.busy?b.colours.redBg:b.colours.surface2},children:[(0,y.jsx)(h.T,{weight:"bold",size:18,colour:d?b.colours.goldLight:b.colours.text,children:a}),(0,y.jsx)(h.T,{size:11,colour:r.busy?'#FFD9D4':r.soon?'#FFE2A8':'#CFF3D7',center:!0,children:r.busy?'Blocked'===r.label||'Needs clearing'===r.label?r.label:'In use':r.soon??'Free'}),u?(0,y.jsx)(n.default,{testID:"best-table",style:{position:'absolute',top:-8,right:-6,backgroundColor:b.colours.gold,borderRadius:8,paddingHorizontal:5},children:(0,y.jsx)(h.T,{size:10,weight:"bold",colour:b.colours.onGold,children:"BEST"})}):null]},a)})})}const T=[1,2,3,4,5,6,7,8];function S({onClose:e,onSeated:d,wide:x,initialTable:p}){const{rid:w,r:S,now:v}=(0,a.useCtx)(15e3),I=k(w,v),[P,$]=(0,t.useState)(2),[D,F]=(0,t.useState)(!1),[R,W]=(0,t.useState)(p??null),B=(0,f.usePlan)(w),z=(0,r.useBookings)(w),M=s.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,u.suggestTable)(B,z.filter(e=>e.date===(0,c.ymd)(v)),e,P,v,(0,u.turnFor)(P,S.settings.turnMins))?.table??null},[B,z,I,P,v.getTime()]),[N,O]=(0,t.useState)(!1),[A,L]=(0,t.useState)(''),E=(e,t=String(e),s=()=>{F(!1),$(e)})=>{const o='9+'===t?D:!D&&P===e;return(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:x?64:60,height:x?64:56,borderRadius:14,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?b.colours.gold:'transparent'},children:(0,y.jsx)(h.T,{weight:"bold",size:22,colour:o?b.colours.onGold:b.colours.gold,children:t})},t)},_=(0,y.jsxs)(h.Row,{gap:12,style:{justifyContent:'center'},children:[(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One fewer",onPress:()=>$(e=>Math.max(9,e-1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"\u2212"})}),(0,y.jsx)(h.T,{weight:"bold",size:26,children:P}),(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One more",onPress:()=>$(e=>Math.min(40,e+1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"+"})})]}),H=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1:void 0},children:[(0,y.jsx)(h.T,{weight:"semibold",children:"How many people?"}),(0,y.jsxs)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[T.map(e=>E(e)),E(9,'9+',()=>{F(!0),$(e=>e>=9?e:9)})]}),D?_:null]}),U=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1.3:void 0},children:[(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",children:["Table ",(0,y.jsx)(h.T,{colour:b.colours.muted,size:14,children:"(optional)"})]}),R?(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>W(null)}):null]}),(0,y.jsx)(C,{use:I,value:R,onPick:e=>W(R===e?null:e),big:x,best:M}),M&&!R?(0,y.jsxs)(h.Muted,{children:["Best fit for ",P,": Table ",M," (smallest free table, fewest clashes)."]}):null,'staff'!==i.APP_VARIANT?(0,y.jsx)(h.Muted,{children:"Using Wix Tables too? Also mark the table there; this prototype doesn't connect to it."}):null]});return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,c.hm)(v)}`,maxWidth:x?900:void 0,testID:"walkin-sheet",children:[(0,y.jsx)(h.Button,{label:`Seat walk-in \xb7 ${P} ${1===P?'person':'people'}${R?` \xb7 Table ${R}`:''}`,onPress:async()=>{const t=await r.repo.bookings.seatWalkIn(w,P,R??void 0,A);j(w,R??void 0),d(t),e()},testID:"seat-walkin",style:{minHeight:56}}),x?(0,y.jsxs)(h.Row,{gap:16,style:{alignItems:'flex-start'},children:[H,U]}):(0,y.jsxs)(y.Fragment,{children:[H,U]}),N?(0,y.jsx)(o.default,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:A,onChangeText:L,style:h.styles.input,autoFocus:!0}):(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"+ Add a note (optional)",onPress:()=>O(!0)}),(0,y.jsx)(h.Muted,{children:"No name needed. Seated now; counts in today's covers and the forecast."})]})}function v({booking:e,onClose:t}){const{rid:s,now:l}=(0,a.useCtx)(15e3),o=k(s,l);return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:t,title:`Assign table \xb7 ${w(e)}`,testID:"assign-table-sheet",children:[(0,y.jsx)(C,{use:o,onPick:async l=>{await r.repo.bookings.assignTable(e.id,l),j(s,l),t()}}),(0,y.jsx)(h.Muted,{children:"Red tables are in use right now; you can still pick one (e.g. joining a table)."})]})}function I({booking:e,onDone:s}){return(0,t.useEffect)(()=>{const e=setTimeout(s,6e3);return()=>clearTimeout(e)},[e.id]),(0,y.jsx)(n.default,{testID:"walkin-toast",style:{position:'fixed',left:12,right:12,bottom:92,zIndex:1e3,alignItems:'center'},pointerEvents:"box-none",children:(0,y.jsxs)(h.Row,{gap:10,style:{backgroundColor:b.colours.surface2,borderColor:b.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:8,paddingLeft:14,paddingRight:8,maxWidth:520,width:'100%',justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",style:{flex:1},children:[w(e)," seated \xb7 ",e.table?`Table ${e.table}`:'table to assign'," (",e.ref,")"]}),(0,y.jsx)(h.Button,{kind:"secondary",label:"Undo",onPress:()=>{r.repo.bookings.undoWalkIn(e.id),s()},testID:"undo-walkin"})]})})}function P({date:e,onClose:s,wide:l}){const{rid:o,r:n,now:i}=(0,a.useCtx)(6e4),u=(0,r.useBookings)(o),[b,f]=(0,t.useState)(''),[x,p]=(0,t.useState)(2),[j,k]=(0,t.useState)(null),[w,C]=(0,t.useState)(''),T=(0,c.parseYmd)(e),S=(0,d.bookingSlots)(n,T,t=>u.filter(s=>s.date===e&&s.time===t&&'cancelled'!==s.status&&!s.walkIn).reduce((e,t)=>e+t.partySize,0),x,e===(0,c.ymd)(i)?i:(0,c.addMins)(T,0));return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:s,title:`New booking \xb7 ${(0,c.niceDate)(T)}`,maxWidth:l?760:void 0,testID:"booking-sheet",children:[(0,y.jsx)(h.Field,{label:"Name",value:b,onChangeText:f,placeholder:"e.g. Reid"}),(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(h.T,{children:"Party size"}),(0,y.jsx)(h.Stepper,{value:x,onChange:p,min:1,max:20,label:"party size"})]}),(0,y.jsx)(h.Row,{wrap:!0,gap:6,children:S.map(e=>(0,y.jsx)(h.Chip,{label:e.time,sub:`${e.left} left`,disabled:!e.available,selected:j===e.time,onPress:()=>k(e.time)},e.time))}),S.length?null:(0,y.jsx)(h.Muted,{children:"Closed on this day (per listed hours)."}),(0,y.jsx)(h.Field,{label:"Notes",value:w,onChangeText:C,placeholder:"e.g. high chair, window table"}),x>=n.settings.savedCardFromParty?(0,y.jsxs)(h.Muted,{children:["Parties of ",n.settings.savedCardFromParty,"+ need a saved card; the customer gets a link (demo, nothing is sent)."]}):null,(0,y.jsx)(h.Button,{label:"Save booking",disabled:b.trim().length<2||!j,onPress:()=>{r.repo.bookings.create({restaurantId:o,customerId:null,name:b.trim(),partySize:x,date:e,time:j,allergies:[],notes:w.trim(),security:x>=n.settings.savedCardFromParty?'saved-card':'none',depositPaid:0}),s()}})]})}},848,[12,104,245,255,109,787,860,796,794,849,795,797,790,861,6]);
|
| 4 |
+
__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STATUS",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"STAGES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"turnFor",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"startOf",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"durOf",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"endOf",{enumerable:!0,get:function(){return o}}),e.clashes=function(a,s=90){const n=new Set,i=a.filter(t=>d(t)&&t.table);for(let a=0;a<i.length;a++)for(let d=a+1;d<i.length;d++){const c=i[a],u=i[d];(0,t.tablesOf)(c.table).some(a=>(0,t.tablesOf)(u.table).includes(a))&&(l(c)<o(u,s)&&l(u)<o(c,s)&&(n.add(c.id),n.add(u.id)))}return n},e.floorView=function(a,s,n,i,d,u=90){const h={},y=s.filter(t=>t.date===b(d));for(const s of a.tables){const a=i[s.name]??{},b=y.filter(a=>(0,t.tablesOf)(a.table).includes(s.name)),F=b.find(t=>'seated'===t.status),p=b.filter(t=>'confirmed'===t.status).sort((t,a)=>t.time.localeCompare(a.time)).find(t=>f(d,t)>=-20),O=p?Math.round(f(d,p)):void 0,S=n.find(t=>'table'===t.type&&t.tableNo===s.name&&!['closed','cancelled','collected'].includes(t.status));let v='free';a.blocked?v='blocked':F?v=a.stage??'seated':a.dirty?v='dirty':S?v=a.stage??'seated':p&&void 0!==O&&O<=45&&(v='soon');const A=F,T=A?.tags?.find(t=>'VIP'===t)??A?.tags?.find(t=>'Regular'===t)??(A?void 0:p?.tags?.[0]);h[s.name]={table:s,status:v,booking:A,next:p,nextIn:O,covers:A?.partySize??0,orderOnly:!A&&!!S,note:a.note,seatedMins:A?Math.max(0,Math.round((d.getTime()-l(A).getTime())/6e4)):void 0,freeAt:A?o(A,u):void 0,allergy:!!(A?.allergies.length||!A&&p?.allergies.length||S?.allergies.length),vip:T,occasion:A?.occasion??(A?void 0:p?.occasion??c(p?.notes))??c(A?.notes)}}return h},Object.defineProperty(e,"OCCASION_ICON",{enumerable:!0,get:function(){return u}}),e.suggestTable=function(a,s,n,i,c,u,f=90,b){const h=[...a.tables.map(t=>({name:t.name,seats:t.maxSeats,min:t.minSeats,parts:[t.name]})),...a.joins.map(t=>{const s=a.tables.filter(a=>t.tables.includes(a.name));return{name:t.tables.join('+'),seats:s.reduce((t,a)=>t+a.maxSeats,0),min:s.reduce((t,a)=>t+a.minSeats,0),parts:t.tables}})],y=c.getTime()+6e4*u;let F=null;for(const a of h){if(a.seats<i)continue;if(n&&a.parts.some(t=>['blocked'].includes(n[t]?.status)))continue;const u=!!n&&a.parts.some(t=>['seated','mains','dessert','bill','dirty'].includes(n[t]?.status)),h=s.filter(s=>s.id!==b&&d(s)&&(0,t.tablesOf)(s.table).some(t=>a.parts.includes(t))&&l(s).getTime()<y&&o(s,f).getTime()>c.getTime()).length,p=(u?1e3:0)+100*h+10*(a.seats-i)+(i<a.min?5:0)+15*(a.parts.length-1);(!F||p<F.score)&&(F={table:a.name,seats:a.seats,clashes:h+(u?1:0),score:p,why:`${a.seats} seats${h||u?`, ${h+(u?1:0)} clash`:', no clashes'}`})}return F?{table:F.table,seats:F.seats,clashes:F.clashes,why:F.why}:null};var t=r(_d[0]);const a={free:{label:'Free',colour:'#2F7D45',fg:'#E7FBEA'},soon:{label:'Reserved soon',colour:'#3C78B5',fg:'#EAF4FF'},seated:{label:'Seated',colour:'#CFA45F',fg:'#0B0B0B'},mains:{label:'Mains',colour:'#E08A2E',fg:'#0B0B0B'},dessert:{label:'Dessert',colour:'#A77BD0',fg:'#0B0B0B'},bill:{label:'Bill requested',colour:'#D9473A',fg:'#FFFFFF'},dirty:{label:'Needs clearing',colour:'#7A6F5E',fg:'#FFFFFF'},blocked:{label:'Blocked',colour:'#3A3A3A',fg:'#CFCFCF'}},s=['seated','mains','dessert','bill'],n=(t,a=90)=>Math.min(a+60,a+15*Math.max(0,Math.ceil((t-2)/2))),l=t=>'seated'===t.status&&t.seatedAt?new Date(t.seatedAt):new Date(`${t.date}T${t.time}:00`),i=(t,a=90)=>t.durationMins??n(t.partySize,a),o=(t,a=90)=>new Date(l(t).getTime()+6e4*i(t,a)),d=t=>!['cancelled','noshow','finished'].includes(t.status);const c=t=>t?/birthday/i.test(t)?'birthday':/anniversary/i.test(t)?'anniversary':void 0:void 0,u={birthday:'\ud83c\udf82',anniversary:'\ud83d\udc8d',celebration:'\ud83e\udd42'},f=(t,a)=>(new Date(`${a.date}T${a.time}:00`).getTime()-t.getTime())/6e4,b=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},849,[861]);
|
| 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,"snap",{enumerable:!0,get:function(){return c}}),_e.FloorCanvas=function(e){const[x,f]=(0,t.useState)({w:0,h:0}),g=x.w?'width'===e.fit?Math.min(x.w/i.PLAN_W,e.maxH?e.maxH/i.PLAN_H:9):Math.min(x.w/i.PLAN_W,x.h/i.PLAN_H):0,v=e.plan.tables.filter(t=>t.areaId===e.areaId),[y,w]=(0,t.useState)(null),M=(0,t.useRef)(null),j=t=>e.plan.sections.find(e=>e.id===t.sectionId),R=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),C=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{M.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const i=M.current;if(!i)return;const s=n.nativeEvent.pageX-i.x,a=n.nativeEvent.pageY-i.y;Math.abs(s)+Math.abs(a)<6&&!y||('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&w({id:t.id,dx:s,dy:a,kind:o})},onResponderRelease:n=>{const s=M.current;M.current=null;const a=n.nativeEvent.pageX-(s?.x??0),l=n.nativeEvent.pageY-(s?.y??0);if(w(null),Math.abs(a)+Math.abs(l)<6||!g)return void('move'===o&&e.onTap?.(t));const u=a/g,h=l/g;if('edit'===e.mode&&'move'===o)e.onMove?.(t,b(c(t.x+u,e.snapOn),0,i.PLAN_W-t.w),b(c(t.y+h,e.snapOn),0,i.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,b(c(t.w+u,e.snapOn),50,400),b(c(t.h+h,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+u,n=t.y+t.h/2+h,i=v.find(e=>e.id!==t.id&&o>=e.x-10&&o<=e.x+e.w+10&&n>=e.y-10&&n<=e.y+e.h+10);i&&e.onDrop(t,i)}}}),I=e=>e*g,k='width'===e.fit?i.PLAN_H*g||200:void 0;return(0,u.jsx)(n.default,{testID:"floor-canvas",onLayout:e=>f({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:k}],children:g?(0,u.jsxs)(n.default,{style:{width:I(i.PLAN_W),height:I(i.PLAN_H),alignSelf:'center',backgroundColor:'#0F0E0C',borderRadius:16,borderWidth:1,borderColor:a.colours.border,overflow:'hidden'},children:['edit'===e.mode?Array.from({length:i.PLAN_W/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',left:I(t*i.GRID*2),top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},`v${t}`)):null,'edit'===e.mode?Array.from({length:i.PLAN_H/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',top:I(t*i.GRID*2),left:0,right:0,height:1,backgroundColor:'#1E1B16'}},`h${t}`)):null,e.plan.joins.map(e=>{const t=v.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,i]=t,s=o.x+o.w/2,a=o.y+o.h/2,l=i.x+i.w/2,h=i.y+i.h/2,c=Math.hypot(l-s,h-a),b=Math.atan2(h-a,l-s);return(0,u.jsx)(n.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:I((s+l)/2-c/2),top:I((a+h)/2)-3,width:I(c),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${b}rad`}]}},e.id)}),v.map(t=>{const i=e.view?.[t.name],c=i?s.STATUS[i.status]:null,b=y?.id===t.id,x=b&&'resize'===y.kind?Math.max(50,t.w+y.dx/g):t.w,f=b&&'resize'===y.kind?Math.max(50,t.h+y.dy/g):t.h,v=b&&'move'===y.kind?t.x+y.dx/g:t.x,w=b&&'move'===y.kind?t.y+y.dy/g:t.y,M=e.selected===t.id||e.highlight?.includes(t.name),k=j(t),z='edit'===e.mode?'#2A2419':c.colour,$='edit'===e.mode?a.colours.text:c.fg,A='round'===t.shape||'stool'===t.shape?I(Math.min(x,f)/2):I('booth'===t.shape?22:12),S=I(Math.min(x,f))<64,T=Math.max(11,Math.min(22,I(Math.min(x,f))/4)),_='edit'===e.mode?`Table ${t.name}, ${t.shape}, ${t.minSeats}\u2013${t.maxSeats} seats${t.online?', bookable online':''}`:`Table ${t.name}, ${c.label}${void 0!==i?.seatedMins?`, seated ${i.seatedMins} min`:''}${i?.covers?`, ${i.covers} covers`:''}${void 0!==i?.nextIn&&'seated'!==i.status?`, next booking ${i.next?.time}`:''}`,E=void 0!==i?.seatedMins&&i.booking?Math.min(1.2,i.seatedMins/(i.booking.durationMins??(0,s.turnFor)(i.booking.partySize,e.turnBase))):null;return(0,u.jsxs)(o.default.Fragment,{children:[p({...t,w:x,h:f}).map((t,o)=>(0,u.jsx)(n.default,{pointerEvents:"none",style:[{position:'absolute',left:I(v+t.x)-Math.max(4,I(8)),top:I(w+t.y)-Math.max(4,I(8)),width:Math.max(8,I(16)),height:Math.max(8,I(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?a.colours.gold:'rgba(255,255,255,0.25)'},h()]},o)),(0,u.jsxs)(n.default,{testID:`table-${t.name}`,accessibilityRole:"button",accessibilityLabel:_,...C(t,'move'),style:[{position:'absolute',left:I(v),top:I(w),width:I(x),height:I(f),borderRadius:A,backgroundColor:z,alignItems:'center',justifyContent:'center',padding:2,borderWidth:M?3:e.sectionColours&&k?2.5:1.5,borderColor:M?'#FFFFFF':e.sectionColours&&k?k.colour:'edit'===e.mode?a.colours.gold:'rgba(0,0,0,0.35)',borderTopWidth:'booth'===t.shape?I(18):void 0,transform:[{rotate:`${t.rot}deg`},{scale:b?1.06:1}],zIndex:b?50:1,opacity:b&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:b?.6:.3,shadowRadius:b?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},b?null:h()],children:[(0,u.jsxs)(n.default,{style:{alignItems:'center',transform:[{rotate:-t.rot+"deg"}]},pointerEvents:"none",children:[(0,u.jsx)(l.T,{weight:"bold",size:T,colour:$,center:!0,children:t.name}),'edit'===e.mode?S?null:(0,u.jsxs)(l.T,{size:11,colour:a.colours.muted,center:!0,children:[t.minSeats,"\u2013",t.maxSeats,t.online?' \xb7 online':'']}):i?(0,u.jsxs)(u.Fragment,{children:['free'!==i.status||S?null:(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[t.minSeats,"\u2013",t.maxSeats," seats"]}),void 0!==i.seatedMins?(0,u.jsxs)(l.T,{size:12,weight:"semibold",colour:$,center:!0,children:[i.seatedMins,"m \xb7 ",i.covers,"\ud83d\udc65"]}):i.orderOnly?(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Open order"}):null,'soon'===i.status&&i.next?(0,u.jsxs)(l.T,{size:11,weight:"semibold",colour:$,center:!0,children:[i.next.time," \xb7 ",i.nextIn<=0?'due':`${i.nextIn}m`]}):null,'dirty'!==i.status||S?null:(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Clear"}),!S||i.allergy||i.vip?(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[i.allergy?'\u26a0':'',i.vip?'VIP'===i.vip?'\u2605':'\u2665':'',i.occasion?s.OCCASION_ICON[i.occasion]:'',i.note?'\u270e':'']}):null]}):null]}),k&&'live'===e.mode&&e.sectionColours&&!S?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:k.colour,borderRadius:6,paddingHorizontal:3},children:(0,u.jsx)(l.T,{size:9,weight:"bold",colour:"#0B0B0B",children:k.server})}):null,null===E||S?null:(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',left:'15%',right:'15%',bottom:5,height:4,borderRadius:2,backgroundColor:'rgba(0,0,0,0.25)'},children:(0,u.jsx)(n.default,{style:{width:`${Math.min(100,100*E)}%`,height:4,borderRadius:2,backgroundColor:E>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),R(t)&&'edit'===e.mode?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,u.jsx)(l.T,{size:10,colour:a.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===t.id?(0,u.jsx)(n.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...C(t,'resize'),style:{position:'absolute',left:I(v+x)-14,top:I(w+f)-14,width:28,height:28,borderRadius:14,backgroundColor:a.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},t.id)}),0===v.length?(0,u.jsx)(n.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,u.jsxs)(l.T,{center:!0,colour:a.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 tap + Table':'',"."]})}):null]}):null})};var t=r(d[0]),o=e(t);r(d[1]);var n=e(r(d[2])),i=r(d[3]),s=r(d[4]),a=r(d[5]),l=r(d[6]),u=r(d[7]);const h=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),c=(e,t=!0)=>t?Math.round(e/i.GRID)*i.GRID:Math.round(e),b=(e,t,o)=>Math.max(t,Math.min(o,e));function p(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape||'stool'===e.shape){for(let n=0;n<t;n++){const i=2*Math.PI*n/t-Math.PI/2;o.push({x:e.w/2+Math.cos(i)*(e.w/2+11.2),y:e.h/2+Math.sin(i)*(e.h/2+11.2)})}return'stool'===e.shape?[]:o}if('booth'===e.shape){for(let n=0;n<t;n++)o.push({x:e.w*(n+.5)/t,y:e.h+9.6});return o}if('square'===e.shape&&t<=4){return[{x:e.w/2,y:-9.6},{x:e.w/2,y:e.h+9.6},{x:-9.6,y:e.h/2},{x:e.w+9.6,y:e.h/2}].slice(0,t)}const n=Math.ceil(t/2),i=t-n;for(let t=0;t<n;t++)o.push({x:e.w*(t+.5)/n,y:-9.6});for(let t=0;t<i;t++)o.push({x:e.w*(t+.5)/i,y:e.h+9.6});return o}},850,[12,104,109,861,849,797,790,6]);
|
| 6 |
+
__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.AreaTabs=p,_e.FloorEditor=function({rid:e,compact:s,maxH:j}){const f=(0,o.usePlan)(e),y=o.useFloor.getState,w=a=>y().setPlan(e,a),[k,S]=(0,a.useState)(f.areas[0]?.id??''),[T,R]=(0,a.useState)(null),[C,P]=(0,a.useState)(!0),[I,D]=(0,a.useState)(!1),[v,B]=(0,a.useState)(null),[z,M]=(0,a.useState)(''),[$,A]=(0,a.useState)(''),L=f.areas.some(e=>e.id===k)?k:f.areas[0]?.id??'',W=f.tables.find(e=>e.id===T)??null,_=a=>W&&y().updateTable(e,W.id,a),H=()=>{let e=1;const a=new Set(f.tables.map(e=>e.name));for(;a.has(String(e));)e++;return String(e)},F=(e,a)=>{for(let s=50;s+a<=o.PLAN_H;s+=50)for(let l=50;l+e<=o.PLAN_W;l+=50)if(!f.tables.some(t=>t.areaId===L&&l<t.x+t.w+25&&t.x<l+e+25&&s<t.y+t.h+25&&t.y<s+a+25))return{x:l,y:s};return{x:50,y:50}},N=e=>{if(!W||e.id===W.id)return;const a=f.joins.filter(a=>!a.tables.includes(W.name)&&!a.tables.includes(e.name)),s=Array.from(new Set([...f.joins.find(e=>e.tables.includes(W.name))?.tables??[W.name],...f.joins.find(a=>a.tables.includes(e.name))?.tables??[e.name]]));w({...f,joins:[...a,{id:(0,o.fid)('j'),tables:s}]}),D(!1),A(`Joined ${s.join('+')} \u2014 book it as one table.`)},V=W?f.joins.find(e=>e.tables.includes(W.name)):void 0,E=W&&f.tables.some(e=>e.id!==W.id&&e.name===W.name),q=W?(0,h.jsxs)(n.default,{testID:"table-tools",style:{gap:10,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(u.T,{weight:"semibold",colour:c.colours.gold,children:["Table ",W.name]}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Done",onPress:()=>R(null)})]}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Name / no."}),(0,h.jsx)(t.default,{accessibilityLabel:"Table name",value:W.name,onChangeText:e=>_({name:e.replace(/[^A-Za-z0-9-]/g,'').slice(0,6)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}),E?(0,h.jsx)(u.T,{size:13,colour:c.colours.red,children:"Another table already uses this number."}):null,(0,h.jsx)(u.Row,{wrap:!0,gap:6,children:o.SHAPES.map(e=>(0,h.jsx)(u.Chip,{label:e.label,selected:W.shape===e.id,onPress:()=>_({shape:e.id,w:x[e.id][0],h:x[e.id][1],...'stool'===e.id?{minSeats:1,maxSeats:1}:{}})},e.id))}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Min seats"}),(0,h.jsx)(u.Stepper,{value:W.minSeats,onChange:e=>_({minSeats:e,maxSeats:Math.max(e,W.maxSeats)}),min:1,max:20,label:"min seats"})]}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Max seats"}),(0,h.jsx)(u.Stepper,{value:W.maxSeats,onChange:e=>_({maxSeats:e,minSeats:Math.min(e,W.minSeats)}),min:1,max:24,label:"max seats"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f2 15\xb0",accessibilityLabel:"Rotate left",onPress:()=>_({rot:(W.rot-15+360)%360})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f3 15\xb0",accessibilityLabel:"Rotate right",onPress:()=>_({rot:(W.rot+15)%360}),testID:"rotate-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Bigger",onPress:()=>_({w:Math.min(400,W.w+25),h:Math.min(300,W.h+25)})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Smaller",onPress:()=>_({w:Math.max(50,W.w-25),h:Math.max(50,W.h-25)})})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Area"}),f.areas.map(e=>(0,h.jsx)(u.Chip,{label:e.name,selected:W.areaId===e.id,onPress:()=>{_({areaId:e.id}),S(e.id)}},e.id))]}),f.sections.length?(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Server section"}),f.sections.map(e=>(0,h.jsx)(u.Chip,{label:`${e.name} (${e.server})`,selected:W.sectionId===e.id,onPress:()=>_({sectionId:e.id})},e.id))]}):null,(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(n.default,{style:{flex:1},children:[(0,h.jsx)(u.T,{size:14,children:"Bookable online"}),(0,h.jsx)(u.Muted,{children:"For a later Wix Tables / booking-page mapping. Nothing is synced now."})]}),(0,h.jsx)(l.default,{accessibilityLabel:"Bookable online",value:W.online,onValueChange:e=>{_({online:e})},trackColor:{true:c.colours.gold,false:'#444'}})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,label:"Duplicate",onPress:()=>{if(!W)return;const a=F(W.w,W.h),s={...W,id:(0,o.fid)('t'),name:H(),x:a.x,y:a.y};y().addTable(e,s),R(s.id),A(`Duplicated as Table ${s.name}.`)},testID:"dup-table"}),V?(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:`Split ${V.tables.join('+')}`,onPress:()=>{w({...f,joins:f.joins.filter(e=>e.id!==V.id)}),A('Split back into separate tables.')},testID:"split-table"}):(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:I?'Tap a table to join\u2026':'Join with\u2026',onPress:()=>D(!I),testID:"join-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"danger",label:"Delete",onPress:()=>B({kind:'table'}),testID:"delete-table"})]})]}):null,O=(0,h.jsx)(b.FloorCanvas,{plan:f,areaId:L,mode:"edit",fit:"width",maxH:j,selected:T,snapOn:C,highlight:V?.tables,onTap:e=>{I?N(e):R(e.id===T?null:e.id)},onMove:(a,s,l)=>y().updateTable(e,a.id,{x:s,y:l}),onResize:(a,s,l)=>y().updateTable(e,a.id,{w:s,h:l})}),G=f.areas.find(e=>e.id===L),J=Object.fromEntries(f.areas.map(e=>[e.id,String(f.tables.filter(a=>a.areaId===e.id).length)]));return(0,h.jsxs)(n.default,{style:{gap:10},testID:"floor-editor",children:[(0,h.jsx)(p,{plan:f,area:L,onPick:e=>{S(e),R(null)},counts:J}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{label:"+ Table",onPress:()=>{const[a,s]=x.square,l=F(a,s),t={id:(0,o.fid)('t'),name:H(),areaId:L,shape:'square',minSeats:2,maxSeats:4,x:l.x,y:l.y,w:a,h:s,rot:0,online:!0,sectionId:f.sections[0]?.id};y().addTable(e,t),R(t.id),A(`Table ${t.name} added \u2014 drag it into place.`)},testID:"add-table",style:{minWidth:110}}),(0,h.jsxs)(u.Row,{gap:6,style:{paddingHorizontal:6},children:[(0,h.jsx)(l.default,{accessibilityLabel:"Snap to grid",value:C,onValueChange:P,trackColor:{true:c.colours.gold,false:'#444'}}),(0,h.jsx)(u.T,{size:14,children:"Snap to grid"})]})]}),$?(0,h.jsx)(u.T,{size:13,colour:c.colours.goldLight,children:$}):null,s?(0,h.jsxs)(h.Fragment,{children:[O,q]}):(0,h.jsxs)(u.Row,{gap:12,style:{alignItems:'flex-start'},children:[(0,h.jsx)(n.default,{style:{flex:1},children:O}),q?(0,h.jsx)(n.default,{style:{width:320},children:q}):null]}),W?null:(0,h.jsx)(u.Muted,{children:"Tap a table to edit it; drag to move (snaps to the grid); drag the gold dot to resize."}),(0,h.jsxs)(n.default,{style:{gap:6,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsx)(u.T,{weight:"semibold",colour:c.colours.gold,children:"Areas"}),G?(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Rename"}),(0,h.jsx)(t.default,{accessibilityLabel:"Area name",value:G.name,onChangeText:e=>w({...f,areas:f.areas.map(a=>a.id===G.id?{...a,name:e.slice(0,24)}:a)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}):null,(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(t.default,{accessibilityLabel:"New area name",placeholder:"New area, e.g. Function room",placeholderTextColor:"#7D776C",value:z,onChangeText:M,style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]}),(0,h.jsx)(u.Button,{small:!0,label:"+ Area",disabled:z.trim().length<2,onPress:()=>{const e={id:(0,o.fid)('a'),name:z.trim()};w({...f,areas:[...f.areas,e]}),S(e.id),M(''),R(null)},testID:"add-area"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Delete this area",disabled:f.areas.length<2,onPress:()=>B({kind:'area'}),testID:"delete-area"}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Reset to example layout",onPress:()=>B({kind:'reset'})})]}),(0,h.jsxs)(u.Muted,{children:[f.tables.length," tables \xb7 ",f.tables.reduce((e,a)=>e+a.maxSeats,0)," seats \xb7 ",f.tables.filter(e=>e.online).length," bookable online. Example layout made up for the demo; table numbers are the ones you'd match in Wix Tables later (not connected)."]})]}),v?(0,h.jsxs)(u.Sheet,{visible:!0,onClose:()=>B(null),title:'table'===v.kind?`Delete Table ${W?.name}?`:'area'===v.kind?`Delete ${G?.name}?`:'Reset the table plan?',testID:"confirm-sheet",children:[(0,h.jsx)(u.Muted,{children:'table'===v.kind?'It comes off the plan. Bookings keep their table number.':'area'===v.kind?`Its ${J[L]} table(s) move to ${f.areas.find(e=>e.id!==L)?.name}.`:'Puts back the example layout for this venue.'}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.Button,{kind:"danger",label:'reset'===v.kind?'Reset':'Delete',accessibilityLabel:'reset'===v.kind?'Reset':'Confirm delete',testID:"confirm-delete",onPress:()=>{if('table'===v.kind&&W&&(y().removeTable(e,W.id),R(null),A(`Table ${W.name} deleted.`)),'area'===v.kind){const e=f.areas.find(e=>e.id!==L);w({...f,areas:f.areas.filter(e=>e.id!==L),tables:f.tables.map(a=>a.areaId===L?{...a,areaId:e.id}:a)}),S(e.id)}'reset'===v.kind&&(y().resetPlan(e),R(null)),B(null)}}),(0,h.jsx)(u.Button,{kind:"secondary",label:"Cancel",onPress:()=>B(null)})]})]}):null]})};var a=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),t=e(r(d[3])),n=e(r(d[4])),o=r(d[5]),c=r(d[6]),u=r(d[7]),b=r(d[8]),h=r(d[9]);const x={round:[100,100],square:[100,100],rect:[175,100],booth:[200,125],stool:[75,75]};function p({plan:e,area:a,onPick:l,counts:t}){return(0,h.jsx)(u.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:e.areas.map(e=>{const n=e.id===a;return(0,h.jsx)(s.default,{testID:`area-${e.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${e.name}`,accessibilityState:{selected:n},onPress:()=>l(e.id),style:{minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:n?c.colours.gold:c.colours.border,backgroundColor:n?c.colours.gold:c.colours.surface,justifyContent:'center'},children:(0,h.jsxs)(u.T,{weight:"semibold",size:15,colour:n?c.colours.onGold:c.colours.text,children:[e.name,t?.[e.id]?(0,h.jsxs)(u.T,{size:12,colour:n?c.colours.onGold:c.colours.muted,children:[" ",t[e.id]]}):null]})},e.id)})})}},851,[12,245,253,255,109,861,797,790,850,6]);
|
| 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}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return b}}),_e.Timeline=function({plan:e,bookings:p,now:y,privacy:x,onOpen:j,turnBase:v,t0:C,t1:k,height:w}){const M=(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:e.name})))],[e]),T=p.filter(e=>!['cancelled','noshow'].includes(e.status)),R=(0,t.useMemo)(()=>(0,s.clashes)(T,v),[T,v]),z=Math.ceil((k.getTime()-C.getTime())/9e5),$=e=>(e.getTime()-C.getTime())/9e5*h,[_,B]=(0,t.useState)(null),O=(0,t.useRef)(null),E=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,$(y)-120);setTimeout(()=>E.current?.scrollTo({x:e,animated:!1}),50)},[]);const[S,W]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{O.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!O.current)return;const r=o.nativeEvent.pageX-O.current.x,n=o.nativeEvent.pageY-O.current.y;Math.abs(r)+Math.abs(n)>=6&&B({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=O.current;O.current=null,B(null);const l=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(l)+Math.abs(d)<6)return void('move'===t&&j(e));const c=Math.round(l/h);if('stretch'===t){const t=Math.max(30,(0,s.durOf)(e,v)+15*c);return n.repo.bookings.update(e.id,{durationMins:t}),void W(`${(0,u.privName)(e,x)} now ${t} min`)}const f=M.findIndex(t=>t.key===((0,i.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(M.length-1,f+Math.round(d/b))),p={};c&&'confirmed'===e.status&&(p.time=(0,a.hm)((0,a.addMins)((0,s.startOf)(e),15*c))),g!==f&&'__none'!==M[g].key&&(p.table=M[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),W(`${(0,u.privName)(e,x)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):c&&'confirmed'!==e.status&&W('Seated parties can move table, not time.')}}),I=$(y);return(0,c.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,c.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsxs)(d.Row,{gap:8,children:[(0,c.jsx)(d.Badge,{kind:R.size?'red':'green',label:R.size?`${R.size} bookings clash`:'No clashes'}),(0,c.jsx)(d.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})]}),(0,c.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${R.size}`,children:(0,c.jsx)(d.T,{size:13,colour:l.colours.goldLight,children:S})})]}),(0,c.jsx)(r.default,{style:{flex:w?void 0:1,height:w,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:l.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,c.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,c.jsxs)(r.default,{style:{width:f,borderRightWidth:1,borderColor:l.colours.border,backgroundColor:l.colours.surface},children:[(0,c.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:12,colour:l.colours.muted,children:"Table"})}),M.map((e,t)=>(0,c.jsxs)(r.default,{style:{height:b,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:l.colours.gold},children:[(0,c.jsx)(d.T,{size:14,weight:"semibold",children:'__none'===e.key?e.name:`T${e.name}`}),!e.area||0!==t&&M[t-1].area===e.area?null:(0,c.jsx)(d.T,{size:10,colour:l.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,c.jsx)(o.default,{ref:E,horizontal:!0,style:{flex:1},children:(0,c.jsxs)(r.default,{style:{width:z*h},children:[(0,c.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:l.colours.border},children:Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{style:{width:Math.min(4,z-4*t)*h,justifyContent:'center',borderLeftWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:11,colour:l.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,a.hm)((0,a.addMins)(C,60*t))})},t))}),M.map((e,t)=>{return(0,c.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:b,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:'rgba(207,164,95,0.4)'},children:[Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*h,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),(o=e.key,T.filter(e=>'__none'===o?!e.table:(0,i.tablesOf)(e.table).includes(o))).map(e=>{const t=_?.id===e.id?_:null,o=$((0,s.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(h,(0,s.durOf)(e,v)/15*h+('stretch'===t?.kind?t.dx:0)),i=R.has(e.id);return(0,c.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,u.privName)(e,x)}, ${e.partySize}, ${(0,a.hm)((0,s.startOf)(e))}, ${(0,s.durOf)(e,v)} min${i?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:g(e),borderWidth:i?2.5:1,borderColor:i?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?.55:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,c.jsxs)(d.T,{size:12,weight:"semibold",colour:'confirmed'===e.status?'#EAF4FF':'#0B0B0B',numberOfLines:1,children:[i?'\u26a0 ':'',(0,a.hm)((0,s.startOf)(e))," ",(0,u.privName)(e,x)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,c.jsx)(r.default,{testID:`tl-stretch-${e.id}`,accessibilityLabel:"Change length",...D(e,'stretch'),style:{position:'absolute',right:0,top:0,bottom:0,width:14,borderTopRightRadius:8,borderBottomRightRadius:8,backgroundColor:'rgba(0,0,0,0.25)',cursor:'ew-resize',touchAction:'none'}})]},e.id)})]},e.key);var o}),I>=0&&I<=z*h?(0,c.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:I,top:0,bottom:0,width:2,backgroundColor:l.colours.gold,zIndex:30},children:(0,c.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:l.colours.gold,borderRadius:6},children:(0,c.jsx)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,a.hm)(y)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),a=_r(_d[7]),l=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]);const h=30,b=44,f=96,g=e=>'seated'===e.status?'#CFA45F':'finished'===e.status?'#3A352C':e.walkIn?'#B9925A':'#3C78B5'},852,[12,104,133,109,796,861,849,795,797,790,853,6]);
|
| 8 |
+
__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 n}}),Object.defineProperty(e,"pv",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"privName",{enumerable:!0,get:function(){return l}});const n=n=>n.replace(' (example)','').split(/\s+/).filter(Boolean).map(n=>`${n[0].toUpperCase()}.`).join(' '),t=(t,l)=>t?l?n(t):t.replace(' (example)',''):'',l=(n,l)=>n.walkIn?`Walk-in ${n.ref}`:t(n.name,l)},853,[]);
|
| 9 |
+
__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Screensaver=function({rid:e,idleMins:t,pinOn:n,pin:i,tonightCards:s}){const[l,u]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),[p,f]=(0,o.useState)(''),h=(0,o.useRef)(Date.now()),w=(0,o.useRef)(!1),y=(0,o.useRef)(0);w.current=l;const b=6e4*t;(0,o.useEffect)(()=>{if(!x)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return w.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),y.current=n+800,w.current=!1,window.__ccWokeAt=n,u(!1),j.current&&d(!0),void(h.current=Date.now())):n<y.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(h.current=Date.now())},n=['pointerdown','pointerup','mousedown','mouseup','touchstart','touchend','click','keydown','wheel'];n.forEach(e=>window.addEventListener(e,t,{capture:!0,passive:!1}));const o=setInterval(()=>{!w.current&&!D.current&&Date.now()-h.current>=b&&(w.current=!0,u(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[b]);const j=(0,o.useRef)(n);j.current=n;const D=(0,o.useRef)(c);return D.current=c,(0,o.useEffect)(()=>{if(!x)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{}}},[]),c?(0,v.jsx)(k,{pin:i,entry:p,setEntry:f,onOk:()=>{d(!1),f(''),h.current=Date.now()}}):l?(0,v.jsx)(R,{rid:e,tonightCards:s}):null};var t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),i=e(r(_d[3])),s=e(r(_d[4])),l=e(r(_d[5]));r(_d[6]);var u=e(r(_d[7])),c=e(r(_d[8])),d=e(r(_d[9])),p=r(_d[10]),f=r(_d[11]),h=r(_d[12]),w=r(_d[13]),y=r(_d[14]),b=r(_d[15]),v=r(_d[16]);const x='undefined'!=typeof window;function j({w:e,h:t,seed:n}){const l=(0,o.useRef)(new i.default.Value(0)).current,u=e=>{const t=233280*Math.sin(9301*n+49297*e);return t-Math.floor(t)};(0,o.useEffect)(()=>{const e=i.default.loop(i.default.timing(l,{toValue:1,duration:9e3+9e3*u(1),delay:4e3*u(2),easing:s.default.linear,useNativeDriver:!1}));return e.start(),()=>e.stop()},[]);const c=3+5*u(3);return(0,v.jsx)(i.default.View,{pointerEvents:"none",style:{position:'absolute',left:u(4)*e,top:0,width:c,height:c,borderRadius:c,backgroundColor:w.colours.goldLight,shadowColor:w.colours.gold,shadowRadius:6,shadowOpacity:.9,opacity:l.interpolate({inputRange:[0,.15,.8,1],outputRange:[0,.85,.5,0]}),transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[t+20,t*(.15+.3*u(5))]})},{translateX:l.interpolate({inputRange:[0,.5,1],outputRange:[0,60*(u(6)-.5),0]})}]}})}function k({pin:e,entry:t,setEntry:n,onOk:o}){const i=i=>{const s=(t+i).slice(0,4);n(s),4===s.length&&(s===e?o():setTimeout(()=>n(''),300))};return(0,v.jsxs)(c.default,{testID:"wake-pin",style:{position:x?'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,v.jsx)(b.T,{size:22,weight:"semibold",colour:w.colours.gold,children:"Enter staff PIN"}),(0,v.jsxs)(b.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(4-t.length)]}),(0,v.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,v.jsx)(u.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>i(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,v.jsx)(b.T,{size:26,colour:w.colours.gold,children:e})},e))})]})}function R({rid:e,tonightCards:u}){const{width:k,height:R}=(0,d.default)(),D=(0,p.useNow)(1e3),I=(0,y.useBrand)(e),E=(0,f.useOwner)(e=>e.offers),C=(0,p.useEvents)(e),O=(0,t.useSpecials)(t=>t.current[e]??null),T=y.HERO_LOGOS[e]??I.logo,L=(0,o.useRef)(new i.default.Value(0)).current,z=(0,o.useRef)(new i.default.Value(0)).current,V=(0,o.useRef)(new i.default.ValueXY({x:0,y:0})).current;(0,o.useEffect)(()=>{i.default.timing(L,{toValue:1,duration:700,useNativeDriver:!1}).start();const e=i.default.loop(i.default.sequence([i.default.timing(z,{toValue:1,duration:14e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1}),i.default.timing(z,{toValue:0,duration:14e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1})]));e.start();const t=()=>i.default.timing(V,{toValue:{x:(Math.random()-.5)*k*.18,y:(Math.random()-.5)*R*.14},duration:6e3,easing:s.default.inOut(s.default.quad),useNativeDriver:!1}).start();t();const n=setInterval(t,2e4);return()=>{e.stop(),clearInterval(n)}},[]);const _=(0,h.ymd)(D),M=O&&(0,n.isToday)(O.postedAt,D)?O:null,S=(0,o.useMemo)(()=>[...M?[{k:'specials',tag:'TODAY\u2019S SPECIALS',title:M.items.length?M.items.slice(0,2).map(e=>e.name.replace(' (sample)','')).join(' \xb7 '):'Fresh on the board today',body:M.items.length?M.items.slice(2).map(e=>e.name.replace(' (sample)','')).join(' \xb7 ')||'Ask your server':'Ask your server about today\u2019s specials'}]:[],...E.filter(e=>e.live).slice(0,2).map(e=>({k:e.id,title:e.title.replace(' (example)',''),body:e.body})),...C.filter(e=>e.date===_).slice(0,1).map(e=>({k:e.id,title:e.title,body:e.description}))].slice(0,3),[E,C,_,M]),N=.42*Math.min(k,R);return(0,v.jsxs)(i.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:x?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#050505',opacity:L,overflow:'hidden',cursor:'pointer'},children:[Array.from({length:18},(e,t)=>(0,v.jsx)(j,{w:k,h:R,seed:t+1},t)),(0,v.jsxs)(i.default.View,{style:{flex:1,alignItems:'center',justifyContent:'center',gap:18,transform:[{translateX:V.x},{translateY:V.y}]},children:[T?(0,v.jsx)(i.default.View,{style:{transform:[{scale:z.interpolate({inputRange:[0,1],outputRange:[1,1.12]})},{translateX:z.interpolate({inputRange:[0,1],outputRange:[-10,10]})}]},children:(0,v.jsx)(l.default,{source:T,style:{width:N,height:N},resizeMode:"contain",accessibilityLabel:`${I.name} logo`})}):(0,v.jsx)(b.T,{size:48,weight:"bold",colour:w.colours.gold,children:I.name}),(0,v.jsx)(b.T,{size:Math.round(.26*N),weight:"semibold",colour:w.colours.text,style:{letterSpacing:4},children:(0,h.hm)(D)}),(0,v.jsx)(b.T,{size:18,colour:w.colours.muted,children:(0,h.niceDate)(D)}),u&&S.length?(0,v.jsx)(c.default,{testID:"tonight-cards",style:{flexDirection:'row',gap:14,flexWrap:'wrap',justifyContent:'center',maxWidth:.86*k},children:S.map(e=>(0,v.jsxs)(c.default,{testID:'specials'===e.k?'specials-card':void 0,style:{width:Math.min(300,.27*k),padding:14,borderRadius:16,borderWidth:1,borderColor:'rgba(207,164,95,0.5)',backgroundColor:'rgba(42,34,22,0.55)',gap:4},children:[(0,v.jsx)(b.T,{size:12,weight:"semibold",colour:w.colours.gold,children:e.tag??'TONIGHT'}),(0,v.jsx)(b.T,{size:17,weight:"semibold",numberOfLines:2,children:e.title}),(0,v.jsx)(b.T,{size:13,colour:w.colours.muted,numberOfLines:3,children:e.body})]},e.k))}):null]}),(0,v.jsx)(c.default,{style:{position:'absolute',bottom:18,left:0,right:0},children:(0,v.jsx)(b.T,{size:13,colour:"#6E675B",center:!0,children:"Touch anywhere to wake"})})]})}},854,[805,806,12,102,206,178,104,245,109,269,796,804,795,797,856,790,6]);
|
| 10 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Card",{enumerable:!0,get:function(){return y}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const r=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,m.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,p.jsxs)(a.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",colour:j.colours.gold,children:"NEXT HOUR"}),(0,p.jsxs)(l.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===r.length?(0,p.jsx)(o.Muted,{children:"No arrivals due in the next hour."}):null,r.map(({b:e,m:t})=>(0,p.jsxs)(a.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?j.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?j.colours.amber:'#3C78B5'},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",children:e.time}),(0,p.jsxs)(o.T,{size:13,children:[(0,i.privName)(e,s)," \xb7 ",e.partySize]}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,p.jsx)(o.T,{size:12,colour:t<0?j.colours.amber:j.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,p.jsx)(o.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,p.jsx)(o.T,{size:12,children:b.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,p.jsxs)(o.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(b.STATUS).map(e=>(0,p.jsxs)(o.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:b.STATUS[e].colour}}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:b.STATUS[e].label})]},e)),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc8d anniversary"})]})},_e.DetailsPanel=function({title:e,children:s,onClose:l}){const[r,a]=(0,t.useState)(20);return(0,t.useEffect)(()=>{const e=Date.now(),t=()=>a(20-Math.floor((Date.now()-e)/1e3)),s=setInterval(t,1e3),l=setTimeout(t,2e4);return()=>{clearInterval(s),clearTimeout(l)}},[]),(0,t.useEffect)(()=>{r<=0&&l()},[r]),(0,p.jsxs)(o.Sheet,{visible:!0,onClose:l,title:e,maxWidth:560,testID:"private-details",children:[(0,p.jsx)(o.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),s,(0,p.jsx)(o.Button,{kind:"secondary",label:"Close now",onPress:l})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return w}}),_e.TableSheet=function({rid:e,name:l,view:h,plan:x,todays:f,now:y,privacy:w,turnBase:v,onClose:T,onWalkIn:S,onMove:k,onDetails:$}){const C=h[l],M=c.useFloor.getState(),[z,I]=(0,t.useState)(!1),[B,D]=(0,t.useState)(C?.note??''),[P,R]=(0,t.useState)(!1);if(!C)return null;const A=C.booking,O=['seated','mains','dessert','bill'].includes(C.status),N=f.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,m.minsBetween)(y,(0,b.startOf)(e)))-Math.abs((0,m.minsBetween)(y,(0,b.startOf)(t)))),W=e=>e.partySize<=C.table.maxSeats,L=(0,b.turnFor)(C.covers||C.table.maxSeats,v);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:T,title:`Table ${l} \xb7 ${b.STATUS[C.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Badge,{kind:"neutral",label:`${C.table.minSeats}\u2013${C.table.maxSeats} seats`}),A?(0,p.jsx)(o.Badge,{kind:"gold",label:`${(0,i.privName)(A,w)} \xb7 ${A.partySize} \xb7 ${C.seatedMins}m`}):null,A?(0,p.jsx)(o.Badge,{kind:C.seatedMins>(0,b.durOf)(A,v)?'red':'neutral',label:`Turn ~${(0,b.durOf)(A,v)} min \xb7 free ~${(0,m.hm)((0,b.endOf)(A,v))} (est.)`}):(0,p.jsx)(o.Badge,{kind:"neutral",label:`Turn estimate for ${C.table.maxSeats}: ~${L} min`}),C.next?(0,p.jsx)(o.Badge,{kind:"blue",label:`Next: ${C.next.time} ${(0,i.privName)(C.next,w)} (${C.next.partySize})`}):null,C.allergy?(0,p.jsx)(o.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),O||'blocked'===C.status?null:(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{label:"Seat walk-in here",onPress:()=>{T(),S(l)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,p.jsx)(o.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>R(!P),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),P?(0,p.jsxs)(a.default,{style:{gap:6},children:[0===N.length?(0,p.jsx)(o.Muted,{children:"No bookings left to seat today."}):null,N.slice(0,8).map(t=>(0,p.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,i.privName)(t,w)} ${t.time}`,onPress:async()=>{await u.repo.bookings.update(t.id,{table:l}),await u.repo.bookings.setStatus(t.id,'seated'),(0,n.resetTableLive)(e,l),T()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:W(t)?j.colours.border:j.colours.amber,backgroundColor:j.colours.surface2},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[t.time," \xb7 ",(0,i.privName)(t,w)," \xb7 ",t.partySize,t.table?` \xb7 booked T${t.table}`:'',t.allergies.length?' \xb7 \u26a0':'']}),W(t)?null:(0,p.jsxs)(o.T,{size:12,colour:j.colours.amber,children:["Bigger than this table (",C.table.maxSeats," max)"]})]},t.id))]}):null,O?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{size:14,colour:j.colours.muted,children:"Course / status"}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:b.STAGES.map(t=>(0,p.jsx)(o.Chip,{label:b.STATUS[t].label,selected:C.status===t,onPress:()=>M.setLive(e,l,{stage:t})},t))}),(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{T(),k(l)},testID:"move-party"}):null,(0,p.jsx)(o.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{A&&await u.repo.bookings.setStatus(A.id,'finished'),M.setLive(e,l,{stage:void 0,dirty:!0}),T()}})]})]}):null,'dirty'===C.status?(0,p.jsx)(o.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{M.setLive(e,l,{dirty:!1}),T()},testID:"mark-clean"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,p.jsx)(o.Button,{kind:"secondary",label:'blocked'===C.status?'Unblock table':'Block table',onPress:()=>{M.setLive(e,l,{blocked:'blocked'!==C.status}),T()},testID:"block-table"}),(0,p.jsx)(o.Button,{kind:"ghost",label:C.note?'Edit note':'+ Note',onPress:()=>I(!z)}),A||C.next?(0,p.jsx)(o.Button,{kind:"ghost",label:"Guest details",onPress:()=>{T(),$(A??C.next)},testID:"guest-details"}):null]}),z?(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Table note",value:B,onChangeText:D,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[o.styles.input,{flex:1}]}),(0,p.jsx)(o.Button,{small:!0,label:"Save",onPress:()=>{M.setLive(e,l,{note:B.trim()||void 0}),I(!1)}})]}):null,w?(0,p.jsx)(o.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,x.joins.some(e=>e.tables.includes(l))?(0,p.jsxs)(o.Muted,{children:["Joins with ",x.joins.find(e=>e.tables.includes(l)).tables.filter(e=>e!==l).join(', ')," for bigger parties (book as ",x.joins.find(e=>e.tables.includes(l)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:l,plan:h,view:f,todays:w,waiting:v,now:T,privacy:S,busy:k,onToast:$}){const[C,M]=(0,t.useState)(''),[z,I]=(0,t.useState)(2),B=(0,c.useFloor)(e=>e.smsLog);return(0,p.jsxs)(y,{title:`Waitlist (${v.length})`,right:(0,p.jsxs)(o.Muted,{children:["new party ~",(0,x.estimateWait)(v.length+1,l.settings.turnMins,k)," min"]}),testID:"waitlist-panel",children:[0===v.length?(0,p.jsx)(o.Muted,{children:"Nobody waiting."}):null,v.map((t,s)=>{const r=(0,b.suggestTable)(h,w,f,t.partySize,T,(0,b.turnFor)(t.partySize,l.settings.turnMins)),y=(0,x.estimateWait)(s+1,l.settings.turnMins,k),v=Math.max(0,(0,m.minsBetween)(new Date(t.joinedAt),T)),C=B.find(s=>s.rid===e&&s.text.includes(`#${t.number} `));return(0,p.jsxs)(a.default,{style:{backgroundColor:j.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:["#",t.number," ",(0,i.pv)(t.name,S)," \xb7 ",t.partySize]}),(0,p.jsxs)(o.T,{size:12,colour:v>y?j.colours.amber:j.colours.muted,children:["waited ",v,"m \xb7 quoted ~",y,"m"]})]}),r?(0,p.jsxs)(o.T,{size:12,colour:r.clashes?j.colours.amber:j.colours.green,children:["Best table: ",r.table," (",r.why,")"]}):(0,p.jsx)(o.T,{size:12,colour:j.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Button,{small:!0,label:C||'notified'===t.status?'Re-send (demo)':'Table ready text (demo)',testID:`sms-${t.number}`,onPress:()=>{c.useFloor.getState().logSms(e,T.toISOString(),`#${t.number} ${t.partySize}: Your table at ${l.name} is ready.`),u.repo.waitlist.setStatus(t.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${l.name} is ready."`)}}),r?(0,p.jsx)(o.Button,{small:!0,kind:"success",label:`Seat at ${r.table}`,onPress:async()=>{await u.repo.waitlist.setStatus(t.id,'seated'),await u.repo.bookings.seatWalkIn(e,t.partySize,r.table,`From waitlist #${t.number}`),(0,n.resetTableLive)(e,r.table),$(`Waitlist #${t.number} seated at ${r.table}`)}}):null,(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>u.repo.waitlist.setStatus(t.id,'removed')})]}),'notified'===t.status?(0,p.jsx)(o.Badge,{kind:"green",label:`Told table ready${C?` ${(0,m.hm)(new Date(C.at))}`:''} (demo)`}):null]},t.id)}),(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[o.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,p.jsx)(s.default,{accessibilityLabel:"Waitlist party size",onPress:()=>I(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(o.T,{weight:"bold",colour:j.colours.gold,children:z})}),(0,p.jsx)(o.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{u.repo.waitlist.join(e,C.trim(),z),M('')}})]})]})},_e.PacePanel=function({r:e,fc:t,todays:s,now:l,walkInCount:r,staffOn:n,onSummary:i}){const u=r+s.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),c=l.getHours(),h=Math.round(t.hours.filter(e=>e.hour<c).reduce((e,t)=>e+t.covers,0)+(t.hours.find(e=>e.hour===c)?.covers??0)*(l.getMinutes()/60)),x=h?u/h:1,f=x>=1.1?j.colours.amber:x>=.85?j.colours.green:j.colours.blue,w=Array.from({length:8},(e,t)=>{const r=(0,m.addMins)(l,15*(t-4)-l.getMinutes()%15),a=(0,m.addMins)(r,15),o=s.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,b.startOf)(e);return t>=r&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:r,covers:o,future:t>=4}}),v=Math.max(4,Math.round(e.settings.capacityPerHour/4)),T=Math.max(v,...w.map(e=>e.covers)),S=w.filter(e=>e.future&&e.covers>v),k=t.nextHour?.covers??0,$=Math.ceil(k/16);return(0,p.jsxs)(y,{title:"Pace & kitchen",right:(0,p.jsx)(o.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,p.jsxs)(a.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${u} vs forecast ${h}`,style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{size:14,children:"Covers so far"}),(0,p.jsxs)(o.T,{weight:"bold",colour:f,children:[u," ",(0,p.jsxs)(o.T,{size:13,colour:j.colours.muted,children:["/ ~",h," forecast"]})]})]}),(0,p.jsx)(a.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,p.jsx)(a.default,{style:{width:`${Math.min(100,75*x)}%`,height:10,borderRadius:5,backgroundColor:f}})}),(0,p.jsxs)(o.Muted,{children:[x>=1.1?'Ahead of forecast':x>=.85?'On pace':'Behind forecast'," \xb7 next hour ~",t.nextHour?`${t.nextHour.coversLow}\u2013${t.nextHour.coversHigh}`:0," covers"]})]}),(0,p.jsx)(o.T,{size:13,colour:j.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,p.jsx)(a.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:w.map((e,t)=>(0,p.jsxs)(a.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,p.jsx)(o.T,{size:10,colour:j.colours.muted,children:e.covers||''}),(0,p.jsx)(a.default,{style:{width:'80%',height:Math.max(2,e.covers/T*40),borderRadius:3,backgroundColor:e.covers>v?j.colours.red:e.future?'#6B5A3A':j.colours.gold}}),(0,p.jsx)(o.T,{size:9,colour:4===t?j.colours.gold:j.colours.muted,children:(0,m.hm)(e.from)})]},t))}),S.map(e=>(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,m.hm)(e.from),"\u2013",(0,m.hm)((0,m.addMins)(e.from,15))," (pace ~",v,") \u2014 stagger seating if you can."]},e.from.getTime())),$>n?(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Next hour ~",k," covers with ",n," on: about ",$-n," more on the floor suggested."]}):(0,p.jsxs)(o.T,{size:13,colour:j.colours.green,children:["Staffing looks OK for the next hour (",n," on)."]}),(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"End-of-service summary",onPress:i,testID:"eos-open"})]})},_e.ServiceSummary=function({r:e,todays:t,orders:s,waitlistAll:l,walkInCount:r,onClose:a}){const n=t.filter(e=>['seated','finished'].includes(e.status)),i=n.reduce((e,t)=>e+t.partySize,0)+r,u=t.filter(e=>e.walkIn),h=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,m.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),b=s.reduce((e,t)=>e+t.paid,0),x=(0,c.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),j=(e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e}),(0,p.jsx)(o.T,{weight:"semibold",children:t})]},e);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[j('Covers served',String(i)),j('Bookings seated',`${n.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),j('Walk-ins',`${u.length} parties \xb7 ${u.reduce((e,t)=>e+t.partySize,0)+r} covers`),j('No-shows',String(t.filter(e=>'noshow'===e.status).length)),j('Average table time',h.length?`${Math.round(h.reduce((e,t)=>e+t,0)/h.length)} min`:'\u2014'),j('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),j('"Table ready" texts',`${x} (demo, none sent)`),j('Taken at the till/app',`${(0,f.gbp)(b)} (demo)`),(0,p.jsx)(o.Muted,{children:"Example data on this device. Nothing is sent anywhere."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return c.tablesOf}});var t=_r(d[0]);_r(d[1]);var s=e(_r(d[2])),l=e(_r(d[3])),r=e(_r(d[4])),a=e(_r(d[5])),o=_r(d[6]),n=_r(d[7]),i=_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]);const y=({title:e,right:t,children:s,testID:l})=>(0,p.jsxs)(a.default,{testID:l,style:{backgroundColor:j.colours.surface,borderRadius:14,borderWidth:1,borderColor:j.colours.border,padding:10,gap:6},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",colour:j.colours.gold,children:e}),t]}),s]});const w=e=>(0,p.jsxs)(a.default,{style:{gap:6},children:[(0,p.jsxs)(o.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,p.jsxs)(o.Muted,{children:[e.time," \xb7 ",e.table?`Table ${e.table}`:'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),e.notes?(0,p.jsxs)(o.T,{children:["Notes: ",e.notes]}):(0,p.jsx)(o.Muted,{children:"No notes."}),e.allergies.length?(0,p.jsx)(a.default,{style:{backgroundColor:j.colours.redBg,borderRadius:8,padding:8},children:(0,p.jsxs)(o.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')]})}):(0,p.jsx)(o.Muted,{children:"No allergies declared."}),(0,p.jsx)(o.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const v=!0},855,[12,104,245,133,255,109,790,848,853,796,861,791,849,795,844,793,797,6]);
|
display-app/_expo/static/js/web/index-0b8f656cbb4a0114badc145b4e012efb.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 S}});var l=_r(_d[0]),s=_r(_d[1]),t=e(_r(_d[2])),n=e(_r(_d[3])),r=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]),m=_r(_d[13]),f=_r(_d[14]),y=_r(_d[15]),x=_r(_d[16]),j=_r(_d[17]),k=_r(_d[18]);const w=[{id:'main',label:'Main menu'},{id:'specials',label:'Specials'},{id:'takeaway',label:'Takeaway'}];function S(){const{rid:e}=(0,l.useLocalSearchParams)(),S=(0,b.useRestaurant)(e),A=(0,b.useMenu)(e),P=(0,b.useCustomer)(),B=(0,b.useBasket)(),O=(0,b.useStore)(e=>e.startBasket),C=(0,b.useNow)(3e4),[R,T]=(0,s.useState)('All'),[M,$]=(0,s.useState)(null),[I,v]=(0,s.useState)(!1),[D,N]=(0,s.useState)(!1),[H,_]=(0,s.useState)('main'),L=(0,x.useSpecials)(l=>l.current[e]??null),F=!!L&&(0,j.isToday)(L.postedAt,C),W=(0,f.useOwner)(e=>e.offers.filter(e=>e.live).length),z=(0,b.useStore)(l=>l.stampCards.find(s=>s.restaurantId===e&&s.customerId===l.customer.id));if(!S)return(0,k.jsx)(i.Screen,{title:"Not found",children:(0,k.jsx)(i.T,{children:"Restaurant not found."})});const G=B.restaurantId===S.id&&'table'===B.mode,K=S.sections.length?S.sections:Array.from(new Set(A.map(e=>e.section))),Q=e=>!(e.soldOut||!e.signOff||null===e.price),Y=A.filter(e=>('All'===R||e.section===R)&&('takeaway'!==H||Q(e))),E=(0,u.hoursFor)(S,C),V=e=>()=>l.router.push(`/customer/${S.id}${e}`),q=[{icon:'\ud83e\udd61',label:'Takeaway',sub:'Order to collect',on:()=>{T('All'),_('takeaway'),G&&O(S.id,'takeaway')}},{icon:'\ud83d\udcf1',label:'Order at table',sub:'Scan the QR',on:()=>N(!0)},{icon:'\ud83d\udcc5',label:'Book a table',on:V('/book')},{icon:'\u23f3',label:'Waitlist',sub:'Walk in',on:V('/waitlist')},{icon:'\u2b50',label:'Stamp card',sub:`${z?.stamps??0} of ${S.settings.stampTarget}`,on:V('/loyalty')},{icon:'\ud83e\udd1d',label:'Bring a friend',on:V('/refer')},{icon:'\ud83c\udf81',label:'Gift cards',on:V('/gift')},{icon:'\u26a0\ufe0f',label:'My allergens',sub:P.allergies.length?`${P.allergies.length} declared`:'None declared',on:()=>l.router.push('/customer/profile')},{icon:'\ud83c\udff7\ufe0f',label:'Offers',sub:P.marketingOptIn[S.id]?'Opted in':'Opt in',on:V('/offers'),badge:W?String(W):void 0},{icon:'\ud83c\udf89',label:"What's on",on:V('/whatson')},{icon:'\ud83d\udcac',label:'Feedback',sub:'Private',on:V('/feedback')},{icon:'\ud83e\udde3',label:'Lost property',on:V('/lost')},{icon:'\ud83d\udecd\ufe0f',label:'Shop',sub:'Merch',on:V('/merch')}];return(0,k.jsxs)(i.Screen,{title:S.name,subtitle:`${S.location}${S.phone?` \xb7 ${S.phone}`:''}`,back:'customer'!==m.APP_VARIANT,right:(0,k.jsxs)(i.Row,{children:[(0,k.jsx)(o.BasketButton,{}),(0,k.jsx)(i.Button,{small:!0,kind:"ghost",label:"Account",onPress:()=>l.router.push('/customer/profile')})]}),children:[S.fictional?(0,k.jsx)(i.Banner,{kind:"warn",title:"Fictional demo restaurant",children:"Shown only to demonstrate multi-restaurant support."}):null,G?(0,k.jsx)(i.Banner,{kind:"success",title:`Ordering at Table ${B.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,k.jsx)(i.Card,{children:(0,k.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsxs)(n.default,{style:{flex:1},children:[(0,k.jsx)(i.T,{weight:"semibold",children:"Takeaway \u2014 collection"}),(0,k.jsxs)(i.Muted,{children:[E?`Kitchen today ${S.kitchenHours[C.getDay()][0]}\u2013${S.kitchenHours[C.getDay()][1]}`:'Kitchen closed today',S.settings.takeawayPaused?' \xb7 slots paused by the restaurant':'']})]}),(0,k.jsx)(i.Badge,{kind:S.settings.takeawayPaused||!E?'amber':'green',label:S.settings.takeawayPaused?'Paused':E?'Taking orders':'Closed'})]})}),S.fictional?(0,k.jsx)(i.Row,{wrap:!0,gap:8,children:q.slice(2,7).map(e=>(0,k.jsx)(i.Button,{small:!0,kind:"secondary",label:e.label,onPress:e.on},e.label))}):(0,k.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:q.map(e=>(0,k.jsx)(p.HubTile,{icon:e.icon,label:e.label,sub:e.sub,badge:e.badge,onPress:e.on},e.label))}),G?(0,k.jsx)(i.Button,{small:!0,kind:"danger",label:"Call staff",onPress:()=>v(!0)}):null,I?(0,k.jsx)(i.Banner,{kind:"success",children:"A member of staff is on their way to your table (demo)."}):null,S.hoursNote?(0,k.jsx)(i.Muted,{children:S.hoursNote}):null,S.fictional?null:(0,k.jsx)(i.ExampleAllergenNotice,{}),(0,k.jsx)(i.Muted,{children:"Menu dishes and prices from The Anchorage\u2019s public menu (PDF). Items marked \u26a0 conflict with your declared allergies."}),(0,k.jsx)(n.default,{accessibilityRole:"tablist",testID:"menu-tabs",style:{flexDirection:'row',gap:6,backgroundColor:h.colours.surface,borderRadius:14,borderWidth:1,borderColor:h.colours.border,padding:4},children:w.map(e=>{const l=H===e.id;return(0,k.jsxs)(t.default,{testID:`menu-tab-${e.id}`,accessibilityRole:"tab",accessibilityState:{selected:l},"aria-selected":l,accessibilityLabel:'specials'===e.id&&F?'Specials, updated today':e.label,onPress:()=>_(e.id),style:{flex:1,minHeight:44,borderRadius:10,alignItems:'center',justifyContent:'center',paddingHorizontal:4,backgroundColor:l?h.colours.gold:'transparent'},children:[(0,k.jsx)(i.T,{size:14,weight:"semibold",colour:l?h.colours.onGold:h.colours.text,center:!0,children:e.label}),'specials'===e.id&&F&&!l?(0,k.jsx)(n.default,{style:{position:'absolute',top:6,right:8,width:7,height:7,borderRadius:4,backgroundColor:h.colours.gold}}):null]},e.id)})}),'specials'===H?(0,k.jsx)(y.SpecialsTab,{rid:S.id,declared:P.allergies,now:C}):null,'takeaway'===H?(0,k.jsx)(i.Muted,{children:"Order to collect. Only dishes available to order online are shown; pick a collection slot at checkout."}):null,'specials'!==H?(0,k.jsxs)(i.Row,{wrap:!0,gap:6,children:[(0,k.jsx)(i.Chip,{label:"All",selected:'All'===R,onPress:()=>T('All')}),K.map(e=>(0,k.jsx)(i.Chip,{label:e,selected:R===e,onPress:()=>T(e)},e))]}):null,'specials'!==H?K.filter(e=>('All'===R||e===R)&&Y.some(l=>l.section===e)).map(e=>(0,k.jsxs)(n.default,{style:{gap:10},children:[(0,k.jsx)(i.H2,{style:{color:h.colours.gold,marginTop:6},children:e}),Y.filter(l=>l.section===e).map(e=>{const s=(0,d.conflictsFor)(e.allergens,P.allergies),o=e.soldOut||!e.signOff||null===e.price;return(0,k.jsxs)(i.Card,{highlight:s.contains.length?h.colours.red:s.may.length?h.colours.amber:void 0,children:[(0,k.jsxs)(t.default,{accessibilityRole:"button",onPress:()=>{B.restaurantId&&B.restaurantId===S.id||O(S.id,'takeaway'),l.router.push(`/customer/${S.id}/dish/${e.id}`)},children:[(0,k.jsxs)(i.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,k.jsx)(i.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,k.jsx)(i.T,{weight:"semibold",colour:h.colours.gold,children:null===e.price?e.priceNote??'\u2014':(0,c.gbp)(e.price)})]}),(0,k.jsx)(i.Muted,{numberOfLines:2,children:e.description})]}),(0,k.jsxs)(i.Row,{wrap:!0,gap:6,children:[e.dietary.map(e=>(0,k.jsx)(i.Badge,{kind:"green",label:e},e)),e.special?(0,k.jsx)(i.Badge,{kind:"gold",label:"Special"}):null,e.soldOut?(0,k.jsx)(i.Badge,{kind:"neutral",label:"Sold out"}):null,e.signOff?null:(0,k.jsx)(i.Badge,{kind:"amber",label:"Awaiting allergen sign-off"}),s.contains.length?(0,k.jsx)(i.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):s.may.length?(0,k.jsx)(i.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null]}),(0,k.jsx)(r.AllergenChips,{map:e.allergens,declared:P.allergies}),M===e.id?(0,k.jsx)(r.AllergenPanel,{item:e,map:e.allergens,declared:P.allergies}):null,(0,k.jsxs)(i.Row,{gap:8,children:[(0,k.jsx)(i.Button,{small:!0,kind:"ghost",label:M===e.id?'Hide allergen panel':'Allergen panel',onPress:()=>$(M===e.id?null:e.id)}),(0,k.jsx)(n.default,{style:{flex:1}}),(0,k.jsx)(i.Button,{small:!0,label:o?e.soldOut?'Sold out':'Not available online':'Choose',disabled:o,onPress:()=>{B.restaurantId&&B.restaurantId===S.id||O(S.id,'takeaway'),l.router.push(`/customer/${S.id}/dish/${e.id}`)}})]})]},e.id)})]},e)):null,(0,k.jsx)(i.Muted,{children:"Drinks list coming soon. Ask your server for today\u2019s drinks."}),(0,k.jsx)(i.Muted,{children:"All payments in this app are demo only: Demo, no real payment."}),(0,k.jsx)(p.LauncherLine,{}),(0,k.jsxs)(i.Sheet,{visible:D,onClose:()=>N(!1),title:"Order at your table",children:[(0,k.jsx)(i.Muted,{children:"Scan the QR code on your table with your phone camera, or pick your table number (demo)."}),(0,k.jsx)(i.Row,{wrap:!0,gap:6,children:Array.from({length:12},(e,l)=>String(l+1)).map(e=>(0,k.jsx)(i.Button,{small:!0,kind:"secondary",label:`Table ${e}`,onPress:()=>{N(!1),O(S.id,'table',e)}},e))}),(0,k.jsx)(i.Muted,{children:"Orders go straight to the kitchen. You pay from your order page (Demo, no real payment)."})]})]})}},763,[785,12,245,109,798,799,790,791,793,792,796,797,803,787,804,801,805,806,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"photoSource",{enumerable:!0,get:function(){return C}}),_e.BoardPhoto=T,_e.PhotoZoom=k,_e.SpecialRow=M,_e.SpecialsTab=function({rid:e,declared:s,now:l}){const n=(0,p.useSpecials)(t=>t.current[e]??null),[o,u]=(0,t.useState)(null);if(!n)return(0,b.jsx)(h.Card,{children:(0,b.jsxs)(c.default,{testID:"specials-empty",style:{alignItems:'center',gap:6,paddingVertical:18},children:[(0,b.jsx)(h.T,{size:34,children:"\ud83e\uddd1\u200d\ud83c\udf73"}),(0,b.jsx)(h.T,{weight:"semibold",size:18,center:!0,children:"Today\u2019s specials are on their way"}),(0,b.jsx)(h.Muted,{center:!0,children:"The kitchen posts the specials board here as soon as it\u2019s written up. Check back soon, or ask a member of staff."})]})});const f=n.allergenCheck;return(0,b.jsxs)(c.default,{style:{gap:10},testID:"specials-tab",children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,b.jsx)(c.default,{testID:"specials-updated",style:{flex:1},children:(0,b.jsx)(h.T,{weight:"semibold",colour:j.colours.goldLight,children:(0,x.freshness)(n,l)})}),(0,x.isToday)(n.postedAt,l)?(0,b.jsx)(h.Badge,{kind:"green",label:"Today"}):(0,b.jsx)(h.Badge,{kind:"amber",label:"Not updated today"})]}),(0,x.isToday)(n.postedAt,l)?null:(0,b.jsx)(h.Muted,{children:"These are the most recent specials posted. Today\u2019s may differ, so please ask."}),n.photo?(0,b.jsxs)(c.default,{style:{gap:4},children:[(0,b.jsx)(T,{photo:n.photo,testID:"specials-photo",onPress:()=>u(n.photo)}),(0,b.jsx)(h.Muted,{center:!0,children:"Tap the photo to zoom"})]}):null,n.items.map(e=>(0,b.jsx)(M,{it:e,declared:s,signedBy:f?.by},e.id)),f?(0,b.jsxs)(h.Muted,{children:["Allergens for the typed specials were checked by ",f.by.replace(' (example)','')," at ",(0,y.hm)(new Date(f.at)),". Example data in this prototype."]}):null,n.photo&&!n.items.length?(0,b.jsx)(h.Muted,{children:"For allergens in these specials, please ask a member of staff before you order."}):null,(0,b.jsx)(h.Muted,{children:"Specials are served in the restaurant while they last. Ask your server to order one."}),(0,b.jsx)(k,{photo:o,onClose:()=>u(null)})]})};var t=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),n=e(r(d[3])),o=e(r(d[4])),c=e(r(d[5])),u=r(d[6]),h=r(d[7]),p=r(d[8]),f=r(d[9]),x=r(d[10]),y=r(d[11]),j=r(d[12]),b=r(d[13]);const w=r(d[14]),C=e=>e===x.SAMPLE_PHOTO?w:{uri:e};function T({photo:e,width:l,onPress:o,testID:u,label:h="Photo of the specials board"}){const[p,f]=(0,t.useState)(.75);(0,t.useEffect)(()=>{e!==x.SAMPLE_PHOTO?s.default.getSize(e,(e,t)=>e&&t&&f(e/t),()=>{}):f(.75)},[e]);const y=(0,b.jsx)(s.default,{source:C(e),resizeMode:"contain",accessibilityLabel:h,style:{width:l??'100%',aspectRatio:p,borderRadius:12,backgroundColor:'#1b1f1d'}});return o?(0,b.jsx)(n.default,{testID:u,accessibilityRole:"button",accessibilityLabel:`${h}. Tap to zoom`,onPress:o,children:y}):(0,b.jsx)(c.default,{testID:u,children:y})}function k({photo:e,onClose:s}){const[u,p]=(0,t.useState)(!1);return(0,t.useEffect)(()=>p(!1),[e]),(0,b.jsx)(l.default,{visible:!!e,transparent:!0,animationType:"fade",onRequestClose:s,children:(0,b.jsxs)(c.default,{testID:"specials-zoom",style:{flex:1,backgroundColor:'rgba(5,5,5,0.97)'},children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between',padding:12},children:[(0,b.jsx)(h.Button,{small:!0,kind:"secondary",label:u?'Zoom out':'Zoom in',onPress:()=>p(!u)}),(0,b.jsx)(h.Button,{small:!0,label:"Close",accessibilityLabel:"Close photo",onPress:s})]}),(0,b.jsx)(o.default,{horizontal:u,contentContainerStyle:{padding:12,alignItems:'center',justifyContent:'center',flexGrow:1},children:(0,b.jsx)(o.default,{contentContainerStyle:{alignItems:'center'},children:e?(0,b.jsx)(n.default,{onPress:()=>p(!u),accessibilityLabel:u?'Zoom out':'Zoom in',children:(0,b.jsx)(T,{photo:e,width:u?820:360})}):null})})]})})}function M({it:e,declared:t,signedBy:s}){const l=(0,f.conflictsFor)(e.allergens,t);return(0,b.jsx)(h.Card,{highlight:l.contains.length?j.colours.red:l.may.length?j.colours.amber:void 0,children:(0,b.jsxs)(c.default,{testID:"special-item",style:{gap:6},children:[(0,b.jsxs)(h.Row,{style:{justifyContent:'space-between',alignItems:'flex-start'},children:[(0,b.jsx)(h.T,{weight:"semibold",style:{flex:1,paddingRight:8},children:e.name}),(0,b.jsx)(h.T,{weight:"semibold",colour:j.colours.gold,children:(0,x.priceText)(e.price)})]}),e.description?(0,b.jsx)(h.Muted,{children:e.description}):null,l.contains.length?(0,b.jsx)(h.Badge,{kind:"red",label:"\u26a0 Contains your allergen"}):l.may.length?(0,b.jsx)(h.Badge,{kind:"amber",label:"\u26a0 May contain your allergen"}):null,e.noAllergens&&!Object.keys(e.allergens).length?(0,b.jsx)(h.Muted,{children:"None of the 14 allergens listed"}):(0,b.jsx)(u.AllergenChips,{map:e.allergens,declared:t}),s?(0,b.jsxs)(h.Muted,{children:["Allergens checked by ",s.replace(' (example)','')]}):null]})})}},801,[12,178,238,245,133,109,798,790,805,791,806,795,797,6,802]);
|
| 3 |
+
__d(function(g,r,i,a,m,e,d){"use strict";m.exports={uri:"/display-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg",width:900,height:1200,toString(){return this.uri}}},802,[]);
|
display-app/_expo/static/js/web/index-19e91eebe2265fb3fefa525477cea205.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
display-app/_expo/static/js/web/index-40f95cd6322320cbf9524c02b0284dba.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e=_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]);function x(){const r=(0,u.useStore)(e=>e.restaurants),s=(0,u.useCustomer)(),x=(0,u.useNow)(3e4);return(0,j.jsxs)(l.Screen,{title:"Restaurants",subtitle:"Book, order and pay at local restaurants",right:(0,j.jsxs)(l.Row,{children:[(0,j.jsx)(n.BasketButton,{}),(0,j.jsx)(l.Button,{small:!0,kind:"ghost",label:"Profile",onPress:()=>e.router.push('/customer/profile')})]}),children:[(0,j.jsxs)(l.Card,{onPress:()=>e.router.push('/customer/profile'),children:[(0,j.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.T,{weight:"semibold",children:["Hello, ",s.name.split(' ')[0]]}),(0,j.jsx)(l.Muted,{children:"Edit profile \u203a"})]}),(0,j.jsx)(l.Muted,{children:"Your allergies (stored once, confirmed on every order and booking):"}),(0,j.jsx)(l.Row,{wrap:!0,gap:6,children:s.allergies.length?s.allergies.map(e=>(0,j.jsx)(l.Badge,{kind:"red",label:`${(0,o.allergenLabel)(e.allergen)} \u2014 ${(0,o.severityLabel)(e.severity)}`},e.allergen)):(0,j.jsx)(l.Muted,{children:"None declared"})})]}),r.map(r=>{const s=(0,a.hoursFor)(r,x);return(0,j.jsxs)(l.Card,{onPress:()=>e.router.push(`/customer/${r.id}`),highlight:'anchorage'===r.id?c.colours.gold:void 0,children:[(0,j.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(l.H2,{style:{flex:1},children:r.name}),r.fictional?(0,j.jsx)(l.Badge,{kind:"amber",label:"FICTIONAL DEMO"}):(0,j.jsx)(l.Badge,{kind:"gold",label:"PILOT"})]}),(0,j.jsx)(l.Muted,{children:r.tagline}),(0,j.jsx)(l.Muted,{children:r.location}),(0,j.jsx)(l.T,{size:14,colour:s?c.colours.green:c.colours.amber,children:s?`Kitchen today ${r.kitchenHours[x.getDay()][0]}\u2013${r.kitchenHours[x.getDay()][1]}`:'Kitchen closed today (hours not listed)'})]},r.id)}),(0,j.jsx)(l.Banner,{kind:"info",children:"Each restaurant has its own menu, stamp card and gift cards. Saltmarsh Kitchen and Brae Bakehouse are fictional."}),(0,j.jsx)(h.LauncherLine,{}),(0,j.jsx)(t.default,{style:{height:8}})]})}},772,[785,12,109,799,790,791,792,796,797,803,6]);
|
display-app/_expo/static/js/web/index-f4304d490b72825b88900169751ec98b.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return'owner'!==u.APP_VARIANT?(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]}):(0,c.jsx)(n.OwnerApp,{})}},780,[785,12,865,787,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OwnerApp=function(){return null}},865,[]);
|
display-app/_expo/static/js/web/lost-254ada7b9fc10346689d98d894e24ca3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),r=_r(d[3]),l=_r(d[4]),o=_r(d[5]);function u(){const{rid:u}=(0,t.useLocalSearchParams)(),h=(0,r.useRestaurant)(u),c=(0,r.useCustomer)(),x=(0,r.useNow)(6e4),j=(0,l.useOwner)(t=>t.lost),p=(0,l.useOwner)(t=>t.lostReports),[f,w]=(0,n.useState)(''),[y,b]=(0,n.useState)(''),[S,C]=(0,n.useState)(''),[R,O]=(0,n.useState)(!1);if(!h)return(0,o.jsx)(s.Screen,{title:"Not found",children:(0,o.jsx)(s.T,{children:"Restaurant not found."})});const T=p.filter(t=>t.contact.includes(c.email));return(0,o.jsxs)(s.Screen,{title:"Lost property",subtitle:h.name,children:[(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Recently handed in"}),j.filter(t=>'held'===t.status).map(t=>(0,o.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,o.jsx)(s.T,{style:{flex:1},children:t.item}),(0,o.jsx)(s.Muted,{children:t.foundAt.slice(0,10)})]},t.id)),j.some(t=>'held'===t.status)?null:(0,o.jsx)(s.Muted,{children:"Nothing handed in right now."}),(0,o.jsx)(s.Muted,{children:"To collect, bring ID or describe the item to staff. Items are kept for 3 months."})]}),R?(0,o.jsxs)(s.Banner,{kind:"success",children:["Report sent to ",h.name,". They'll be in touch if it turns up (demo: nothing is sent)."]}):null,(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Lost something?"}),(0,o.jsx)(s.Field,{label:"What did you lose?",value:f,onChangeText:w,placeholder:"e.g. Grey scarf"}),(0,o.jsx)(s.Field,{label:"When were you in?",value:y,onChangeText:b,placeholder:"e.g. Saturday evening"}),(0,o.jsx)(s.Field,{label:"Where were you sitting? (optional)",value:S,onChangeText:C,placeholder:"e.g. By the window"}),(0,o.jsxs)(s.Muted,{children:["We'll share your name and email (",c.email,") with ",h.name," for this report only."]}),(0,o.jsx)(s.Button,{label:"Send report",disabled:f.trim().length<2||y.trim().length<2,onPress:()=>{l.useOwner.getState().setOwner({lostReports:[{id:`lr-${Date.now()}`,item:f.trim(),when:y.trim(),where:S.trim()||'Not sure',contact:`${c.name} \xb7 ${c.email}`,at:x.toISOString(),status:'open'},...l.useOwner.getState().lostReports]}),w(''),b(''),C(''),O(!0)}})]}),T.length?(0,o.jsxs)(s.Card,{children:[(0,o.jsx)(s.H2,{children:"Your reports"}),T.map(t=>(0,o.jsxs)(s.Row,{style:{justifyContent:'space-between'},children:[(0,o.jsxs)(s.T,{style:{flex:1},children:[t.item," \xb7 ",t.when]}),(0,o.jsx)(s.Badge,{kind:'matched'===t.status?'green':'open'===t.status?'amber':'neutral',label:'matched'===t.status?'Found!':'open'===t.status?'Looking':'Closed'})]},t.id))]}):null]})}},764,[785,12,790,796,804,6]);
|
display-app/_expo/static/js/web/loyalty-b4cf2f88c2062e44f0bc0b1af86851e7.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var e=_r(d[0]);_r(d[1]);var r,s=_r(d[2]),t=(r=s)&&r.__esModule?r:{default:r},i=_r(d[3]),n=_r(d[4]),o=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]);function h(){const{rid:r}=(0,e.useLocalSearchParams)(),s=(0,l.useRestaurant)(r),h=(0,l.useCustomer)(),p=(0,l.useStampCard)(r);if(!s)return(0,u.jsx)(n.Screen,{title:"Not found",children:(0,u.jsx)(n.T,{children:"Restaurant not found."})});const f=s.settings.stampTarget,j=p?.stamps??0;return(0,u.jsxs)(n.Screen,{title:"Stamp card",subtitle:`${s.name} \u2014 this card is just for ${s.name}`,children:[(0,u.jsxs)(n.Card,{highlight:c.colours.gold,children:[(0,u.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,u.jsxs)(n.H2,{children:[j," of ",f," stamps"]}),(0,u.jsxs)(n.T,{colour:c.colours.gold,weight:"semibold",children:["Reward: ",s.settings.stampReward]})]}),(0,u.jsx)(t.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:10,justifyContent:'center',paddingVertical:8},children:Array.from({length:f}).map((e,r)=>(0,u.jsx)(t.default,{accessibilityLabel:r<j?'Stamp collected':'Empty stamp',style:{width:52,height:52,borderRadius:26,borderWidth:2,borderColor:c.colours.gold,backgroundColor:r<j?c.colours.gold:'transparent',alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(n.T,{size:22,colour:r<j?c.colours.onGold:c.colours.border,children:"\u2605"})},r))}),(0,u.jsxs)(n.Muted,{children:["One stamp per paid visit or order over ",(0,o.gbp)(s.settings.stampMinSpend)," \u2014 dine-in, table QR or takeaway. Rewards are funded by ",s.name,"."]}),p?.rewardsAvailable?(0,u.jsx)(n.Banner,{kind:"success",title:`${p.rewardsAvailable} reward${p.rewardsAvailable>1?'s':''} ready: ${s.settings.stampReward}`,children:(0,u.jsx)(n.Button,{small:!0,label:"Use reward (show staff)",onPress:()=>l.repo.loyalty.redeemReward(s.id,h.id)})}):null]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Show this to staff"}),(0,u.jsx)(n.Muted,{children:"Staff scan this on the tablet to add a stamp for dine-in visits not paid by table QR."}),(0,u.jsx)(i.QR,{value:`covercharge:stamp:${s.id}:${h.id}`,size:190}),(0,u.jsx)(n.T,{center:!0,weight:"semibold",children:h.name})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"Bring a friend"}),(0,u.jsx)(n.T,{children:"Your referral code"}),(0,u.jsx)(n.T,{size:28,weight:"bold",colour:c.colours.gold,center:!0,children:h.referralCode}),(0,u.jsx)(n.Muted,{children:"When a friend completes their first qualifying paid visit or order, you both get a stamp. One referral reward per new account, phone and card; monthly cap applies."})]}),(0,u.jsxs)(n.Card,{children:[(0,u.jsx)(n.H2,{children:"History"}),(p?.history??[]).length?p.history.slice(0,10).map((e,r)=>(0,u.jsxs)(n.Muted,{children:[e.at.slice(0,10)," \xb7 ",e.source]},r)):(0,u.jsx)(n.Muted,{children:"No stamps yet."})]}),(0,u.jsx)(n.Muted,{children:"Rewards are kept on food (Scottish licensing rules restrict drinks promotions). Stamps are never given for reviews."})]})}},765,[785,12,109,807,790,793,796,797,6]);
|
| 2 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.QR=function({value:e,size:t=180}){return(0,n.jsx)(o.default,{style:{padding:12,backgroundColor:'#FFFFFF',borderRadius:12,alignSelf:'center',borderWidth:3,borderColor:u.colours.gold},children:(0,n.jsx)(l.default,{value:e,size:t,color:"#0B0B0B",backgroundColor:"#FFFFFF"})})},r(d[0]);var o=e(r(d[1])),l=e(r(d[2])),u=r(d[3]),n=r(d[4])},807,[12,109,808,797,6]);
|
| 3 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},808,[809]);
|
| 4 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";function o(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e=r(d[0]),t=r(d[1]),l=o(t),s=o(r(d[2])),n=o(r(d[3])),c=o(r(d[4])),h=r(d[5]);const u=({size:o,backgroundColor:e,logo:l,logoSVG:s,logoSize:n,logoBackgroundColor:u,logoColor:x,logoMargin:f,logoBorderRadius:p,clipPathId:j})=>{const C=(o-n-2*f)/2,y=n+2*f,b=p+f/n*p,k=`clip-logo-background-${j}`,G=`clip-logo-${j}`;return(0,h.jsxs)(t.G,{x:C,y:C,children:[(0,h.jsxs)(t.Defs,{children:[(0,h.jsx)(t.ClipPath,{id:k,children:(0,h.jsx)(t.Rect,{width:y,height:y,rx:b,ry:b})}),(0,h.jsx)(t.ClipPath,{id:G,children:(0,h.jsx)(t.Rect,{width:n,height:n,rx:p,ry:p})})]}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Rect,{width:y,height:y,fill:e,clipPath:`url(#${k})`})}),(0,h.jsxs)(t.G,{x:f,y:f,clipPath:`url(#${G})`,children:[(0,h.jsx)(t.Rect,{width:y-f,height:y-f,fill:u}),s?(0,h.jsx)(c.default,{svg:s,logoSize:n,logoColor:x}):(0,h.jsx)(t.Image,{width:n,height:n,preserveAspectRatio:"xMidYMid slice",href:l,clipPath:`url(#${G})`})]})]})};var x=({value:o="this is a QR code",size:c=100,color:x="black",backgroundColor:f="white",logo:p,logoSVG:j,logoSize:C=.2*c,logoBackgroundColor:y="transparent",logoColor:b,logoMargin:k=2,logoBorderRadius:G=0,quietZone:R=0,enableLinearGradient:w=!1,gradientDirection:P=['0%','0%','100%','100%'],linearGradient:S=['rgb(255,0,0)','rgb(0,255,255)'],ecl:M="M",getRef:z,onError:v,testID:B})=>{const I=(0,e.useId)(),_=(0,e.useMemo)(()=>{try{return(0,n.default)((0,s.default)(o,M),c)}catch(o){if(!v||'function'!=typeof v)throw o;v(o)}},[o,c,M]);if(!_)return null;const{path:D,cellSize:$}=_,O=p||j;return(0,h.jsxs)(l.default,{testID:B,ref:z,viewBox:[-R,-R,c+2*R,c+2*R].join(' '),width:c,height:c,children:[(0,h.jsx)(t.Defs,{children:(0,h.jsxs)(t.LinearGradient,{id:"grad",x1:P[0],y1:P[1],x2:P[2],y2:P[3],children:[(0,h.jsx)(t.Stop,{offset:"0",stopColor:S[0],stopOpacity:"1"}),(0,h.jsx)(t.Stop,{offset:"1",stopColor:S[1],stopOpacity:"1"})]})}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Rect,{x:-R,y:-R,width:c+2*R,height:c+2*R,fill:f})}),(0,h.jsx)(t.G,{children:(0,h.jsx)(t.Path,{d:D,strokeLinecap:"butt",stroke:w?'url(#grad)':x,strokeWidth:$})}),O&&u({size:c,backgroundColor:f,logo:p,logoSVG:j,logoSize:C,logoBackgroundColor:y,logoColor:b,logoMargin:k,logoBorderRadius:G,clipPathId:I})]})}},809,[12,842,810,839,840,6]);
|
| 5 |
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},l=(e,t)=>{const l=Array.prototype.slice.call(u.default.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(l.length);return l.reduce((e,t,u)=>(u%n===0?e.push([t]):e[e.length-1].push(t))&&e,[])}},810,[811]);
|
| 6 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]),e=r(d[2]),o=r(d[3]);function c(e,o,c,l,u){const f=[].slice.call(arguments,1),s=f.length,v='function'==typeof f[s-1];if(!v&&!t())throw new Error('Callback required as last argument');if(!v){if(s<1)throw new Error('Too few arguments provided');return 1===s?(c=o,o=l=void 0):2!==s||o.getContext||(l=c,c=o,o=void 0),new Promise(function(t,u){try{const u=n.create(c,l);t(e(u,o,l))}catch(t){u(t)}})}if(s<2)throw new Error('Too few arguments provided');2===s?(u=c,c=o,o=l=void 0):3===s&&(o.getContext&&void 0===u?(u=l,l=void 0):(u=l,l=c,c=o,o=void 0));try{const t=n.create(c,l);u(null,e(t,o,l))}catch(t){u(t)}}_e.create=n.create,_e.toCanvas=c.bind(null,e.render),_e.toDataURL=c.bind(null,e.renderToDataURL),_e.toString=c.bind(null,function(t,n,e){return o.render(t,e)})},811,[812,813,836,838]);
|
| 7 |
+
__d(function(g,r,i,a,m,e,d){m.exports=function(){return'function'==typeof Promise&&Promise.prototype&&Promise.prototype.then}},812,[]);
|
| 8 |
+
__d(function(g,_r,_i,a,m,e,d){const t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),s=_r(d[4]),i=_r(d[5]),f=_r(d[6]),c=_r(d[7]),l=_r(d[8]),u=_r(d[9]),h=_r(d[10]),w=_r(d[11]),C=_r(d[12]);function y(t,o){const n=t.size,r=i.getPositions(o);for(let o=0;o<r.length;o++){const s=r[o][0],i=r[o][1];for(let o=-1;o<=7;o++)if(!(s+o<=-1||n<=s+o))for(let r=-1;r<=7;r++)i+r<=-1||n<=i+r||(o>=0&&o<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===o||6===o)||o>=2&&o<=4&&r>=2&&r<=4?t.set(s+o,i+r,!0,!0):t.set(s+o,i+r,!1,!0))}}function S(t){const o=t.size;for(let n=8;n<o-8;n++){const o=n%2==0;t.set(n,6,o,!0),t.set(6,n,o,!0)}}function p(t,o){const n=s.getPositions(o);for(let o=0;o<n.length;o++){const r=n[o][0],s=n[o][1];for(let o=-2;o<=2;o++)for(let n=-2;n<=2;n++)-2===o||2===o||-2===n||2===n||0===o&&0===n?t.set(r+o,s+n,!0,!0):t.set(r+o,s+n,!1,!0)}}function v(t,o){const n=t.size,r=u.getEncodedBits(o);let s,i,f;for(let o=0;o<18;o++)s=Math.floor(o/3),i=o%3+n-8-3,f=1==(r>>o&1),t.set(s,i,f,!0),t.set(i,s,f,!0)}function B(t,o,n){const r=t.size,s=h.getEncodedBits(o,n);let i,f;for(i=0;i<15;i++)f=1==(s>>i&1),i<6?t.set(i,8,f,!0):i<8?t.set(i+1,8,f,!0):t.set(r-15+i,8,f,!0),i<8?t.set(8,r-i-1,f,!0):i<9?t.set(8,15-i-1+1,f,!0):t.set(8,15-i-1,f,!0);t.set(r-8,8,1,!0)}function b(t,o){const n=t.size;let r=-1,s=n-1,i=7,f=0;for(let c=n-1;c>0;c-=2)for(6===c&&c--;;){for(let n=0;n<2;n++)if(!t.isReserved(s,c-n)){let r=!1;f<o.length&&(r=1==(o[f]>>>i&1)),t.set(s,c-n,r),i--,-1===i&&(f++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function M(o,r,s){const i=new n;s.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),w.getCharCountIndicator(t.mode,o)),t.write(i)});const f=8*(t.getSymbolTotalCodewords(o)-c.getTotalCodewordsCount(o,r));for(i.getLengthInBits()+4<=f&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const l=(f-i.getLengthInBits())/8;for(let t=0;t<l;t++)i.put(t%2?17:236,8);return I(i,o,r)}function I(o,n,r){const s=t.getSymbolTotalCodewords(n),i=s-c.getTotalCodewordsCount(n,r),f=c.getBlocksCount(n,r),u=f-s%f,h=Math.floor(s/f),w=Math.floor(i/f),C=w+1,y=h-w,S=new l(y);let p=0;const v=new Array(f),B=new Array(f);let b=0;const M=new Uint8Array(o.buffer);for(let t=0;t<f;t++){const o=t<u?w:C;v[t]=M.slice(p,p+o),B[t]=S.encode(v[t]),p+=o,b=Math.max(b,o)}const I=new Uint8Array(s);let A,E,T=0;for(A=0;A<b;A++)for(E=0;E<f;E++)A<v[E].length&&(I[T++]=v[E][A]);for(A=0;A<y;A++)for(E=0;E<f;E++)I[T++]=B[E][A];return I}function A(o,n,s,i){let c;if(Array.isArray(o))c=C.fromArray(o);else{if('string'!=typeof o)throw new Error('Invalid data');{let t=n;if(!t){const n=C.rawSplit(o);t=u.getBestVersionForData(n,s)}c=C.fromString(o,t||40)}}const l=u.getBestVersionForData(c,s);if(!l)throw new Error('The amount of data is too big to be stored in a QR Code');if(n){if(n<l)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+l+'.\n')}else n=l;const h=M(n,s,c),w=t.getSymbolSize(n),I=new r(w);return y(I,n),S(I),p(I,n),B(I,s,0),n>=7&&v(I,n),b(I,h),isNaN(i)&&(i=f.getBestMask(I,B.bind(null,I,s))),f.applyMask(i,I),B(I,s,i),{modules:I,version:n,errorCorrectionLevel:s,maskPattern:i,segments:c}}e.create=function(n,r){if(void 0===n||''===n)throw new Error('No input text');let s,i,c=o.M;return void 0!==r&&(c=o.from(r.errorCorrectionLevel,o.M),s=u.from(r.version),i=f.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),A(n,s,c,i)}},813,[814,815,816,817,818,819,820,821,822,825,829,826,830]);
|
| 9 |
+
__d(function(g,r,i,a,m,e,d){let n;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return 4*n+17},e.getSymbolTotalCodewords=function(n){return o[n]},e.getBCHDigit=function(n){let o=0;for(;0!==n;)o++,n>>>=1;return o},e.setToSJISFunction=function(o){if('function'!=typeof o)throw new Error('"toSJISFunc" is not a valid function.');n=o},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(o){return n(o)}},814,[]);
|
| 10 |
+
__d(function(g,r,i,a,m,_e,d){function t(t){if('string'!=typeof t)throw new Error('Param is not a string');switch(t.toLowerCase()){case'l':case'low':return _e.L;case'm':case'medium':return _e.M;case'q':case'quartile':return _e.Q;case'h':case'high':return _e.H;default:throw new Error('Unknown EC Level: '+t)}}_e.L={bit:1},_e.M={bit:0},_e.Q={bit:3},_e.H={bit:2},_e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},_e.from=function(e,n){if(_e.isValid(e))return e;try{return t(e)}catch(t){return n}}},815,[]);
|
| 11 |
+
__d(function(g,r,_i,a,m,e,d){function t(){this.buffer=[],this.length=0}t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let h=0;h<n;h++)this.putBit(1==(t>>>n-h-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},m.exports=t},816,[]);
|
| 12 |
+
__d(function(g,r,i,a,m,e,d){function t(t){if(!t||t<1)throw new Error('BitMatrix size must be defined and greater than 0');this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}t.prototype.set=function(t,s,n,o){const h=t*this.size+s;this.data[h]=n,o&&(this.reservedBit[h]=!0)},t.prototype.get=function(t,s){return this.data[t*this.size+s]},t.prototype.xor=function(t,s,n){this.data[t*this.size+s]^=n},t.prototype.isReserved=function(t,s){return this.reservedBit[t*this.size+s]},m.exports=t},817,[]);
|
| 13 |
+
__d(function(g,r,_i,a,m,e,d){const o=r(d[0]).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,s=o(t),l=145===s?26:2*Math.ceil((s-13)/(2*n-2)),f=[s-7];for(let o=1;o<n-1;o++)f[o]=f[o-1]-l;return f.push(6),f.reverse()},e.getPositions=function(o){const t=[],n=e.getRowColCoords(o),s=n.length;for(let o=0;o<s;o++)for(let l=0;l<s;l++)0===o&&0===l||0===o&&l===s-1||o===s-1&&0===l||t.push([n[o],n[l]]);return t}},818,[814]);
|
| 14 |
+
__d(function(g,r,i,a,m,e,d){const n=r(d[0]).getSymbolSize;e.getPositions=function(t){const o=n(t);return[[0,0],[o-7,0],[0,o-7]]}},819,[814]);
|
| 15 |
+
__d(function(g,r,_i,a,m,e,d){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,s=40,l=10;function o(t,n,s){switch(t){case e.Patterns.PATTERN000:return(n+s)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return s%3==0;case e.Patterns.PATTERN011:return(n+s)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2==0;case e.Patterns.PATTERN101:return n*s%2+n*s%3==0;case e.Patterns.PATTERN110:return(n*s%2+n*s%3)%2==0;case e.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2==0;default:throw new Error('bad maskPattern:'+t)}}e.isValid=function(t){return null!=t&&''!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(n){const s=n.size;let l=0,o=0,P=0,T=null,c=null;for(let u=0;u<s;u++){o=P=0,T=c=null;for(let N=0;N<s;N++){let s=n.get(u,N);s===T?o++:(o>=5&&(l+=t+(o-5)),T=s,o=1),s=n.get(N,u),s===c?P++:(P>=5&&(l+=t+(P-5)),c=s,P=1)}o>=5&&(l+=t+(o-5)),P>=5&&(l+=t+(P-5))}return l},e.getPenaltyN2=function(t){const s=t.size;let l=0;for(let n=0;n<s-1;n++)for(let o=0;o<s-1;o++){const s=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==s&&0!==s||l++}return l*n},e.getPenaltyN3=function(t){const n=t.size;let l=0,o=0,P=0;for(let s=0;s<n;s++){o=P=0;for(let T=0;T<n;T++)o=o<<1&2047|t.get(s,T),T>=10&&(1488===o||93===o)&&l++,P=P<<1&2047|t.get(T,s),T>=10&&(1488===P||93===P)&&l++}return l*s},e.getPenaltyN4=function(t){let n=0;const s=t.data.length;for(let l=0;l<s;l++)n+=t.data[l];return Math.abs(Math.ceil(100*n/s/5)-10)*l},e.applyMask=function(t,n){const s=n.size;for(let l=0;l<s;l++)for(let P=0;P<s;P++)n.isReserved(P,l)||n.xor(P,l,o(t,P,l))},e.getBestMask=function(t,n){const s=Object.keys(e.Patterns).length;let l=0,o=1/0;for(let P=0;P<s;P++){n(P),e.applyMask(P,t);const s=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(P,t),s<o&&(o=s,l=P)}return l}},820,[]);
|
| 16 |
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],u=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(u,c){switch(c){case t.L:return n[4*(u-1)+0];case t.M:return n[4*(u-1)+1];case t.Q:return n[4*(u-1)+2];case t.H:return n[4*(u-1)+3];default:return}},e.getTotalCodewordsCount=function(n,c){switch(c){case t.L:return u[4*(n-1)+0];case t.M:return u[4*(n-1)+1];case t.Q:return u[4*(n-1)+2];case t.H:return u[4*(n-1)+3];default:return}}},821,[815]);
|
| 17 |
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error('Encoder not initialized');const o=new Uint8Array(n.length+this.degree);o.set(n);const s=t.mod(o,this.genPoly),h=this.degree-s.length;if(h>0){const t=new Uint8Array(this.degree);return t.set(s,h),t}return s},m.exports=n},822,[823]);
|
| 18 |
+
__d(function(g,r,_i,a,m,e,d){const n=r(d[0]);e.mul=function(t,l){const o=new Uint8Array(t.length+l.length-1);for(let u=0;u<t.length;u++)for(let f=0;f<l.length;f++)o[u+f]^=n.mul(t[u],l[f]);return o},e.mod=function(t,l){let o=new Uint8Array(t);for(;o.length-l.length>=0;){const t=o[0];for(let u=0;u<l.length;u++)o[u]^=n.mul(l[u],t);let u=0;for(;u<o.length&&0===o[u];)u++;o=o.slice(u)}return o},e.generateECPolynomial=function(t){let l=new Uint8Array([1]);for(let o=0;o<t;o++)l=e.mul(l,new Uint8Array([1,n.exp(o)]));return l}},823,[824]);
|
| 19 |
+
__d(function(g,r,_i,a,m,e,d){const n=new Uint8Array(512),t=new Uint8Array(256);!(function(){let o=1;for(let u=0;u<255;u++)n[u]=o,t[o]=u,o<<=1,256&o&&(o^=285);for(let t=255;t<512;t++)n[t]=n[t-255]})(),e.log=function(n){if(n<1)throw new Error('log('+n+')');return t[n]},e.exp=function(t){return n[t]},e.mul=function(o,u){return 0===o||0===u?0:n[t[o]+t[u]]}},824,[]);
|
| 20 |
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),f=r(_d[3]),u=r(_d[4]),c=t.getBCHDigit(7973);function s(t,n,o){for(let f=1;f<=40;f++)if(n<=e.getCapacity(f,o,t))return f}function l(t,n){return f.getCharCountIndicator(t,n)+4}function d(t,n){let o=0;return t.forEach(function(t){const f=l(t.mode,n);o+=f+t.getBitsLength()}),o}function C(t,n){for(let o=1;o<=40;o++){if(d(t,o)<=e.getCapacity(o,n,f.MIXED))return o}}e.from=function(t,n){return u.isValid(t)?parseInt(t,10):n},e.getCapacity=function(o,c,s){if(!u.isValid(o))throw new Error('Invalid QR Code version');void 0===s&&(s=f.BYTE);const d=8*(t.getSymbolTotalCodewords(o)-n.getTotalCodewordsCount(o,c));if(s===f.MIXED)return d;const C=d-l(s,o);switch(s){case f.NUMERIC:return Math.floor(C/10*3);case f.ALPHANUMERIC:return Math.floor(C/11*2);case f.KANJI:return Math.floor(C/13);case f.BYTE:default:return Math.floor(C/8)}},e.getBestVersionForData=function(t,n){let f;const u=o.from(n,o.M);if(Array.isArray(t)){if(t.length>1)return C(t,u);if(0===t.length)return 1;f=t[0]}else f=t;return s(f.mode,f.getLength(),u)},e.getEncodedBits=function(n){if(!u.isValid(n)||n<7)throw new Error('Invalid QR Code version');let o=n<<12;for(;t.getBCHDigit(o)-c>=0;)o^=7973<<t.getBCHDigit(o)-c;return n<<12|o}},825,[814,821,815,826,827]);
|
| 21 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]);function e(t){if('string'!=typeof t)throw new Error('Param is not a string');switch(t.toLowerCase()){case'numeric':return _e.NUMERIC;case'alphanumeric':return _e.ALPHANUMERIC;case'kanji':return _e.KANJI;case'byte':return _e.BYTE;default:throw new Error('Unknown mode: '+t)}}_e.NUMERIC={id:'Numeric',bit:1,ccBits:[10,12,14]},_e.ALPHANUMERIC={id:'Alphanumeric',bit:2,ccBits:[9,11,13]},_e.BYTE={id:'Byte',bit:4,ccBits:[8,16,16]},_e.KANJI={id:'Kanji',bit:8,ccBits:[8,10,12]},_e.MIXED={bit:-1},_e.getCharCountIndicator=function(n,e){if(!n.ccBits)throw new Error('Invalid mode: '+n);if(!t.isValid(e))throw new Error('Invalid version: '+e);return e>=1&&e<10?n.ccBits[0]:e<27?n.ccBits[1]:n.ccBits[2]},_e.getBestModeForData=function(t){return n.testNumeric(t)?_e.NUMERIC:n.testAlphanumeric(t)?_e.ALPHANUMERIC:n.testKanji(t)?_e.KANJI:_e.BYTE},_e.toString=function(t){if(t&&t.id)return t.id;throw new Error('Invalid mode')},_e.isValid=function(t){return t&&t.bit&&t.ccBits},_e.from=function(t,n){if(_e.isValid(t))return t;try{return e(t)}catch(t){return n}}},826,[827,828]);
|
| 22 |
+
__d(function(g,r,i,a,m,e,d){e.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}},827,[]);
|
| 23 |
+
__d(function(g,r,i,a,m,e,d){let u="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";u=u.replace(/u/g,'\\u');const n='(?:(?![A-Z0-9 $%*+\\-./:]|'+u+')(?:.|[\r\n]))+';e.KANJI=new RegExp(u,'g'),e.BYTE_KANJI=new RegExp('[^A-Z0-9 $%*+\\-./:]+','g'),e.BYTE=new RegExp(n,'g'),e.NUMERIC=new RegExp('[0-9]+','g'),e.ALPHANUMERIC=new RegExp('[A-Z $%*+\\-./:]+','g');const t=new RegExp('^'+u+'$'),E=new RegExp("^[0-9]+$"),A=new RegExp('^[A-Z0-9 $%*+\\-./:]+$');e.testKanji=function(u){return t.test(u)},e.testNumeric=function(u){return E.test(u)},e.testAlphanumeric=function(u){return A.test(u)}},828,[]);
|
| 24 |
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=t.getBCHDigit(1335);e.getEncodedBits=function(o,c){const B=o.bit<<3|c;let d=B<<10;for(;t.getBCHDigit(d)-n>=0;)d^=1335<<t.getBCHDigit(d)-n;return 21522^(B<<10|d)}},829,[814]);
|
| 25 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6]),h=r(d[7]);function i(t){return unescape(encodeURIComponent(t)).length}function f(t,n,o){const u=[];let s;for(;null!==(s=t.exec(o));)u.push({data:s[0],index:s.index,mode:n,length:s[0].length});return u}function E(n){const o=f(l.NUMERIC,t.NUMERIC,n),u=f(l.ALPHANUMERIC,t.ALPHANUMERIC,n);let s,h;c.isKanjiModeEnabled()?(s=f(l.BYTE,t.BYTE,n),h=f(l.KANJI,t.KANJI,n)):(s=f(l.BYTE_KANJI,t.BYTE,n),h=[]);return o.concat(u,s,h).sort(function(t,n){return t.index-n.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function A(l,c){switch(c){case t.NUMERIC:return n.getBitsLength(l);case t.ALPHANUMERIC:return o.getBitsLength(l);case t.KANJI:return s.getBitsLength(l);case t.BYTE:return u.getBitsLength(l)}}function I(t){return t.reduce(function(t,n){const o=t.length-1>=0?t[t.length-1]:null;return o&&o.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function C(n){const o=[];for(let u=0;u<n.length;u++){const s=n[u];switch(s.mode){case t.NUMERIC:o.push([s,{data:s.data,mode:t.ALPHANUMERIC,length:s.length},{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.ALPHANUMERIC:o.push([s,{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.KANJI:o.push([s,{data:s.data,mode:t.BYTE,length:i(s.data)}]);break;case t.BYTE:o.push([{data:s.data,mode:t.BYTE,length:i(s.data)}])}}return o}function p(n,o){const u={},s={start:{}};let l=['start'];for(let c=0;c<n.length;c++){const h=n[c],i=[];for(let n=0;n<h.length;n++){const f=h[n],E=''+c+n;i.push(E),u[E]={node:f,lastCount:0},s[E]={};for(let n=0;n<l.length;n++){const c=l[n];u[c]&&u[c].node.mode===f.mode?(s[c][E]=A(u[c].lastCount+f.length,f.mode)-A(u[c].lastCount,f.mode),u[c].lastCount+=f.length):(u[c]&&(u[c].lastCount=f.length),s[c][E]=A(f.length,f.mode)+4+t.getCharCountIndicator(f.mode,o))}}l=i}for(let t=0;t<l.length;t++)s[l[t]].end=0;return{map:s,table:u}}function B(l,h){let i;const f=t.getBestModeForData(l);if(i=t.from(h,f),i!==t.BYTE&&i.bit<f.bit)throw new Error('"'+l+"\" cannot be encoded with mode "+t.toString(i)+'.\n Suggested mode is: '+t.toString(f));switch(i!==t.KANJI||c.isKanjiModeEnabled()||(i=t.BYTE),i){case t.NUMERIC:return new n(l);case t.ALPHANUMERIC:return new o(l);case t.KANJI:return new s(l);case t.BYTE:return new u(l)}}e.fromArray=function(t){return t.reduce(function(t,n){return'string'==typeof n?t.push(B(n,null)):n.data&&t.push(B(n.data,n.mode)),t},[])},e.fromString=function(t,n){const o=p(C(E(t,c.isKanjiModeEnabled())),n),u=h.find_path(o.map,'start','end'),s=[];for(let t=1;t<u.length-1;t++)s.push(o.table[u[t]].node);return e.fromArray(I(s))},e.rawSplit=function(t){return e.fromArray(E(t,c.isKanjiModeEnabled()))}},830,[826,831,832,833,834,828,814,835]);
|
| 26 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.NUMERIC,this.data=n.toString()}n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,o,s;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),s=parseInt(o,10),t.put(s,10);const i=this.data.length-n;i>0&&(o=this.data.substr(n),s=parseInt(o,10),t.put(s,3*i+1))},m.exports=n},831,[826]);
|
| 27 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' ','$','%','*','+','-','.','/',':'];function i(n){this.mode=t.ALPHANUMERIC,this.data=n}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let h=45*n.indexOf(this.data[i]);h+=n.indexOf(this.data[i+1]),t.put(h,11)}this.data.length%2&&t.put(n.indexOf(this.data[i]),6)},m.exports=i},832,[826]);
|
| 28 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.BYTE,this.data='string'==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,o=this.data.length;n<o;n++)t.put(this.data[n],8)},m.exports=n},833,[826]);
|
| 29 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]);function i(n){this.mode=t.KANJI,this.data=n}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i<this.data.length;i++){let o=n.toSJIS(this.data[i]);if(o>=33088&&o<=40956)o-=33088;else{if(!(o>=57408&&o<=60351))throw new Error('Invalid SJIS character: '+this.data[i]+"\nMake sure your charset is UTF-8");o-=49472}o=192*(o>>>8&255)+(255&o),t.put(o,13)}},m.exports=i},834,[826,814]);
|
| 30 |
+
__d(function(g,r,i,_a,m,e,_d){'use strict';var t={single_source_shortest_paths:function(o,s,u){var n={},a={};a[s]=0;var h,f,p,_,c,v,d,l=t.PriorityQueue.make();for(l.push(s,0);!l.empty();)for(p in f=(h=l.pop()).value,_=h.cost,c=o[f]||{})c.hasOwnProperty(p)&&(v=_+c[p],d=a[p],(void 0===a[p]||d>v)&&(a[p]=v,l.push(p,v),n[p]=f));if(void 0!==u&&void 0===a[u]){var y=['Could not find a path from ',s,' to ',u,'.'].join('');throw new Error(y)}return n},extract_shortest_path_from_predecessor_list:function(t,o){for(var s=[],u=o;u;)s.push(u),t[u],u=t[u];return s.reverse(),s},find_path:function(o,s,u){var n=t.single_source_shortest_paths(o,s,u);return t.extract_shortest_path_from_predecessor_list(n,u)},PriorityQueue:{make:function(o){var s,u=t.PriorityQueue,n={};for(s in o=o||{},u)u.hasOwnProperty(s)&&(n[s]=u[s]);return n.queue=[],n.sorter=o.sorter||u.default_sorter,n},default_sorter:function(t,o){return t.cost-o.cost},push:function(t,o){var s={value:t,cost:o};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==m&&(m.exports=t)},835,[]);
|
| 31 |
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]);function e(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+'px',e.style.width=n+'px'}function n(){try{return document.createElement('canvas')}catch(t){throw new Error('You need to specify a canvas element')}}_e.render=function(o,c,s){let u=s,h=c;void 0!==u||c&&c.getContext||(u=c,c=void 0),c||(h=n()),u=t.getOptions(u);const l=t.getImageWidth(o.modules.size,u),p=h.getContext('2d'),y=p.createImageData(l,l);return t.qrToImageData(y.data,o,u),e(p,h,l),p.putImageData(y,0,0),h},_e.renderToDataURL=function(t,e,n){let o=n;void 0!==o||e&&e.getContext||(o=e,e=void 0),o||(o={});const c=_e.render(t,e,o),s=o.type||'image/png',u=o.rendererOpts||{};return c.toDataURL(s,u.quality)}},836,[837]);
|
| 32 |
+
__d(function(g,r,_i,a,m,e,d){function t(t){if('number'==typeof t&&(t=t.toString()),'string'!=typeof t)throw new Error('Color should be defined as hex string');let o=t.slice().replace('#','').split('');if(o.length<3||5===o.length||o.length>8)throw new Error('Invalid hex color: '+t);3!==o.length&&4!==o.length||(o=Array.prototype.concat.apply([],o.map(function(t){return[t,t]}))),6===o.length&&o.push('F','F');const n=parseInt(o.join(''),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:'#'+o.slice(0,6).join('')}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=void 0===o.margin||null===o.margin||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,l=o.scale||4;return{width:i,scale:i?4:l,margin:n,color:{dark:t(o.color.dark||'#000000ff'),light:t(o.color.light||'#ffffffff')},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(t,o){return o.width&&o.width>=t+2*o.margin?o.width/(t+2*o.margin):o.scale},e.getImageWidth=function(t,o){const n=e.getScale(t,o);return Math.floor((t+2*o.margin)*n)},e.qrToImageData=function(t,o,n){const i=o.modules.size,l=o.modules.data,c=e.getScale(i,n),f=Math.floor((i+2*n.margin)*c),h=n.margin*c,s=[n.color.light,n.color.dark];for(let o=0;o<f;o++)for(let u=0;u<f;u++){let p=4*(o*f+u),w=n.color.light;if(o>=h&&u>=h&&o<f-h&&u<f-h){w=s[l[Math.floor((o-h)/c)*i+Math.floor((u-h)/c)]?1:0]}t[p++]=w.r,t[p++]=w.g,t[p++]=w.b,t[p]=w.a}}},837,[]);
|
| 33 |
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function o(t,o){const n=t.a/255,i=o+'="'+t.hex+'"';return n<1?i+' '+o+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function n(t,o,n){let i=t+o;return void 0!==n&&(i+=' '+n),i}function i(t,o,i){let l='',h=0,s=!1,c=0;for(let u=0;u<t.length;u++){const f=Math.floor(u%o),w=Math.floor(u/o);f||s||(s=!0),t[u]?(c++,u>0&&f>0&&t[u-1]||(l+=s?n('M',f+i,.5+w+i):n('m',h,0),h=0,s=!1),f+1<o&&t[u+1]||(l+=n('h',c),c=0)):h++}return l}e.render=function(n,l,h){const s=t.getOptions(l),c=n.modules.size,u=n.modules.data,f=c+2*s.margin,w=s.color.light.a?'<path '+o(s.color.light,'fill')+' d="M0 0h'+f+'v'+f+'H0z"/>':'',p='<path '+o(s.color.dark,'stroke')+' d="'+i(u,c,s.margin)+'"/>',v="viewBox=\"0 0 "+f+' '+f+'"',x='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':'')+v+' shape-rendering="crispEdges">'+w+p+'</svg>\n';return'function'==typeof h&&h(null,x),x}},838,[837]);
|
| 34 |
+
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=(t,n)=>{const l=n/t.length;let c='';return t.forEach((n,u)=>{let o=!1;n.forEach((n,f)=>{n?(o||(c+=`M${l*f} ${l/2+l*u} `,o=!0),o&&f===t.length-1&&(c+=`L${l*(f+1)} ${l/2+l*u} `)):o&&(c+=`L${l*f} ${l/2+l*u} `,o=!1)})}),{cellSize:l,path:c}}},839,[]);
|
| 35 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}}),r(d[0]);var t=r(d[1]),n=r(d[2]),o=r(d[3]);var s=({svg:s,logoSize:l,logoColor:u})=>{if((0,n.isString)(s)){const u=(0,n.isUrlString)(s)?s:`data:image/svg+xml;base64,${window.btoa(s)}`;return(0,o.jsx)(t.Image,{href:encodeURI(u),width:l,height:l})}const c=s;return(0,o.jsx)(c,{fill:u,width:l,height:l})}},840,[12,842,841,6]);
|
| 36 |
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return'string'==typeof t}Object.defineProperty(e,'__esModule',{value:!0}),e.isString=t,e.isUrlString=function(n){return t(n)&&n.startsWith('http')}},841,[]);
|
display-app/_expo/static/js/web/merch-83b3de1a838e4dd4728123294fac8f36.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return x}});var e,t=_r(d[0]),n=_r(d[1]),s=_r(d[2]),l=(e=s)&&e.__esModule?e:{default:e},r=_r(d[3]),o=_r(d[4]),c=_r(d[5]),u=_r(d[6]),m=_r(d[7]),h=_r(d[8]),j=_r(d[9]),p=_r(d[10]);function x(){const{rid:e}=(0,t.useLocalSearchParams)(),s=(0,c.useRestaurant)(e),x=(0,c.useCustomer)(),b=(0,c.useNow)(6e4),f=(0,u.useOwner)(e=>e.merch),[y,w]=(0,n.useState)({}),[k,S]=(0,n.useState)(null),[C,$]=(0,n.useState)(null);if(!s)return(0,p.jsx)(o.Screen,{title:"Not found",children:(0,p.jsx)(o.T,{children:"Restaurant not found."})});const v=f.find(e=>e.id===k),O=e=>y[e]??1;return(0,p.jsxs)(o.Screen,{title:"Shop",subtitle:`${s.name} merch \xb7 collect in the restaurant`,children:[C?(0,p.jsxs)(o.Banner,{kind:"success",title:"Order placed (demo)",children:[C," Collect it at the bar on your next visit."]}):null,f.filter(e=>e.live||0===e.stock).map(e=>(0,p.jsxs)(o.Card,{children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(l.default,{style:{flex:1},children:[(0,p.jsx)(o.T,{weight:"semibold",children:e.name}),(0,p.jsx)(o.T,{colour:j.colours.gold,weight:"semibold",children:(0,m.gbp)(e.price)})]}),0!==e.stock&&e.live?e.stock<8?(0,p.jsx)(o.Badge,{kind:"amber",label:`${e.stock} left`}):null:(0,p.jsx)(o.Badge,{kind:"neutral",label:"Sold out"})]}),e.live&&e.stock>0?(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.Stepper,{value:O(e.id),min:1,max:Math.min(5,e.stock),onChange:t=>w({...y,[e.id]:t}),label:`${e.name} quantity`}),(0,p.jsx)(o.Button,{small:!0,label:`Buy \xb7 ${(0,m.gbp)(e.price*O(e.id))}`,onPress:()=>S(e.id)})]}):null]},e.id)),(0,p.jsxs)(o.Muted,{children:["Collection only in this prototype. Prices set by ",s.name,"."]}),v?(0,p.jsx)(r.MockPay,{visible:!0,onClose:()=>S(null),amount:v.price*O(v.id),restaurantId:s.id,allowGiftCard:!1,title:`Buy ${v.name}`,onPaid:()=>{const e=u.useOwner.getState();e.setOwner({merch:e.merch.map(e=>e.id===v.id?{...e,stock:Math.max(0,e.stock-O(v.id))}:e),merchOrders:[{id:`mo-${Date.now()}`,productId:v.id,qty:O(v.id),customer:x.name,at:(0,h.ymd)(b),status:'new'},...e.merchOrders]}),$(`${O(v.id)} \xd7 ${v.name}, ${(0,m.gbp)(v.price*O(v.id))}.`),S(null)}}):null]})}},766,[785,12,109,789,790,796,804,793,795,797,6]);
|
display-app/_expo/static/js/web/offers-e468fdf2d44335b7725e9cc9534ba97f.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var n=_r(d[0]);_r(d[1]);var t=_r(d[2]),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),o=_r(d[6]),c=_r(d[7]);function f(){const{rid:f}=(0,n.useLocalSearchParams)(),u=(0,s.useRestaurant)(f),h=(0,s.useCustomer)(),j=(0,r.useOwner)(n=>n.offers);if(!u)return(0,c.jsx)(t.Screen,{title:"Not found",children:(0,c.jsx)(t.T,{children:"Restaurant not found."})});const x=!!h.marketingOptIn[u.id],b=j.filter(n=>n.live),p=b.filter(n=>'special'===n.kind),y=b.filter(n=>'offer'===n.kind);return(0,c.jsxs)(t.Screen,{title:"Specials & offers",subtitle:u.name,children:[(0,c.jsxs)(t.Card,{highlight:x?o.colours.green:o.colours.gold,children:[(0,c.jsx)(t.Toggle,{label:`Send me offers from ${u.name}`,value:x,onChange:n=>s.repo.customers.update({marketingOptIn:{...h.marketingOptIn,[u.id]:n}})}),(0,c.jsx)(t.Muted,{children:x?'You can switch this off any time. We only use it for this restaurant.':'Off by default. Turn on to see member offers and get the occasional notification (max one a week). You can switch it off any time.'})]}),(0,c.jsx)(t.H2,{children:"Today's specials"}),p.length?p.map(n=>(0,c.jsxs)(t.Card,{children:[(0,c.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,c.jsx)(t.Badge,{kind:"gold",label:"Special"})]}),(0,c.jsx)(t.Muted,{children:n.body})]},n.id)):(0,c.jsx)(t.Muted,{children:"No specials on the board right now."}),(0,c.jsx)(t.H2,{children:"Member offers"}),x?y.length?y.map(n=>(0,c.jsxs)(t.Card,{children:[(0,c.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsx)(t.T,{weight:"semibold",style:{flex:1},children:n.title}),(0,c.jsx)(t.Badge,{kind:"green",label:"Offer"})]}),(0,c.jsx)(t.Muted,{children:n.body}),n.until?(0,c.jsxs)(t.Muted,{children:["Until ",(0,l.niceDate)((0,l.parseYmd)(n.until))]}):null]},n.id)):(0,c.jsx)(t.Muted,{children:"No offers right now."}):(0,c.jsxs)(t.Banner,{kind:"info",children:["Turn on offers above to see ",y.length," member offer",1===y.length?'':'s',"."]}),(0,c.jsxs)(t.Muted,{children:["Offers are set by ",u.name,". Drinks promotions follow Scottish licensing rules. Demo: no notifications are sent."]})]})}},767,[785,12,790,796,804,795,797,6]);
|
display-app/_expo/static/js/web/profile-73c051c1dbf6dad5751e1adc512639c1.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var e=_r(d[0]);_r(d[1]);var r,l=_r(d[2]),s=(r=l)&&r.__esModule?r:{default:r},t=_r(d[3]),n=_r(d[4]),a=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]);function p(){const r=(0,u.useCustomer)(),l=(0,u.useStore)((0,c.useShallow)(e=>e.orders.filter(r=>r.customerId===e.customer.id))),p=(0,u.useStore)((0,c.useShallow)(e=>e.bookings.filter(r=>r.customerId===e.customer.id))),b=(0,u.useStore)(e=>e.restaurants),y=e=>b.find(r=>r.id===e)?.name??e;return(0,h.jsxs)(t.Screen,{title:"Your account",subtitle:"One Cover Charge account for every restaurant",children:[(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.Field,{label:"Name",value:r.name,onChangeText:e=>u.repo.customers.update({name:e})}),(0,h.jsx)(t.Field,{label:"Email",value:r.email,keyboardType:"email-address",onChangeText:e=>u.repo.customers.update({email:e})}),(0,h.jsx)(t.Field,{label:"Mobile",value:r.phone,keyboardType:"phone-pad",onChangeText:e=>u.repo.customers.update({phone:e})}),(0,h.jsxs)(t.Muted,{children:["Referral code: ",r.referralCode]})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Allergies & severity"}),(0,h.jsx)(t.Muted,{children:"Stored once and shared with a restaurant only when you order or book there. You confirm them on every order, table session and booking."}),(0,h.jsx)(t.Toggle,{label:"I consent to Cover Charge storing my allergy information (health data, UK GDPR)",value:r.allergyConsent,onChange:e=>u.repo.customers.update({allergyConsent:e})}),r.allergyConsent?null:(0,h.jsx)(t.Banner,{kind:"warn",children:"Without consent your allergies won\u2019t be stored \u2014 tell staff directly."}),n.ALLERGENS.map(e=>{const l=r.allergies.find(r=>r.allergen===e.id);return(0,h.jsxs)(s.default,{style:{gap:6,paddingVertical:6},children:[(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(t.T,{weight:l?'semibold':'regular',children:e.label}),l?(0,h.jsx)(t.Badge,{kind:"red",label:"Declared"}):null]}),(0,h.jsxs)(t.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(t.Chip,{label:"None",selected:!l,onPress:()=>u.repo.customers.setAllergy(e.id,null),disabled:!r.allergyConsent&&!l}),n.SEVERITIES.map(s=>(0,h.jsx)(t.Chip,{label:s.label,selected:l?.severity===s.id,disabled:!r.allergyConsent,onPress:()=>u.repo.customers.setAllergy(e.id,s.id)},s.id))]})]},e.id)})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your orders"}),l.length?l.map(r=>(0,h.jsxs)(t.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(t.T,{style:{flex:1},children:[r.ref," \xb7 ",y(r.restaurantId)," \xb7 ",'table'===r.type?`Table ${r.tableNo}`:'Takeaway']}),(0,h.jsx)(t.Button,{small:!0,kind:"secondary",label:`${r.status} \xb7 ${(0,a.gbp)(r.subtotal+r.tip)}`,onPress:()=>e.router.push(`/customer/order/${r.id}`)})]},r.id)):(0,h.jsx)(t.Muted,{children:"No orders yet."})]}),(0,h.jsxs)(t.Card,{children:[(0,h.jsx)(t.H2,{children:"Your bookings"}),p.length?p.map(e=>(0,h.jsxs)(t.T,{children:[e.ref," \xb7 ",y(e.restaurantId)," \xb7 ",(0,o.niceDate)((0,o.parseYmd)(e.date))," ",e.time," \xb7 ",e.partySize," people \xb7 ",e.status]},e.id)):(0,h.jsx)(t.Muted,{children:"No bookings yet."})]}),(0,h.jsx)(t.Muted,{children:"Account deletion and data export would live here (Apple 5.1.1(v); Google web deletion link)."})]})}},774,[785,12,109,790,791,793,795,796,846,6]);
|