1import{j as e,N as F}from"./index-DknunFSe.js";import{r as a}from"./vendor-react-CNpY0XEk.js";import"./vendor-google-CFE1saLJ.js";function W(o){return o?/^E\d+$/i.test(o.trim()):!1}const K=()=>{const[o,h]=a.useState(null),[b,g]=a.useState(null),[T,$]=a.useState(!0),[c,r]=a.useState("identify"),[l,p]=a.useState(""),[i,G]=a.useState(""),[v,w]=a.useState(""),[y,j]=a.useState(""),[k,N]=a.useState(""),[C,S]=a.useState(""),[A,E]=a.useState(!1),[x,M]=a.useState(!1),[L,u]=a.useState(""),[P,I]=a.useState(!1),[R,d]=a.useState(""),[z,V]=a.useState({x:0,y:0}),X=n=>{const s=n.currentTarget.getBoundingClientRect(),t=(n.clientX-s.left)/s.width-.5,f=(n.clientY-s.top)/s.height-.5;V({x:f*-14,y:t*16})},B=()=>V({x:0,y:0});a.useEffect(()=>{(async()=>{const f=localStorage.getItem("morphyxToken")||"";try{const[m,_]=await Promise.all([f?fetch("/api/reservation/register?action=admin-check",{headers:{Authorization:`Bearer ${f}`}}):Promise.resolve(null),fetch("/api/reservation/register?action=guest-list-status")]),U=m&&m.ok?(await m.json()).isAdmin===!0:!1;h(U);const q=await _.json();g(_.ok&&q.enabled===!0)}catch{h(!1),g(!1)}finally{$(!1)}})();const s=new URLSearchParams(window.location.search),t=s.get("code")||s.get("email");t&&p(t)},[]);const Y=async n=>{if(n.preventDefault(),!!l.trim()){M(!0),u("");try{const s=await fetch(`/api/reservation/register?action=verify-email&email=${encodeURIComponent(l.trim())}`),t=await s.json();s.ok&&t.registered?(G(t.name),w(t.position||""),j(t.company||""),N(t.avatar_url||""),S(t.seat_number||""),t.self_attendance?(E(!0),r("success")):t.avatar_url?r("confirm"):r("avatar_required")):u(t.message||"This email or invitation code is not registered for the event.")}catch(s){console.error("Verify error:",s),u("Network error. Please try again.")}finally{M(!1)}}},O=async()=>{I(!0),d("");try{const n=localStorage.getItem("morphyxToken")||"",s=await fetch("/api/reservation/register?action=self-attend",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({identifier:l.trim()})}),t=await s.json();s.ok?(E(!!t.already),t.position&&w(t.position),t.company&&j(t.company),t.avatar_url&&N(t.avatar_url),t.seat_number&&S(t.seat_number),r("success")):t.avatarRequired?r("avatar_required"):d(t.message||"Failed to validate attendance.")}catch(n){console.error("Attendance error:",n),d("Network error. Please try again.")}finally{I(!1)}};return T?e.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-lime-500"})}):!b&&!o?e.jsx(F,{}):e.jsxs("div",{className:"min-h-screen bg-black text-white relative flex flex-col items-center justify-center pt-28 pb-12 px-4 font-sans select-none",children:[e.jsx("style",{children:` 2 @keyframes epass-float { 3 0%, 100% { transform: translateY(0); } 4 50% { transform: translateY(-8px); } 5 } 6 .epass-float { 7 animation: epass-float 4s ease-in-out infinite; 8 } 9 @keyframes epass-shine-sweep { 10 0% { background-position: -150% -150%; } 11 100% { background-position: 150% 150%; } 12 } 13 .epass-shine-sweep { 14 background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.16) 50%, transparent 60%); 15 background-size: 250% 250%; 16 animation: epass-shine-sweep 4s ease-in-out infinite; 17 mix-blend-mode: screen; 18 } 19 @media (prefers-reduced-motion: reduce) { 20 .epass-float, .epass-shine-sweep { animation: none; } 21 } 22 `}),e.jsx("div",{className:"absolute inset-0 bg-[length:100%_100%] bg-no-repeat bg-center select-none opacity-80 z-0",style:{backgroundImage:"url('/reservation/PANEL 2/BG REGISTER.png')"}}),e.jsx("div",{className:"absolute inset-0 bg-black/55 z-0"}),e.jsx("div",{className:"relative z-10 w-full max-w-md p-[2.5px] rounded-[2.5rem] shadow-2xl mx-4",style:{background:"linear-gradient(135deg, #b9ff00 0%, #bf00ff 100%)"},children:e.jsxs("div",{className:"rounded-[2.4rem] p-8 md:p-10 w-full flex flex-col items-center",style:{background:"linear-gradient(135deg, rgba(185, 255, 0, 0.15) 0%, #000000 15%, #000000 85%, rgba(191, 0, 255, 0.15) 100%)"},children:[c==="identify"&&e.jsxs("div",{className:"w-full flex flex-col items-center",children:[b===!1&&e.jsx("div",{className:"w-full mb-6 p-3 bg-yellow-950/40 border border-yellow-500/40 rounded-xl text-yellow-300 text-[11px] text-center",children:"â ï¸ Admin preview: guest self check-in is currently OFF for the public. Only admins can test this flow right now."}),e.jsx("h2",{className:"text-3xl font-black tracking-wide mb-3 text-neutral-200 text-center",children:"Validate Attendance"}),e.jsx("p",{className:"text-gray-400 text-xs md:text-sm text-center mb-8 font-light max-w-xs leading-relaxed",children:"Welcome to the MCS Launch Event! Enter your registered email or the invitation code from your confirmation email to check in."}),e.jsxs("form",{onSubmit:Y,className:"w-full space-y-6",children:[L&&e.jsxs("div",{className:"p-3 bg-red-950/40 border border-red-500/50 rounded-xl text-red-400 text-xs text-center",children:["â ï¸ ",L]}),e.jsxs("div",{className:"text-left w-full",children:[e.jsx("label",{className:"block text-white text-xs font-semibold mb-2 ml-2",children:"Email or Invitation Code:"}),e.jsx("input",{type:"text",required:!0,placeholder:"[email protected] or MCS-XXXXXX",value:l,onCh
22ange:n=>p(n.target.value),className:"w-full bg-black/90 border border-neutral-800 rounded-full px-6 py-3 text-base sm:text-sm text-white placeholder-gray-600 transition-all focus:outline-none focus:border-[#b9ff00] focus:ring-1 focus:ring-[#b9ff00]"})]}),e.jsxs("div",{className:"flex flex-col space-y-4 pt-4 w-full",children:[e.jsx("button",{type:"submit",disabled:x||!l.trim(),className:`py-3 rounded-full font-bold text-black text-sm tracking-wide transition-all duration-300 shadow-md ${l.trim()&&!x?"bg-[#b9ff00] hover:bg-[#adff00] hover:scale-[1.03] active:scale-95":"bg-gray-800 text-gray-500 cursor-not-allowed"}`,children:x?"Verifying...":"Continue"}),e.jsx("button",{type:"button",onClick:()=>window.location.href="/reservation",className:"py-3 text-sm text-neutral-400 hover:text-white transition-colors duration-300 font-medium",children:"â Back to Event Page"})]})]})]}),c==="avatar_required"&&e.jsxs("div",{className:"w-full flex flex-col items-center text-center",children:[e.jsxs("h2",{className:"text-3xl font-black tracking-wide mb-3 text-neutral-200",children:["Hi, ",e.jsx("span",{className:"text-[#b9ff00]",children:i}),"!"]}),e.jsx("p",{className:"text-gray-400 text-xs md:text-sm mb-8 font-light max-w-xs leading-relaxed",children:"You need to create your event avatar first before we can check you in and generate your e-pass."}),e.jsx("div",{className:"w-28 h-28 rounded-full p-[1.5px] mb-8 flex items-center justify-center",style:{background:"linear-gradient(135deg, #b9ff00 0%, #bf00ff 100%)"},children:e.jsx("div",{className:"w-full h-full rounded-full bg-black flex items-center justify-center",children:e.jsx("svg",{className:"w-12 h-12 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"})})})}),e.jsxs("div",{className:"flex flex-col space-y-4 w-full",children:[e.jsx("button",{onClick:()=>window.location.href=`/reservation/avatar?code=${encodeURIComponent(l.trim())}&returnTo=attendance`,className:"w-full py-3.5 bg-[#b9ff00] hover:bg-[#adff00] text-black font-extrabold text-sm rounded-full tracking-wide transition-all transform hover:scale-[1.03] active:scale-95 shadow-md shadow-lime-500/10",children:"Create My Avatar"}),e.jsx("button",{onClick:()=>r("identify"),className:"text-xs text-neutral-400 hover:text-white transition-colors py-1.5",children:"â Not you? Go back"})]})]}),c==="confirm"&&e.jsxs("div",{className:"w-full flex flex-col items-center text-center",children:[e.jsxs("h2",{className:"text-3xl font-black tracking-wide mb-3 text-neutral-200",children:["Hi, ",e.jsx("span",{className:"text-[#b9ff00]",children:i}),"!"]}),e.jsx("p",{className:"text-gray-400 text-xs md:text-sm mb-8 font-light max-w-xs leading-relaxed",children:"Tap the button below to confirm you have arrived at the MCS Launch Event."}),e.jsx("div",{className:"w-28 h-28 rounded-full p-[1.5px] mb-8 flex items-center justify-center",style:{background:"linear-gradient(135deg, #b9ff00 0%, #bf00ff 100%)"},children:e.jsx("div",{className:"w-full h-full rounded-full bg-black flex items-center justify-center",children:e.jsxs("svg",{className:"w-12 h-12 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})})}),R&&e.jsxs("div",{className:"p-3 mb-6 bg-red-950/40 border border-red-500/50 rounded-xl text-red-400 text-xs text-center w-full",children:["â ï¸ ",R]}),e.jsxs("div",{className:"flex flex-col space-y-4 w-full",children:[e.jsx("button",{onClick:O,disabled:P,className:"w-full py-3.5 bg-[#b9ff00] hover:bg-[#adff00] text-black font-extrabold text-sm rounded-full tracking-wide transition-all transform hover:scale-[1.03] active:scale-95 shadow-md shadow-lime-500/10 disabled:opacity-60",children:P?"Confirming...":"I'm Here â Confirm Attendance"}),e.jsx("button",{onClick:()=>{r("identify"),d("")},className:"text-xs text-neutral-400 hover:text-white transition-colors py-1.5",children:"â Not you? Go back"})]})]}),c==="success"&&e.jsxs("div",{className:"w-full flex flex-col items-center text-center animate-fade-in-up",children:[e.jsx("h2",{className:"text-2xl font-black tracking-wide mb-6 text-neutral-200",children:A?"Already Checked In":"Attendance Confirmed!"}),e.jsx("div",{className:"w-full max-w-[300px] mx-auto epass-float",style:{perspective:"1000px"},onMouseMove:X,onMouseLeave:B,children:e.jsxs("div",{className:"relative w-full p-[2px] rounded-[2rem]
22shadow-2xl",style:{background:"linear-gradient(135deg, #b9ff00 0%, #bf00ff 100%)",transform:`rotateX(${z.x}deg) rotateY(${z.y}deg)`,transition:"transform 0.15s ease-out"},children:[W(C)&&e.jsx("div",{className:"absolute -top-2 -right-2 z-30 px-3 py-1 rounded-full bg-gradient-to-r from-[#ffd700] to-[#ff9d00] text-black text-[10px] font-black tracking-widest shadow-lg rotate-6 select-none",children:"â
VIP"}),e.jsxs("div",{className:"relative overflow-hidden rounded-[1.9rem] p-6 w-full flex flex-col items-center bg-black",style:{background:"linear-gradient(135deg, rgba(185, 255, 0, 0.15) 0%, #000000 15%, #000000 85%, rgba(191, 0, 255, 0.15) 100%)"},children:[e.jsx("div",{className:"epass-shine-sweep pointer-events-none absolute inset-0 z-20"}),e.jsx("div",{className:"w-11 h-11 rounded-full bg-black border border-neutral-800 flex items-center justify-center mb-4 shadow-md",children:e.jsx("img",{src:"/logos/FAVICON MORPHYX-01.png",alt:"Morphyx",className:"w-6 h-6 object-contain"})}),e.jsx("div",{className:"p-[3px] rounded-full mb-4 shadow-lg",style:{background:"linear-gradient(135deg, #b9ff00 0%, #bf00ff 100%)"},children:e.jsx("div",{className:"w-24 h-24 rounded-full overflow-hidden bg-neutral-900 flex items-center justify-center",children:k?e.jsx("img",{src:k,alt:i,className:"w-full h-full object-cover"}):e.jsx("span",{className:"text-3xl font-black text-neutral-600",children:i.charAt(0).toUpperCase()})})}),e.jsx("h3",{className:"text-xl font-black text-white leading-tight",children:i}),v&&e.jsx("p",{className:"text-[#b9ff00] text-xs font-bold uppercase tracking-wide mt-1",children:v}),y&&e.jsx("p",{className:"text-gray-400 text-xs font-light mt-0.5",children:y}),e.jsxs("div",{className:"w-full mt-5 pt-4 border-t border-neutral-800/70 flex items-center justify-between text-left",children:[e.jsxs("div",{children:[e.jsx("span",{className:"block text-[9px] uppercase tracking-wider text-gray-500 font-bold",children:"Event"}),e.jsx("span",{className:"block text-[11px] text-white font-semibold",children:"MCS Launch Event"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("span",{className:"block text-[9px] uppercase tracking-wider text-gray-500 font-bold",children:"Seat"}),e.jsx("span",{className:"block text-[11px] text-[#b9ff00] font-bold font-mono",children:C||"TBA"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"block text-[9px] uppercase tracking-wider text-gray-500 font-bold",children:"Status"}),e.jsx("span",{className:"block text-[11px] text-[#b9ff00] font-bold",children:"â Checked In"})]})]})]})]})}),e.jsx("p",{className:"text-gray-300 text-xs md:text-sm max-w-xs mt-8 mb-8 font-light leading-relaxed",children:A?`Welcome back, ${i}! Your attendance was already validated. Enjoy the event!`:`Welcome, ${i}! Your attendance has been validated. Enjoy the MCS Launch Event!`}),e.jsxs("div",{className:"flex flex-col space-y-4 w-full max-w-[260px]",children:[e.jsx("button",{onClick:()=>window.location.href="/reservation/avatar",className:"w-full py-3 bg-[#b9ff00] hover:bg-[#adff00] text-black font-bold text-sm rounded-full tracking-wide transition-all transform hover:scale-105 active:scale-95 shadow-md",children:"Create / View Avatar"}),e.jsx("button",{onClick:()=>window.location.href="/reservation",className:"w-full py-3 bg-neutral-900 hover:bg-neutral-800 text-white border border-neutral-800 rounded-full font-bold text-xs tracking-wide transition-all",children:"Return to Event Page"})]})]})]})})]})};export{K 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.