PageSourceSearch

https://manitou-beach.vercel.app/assets/PrizeRedeemPage-COWVRugf.js

js manitou-beach.vercel.app collected 2026-10-03 07:17:54 UTC 6,905 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-sXzA9O_1.js","assets/index-Dnyn28Md.js"])))=>i.map(i=>d[i]);
2import{o as R,r as i,j as e,C as t,G as L,N as B,F as w,_ as P}from"./index-Dnyn28Md.js";const S={width:"100%",padding:"12px 16px",borderRadius:10,border:`1.5px solid ${t.sand}`,fontFamily:"'Libre Franklin', sans-serif",fontSize:16,color:t.text,background:"#fff",outline:"none",boxSizing:"border-box",textTransform:"uppercase",letterSpacing:2};function E(){const[F]=R(),[o,p]=i.useState((F.get("code")||"").toUpperCase()),[s,x]=i.useState(""),[m,u]=i.useState(!1),[r,a]=i.useState(null),[v,l]=i.useState(!1);i.useRef(null);const d=i.useRef(null),h=()=>{},g=async()=>{if(o.trim()&&s.trim()){u(!0),a(null);try{const c=await(await fetch("/api/prize-wheel/redeem",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({claimCode:o.trim(),vendorPin:s.trim()})})).json();a(c)}catch{a({ok:!1,error:"Network error. Check connection and try again."})}u(!1)}},C=async()=>{l(!0);try{const{Html5Qrcode:n}=await P(async()=>{const{Html5Qrcode:f}=await import("./index-sXzA9O_1.js");return{Html5Qrcode:f}},__vite__mapDeps([0,1])),c=new n("qr-reader-redeem");d.current=c,await c.start({facingMode:"environment"},{fps:10,qrbox:{width:240,height:240}},f=>{let k=f;try{const j=new URL(f).searchParams.get("code");j&&(k=j)}catch{}c.stop().catch(()=>{}),d.current=null,l(!1),p(k.toUpperCase())},()=>{})}catch(n){console.error("QR scanner error:",n),l(!1)}},y=()=>{d.current&&(d.current.stop().catch(()=>{}),d.current=null),l(!1)};i.useEffect(()=>()=>y(),[]);const z=()=>{p(""),x(""),a(null),l(!1)},b={fontSize:11,fontWeight:700,letterSpacing:1,textTransform:"uppercase",color:t.textMuted,display:"block",marginBottom:6,fontFamily:"'Libre Franklin', sans-serif"};return e.jsxs("div",{style:{background:t.cream,minHeight:"100vh"},children:[e.jsx(L,{}),e.jsx(B,{activeSection:"",scrollTo:h,isSubPage:!0}),e.jsxs("div",{style:{maxWidth:500,margin:"0 auto",padding:"120px 24px 80px"},children:[e.jsxs("div",{style:{marginBottom:28},children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,letterSpacing:1.5,textTransform:"uppercase",color:t.sunset,marginBottom:8,fontFamily:"'Libre Franklin', sans-serif"},children:"Vendor Tool"}),e.jsx("h1",{style:{fontFamily:"'Libre Baskerville', serif",fontSize:"clamp(24px, 5vw, 34px)",fontWeight:400,color:t.dusk,margin:"0 0 10px"},children:"Mark a Prize Redeemed"}),e.jsx("p",{style:{color:t.textLight,fontSize:15,lineHeight:1.6,margin:0,fontFamily:"'Libre Franklin', sans-serif"},children:"Scan the customer's QR code or type their code, enter your PIN, and tap the button."})]}),(r==null?void 0:r.ok)&&e.jsxs("div",{style:{background:"#F0FDF4",border:"2px solid #86EFAC",borderRadius:16,padding:"28px 24px",textAlign:"center",marginBottom:24},children:[e.jsx("div",{style:{fontSize:56,marginBottom:12,lineHeight:1},children:"✅"}),e.jsx("h2",{style:{fontFamily:"'Libre Baskerville', serif",fontSize:22,color:"#15803D",margin:"0 0 8px"},children:"Prize Redeemed!"}),e.jsx("p",{style:{fontSize:18,fontWeight:700,color:"#166534",margin:"0 0 4px",fontFamily:"'Libre Franklin', sans-serif"},children:r.prize}),e.jsxs("p",{style:{fontSize:14,color:"#15803D",margin:"0 0 20px",fontFamily:"'Libre Franklin', sans-serif"},children:["from ",r.sponsor]}),e.jsx("button",{onClick:z,style:{padding:"12px 28px",borderRadius:10,border:"none",background:"#15803D",color:"#fff",fontSize:15,fontWeight:600,cursor:"pointer",fontFamily:"'Libre Franklin', sans-serif"},children:"Redeem Another"})]}),r&&!r.ok&&e.jsxs("div",{style:{background:"#FEF2F2",border:"2px solid #FECACA",borderRadius:16,padding:"28px 24px",textAlign:"center",marginBottom:24},children:[e.jsx("div",{style:{fontSize:56,marginBottom:12,lineHeight:1},children:"❌"}),e.jsx("h2",{style:{fontFamily:"'Libre Baskerville', serif",fontSize:22,color:"#B91C1C",margin:"0 0 8px"},children:"Can't Redeem"}),e.jsx("p",{style:{fontSize:15,color:"#991B1B",margin:"0 0 20px",fontFamily:"'Libre Franklin', sans-serif",lineHeight:1.6},children:r.error}),e.jsx("button",{onClick:()=>a(null),style:{padding:"12px 28px",borderRadius:10,border:"none",background:"#B91C1C",color:"#fff",fontSize:15,fontWeight:600,cursor:"pointer",fontFamily:"'Libre Franklin', sans-serif"},children:"Try Again"})]}
2),!(r!=null&&r.ok)&&e.jsxs("div",{style:{background:"#fff",borderRadius:16,padding:"24px",border:`1.5px solid ${t.sand}`,boxShadow:"0 2px 12px rgba(0,0,0,0.06)"},children:[e.jsx("div",{style:{marginBottom:20},children:v?e.jsxs("div",{children:[e.jsx("div",{id:"qr-reader-redeem",style:{width:"100%",borderRadius:10,overflow:"hidden"}}),e.jsx("button",{onClick:y,style:{marginTop:10,width:"100%",padding:"10px",borderRadius:8,border:`1.5px solid ${t.sand}`,background:"#fff",color:t.textMuted,fontSize:14,cursor:"pointer",fontFamily:"'Libre Franklin', sans-serif"},children:"Cancel Scan"})]}):e.jsxs("button",{onClick:C,style:{width:"100%",padding:"12px",borderRadius:10,border:`1.5px solid ${t.lakeBlue}`,background:`${t.lakeBlue}10`,color:t.lakeBlue,fontSize:15,fontWeight:600,cursor:"pointer",fontFamily:"'Libre Franklin', sans-serif",display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[e.jsx("span",{style:{fontSize:20},children:"📷"})," Scan QR Code"]})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,margin:"0 0 20px"},children:[e.jsx("div",{style:{flex:1,height:1,background:t.sand}}),e.jsx("span",{style:{fontSize:12,color:t.textMuted,fontFamily:"'Libre Franklin', sans-serif"},children:"or type it in"}),e.jsx("div",{style:{flex:1,height:1,background:t.sand}})]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:b,children:"Claim Code"}),e.jsx("input",{style:S,placeholder:"MB-XXXX-XX",value:o,onChange:n=>p(n.target.value.toUpperCase().replace(/[^A-Z0-9-]/g,"")),maxLength:11})]}),e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("label",{style:b,children:"Your Vendor PIN"}),e.jsx("input",{style:{...S,letterSpacing:6,textTransform:"none"},type:"password",inputMode:"numeric",placeholder:"PIN",value:s,onChange:n=>x(n.target.value),maxLength:6,onKeyDown:n=>n.key==="Enter"&&g()})]}),e.jsx("button",{onClick:g,disabled:m||!o.trim()||!s.trim(),style:{width:"100%",padding:"15px",borderRadius:10,border:"none",background:!o.trim()||!s.trim()?t.sand:t.sunset,color:!o.trim()||!s.trim()?t.textMuted:"#fff",fontSize:16,fontWeight:700,cursor:m||!o.trim()||!s.trim()?"not-allowed":"pointer",fontFamily:"'Libre Franklin', sans-serif",transition:"background 0.2s"},children:m?"Checking...":"Mark Redeemed"}),e.jsx("p",{style:{marginTop:16,fontSize:12,color:t.textMuted,lineHeight:1.6,textAlign:"center",fontFamily:"'Libre Franklin', sans-serif"},children:"This marks the prize as used in the system. Only tap it once the customer is in front of you ready to receive the deal."})]})]}),e.jsx(w,{scrollTo:h})]})}export{E 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.