1import{a1 as b,r as a,ah as j,ai as N,j as e,C as c,d as o,b as d}from"./index-DbZOmY8Y.js";import{B as y}from"./badge-Duxj7S1s.js";import{A as v}from"./arrow-right-CLPFoKrn.js";import{L as w}from"./lock-D4p4gyhu.js";const S={packing:"Open",sealed:"Sealed",delivered:"Arrived",unpacked:"Done"},m={packing:"bg-blue-100 text-blue-800",sealed:"bg-purple-100 text-purple-800",delivered:"bg-green-100 text-green-800",unpacked:"bg-gray-100 text-gray-800"},x=t=>t?t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase()):"Not set",B=()=>{const{shareToken:t}=b(),[s,u]=a.useState(null),[p,n]=a.useState(!0),[h,r]=a.useState(!1);a.useEffect(()=>{t&&f()},[t]);const f=async()=>{n(!0);try{const i=await fetch(`${j}/functions/v1/get-box-label`,{method:"POST",headers:{"Content-Type":"application/json",apikey:N},body:JSON.stringify({share_token:t})});if(!i.ok){r(!0);return}const l=await i.json();l.error?r(!0):u(l)}catch{r(!0)}finally{n(!1)}};if(p)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--snapfind-primary-gradient)"},children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-8 h-8 border-2 border-white border-t-transparent rounded-full animate-spin mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-white/80",children:"Loading box details..."})]})});if(h)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--snapfind-primary-gradient)"},children:e.jsx(c,{className:"max-w-md mx-4",children:e.jsxs(o,{className:"pt-6 text-center py-8",children:[e.jsx(d,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground/30"}),e.jsx("h2",{className:"text-xl font-bold mb-2",children:"Box Not Found"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This box label link is invalid or has been removed."})]})})});if(!s)return null;const g=m[s.status]||m.packing;return e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"var(--snapfind-primary-gradient)"},children:e.jsx(c,{className:"max-w-md w-full shadow-2xl",children:e.jsxs(o,{className:"pt-8 pb-8 text-center",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("div",{className:"w-14 h-14 rounded-xl mx-auto mb-3 flex items-center justify-center",style:{background:"var(--snapfind-primary-gradient)"},children:e.jsx(d,{className:"w-7 h-7 text-white"})}),e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"SnapFind Storage Location"})]}),e.jsx("h1",{className:"text-2xl font-bold mb-4",children:s.box_name}),e.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase",children:"From"}),e.jsx("p",{className:"font-medium",children:x(s.from_room)})]}),e.jsx(v,{className:"w-5 h-5 text-purple-600"}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase",children:"To"}),e.jsx("p",{className:"font-medium",children:x(s.to_room)})]})]}),e.jsxs("div",{className:"flex items-center justify-center gap-3 mb-6",children:[e.jsx(y,{className:`${g} border-0`,children:S[s.status]||s.status}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[s.item_count," item",s.item_count!==1?"s":""]})]}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(w,{className:"w-4 h-4 shrink-0"}),e.jsx("p",{children:"Item details are only visible to the box owner."})]})]})})})};export{B as default};
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.