1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4281],{27023:(e,t,n)=>{"use strict";function a(e={}){let t=Number(e.guests)||0,n=Number(e.orders)||0,r=Number(e.parties_done)||0,s=t?Math.round((Number(e.checked_in)||0)/t*100):0,i=(e,t)=>`${e} ${t}${1===e?"":"s"}`,l=n&&n!==t?` across ${i(n,"booking")}`:"";return`${i(t,"ticket")}${l} \xb7 ${r} fully checked in \xb7 ${s}% of guests arrived`}n.d(t,{f:()=>a})},36278:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/admin/checkin",function(){return n(95404)}])},57728:(e,t,n)=>{"use strict";n.d(t,{ZU:()=>i,jR:()=>l});var a=n(14232),r=n(50900);function s(){try{let e=r.Capacitor?.getPlatform?.()||"web";return"ios"===e||"android"===e?e:"web"}catch{return"web"}}function i(){let[e,t]=(0,a.useState)(s);return(0,a.useEffect)(()=>{t(s())},[]),e}function l(e){return"ios"===e?"iOS Settings":"android"===e?"Android Settings":"your browser settings"}},95404:(e,t,n)=>{"use strict";let a;n.r(t),n.d(t,{default:()=>w});var r=n(37876),s=n(14232),i=n(89099),l=n(62422);function o({toast:e}){let[t,n]=(0,s.useState)(null),[a,i]=(0,s.useState)(""),[l,o]=(0,s.use
1State)(""),[c,d]=(0,s.useState)(""),[h,x]=(0,s.useState)(!1);function u(){fetch("/api/member/mod/event-notify").then(e=>e.ok?e.json():{events:[]}).then(e=>{n(e.events||[]),e.events?.length&&!a&&i(String(e.events[0].id))}).catch(()=>n([]))}if((0,s.useEffect)(()=>{u()},[]),!t||0===t.length)return null;let m=t.find(e=>String(e.id)===String(a))||t[0];async function f(){if(c.trim()){x(!0);try{let t=await fetch("/api/member/mod/event-notify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventId:Number(a),title:l.trim(),body:c.trim()})}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.error||"Send failed");e?.(n.sent?`Sent to ${n.sent} attendee${1===n.sent?"":"s"} here now.`:n.message||"No one is checked in yet.",n.sent?"success":"error"),n.sent&&(o(""),d("")),u()}catch(t){e?.(t.message||"Send failed","error")}finally{x(!1)}}}return(0,r.jsxs)("div",{className:"bg-white rounded-2xl border border-orange-100 shadow-xs p-4 mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,r.jsx)("span",{className:"w-8 h-8 rounded-xl bg-orange-50 text-brand-orange flex items-center justify-center shrink-0",children:(0,r.jsxs)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),(0,r.jsx)("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})}),(0,r.jsx)("p",{className:"font-bold text-brand-navy text-sm",children:"Notify attendees here now"})]}),(0,r.jsx)("p",{className:"text-gray-500 text-xs mb-3",children:"Push a message to everyone who checked in with âIâm here.â Great for âRangoli contest starts in 10 min at the main stage.â"}),t.length>1&&(0,r.jsx)("select",{value:a,onChange:e=>i(e.target.value),className:"w-full border border-orange-100 rounded-xl px-3 py-2.5 text-sm bg-white mb-2",children:t.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.title," \xb7 ",e.count," here"]},e.id))}),(0,r.jsxs)("div",{className:"flex items-center justify-between bg-orange-50 rounded-xl px-3 py-2 mb-2",children:[(0,r.jsx)("p",{className:"text-sm font-semibold text-brand-navy truncate",children:m.title}),(0,r.jsxs)("span",{className:"text-brand-orange text-xs font-bold shrink-0",children:[m.count," here now"]})]}),(0,r.jsx)("input",{value:l,onChange:e=>o(e.target.value),maxLength:80,placeholder:`Title (optional â defaults to â${m.title}â)`,className:"w-full border border-orange-100 rounded-xl px-3 py-2.5 text-sm mb-2"}),(0,r.jsx)("textarea",{value:c,onChange:e=>d(e.target.value),maxLength:200,rows:3,placeholder:"Message to everyone here nowâ¦",className:"w-full border border-orange-100 rounded-xl px-3 py-2.5 text-sm resize-none"}),(0,r.jsx)("div",{className:"flex items-center justify-between mt-1 mb-2",children:(0,r.jsxs)("span",{className:"text-gray-400 text-[11px]",children:[c.length,"/200"]})}),(0,r.jsx)("button",{onClick:f,disabled:h||!c.trim()||0===m.count,className:"w-full bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold rounded-xl py-3 text-sm disabled:opacity-50",children:h?"Sendingâ¦":0===m.count?"No one checked in yet":`Send to ${m.count} here now`})]})}var c=n(94430),d=n(62406),h=n(96642);let x="ic_checkin_queue";function u(){try{return JSON.parse(localStorage.getItem(x)||"[]")}catch{return[]}}function m(e){try{localStorage.setItem(x,JSON.stringify(e))}catch{}}function f(){return u().length}function b(e){return u().filter(t=>t.code===e).reduce((e,t)=>"checkout"===t.action?e-t.count:e+t.count,0)}var g=n(27023),p=n(57728);let y=()=>a||=n.e(8067).then(n.t.bind(n,21746,23)).then(e=>e.default),k=(e,t,n)=>Math.max(t,Math.min(n,e));function w(){let e,t=(0,i.useRouter)(),{member:n,loading:a}=(0,d.IG)(),{toast:x}=(0,c.j)(),[w,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(""),[S,C]=(0,s.useState)(null),[_,$]=(0,s.useState)(""),[E,M]=(0,s.useState)(!1),R=(0,p.ZU)(),[I,O]=(0,s.useState)(!1),[L,q]=(0,s.useState)(null),[T,U]=(0,s.useState)(!1),[A,D]=(0,s.use
1State)(""),[P,J]=(0,s.useState)([]),[F,Q]=(0,s.useState)(""),[B,H]=(0,s.useState)([]),[W,G]=(0,s.useState)(!1),[V,Z]=(0,s.useState)(0),X=(0,s.useRef)(null),Y=(0,s.useRef)(null),z=(0,s.useRef)(null),K=(0,s.useRef)(null);function ee(){fetch("/api/member/mod/checkin?stats=1").then(e=>e.json()).then(e=>q(e.stats||[])).catch(()=>{})}function et(e){e&&fetch(`/api/member/mod/checkin?all=1&eventId=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error("offline");return e.json()}).then(t=>{H(t.tickets||[]),(0,h.Io)(`checkin_all_${e}`,t.tickets||[]),G(!1)}).catch(()=>{let t=(0,h.Lj)(`checkin_all_${e}`);t?.data&&(H(t.data),G(!0))})}async function en(){let e=u();if(!e.length)return void Z(0);try{let n=await fetch("/api/member/mod/checkin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"sync",ops:e})});if(!n.ok)throw Error("sync failed");let a=await n.json();var t=e.map(e=>e.opId);let r=new Set(t);m(u().filter(e=>!r.has(e.opId))),Z(f()),G(!1);let s=(a.results||[]).filter(e=>e.ticket).map(e=>e.ticket);if(w){let e=s.find(e=>e.code===w.code);e&&v(t=>({...t,checked_in:e.checked_in}))}ee(),F&&et(F)}catch{G(!0),Z(f())}}async function ea(e){let t=(e=>{try{return new URL(e).searchParams.get("code")||e}catch{return e}})(String(e).trim());if(t){$(""),v(null),C(null),U(!1),M(!0);try{let e=await fetch(`/api/member/mod/checkin?code=${encodeURIComponent(t)}`),n=await e.json().catch(()=>({}));if(!e.ok)throw Error(n.error||"Ticket not found");v(n.ticket),G(!1),F&&n.ticket?.event_id&&Number(n.ticket.event_id)!==Number(F)&&$(`â ï¸ This ticket is for "${n.ticket.event_label}", not the selected event.`)}catch(n){let e=B.find(e=>e.code===t);e?(v(e),G(!0)):$(navigator.onLine?n.message:"Offline â ticket not in this eventâs saved list.")}finally{M(!1)}}}async function er(e,t){if(!e)return void C(null);$(""),v(null),M(!0);try{let n=F?`&eventId=${F}`:"",a=await fetch(`/api/member/mod/checkin?q=${encodeURIComponent(e)}${n}`),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.error||"Search failed");let s=r.tickets||[];G(!1),t&&1===s.length?(C(null),v(await es(s[0].code))):(C(s),s.length||$("No tickets match that name, email, or order number."))}catch(r){let n=e.toLowerCase(),a=B.filter(e=>[e.holder_name,e.holder_email,e.code].some(e=>String(e||"").toLowerCase().includes(n)));a.length?(G(!0),t&&1===a.length?(C(null),v(a[0])):C(a)):$(navigator.onLine?r.message:"Offline â no saved tickets match.")}finally{M(!1)}}async function es(e){try{let t=await fetch(`/api/member/mod/checkin?code=${encodeURIComponent(e)}`),n=await t.json().catch(()=>({}));if(t.ok)return n.ticket}catch{}return B.find(t=>t.code===e)||null}async function ei(e,t){if(!w)return;let n=w.checked_in||0,a=k(t,1,Math.max(0,"checkout"===e?n+b(w.code):w.quantity-n-b(w.code)));a<1||(!function(e){let t=u();t.push(e),m(t),t.length}({opId:`op-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,code:w.code,count:a,action:e,at:Date.now()}),Z(f()),$("checkout"===e?`Checked out ${a}`:`Checked in ${a}`),await en())}(0,s.useEffect)(()=>{if(!a&&n&&!n.is_staff)return void t.replace("/app")},[a,n]),(0,s.useEffect)(()=>{ee(),fetch("/api/member/mod/checkin?events=1").then(e=>e.json()).then(e=>{let t=e.events||[];J(t);let n=t.find(e=>!e.archived);n&&Q(String(n.id))}).catch(()=>{})},[]),(0,s.useEffect)(()=>{et(F)},[F]),(0,s.useEffect)(()=>{Z(f()),en();let e=()=>en();return window.addEventListener("online",e),()=>window.removeEventListener("online",e)},[]),(0,s.useEffect)(()=>{let e=j.trim();if(e.length<2){e||C(null);return}let t=setTimeout(()=>er(e,!1),300);return()=>clearTimeout(t)},[j]);let el=e=>ei("checkin",e),eo=e=>ei("checkout",e);async function ec(e){if(w){M(!0),$("");try{let t=await fetch("/api/member/mod/checkin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set",code:w.code,value:e})}),n=await t.json().catch(()=>({}));if(!t.ok){$(n.error||"Could not update"),n.ticket&&v(n.ticket);return}v(e=>({...e,checked_in:n.ticket.checked_in})),U(!1),$(`Updated â ${n.ticket.checked_in}/${w.quantity} checked in`),ee()}catch(e){$(e.message)}finally{M(!1)}}}async function ed(){if(!navigator.mediaDevices?.getUserMedia)return void $("This device canât scan â search or enter the code instead.");if(!window.isSecureContext)return void $("Camera needs a secure (https) connection â search or enter the code instead.");try{z.current=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}),$(""),O(!0)}catch(e){$(e?.name==="NotAllowedError"?"Camera permission was blocked. Allow camera access in your browser, then try again.":"Could not access the camera â search or enter the code instead."),O(!1)}}function eh(){O(!1)}async function ex(e){let t=await y();return new Promise((n,a)=>{let r=new Image,s=URL.createObjectURL(e);r.onload=()=>{try{let e=r.width,a=r.height,i=Math.min(1,1600/Math.max(e,a));e=Math.round(e*i),a=Math.round(a*i);
1let l=document.createElement("canvas");l.width=e,l.height=a;let o=l.getContext("2d",{willReadFrequently:!0});o.drawImage(r,0,0,e,a);let c=o.getImageData(0,0,e,a);URL.revokeObjectURL(s),n(t(c.data,e,a)?.data||null)}catch(e){URL.revokeObjectURL(s),a(e)}},r.onerror=()=>{URL.revokeObjectURL(s),a(Error("Could not read image"))},r.src=s})}async function eu(e){let t=e.target.files?.[0];if(e.target.value="",t){$("Reading photoâ¦"),M(!0),v(null),C(null);try{let e=await ex(t);e?ea(e):$("Couldnât find a QR code in that photo â fill the frame with the code, or search by name.")}catch{$("Couldnât read that photo â try again or search by name.")}finally{M(!1)}}}(0,s.useEffect)(()=>{t.query.code&&ea(String(t.query.code))},[t.query.code]),(0,s.useEffect)(()=>{if(!I)return;let e=z.current,t=X.current;if(!e||!t)return;let n=0,a=!1;t.srcObject=e,t.setAttribute("playsinline","true"),t.play().catch(()=>{});let r=null;try{"BarcodeDetector"in window&&(r=new window.BarcodeDetector({formats:["qr_code"]}))}catch{}let s=null;r||y().then(e=>{s=e});let i=Y.current,l=async()=>{if(!a){try{if(r){let e=await r.detect(t);if(e[0]?.rawValue){eh(),ea(e[0].rawValue);return}}else if(s&&t.readyState===t.HAVE_ENOUGH_DATA&&i){let e=t.videoWidth,n=t.videoHeight;if(e&&n){i.width=e,i.height=n;let a=i.getContext("2d",{willReadFrequently:!0});a.drawImage(t,0,0,e,n);let r=a.getImageData(0,0,e,n),l=s(r.data,e,n,{inversionAttempts:"dontInvert"});if(l?.data){eh(),ea(l.data);return}}}}catch{}a||(n=requestAnimationFrame(l))}};return n=requestAnimationFrame(l),()=>{a=!0,cancelAnimationFrame(n),e.getTracks().forEach(e=>e.stop()),z.current=null}},[I]);let em=w?k((w.checked_in||0)+b(w.code),0,w.quantity):0,ef=w?w.quantity-em:0;return(0,r.jsxs)(l.Ay,{title:"Check-in",active:"/app/admin",children:[(0,r.jsx)("div",{className:"app-fade-up flex items-center gap-2 mb-3",children:(0,r.jsx)("h1",{className:"text-xl font-extrabold text-brand-navy dark:text-white",children:"Check-in"})}),(0,r.jsx)("p",{className:"app-fade-up text-gray-500 dark:text-white/55 text-sm mb-4",children:"Scan a ticket QR, or search by name, email, or order number. You can check in part of a party now and the rest when they arrive."}),(0,r.jsx)(o,{toast:x}),(W||V>0)&&(0,r.jsxs)("div",{className:"app-fade-up flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-2xl px-3.5 py-2.5 mb-4",children:[(0,r.jsx)("svg",{width:"16",height:"16",className:"text-amber-500 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M1 1l22 22M16.72 11.06A10.94 10.94 0 0 1 19 12.55M5 12.55a10.94 10.94 0 0 1 5.17-2.39M10.71 5.05A16 16 0 0 1 22.58 9M1.42 9a15.91 15.91 0 0 1 4.7-2.88M8.53 16.11a6 6 0 0 1 6.95 0M12 20h.01"})}),(0,r.jsx)("p",{className:"text-amber-700 text-xs font-semibold",children:V>0?`${V} check-in${1===V?"":"s"} saved offline â will sync automatically when back online.`:"Offline â using this eventâs saved ticket list. Check-ins are saved and synced later."}),V>0&&navigator.onLine&&(0,r.jsx)("button",{onClick:en,className:"ml-auto text-amber-800 text-xs font-bold underline shrink-0",children:"Sync now"})]}),P.length>0&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-xs font-semibold text-gray-500 dark:text-white/55 mb-1",children:"Event"}),(0,r.jsxs)("select",{value:F,onChange:e=>Q(e.target.value),className:"w-full border border-orange-100 rounded-xl px-3 py-2.5 text-sm bg-white",children:[(0,r.jsx)("option",{value:"",children:"All events"}),P.filter(e=>!e.archived).map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.title,e.date?` \xb7 ${e.date}`:""]},e.id)),P.some(e=>e.archived)&&(0,r.jsx)("optgroup",{label:"Archived (past)",children:P.filter(e=>e.archived).map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.title,e.date?` \xb7 ${e.date}`:""]},e.id))})]}),(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-[11px] mt-1",children:"Pick an event to focus name search and flag tickets scanned for the wrong event."})]}),L&&L.length>0&&(()=>{let e=F?L.filter(e=>Number(e.event_id)===Number(F)):L;return e.length?(0,r.jsx)("div",{className:"space-y-3 mb-4",children:e.map(e=>{let t=Math.max(0,e.guests-e.checked_in),n=e.guests?Math.round(e.checked_in/e.guests*100):0;return(0,r.jsxs)("div",{className:"bg-white rounded-2xl border border-orange-100 shadow-xs p-4",children:[(0,r.jsx)("p",{className:"font-bold text-brand-navy dark:text-white",children:e.event_label}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-2 mt-3 text-center",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-2xl font-extrabold text-brand-green-dark dark:text-brand-green-light",children:e.checked_in}),(0,r.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-[11px] font-semibold uppercase tracking-wide",children:"Checked in"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-2xl font-extrabold text-brand-orange dark:text-brand-saffron",children:t}),(0,r.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-[11px] font-semibold uppercase tracking-wide",children:"To arrive"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-2xl font-extrabold text-brand-navy dark:text-white",children:e.guests}),(0,r.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-[11px] font-semibold uppercase tracking-wide",children:"Total guests"})]})]}),(0,r.jsx)("div",{className:"mt-3 h-2 rounded-full bg-gray-100 overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded-full bg-linear-to-r from-brand-orange to-brand-saffron",style:{width:`${n}%`}})}),(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-[11px] mt-1.5",children:(0,g.f)(e)})]},e.event_id)})}):null})(),(0,r.jsxs)("div",{className:"bg-white rounded-2xl border border-orange-100 shadow-xs p-4 mb-4",children:[I?(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("video",{ref:X,className:"w-full rounded-xl bg-black aspect-square object-cover",muted:!0,playsInl
1ine:!0}),(0,r.jsx)("canvas",{ref:Y,className:"hidden"}),(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-xs mt-2",children:"Point the camera at the ticket QRâ¦"}),(0,r.jsx)("button",{onClick:eh,className:"mt-2 text-gray-500 dark:text-white/55 text-sm font-bold",children:"Stop scanning"})]}):(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("button",{onClick:ed,className:"w-full bg-brand-navy text-white font-bold rounded-xl py-3 text-sm",children:"Scan QR with camera (live)"}),(0,r.jsx)("button",{onClick:()=>K.current?.click(),className:"w-full border border-orange-100 text-brand-navy dark:text-white font-bold rounded-xl py-3 text-sm",children:"Take a photo of the QR"}),"ios"===R&&(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-[11px] text-center",children:"Live scanning isnât supported in the iPhone app â use âTake a photoâ."})]}),(0,r.jsx)("input",{ref:K,type:"file",accept:"image/*",capture:"environment",onChange:eu,className:"hidden"}),(0,r.jsxs)("form",{onSubmit:function(e){e?.preventDefault(),er(j.trim(),!0)},className:"flex gap-2 mt-3",children:[(0,r.jsx)("input",{value:j,onChange:e=>N(e.target.value),placeholder:"Search name, email, or order #â¦",className:"flex-1 border border-orange-100 rounded-xl px-4 py-2.5 text-sm"}),(0,r.jsx)("button",{className:"bg-orange-50 text-brand-orange dark:text-brand-saffron text-sm font-bold rounded-xl px-4",children:"Search"})]})]}),E&&(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-sm text-center py-2",children:"Workingâ¦"}),_&&(0,r.jsx)("p",{className:`text-sm text-center py-2 ${/^(Checked in|Checked out|Updated)/.test(_)?"text-brand-green-dark dark:text-brand-green-light":"text-red-600"}`,children:_}),S&&S.length>0&&(0,r.jsx)("div",{className:"space-y-2 mb-4",children:S.map(e=>(0,r.jsxs)("button",{onClick:async()=>{C(null),v(await es(e.code))},className:"w-full text-left bg-white rounded-2xl border border-orange-100 shadow-xs p-3.5 active:scale-[0.99] transition-transform",children:[(0,r.jsxs)("p",{className:"font-bold text-brand-navy dark:text-white",children:[e.holder_name||"â"," ",(0,r.jsxs)("span",{className:"text-gray-400 dark:text-white/45 font-normal text-xs",children:["\xb7 ",e.checked_in,"/",e.quantity," in"]})]}),(0,r.jsxs)("p",{className:"text-gray-500 dark:text-white/55 text-xs",children:[e.holder_email," \xb7 ",e.event_label]}),(0,r.jsxs)("p",{className:"text-gray-400 dark:text-white/45 text-[11px] font-mono mt-0.5",children:["Order #",e.code]})]},e.id))}),w&&(0,r.jsxs)("div",{className:"bg-white rounded-2xl border border-orange-100 shadow-xs p-5",children:[(0,r.jsx)("p",{className:"font-extrabold text-brand-navy dark:text-white text-lg",children:w.event_label}),(0,r.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-sm",children:(e=w.event_date)?new Date(e+"T00:00:00").toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",timeZone:"America/New_York"}):""}),(0,r.jsxs)("p",{className:"text-gray-700 dark:text-white/80 text-sm mt-2",children:["Holder: ",(0,r.jsx)("b",{children:w.holder_name||"â"}),w.holder_email?` \xb7 ${w.holder_email}`:""]}),(0,r.jsxs)("p",{className:"text-gray-400 dark:text-white/45 text-xs font-mono",children:["Order #",w.code]}),(0,r.jsxs)("p",{className:"text-gray-700 dark:text-white/80 text-sm mt-1",children:["Admits ",(0,r.jsx)("b",{children:w.quantity})," \xb7 checked in ",(0,r.jsx)("b",{children:em})," \xb7 remaining ",(0,r.jsx)("b",{children:ef})]}),ef>0?(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsxs)("button",{onClick:()=>el(ef),disabled:E,className:"w-full bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold rounded-xl py-3 text-sm disabled:opacity-50",children:["Check in all ",ef]}),w.quantity>1&&(0,r.jsx)("div",{className:"flex gap-2 mt-2",children:[1,2,3,4].filter(e=>e<=ef).map(e=>(0,r.jsxs)("button",{onClick:()=>el(e),disabled:E,className:"flex-1 border border-orange-100 text-brand-navy dark:text-white font-bold rounded-xl py-2.5 text-sm disabled:opacity-50",children:["+",e]},e))})]}):(0,r.jsxs)("p",{className:"mt-4 text-center text-brand-green-dark dark:text-brand-green-light font-bold text-sm bg-green-50 rounded-xl py-3",children:["All ",w.quantity," checked in â"]}),em>0&&!T&&(0,r.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-[11px] font-semibold uppercase tracking-wide",children:"Correct the count"}),(0,r.jsx)("button",{onClick:()=>{D(String(em)),U(!0)},className:"text-brand-navy dark:text-white text-xs font-bold underline",children:"Edit number"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{onClick:()=>eo(em),disabled:E,className:"flex-1 border border-red-200 text-red-600 font-bold rounded-xl py-2.5 text-sm disabled:opacity-50",children:["Check out all ",em]}),em>1&&[1,2,3].filter(e=>e<em).map(e=>(0,r.jsxs)("button",{onClick:()=>eo(e),disabled:E,className:"border border-orange-100 text-gray-700 dark:text-white/80 font-bold rounded-xl py-2.5 px-3 text-sm disabled:opacity-50",children:["â",e]},e))]})]}),T&&(0,r.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100",children:[(0,r.jsxs)("p",{className:"text-gray-400 dark:text-white/45 text-[11px] font-semibold uppercase tracking-wide mb-2",children:["Set exact number checked in (0â",w.quantity,")"]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("input",{type:"number",inputMode:"numeric",min:0,max:w.quantity,value:A,onChange:e=>D(e.target.value),className:"w-20 border border-orange-100 rounded-xl px-3 py-2.5 text-sm text-center"}),(0,r.jsx)("button",{onClick:()=>ec(A),disabled:E||""===A,className:"flex-1 bg-brand-navy text-white font-bold rounded-xl py-2.5 text-sm disabled:opacity-50",children:"Save"}),(0,r.jsx)("button",{onClick:()=>U(!1),disabled:E,className:"border border-orange-100 text-gray-700 dark:text-white/80 font-bold rounded-xl py-2.5 px-3 text-sm",children:"Cancel"})]})]})]}),(0,r.jsx)("div",{className:"h-20","aria-hidden":"true"})]})}},96642:(e,t,n)=>{"use strict";n.d(t,{Io:()=>r,Lj:()=>s,w0:()=>i});let a="ic_cache_";function r(e,t){try{localStorage.setItem(a+e,JSON.stringify({at:Date.now(),data:t}))}catch{}}function s(e){try{let t=localStorage.getItem(a+e);return t?JSON.parse(t):null}catch{return null}}function i(e){if(!e)return"";let t=Math.floor((Date.now()-e)/6e4);if(t<1)return"just now";if(t<60)return`${t} min ago`;let n=Math.floor(t/60);if(n<24)return`${n} hr${1===n?"":"s"} ago`;let a=Math.floor(n/24);return`${a} day${1===a?"":"s"} ago`}}},e=>
1{e.O(0,[8230,900,6475,2422,636,6593,8792],()=>e(e.s=36278)),_N_E=e.O()}]);
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.