PageSourceSearch

https://www.rokt.co.uk/assets/front-desk-BtOlbcbP.js

js rokt.co.uk collected 2026-09-26 20:56:27 UTC 40,815 bytes, 37 lines download raw bytes

1import{r as u,j as e,a7 as Be,t as x,L as Qe,c as V}from"./index-CJqDwbWI.js";import{u as q}from"./useQuery-B5Qacmwf.js";import{u as b}from"./useServerFn-v-rx2Sch.js";import{C as se}from"./card-Bc5WeLLU.js";import{B as d}from"./button-CJvQgm0c.js";import{B}from"./badge-Dv8ctGrt.js";import{I as W}from"./input-yV4NZ5w_.js";import{g as j}from"./format-BONO3U-I.js";import{b as Je,d as es}from"./waivers.functions-Cod2deHP.js";import{S as Pe,e as Re,a as Ie,b as $e,c as De}from"./sheet-Dsv__nOr.js";import{g as ss,e as ts,l as as,a as rs,r as ns,c as is,q as ds,b as ls,d as cs,f as os,h as ms,i as us,p as xs,j as hs,s as ps,k as gs,m as fs}from"./terminal.functions-DBOSpoAx.js";import{A as js,a as he,b as pe,c as ge}from"./accordion-Qr9z_7Pj.js";import{D as bs,b as ys,c as Ns,d as vs,e as ws}from"./dialog-H4tippPS.js";import{P as Le}from"./printer-FwYFSLry.js";import{M as ks}from"./mail-BHbUm6tS.js";import{R as Cs}from"./refresh-cw-BHetQdYd.js";import{C as ee}from"./credit-card-CTqKKhvW.js";import{M as qe}from"./minus-CESscrSA.js";import{P as Ae}from"./plus-Deaxk-dF.js";import{T as _s}from"./trash-2-DvaVeV0K.js";import{A as Ss,T as Ts}from"./terminal-status-Cfctghkn.js";import{C as Ps,M as Rs}from"./member-photo-dLeLuIf8.js";import{s as Is,a as $s}from"./admin.functions-DSAhb4Ok.js";import{C as Ds}from"./camera-off-B5-dgQqN.js";import{S as Ls}from"./search-B7v2yHpZ.js";import{C as je}from"./check-DIDnUjFX.js";import{K as Ms}from"./key-round-DJ-DTs8U.js";import{P as zs}from"./admin-shop-Dzdu4Q2S.js";import{C as Fs}from"./chevron-left-D5q2emwl.js";import{C as Bs}from"./chevron-right-DlyiE8VH.js";import"./utils-BQHNewu7.js";import"./index-LHNt3CwB.js";import"./createServerFn-BNU7_o-M.js";import"./auth-middleware-Dh6bjlzA.js";import"./index-DDyBxt-g.js";import"./index-Dp7bn7i4.js";import"./index-BlrUkc-M.js";import"./index-BUOmK2gw.js";import"./index-0rorp7EC.js";import"./x-B2P6xOym.js";import"./createLucideIcon-CwdkvUyU.js";import"./index-B6nLfDAP.js";import"./chevron-down-D-LWrGh5.js";import"./user-round-BUr9CbZb.js";const F=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function Ee(t){const o=new Date(t.paidAtISO).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}),s=t.lines.map(p=>`<tr><td>${F(p.label)}</td></tr>`).join("");return`<!doctype html><html><head><meta charset="utf-8"><title>ROKT receipt ${F(t.reference)}</title>
2<style>
3  @page { margin: 10mm; }
4  body { font-family: ui-sans-serif, system-ui, sans-serif; color: #111; width: 72mm; margin: 0 auto; font-size: 12px; }
5  h1 { font-size: 18px; margin: 0 0 2px; letter-spacing: 2px; }
6  .muted { color: #555; }
7  hr { border: none; border-top: 1px dashed #999; margin: 8px 0; }
8  table { width: 100%; border-collapse: collapse; }
9  td { padding: 2px 0; vertical-align: top; }
10  .total { font-size: 18px; font-weight: 700; }
11  .center { text-align: center; }
12  .test { border: 1px solid #111; padding: 2px 4px; display: inline-block; margin-top: 4px; text-transform: uppercase; }
13</style></head><body>
14<div class="center">
15  <h1>ROKT</h1>
16  <div class="muted">The Old Flour Mill, Millroyd Street<br/>Brighouse, West Yorkshire HD6 1EY<br/>01484 717444 · [email protected]</div>
17  ${t.testMode?'<div class="test">Test mode, not a real payment</div>':""}
18</div>
19<hr/>
20<table>
21  <tr><td class="muted">Receipt</td><td class="center">${F(t.reference)}</td></tr>
22  <tr><td class="muted">Date</td><td class="center">${F(o)}</td></tr>
23  ${t.customerName?`<tr><td class="muted">Customer</td><td class="center">${F(t.customerName)}</td></tr>`:""}
24</table>
25<hr/>
26<table>${s||`<tr><td>${F(t.description)}</td></tr>`}</table>
27<hr/>
28<table><tr><td class="total">Total</td><td class="total" style="text-align:right">${j(t.amountPence)}</td></tr></table>
29<hr/>
30<table>
31  <tr><td class="muted">Paid by</td><td style="text-align:right">${F([t.cardBrand,t.cardLast4?`•••• ${t.cardLast4}`:null].filter(Boolean).join(" ")||"Card")}</td></tr>
32  ${t.entryMethod?`<tr><td class="muted">Method</td><td style="text-align:right">${F(t.entryMethod)}</td></tr>`:""}
33  ${t.readerLabel?`<tr><td class="muted">Reader</td><td style="text-align:right">${F(t.readerLabel)}</td></tr>`:""}
34</table>
35<hr/>
36<p class="center muted">Thanks for climbing with us.<br/>rokt.co.uk</p>
37</body></html>`}function qs(t){const o=Ee(t),s=document.createElement("iframe");s.style.position="fixed",s.style.right="0",s.style.bottom="0",s.style.width="0",s.style.height="0",s.style.border="0",document.body.appendChild(s);const l=s.contentDocument;if(!l){document.body.removeChild(s),x.error("Could not open the print view");return}l.open(),l.write(o),l.close(),s.onload=()=>{s.contentWindow?.focus(),s.contentWindow?.print(),window.setTimeout(()=>s.remove(),1e3)}}function As({paymentIntentId:t,onClose:o}){const s=b(ss),l=b(ts),[p,y]=u.useState(""),[w,g]=u.useState(!1),[c,N]=u.useState(null),[k,L]=u.useState(!1),{data:M,isLoading:A,isError:I}=q({queryKey:["terminal-receipt",t],queryFn:async()=>{const i=await s({data:{paymentIntentId:t}});return y(T=>T||(i.customerEmail??"")),i},enabled:!!t,retry:!1}),n=M??null;return e.jsx(bs,{open:!!t,onOpenChange:i=>{i||(y(""),N(null),o())},children:e.jsxs(ys,{className:"max-w-md",children:[e.jsxs(Ns,{children:[e.jsx(vs,{className:"uppercase",children:"Payment taken"}),e.jsx(ws,{children:"Print the receipt for the customer, or email it to them."})]}),A&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Building the receipt…"}),I&&e.jsx("p",{className:"text-sm text-destructive",children:"Could not load that receipt."}),n&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-md border border-border/60 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-display text-3xl",children:j(n.amountPence)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(n.paidAtISO).toLocaleStr
37ing("en-GB",{dateStyle:"medium",timeStyle:"short"})})]}),n.testMode&&e.jsx(B,{variant:"outline",children:"Test mode"})]}),e.jsx("ul",{className:"mt-3 space-y-1 text-sm",children:(n.lines.length>0?n.lines.map(i=>i.label):[n.description]).map(i=>e.jsx("li",{children:i},i))}),e.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:[n.cardBrand,n.cardLast4?`•••• ${n.cardLast4}`:null,n.entryMethod].filter(Boolean).join(" · ")||"Card payment"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Receipt ",n.reference]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(d,{className:"gap-2",disabled:k,onClick:async()=>{L(!0);try{const{printToTillPrinter:i}=await Be(async()=>{const{printToTillPrinter:$}=await import("./qz-print-DR97l832.js");return{printToTillPrinter:$}},[]),T=await i(Ee(n));x.success(`Receipt sent to ${T}`)}catch(i){x.error(i instanceof Error?i.message:"Could not reach the till printer")}L(!1)},children:[e.jsx(Le,{className:"h-4 w-4"})," ",k?"Printing…":"Print receipt"]}),e.jsxs(d,{variant:"outline",className:"gap-2",onClick:()=>qs(n),children:[e.jsx(Le,{className:"h-4 w-4"})," Print from this browser"]}),n.stripeReceiptUrl&&e.jsx(d,{variant:"outline",asChild:!0,children:e.jsx("a",{href:n.stripeReceiptUrl,target:"_blank",rel:"noreferrer",children:"View card receipt"})})]}),e.jsxs("div",{className:"rounded-md border border-border/60 p-3",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Email the receipt"}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[e.jsx(W,{type:"email",value:p,onChange:i=>y(i.target.value),placeholder:"[email protected]",className:"max-w-[240px]"}),e.jsxs(d,{variant:"secondary",className:"gap-2",disabled:w||p.trim().length===0,onClick:async()=>{g(!0);try{const i=await l({data:{paymentIntentId:t,email:p}});N(i.email),x.success(`Receipt emailed to ${i.email}`)}catch(i){x.error(i instanceof Error?i.message:"Could not email that receipt")}g(!1)},children:[e.jsx(ks,{className:"h-4 w-4"})," Send"]})]}),c&&e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Sent to ",c,"."]}),n.testMode&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"In test mode the card receipt only goes out if test emails are switched on in the payment settings."})]})]})]})})}function Oe({due:t=[],memberName:o,variant:s="full"}){const l=s==="full",p=b(as),y=b(rs),w=b(ns),g=b(is),c=b(ds),N=b(ls
37),k=b(cs),L=b(os),M=b(ms),A=b(us),I=b(xs),n=b(hs),[i,T]=u.useState(null),[$,H]=u.useState(""),[E,Z]=u.useState(!1),[C,X]=u.useState(0),[O,r]=u.useState({}),[m,v]=u.useState(0),[f,D]=u.useState(0),[te,ye]=u.useState(!1),[Ne,Ge]=u.useState("1.00"),[K,ae]=u.useState(null),[ve,re]=u.useState(""),ne=u.useRef(null),[We,we]=u.useState(null),{data:_,isLoading:Ue,refetch:ie,isFetching:Ve}=q({queryKey:["terminal-readers"],queryFn:()=>p(),retry:!1});u.useEffect(()=>{if(!_)return;const a=_.defaultReaderId&&_.readers.some(R=>R.id===_.defaultReaderId)?_.defaultReaderId:null,h=_.readers.find(R=>R.drivable&&!R.simulated&&R.status==="online")?.id??null,G=_.readers.find(R=>R.drivable&&!R.simulated)?.id??null,Ye=a??h??G??_.readers.find(R=>R.drivable)?.id??null;T(R=>R??Ye)},[_]);const{data:P}=q({queryKey:["walkin-quote",C,m,f],queryFn:()=>c({data:{adults:C,juniors:m,infants:f}}),enabled:C+m+f>0}),me=t.reduce((a,h)=>a+h.amount_pence,0),S=_?.readers.find(a=>a.id===i)??null,Y=_?.mode==="sandbox",Q=!!(S&&!S.simulated&&S.status!=="online"),de=Math.round((Number.parseFloat(Ne)||0)*100),{data:He,refetch:ke}=q({queryKey:["till-items"],queryFn:()=>M(),retry:!1}),le=He??[],U=C+m+f,ce=le.map(a=>({id:a.id,qty:O[a.id]??0})).filter(a=>a.qty>0),Ce=ce.reduce((a,h)=>a+h.qty,0),_e=a=>le.filter(h=>h.category===a).reduce((h,G)=>h+G.pricePence*(O[G.id]??0),0),ue=_e("snacks"),xe=_e("hire"),z=(U>0?P?.totalPence??0:0)+ue+xe,Se=(a,h)=>r(G=>({...G,[a]:Math.max(0,Math.min(50,(G[a]??0)+h))})),Te=()=>{X(0),v(0),D(0),r({})},J=()=>{ne.current&&window.clearInterval(ne.current),ne.current=null};u.useEffect(()=>J,[]);const Ze=a=>{J(),ne.current=window.setInterval(async()=>{try{const h=await A({data:{paymentIntentId:a}});re(h.status),h.status==="succeeded"?(J(),ae(null),we(a),x.success("Card payment taken")):(h.status==="canceled"||h.error)&&(J(),ae(null),x.error(h.error??"Payment cancelled"))}catch{}},2e3)},oe=async a=>{if(!i){x.error("Pick a card reader first");return}ye(!0),re("waiting for card");try{const h=await a();ae({paymentIntentId:h.paymentIntentId,amountPence:h.amountPence,simulated:h.simulated}),Ze(h.paymentIntentId),x.success(`Reader is asking for ${j(h.amountPence)}`)}catch(h){re(""),x.error(h instanceof Error?h.message:"Could not start the payment")}ye(!1)},Xe=async()=>{i&&(await n({data:{readerId:i}}).catch(()=>null),J(),ae(null),re(""))};return e.jsxs(se,{className:"space-y-4 p-4",children:[l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Card reader"}),e.jsx("h3",{className:"font-display text-lg uppercase",children:"Take a payment at the desk"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[_?.mode&&e.jsx(B,{variant:"outline",children:Y?"Test mode":"Live mode"}),e.jsxs(d,{variant:"ghost",size:"sm",className:"gap-1",onClick:()=>ie(),disabled:Ve,children:[e.jsx(Cs,{className:"h-4 w-4"})," Refresh"]})]})]}),Ue?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Looking for readers…"}):(_?.readers.length??0)===0?e.jsxs("div",{className:"rounded-md border border-dashed border-border/60 p-3 text-sm text-muted-foreground",children:[e.jsx("p",{children:"No readers registered on this Stripe account yet."}),Y&&e.jsx(d,{className:"mt-2",size:"sm",onClick:async()=>{try{const a=await y();T(a.id),await ie(),x.success("Simulated reader ready")}catch(a){x.error(a instanceof Error?a.message:"Could not add a simulated reader")}},children:"Add a simulated reader"})]}):e.jsxs("div",{className:"flex flex-wrap gap-2",children:[_.readers.map(a=>e.jsxs(d,{size:"sm",variant:a.id===i?"default":"outline",disabled:!a.drivable,title:a.drivable?a.deviceLabel:"Bluetooth readers are driven by Stripe's mobile apps, not this screen",onClick:async()=>{T(a.id),await g({data:{readerId:a.id}}).catch(()=>null)},children:[a.label,e.jsx("span",{className:"ml-1 text-xs opacity-70",children:a.simulated?"simulated":a.drivable?a.status:"bluetooth"})]},a.id)),Y&&!_.readers.some(a=>a.simulated)&&e.jsx(d,{size:"sm",variant:"ghost",onClick:async()=>{try{const a=await y();T(a.id),await ie()}catch(a){x.error(a instanceof Error?a.message:"Could not add a simulated reader")}},children:"+ simulated S700"})]}),S&&e.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[e.jsxs("p",{children:["Selected: ",S.deviceLabel.replace(/\s*\(simulated\)$/,""),S.simulated?", a test reader standing in for your S700. No real money moves.":""]}),!S.simulated&&e.jsxs("p",{children:["Status: ",S.status==="online"?"online and reachable":S.status,S.ipAddress?` · ${S.ipAddress}`:"",S.lastSeenAt?` · last seen ${new Date(S.lastSeenAt).toLocaleTimeString()}`:""]})]}),Q&&e.jsx("p",{className:"text-xs text-destructive",children:"Stripe cannot see that reader right now. Wake the screen, check it is on the same WiFi as this browser, then press Refresh."}),S&&!S.drivable&&e.jsx("p",{className:"text-xs text-destructive",children:"That reader is a Bluetooth model. The S700 and the test reader can be driven from here."}),e.jsxs("div",{className:"rounded-md border border-dashed border-border/60 p-3",children:[e.jsx("p",{className:"text-sm font-medium",children:"Pair the Stripe Reader S700"}),e.jsxs("ol",{className:"mt-1 list-decimal space-y-1 pl-4 text-xs text-muted-foreground",children:[e.jsx("li",{children:"On the reader, swipe in from the left edge and tap Settings, then enter the admin PIN."}),e.jsx("li",{children:Y?"Make sure the reader is in test mode. A live-mode reader will not pair while the desk is in test mode.":"Make sure the reader is in live mode. A test-mode reader will not pair while the desk is in live mode."}),e.jsx("li",{children:"Tap Generate pairing code and type the three words below. Codes expire after a few minutes."})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[e.jsx(W,{value:$,onChange:a=>H(a.target.value),placeholder:"quick-brown-fox",className:"max-w-[220px]"}),e.jsx(d,{size:"sm",disabled:E||$.trim().length===0,onClick:async()=>{Z(!0);try{const a=await w({data:{code:$,label:"ROKT front desk S700"}});T(a.id),H(""),await ie(),x.success(`${a.deviceLabel} paired`)}catch(a){x.error(a instanceof Error?a.message:"Could not pair that reader")}Z(!1)},children:"Pair reader"})]})]})]}),t.length>0&&me>0&&e.jsxs("div",{className:"rounded-md border border-primary/40 bg-primary/5 p-3",children:[e.jsxs("p",{className:"text-sm font-medium",children:[o??"Member"," owes ",j(me)," for today"]}),e.jsx("ul",{className:"mt-1 text-xs text-muted-foreground",children:t.map(a=>e.jsxs("li",{children:[a.label," · ",j(a.amount_pence)]},a.id))}),e.jsxs(d,{className:"mt-2 gap-2",size:"sm",disabled:te||!!K||!i||Q,onClick:()=>oe(()=>N({data:{bookingIds:t.map(a=>a.id),readerId:i}})),children:[e.jsx(ee,{className:"h-4 w-4"})," Charge ",j(me)," on the reader"]})]}),e.jsxs("div",{className:"rounded-md border border-border/60 p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"This sale"}),e.jsx("p",{className:"font-display text-3xl",children:j(z)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:z===0?"Open a section below to add climbers, snacks or hire.":[U>0?`${U} climber${U===1?"":"s"}`:null,ce.length>0?`${Ce} item${Ce===1?"":"s"}
37`:null].filter(Boolean).join(" · ")})]}),l&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(d,{className:"gap-2",disabled:te||!!K||!i||Q||z===0,onClick:()=>oe(()=>L({data:{adults:C,juniors:m,infants:f,lines:ce,readerId:i}})),children:[e.jsx(ee,{className:"h-4 w-4"})," Send ",j(z)," to the reader"]}),z>0&&e.jsx(d,{variant:"ghost",onClick:Te,children:"Clear sale"})]})]}),e.jsxs(js,{type:"multiple",className:"mt-2",children:[e.jsxs(he,{value:"walkin",children:[e.jsxs(pe,{className:"text-sm",children:["Walk-in climb ",P&&U>0?e.jsx("span",{className:"ml-2 text-muted-foreground",children:j(P.totalPence)}):null]}),e.jsxs(ge,{children:[e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(fe,{label:"Adults",value:C,setValue:X,min:0}),e.jsx(fe,{label:"6 to 17s",value:m,setValue:v,min:0}),e.jsx(fe,{label:"5 and under",value:f,setValue:D,min:0})]}),P&&U>0&&e.jsxs("p",{className:"mt-2 text-sm",children:[e.jsx("span",{className:"font-display text-xl",children:j(P.totalPence)}),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:P.familyPence!==null&&P.familyPence<P.individualPence?`family rate, saving ${j(P.individualPence-P.familyPence)}`:`${j(P.adultPricePence)} per adult, ${j(P.juniorPricePence)} per 6 to 17, ${j(P.infantPricePence)} per 5 and under`})]})]})]}),e.jsxs(he,{value:"snacks",children:[e.jsxs(pe,{className:"text-sm",children:["Snacks & drinks ",ue>0?e.jsx("span",{className:"ml-2 text-muted-foreground",children:j(ue)}):null]}),e.jsx(ge,{children:e.jsx(Me,{category:"snacks",items:le,qty:O,bump:Se,onChanged:ke})})]}),e.jsxs(he,{value:"hire",children:[e.jsxs(pe,{className:"text-sm",children:["Equipment hire ",xe>0?e.jsx("span",{className:"ml-2 text-muted-foreground",children:j(xe)}):null]}),e.jsx(ge,{children:e.jsx(Me,{category:"hire",items:le,qty:O,bump:Se,onChanged:ke})})]})]})]}),e.jsxs("div",{className:"rounded-md border border-dashed border-border/60 p-3",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Reader test charge"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Push a small amount to the reader to prove the hardware takes a card end to end.",Y?" You are in test mode, so no real money moves.":" You are in live mode, so this takes real money and needs refunding."]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.jsx(W,{className:"w-24",inputMode:"decimal",value:Ne,onChange:a=>Ge(a.target.value.replace(/[^0-9.]/g,"")),"aria-label":"Test amount in pounds"}),e.jsxs(d,{size:"sm",variant:"outline",className:"gap-2",disabled:te||!!K||!i||Q||!(de>=100&&de<=1e3),onClick:()=>oe(()=>k({data:{amountPence:de,readerId:i}})),children:[e.jsx(ee,{className:"h-4 w-4"})," Charge ",j(de||100)," test"]})]})]}),K&&e.jsxs("div",{className:"rounded-md border border-border/60 bg-background/60 p-3 text-sm",children:[e.jsxs("p",{children:["Waiting on the reader for ",e.jsx("strong",{children:j(K.amountPence)}),ve?` · ${ve.replace(/_/g," ")}`:""]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[K.simulated&&e.jsxs(e.Fragment,{children:[e.jsx(d,{size:"sm",onClick:()=>I({data:{readerId:i}}),children:"Tap test card"}),e.jsx(d,{size:"sm",variant:"outline",onClick:()=>I({data:{readerId:i,decline:!0}}),children:"Tap declining card"})]}),e.jsx(d,{size:"sm",variant:"ghost",onClick:Xe,children:"Cancel"})]})]}),!l&&e.jsx(e.Fragment,{children:e.jsx("div",{className:"sticky bottom-4 z-40 mt-6",children:e.jsxs("div",{className:"flex w-full flex-wrap items-center justify-between gap-3 rounded-2xl border border-border/60 bg-background/80 px-5 py-4 shadow-2xl shadow-black/50 ring-1 ring-white/5 backdrop-blur-xl",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"This sale"}),e.jsx("p",{className:"font-display text-2xl leading-none",children:j(z)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[z>0&&e.jsx(d,{variant:"ghost",onClick:Te,children:"Clear sale"}),e.jsxs(d,{size:"lg",className:"min-h-12 gap-2",disabled:te||!!K||!i||Q||z===0,onClick:()=>oe(()=>L({data:{adults:C,juniors:m,infants:f,lines:ce,readerId:i}})),children:[e.jsx(ee,{className:"h-5 w-5"})," Send ",j(z)," to the reader"]})]})]})})}),e.jsx(As,{paymentIntentId:We,onClose:()=>we(null)})]})}function fe({label:t,value:o,setValue:s,min:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2",children:[e.jsx("span",{className:"text-sm",children:t}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(d,{size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>s(Math.max(l,o-1)),children:e.jsx(qe,{className:"h-4 w-4"})}),e.jsx("span",{className:"w-6 text-center font-medium",children:o}),e.jsx(d,{size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>s(Math.min(20,o+1)),children:e.jsx(Ae,{className:"h-4 w-4"})})]})]})}function Me({category:t,items:o,qty:s,bump:l,onChanged:p}){const y=b(ps),w=b(gs),[g,c]=u.useState(!1),[N,k]=u.useState(""),[L,M]=u.useState(""),A=o.filter(n=>n.category===t),I=p;return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:e.jsx(d,{size:"sm",variant:"ghost",onClick:()=>c(n=>!n),children:g?"Done":"Edit prices"})}),A.length===0?e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Nothing on the list yet. Use Edit prices to add items."}):e.jsx("div",{className:"mt-2 grid gap-2 sm:grid-cols-2",children:A.map(n=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2",children:[e.jsxs("span",{className:"min-w-0 text-sm",children:[e.jsx("span",{className:"block truncate",children:n.name}),e.jsx("span",{className:"text-xs text-muted-foreground",children:j(n.pricePence)})]}),e.jsx("span",{className:"flex shrink-0 items-center gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"h-8 w-20",inputMode:"decimal",defaultValue:(n.pricePence/100).toFixed(2),onBlur:async i=>{const T=Math.round((Number.parseFloat(i.target.value)||0)*100);if(T!==n.pricePence)try{await y({data:{id:n.id,category:t,name:n.name,pricePence:T}}),await I(),x.success("Price saved")}catch($){x.error($ instanceof Error?$.message:"Could not save that price")}},"aria-label":`${n.name} price in pounds`}),e.jsx(d,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:async()=>{await w({data:{id:n.id}}).catch(()=>null),await I()},"aria-label":`Remove ${n.name}`,children:e.jsx(_s,{className:"h-4 w-4"})})]}):e.jsxs(e.Fragment,{children:[e.jsx(d,{size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>l(n.id,-1),children:e.jsx(qe,{className:"h-4 w-4"})}),e.jsx("span",{className:"w-6 text-center font-medium",children:s[n.id]??0}),e.jsx(d,{size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>l(n.id,1),children:e.jsx(Ae,{className:"h-4 w-4"})})]})})]},n.id))}),g&&e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.jsx(W,{className:"h-9 max-w-[200px]",placeholder:"New item name",value:N,onChange:n=>k(n.target.value)}),e.jsx(W,{className:"h-9 w-24",inputMode:"decimal",placeholder:"1.50",value:L,onChange:n=>M(n.target.value.replace(/[^0-9.]/g,"")),"aria-label":"New item price in pounds"}),e.jsx(d,{size:"sm",variant:"outline",onClick:async()=>
37{try{await y({data:{category:t,name:N,pricePence:Math.round((Number.parseFloat(L)||0)*100)}}),k(""),M(""),await I(),x.success("Item added")}catch(n){x.error(n instanceof Error?n.message:"Could not add that item")}},children:"Add item"})]})]})}function Es(){const t=b(fs),{data:o}=q({queryKey:["terminal-health"],queryFn:()=>t(),refetchInterval:3e4,retry:!1});if(!o)return null;const s=(o.readers??[]).some(l=>l.healthy);return e.jsxs("span",{className:"ml-1 inline-flex items-center gap-1.5 text-xs font-medium",children:[e.jsx("span",{"aria-hidden":!0,className:`inline-block h-2 w-2 rounded-full ${s?"bg-emerald-500":"bg-destructive"}`}),s?"Online":"Offline"]})}function Os(){const[t,o]=u.useState("ROKT-"),[s,l]=u.useState(null),[p,y]=u.useState(!1),w=u.useRef(null),g=u.useRef(null),c=u.useRef(!1),[N,k]=u.useState(!1),L=b(Is),{data:M,refetch:A}=q({queryKey:["card-scans"],queryFn:async()=>{const r=(await V.from("card_scans").select("id, user_id, result, created_at").order("created_at",{ascending:!1}).limit(8)).data??[],m=[...new Set(r.map(D=>D.user_id).filter(Boolean))],v=m.length?(await V.from("profiles").select("id, display_name, member_number").in("id",m)).data??[]:[],f=new Map(v.map(D=>[D.id,D]));return r.map(D=>({...D,profiles:D.user_id?f.get(D.user_id)??null:null}))}}),I=async r=>{if(!c.current){c.current=!0;try{const{data:m,error:v}=await V.rpc("lookup_member_card",{_token:r});if(v)throw v;const f=m;l(f),k(!1),f.found||x.error("No member found for that code"),A()}catch(m){x.error(m.message)}finally{setTimeout(()=>{c.current=!1},800)}}},n=()=>{g.current?.stop(),g.current=null,y(!1)},i=async()=>{try{const{BrowserMultiFormatReader:r}=await Be(async()=>{const{BrowserMultiFormatReader:f}=await import("./index-CJ5sQYvB.js");return{BrowserMultiFormatReader:f}},[]),m=new r;y(!0);const v=await m.decodeFromVideoDevice(void 0,w.current,f=>{f&&I(f.getText())});g.current=v}catch{y(!1),x.error("Camera unavailable — use the member number instead")}};u.useEffect(()=>()=>g.current?.stop(),[]);const T=async r=>{if(!H){x.error("Member photo needed",{description:"Take the member's photo on the camera above before checking them in."});return}const{error:m}=await V.rpc("check_in_booking",{_booking_id:r});if(m){x.error(m.message);return}x.success("Checked in"),l(v=>v&&{...v,todays_bookings:(v.todays_bookings??[]).map(f=>f.id===r?{...f,status:"attended"}:f)})},$=async r=>{if(s?.user_id)try{await L({data:{userId:s.user_id,complete:r}}),x.success(r?"Induction signed off":"Induction sign-off removed"),l(m=>m&&{...m,induction_completed_at:r?new Date().toISOString():null})}catch(m){x.error(m instanceof Error?m.message:"Could not update the induction")}},H=!!s?.avatar_url||N,E=s?.subscription,Z=E?.status==="active",C=s?.age_band??"unknown",X=s?.guardian?.status==="approved"&&!!s?.guardian?.declaration_signed_at,O=C==="teen"&&(!X||!s?.induction_completed_at);return e.jsxs("section",{children:[e.jsxs("div",{className:"mb-4 flex flex-wrap gap-2",children:[e.jsxs(Pe,{children:[e.jsx(Re,{asChild:!0,children:e.jsxs(d,{size:"lg",className:"min-h-12 gap-2",children:[e.jsx(ee,{className:"h-5 w-5"})," Card terminal"]})}),e.jsxs(Ie,{side:"right",className:"w-full overflow-y-auto sm:max-w-xl",children:[e.jsx($e,{children:e.jsx(De,{children:"Card terminal"})}),e.jsx("div",{className:"mt-4",children:e.jsx(Oe,{memberName:s?.found?s.display_name??null:null,due:(s?.todays_bookings??[]).filter(r=>r.status==="pending"&&(r.amount_pence??0)>0).map(r=>({id:r.id,label:`${r.session_name} ${new Date(r.starts_at).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"})}`,amount_pence:r.amount_pence??0}))})})]})]}),e.jsxs(Pe,{children:[e.jsx(Re,{asChild:!0,children:e.jsxs(d,{size:"lg",variant:"outline",className:"min-h-12 gap-2",children:[e.jsx(Ss,{className:"h-5 w-5"})," Card reader status",e.jsx(Es,{})]})}),e.jsxs(Ie,{side:"right",className:"w-full overflow-y-auto sm:max-w-xl",children:[e.jsx($e,{children:e.jsx(De,{children:"Card reader status"})}),e.jsx("div",{className:"mt-4",children:e.jsx(Ts,{})})]})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(se,{className:"space-y-3 p-4",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Scan a membership card"}),e.jsx("video",{ref:w,className:`w-full rounded-lg bg-black ${p?"":"hidden"}
37`,muted:!0,playsInline:!0}),!p&&e.jsx("div",{className:"flex h-44 items-center justify-center rounded-lg border border-dashed border-border/60 text-sm text-muted-foreground",children:"Camera off"}),e.jsx("div",{className:"flex gap-2",children:p?e.jsxs(d,{variant:"outline",size:"lg",className:"min-h-12 w-full gap-2",onClick:n,children:[e.jsx(Ds,{className:"h-5 w-5"})," Stop"]}):e.jsxs(d,{size:"lg",className:"min-h-12 w-full gap-2",onClick:i,children:[e.jsx(Ps,{className:"h-5 w-5"})," Start camera"]})}),e.jsxs("form",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2",onSubmit:r=>{r.preventDefault(),t.trim()&&I(t.trim())},children:[e.jsx(W,{value:t,onChange:r=>{const m=r.target.value.toUpperCase().replace(/^ROKT-?/,"");o(`ROKT-${m.replace(/[^A-Z0-9]/g,"")}`)},placeholder:"ROKT-XXXXX",className:"min-h-12 min-w-0 font-mono text-base uppercase"}),e.jsxs(d,{type:"submit",variant:"outline",className:"min-h-12 shrink-0 gap-2",children:[e.jsx(Ls,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Look up"})]})]})]}),e.jsx(se,{className:"p-4",children:!s||!s.found?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan a card or enter a member number to see the member here."}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-display text-2xl",children:s.display_name??"Member"}),e.jsx("p",{className:"font-mono text-sm text-primary",children:s.member_number})]}),e.jsx(B,{variant:Z?"default":"destructive",className:"shrink-0",children:Z?E?.tier_name:"Lapsed"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm sm:gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase text-muted-foreground",children:"Points"}),e.jsx("p",{children:s.points??0})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase text-muted-foreground",children:"Summits"}),e.jsx("p",{children:s.summit_count??0})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase text-muted-foreground",children:"Sessions"}),e.jsx("p",{children:E?`${E.slots_used_this_period}/${E.monthly_slots??"∞"}`:"—"})]})]}),C!=="adult"&&e.jsxs("div",{className:`rounded-md border p-3 text-sm ${C==="teen"&&s.induction_completed_at?"border-success/60 bg-success/10":O?"border-destructive/60 bg-destructive/10":"border-primary/50 bg-primary/5"}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("p",{className:"font-semibold uppercase tracking-widest text-xs",children:C==="teen"?"14–17 member":C==="junior"?"Under 14":"No date of birth on file"}),C==="teen"&&(s.induction_completed_at?e.jsxs(d,{size:"sm",variant:"outline",onClick:()=>$(!1),className:"border-success/60 bg-success/15 text-success hover:bg-success/25 hover:text-success",children:[e.jsx(je,{className:"mr-1 h-4 w-4"})," Induction complete"]}):e.jsx(d,{size:"sm",variant:"outline",onClick:()=>$(!0),children:"Mark induction complete"}))]}),e.jsxs("ul",{className:"mt-2 space-y-1 text-muted-foreground",children:[e.jsxs("li",{children:["Guardian:"," ",s.guardian?`${s.guardian.guardian_name??"Linked adult"} — ${X?"approved & signed":"awaiting approval"}`:"none linked"]}),e.jsxs("li",{children:["Induction: ",s.induction_completed_at?"signed off":"outstanding"]}),C==="junior"&&e.jsx("li",{children:"Must climb on a linked adult's booking, adult supervising."})]}),O&&e.jsx("p",{className:"mt-2 font-medium text-destructive",children:"Not cleared to climb unsupervised — an approved guardian and a signed-off induction are required."})]}),e.jsx(Rs,{userId:s.user_id,compact:!0,onSaved:()=>k(!0)}),!H&&e.jsx("p",{className:"rounded-md border border-destructive/60 bg-destructive/10 p-3 text-sm font-medium text-destructive",children:"No member photo on file — take one before checking this member in."}),e.jsx(Ks,{userId:s.user_id}),e.jsx(Ws,{userId:s.user_id}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-xs uppercase tracking-widest text-muted-foreground",children:"Today's sessions"}),(s.todays_bookings??[]).length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing booked today."}):e.jsx("div",{className:"space-y-2",children:s.todays_bookings.map(r=>e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-md border border-border/60 p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:r.session_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(r.starts_at).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"})," · ",r.party_size??1," climber",(r.party_size??1)===1?"":"s",(r.amount_pence??0)>0&&` · ${j(r.amount_pence)} due`]}),(r.extra_adults??0)>0&&e.jsxs("p",{className:"mt-1 text-xs text-primary",children:["+ ",r.extra_adults," extra adult",r.extra_adults===1?"":"s"]}),(r.juniors??[]).length>0&&e.jsxs("p",{className:"mt-1 text-xs text-primary",children:["+ ",r.juniors.map(m=>m.first_name).join(", ")," (junior",r.juniors.length===1?"":"s",")"]})]}),r.status==="attended"?e.jsxs(B,{className:"gap-1",children:[e.jsx(je,{className:"h-3 w-3"})," In"]}):e.jsx(d,{size:"sm",onClick:()=>T(r.id),children:"Check in"})]},r.id))})]}),(s.pickups??[]).length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-xs uppercase tracking-widest text-muted-foreground",children:"Awaiting collection"}),s.pickups.map(r=>e.jsxs("p",{className:"text-sm",children:[e.jsx("span",{className:"font-mono text-primary",children:r.pickup_code??"—"})," · ",j(r.total_pence)]},r.id))]})]})})]}),(M??[]).length>0&&e.jsxs(se,{className:"mt-4 p-4",children:[e.jsx("p",{className:"mb-3 text-xs uppercase tracking-widest text-muted-foreground",children:"Recent scans"}),e.jsx("div",{className:"flex flex-wrap gap-2 text-xs",children:M.map(r=>{const m=new Date(r.created_at).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"}),v=r.result==="ok"?r.profiles?.member_number:null,f=r.profiles?.display_name??v??"Member";return v?e.jsxs(Qe,{to:"/admin/members/$memberNumber",params:{memberNumber:v},className:"rounded-full border border-border px-3 py-1 hover:border-primary hover:text-primary",children:[f," · ",m]},r.id):e.jsxs("span",{className:"rounded-full border border-border/60 px-3 py-1 text-muted-foreground",children:["Unknown card · ",m]},r.id)})})]})]})}function Ks({userId:t}){const{data:o,isLoading:s}=q({queryKey:["desk-door-code",t],queryFn:async()=>{const[y,w]=await Promise.all([V.rpc("has_gym_access",{_user_id:t}),V.from("door_codes").select("code, status, sync_status, issued_at").eq("user_id",t).maybeSingle()]);
37return{eligible:y.data===!0,code:w.data??null}}});if(s||!o?.eligible)return null;const l=o.code,p=l?.status==="active"&&l?.sync_status==="synced";return e.jsxs("div",{className:"rounded-md border border-primary/50 bg-primary/5 p-3 text-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("p",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-widest",children:[e.jsx(Ms,{className:"h-4 w-4 text-primary"})," Gym door access"]}),e.jsx(B,{variant:p?"default":"secondary",children:l?l.status!=="active"?"Switched off":p?"Live on the door":"Test mode":"No code yet"})]}),l?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 font-mono text-2xl font-bold tracking-[0.3em] text-primary",children:l.code}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Issued ",new Date(l.issued_at).toLocaleDateString("en-GB")," · member enters this on the keypad by the gym door."]})]}):e.jsx("p",{className:"mt-2 text-muted-foreground",children:"Included with their plan — it is created the next time they open their account page."})]})}const Gs=[{kind:"induction",label:"Induction"},{kind:"belay_check",label:"Belay check"},{kind:"registered_roped",label:"Roped registration"},{kind:"registered_bouldering",label:"Bouldering registration"},{kind:"unsupervised_14",label:"14+ unsupervised"},{kind:"parent_tour",label:"Parent tour"}];function Ws({userId:t}){const o=b(Je),s=b(es),{data:l,isLoading:p,refetch:y}=q({queryKey:["staff-waivers",t],queryFn:()=>o({data:{userId:t}})}),w=async(c,N)=>{try{await s({data:{userId:t,kind:c,grant:N}}),x.success(N?"Signed off":"Removed"),y()}catch(k){x.error(k?.message??"Couldn't update that")}};if(p||!l)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading waiver record…"});const g=l.required.filter(c=>c.status!=="signed");return e.jsxs("div",{className:"rounded-md border border-border/60 p-3",children:[e.jsx("p",{className:"mb-2 text-xs uppercase tracking-widest text-muted-foreground",children:"Waivers & competency"}),g.length===0?e.jsx("p",{className:"text-sm text-primary",children:"All waivers signed and in date."}):e.jsx("ul",{className:"space-y-1 text-sm text-destructive",children:g.map(c=>e.jsxs("li",{children:[c.name,c.junior_name?` (${c.junior_name})`:""," — ",c.status.replace(/_/g," ")]},`${c.slug}-${c.junior_id??c.subject}`))}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:Gs.map(c=>{const N=l.competencies.find(k=>k.kind===c.kind&&!k.junior_id);return e.jsxs(d,{size:"sm",variant:N?"default":"outline",className:"gap-1",onClick:()=>w(c.kind,!N),title:N?`${new Date(N.granted_at).toLocaleDateString("en-GB")}${N.granted_by_name?` · ${N.granted_by_name}`:""}`:"Tap to sign off",children:[N&&e.jsx(je,{className:"h-3 w-3"})," ",c.label]},c.kind)})})]})}const be="Europe/London";function Ke(t){return new Intl.DateTimeFormat("en-CA",{timeZone:be,year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}function ze(t){return new Intl.DateTimeFormat("en-GB",{timeZone:be,hour:"2-digit",minute:"2-digit"}).format(new Date(t))}function Us(t){const o=new Date(`${t}T12:00:00Z`);return new Intl.DateTimeFormat("en-GB",{timeZone:be,weekday:"short",day:"numeric",month:"short"}).format(o)}function Fe(t,o){const s=new Date(`${t}T12:00:00Z`);return s.setUTCDate(s.getUTCDate()+o),Ke(s)}function Vs(){const t=Ke(new Date),[o,s]=u.useState(t),l=b($s),{data:p,isLoading:y}=q({queryKey:["front-desk-day",o],queryFn:()=>l({data:{date:o}})}),w=p?.slots??[];return e.jsxs(se,{className:"flex h-full flex-col gap-4 p-5",children:[e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Bookings today"}),e.jsxs("p",{className:"truncate font-semibold",children:[Us(o),o===t?"":" (other day)"]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx(d,{variant:"outline",size:"icon","aria-label":"Previous day",onClick:()=>s(Fe(o,-1)),children:e.jsx(Fs,{})}),e.jsx(d,{variant:"outline",size:"sm",onClick:()=>s(t),disabled:o===t,children:"Today"}),e.jsx(d,{variant:"outline",size:"icon","aria-label":"Next day",onClick:()=>s(Fe(o,1)),children:e.jsx(Bs,{})})]})]}),p?e.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[e.jsxs(B,{variant:"secondary",children:[p.totals.booked," of ",p.totals.capacity," places"]}),e.jsxs(B,{variant:"secondary",children:[p.totals.parties," bookings"]})]}):null,e.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto",children:[y&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading the day."}),!y&&w.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No sessions on this day."}),w.map(g=>e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3",children:[e.jsxs("p",{className:"min-w-0 truncate font-mono text-sm font-semibold",children:[ze(g.startsAt)," to ",ze(g.endsAt)]}),e.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[g.booked,"/",g.capacity]})]}),g.bookings.length===0?e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Nobody booked in yet."}):e.jsx("ul",{className:"mt-2 space-y-1 text-sm",children:g.bookings.map(c=>e.jsxs("li",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate",children:c.name??c.memberNumber??"Member"}),c.partySize>1&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["party of ",c.partySize]}),c.checkedIn?e.jsx(B,{className:"border-green-500/40 bg-green-500/15 text-green-500",variant:"outline",children:"Checked in"}):null,c.flags.length>0?e.jsx(B,{variant:"outline",className:"border-amber-500/40 text-amber-500",children:c.flags[0]}):null]},c.bookingId))})]},g.sessionId))]})]})}const Bt=()=>e.jsxs("div",{className:"w-full space-y-8 px-6 py-12 sm:px-8 md:px-12 lg:px-16 lg:py-16",children:[e.jsx(Os,{}),e.jsx(Oe,{variant:"charges"}),e.jsxs("div",{className:"grid items-start gap-8 lg:grid-cols-2",children:[e.jsx("div",{className:"min-w-0",children:e.jsx(zs,{})}),e.jsx("div",{className:"min-w-0",children:e.jsx(Vs,{})})]})]});
37export{Bt as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.