1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60],{8060:function(e,t,n){n.d(t,{default:function(){return u}});var a=n(7437),r=n(7648),s=n(3145),i=n(4362),l=n(2265),o=n(6096);function c(){let{user:e,isAuthenticated:t,isLoading:n,logout:c}=(0,i.a)(),[d,m]=(0,l.useState)(!1),u=(0,l.useRef)(null);return(0,l.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&m(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,a.jsx)("header",{className:"sticky top-0 z-50 border-b border-gray-200 bg-white/90 backdrop-blur-md",children:(0,a.jsxs)("div",{className:"mx-auto flex h-16 max-w-7xl items-center justify-between px-4 sm:px-6 lg:px-8",children:[(0,a.jsxs)(r.default,{href:"/",className:"flex items-center gap-2.5 no-underline",children:[(0,a.jsx)(s.default,{src:o.Z,alt:"HackDemo",width:36,height:36,className:"rounded-lg",priority:!0}),(0,a.jsx)("span",{className:"text-lg font-semibold tracking-tight text-gray-900",children:"HackDemo"})]}),(0,a.jsxs)("nav",{className:"hidden sm:flex items-center gap-1",children:[(0,a.jsx)(r.default,{href:"/",className:"rounded-lg px-3 py-2 text-sm font-medium text-gray-600 no-underline transition-colors hover:bg-gray-100 hover:text-gray-900",children:"Home"}),(0,a.jsx)(r.default,{href:"/pricing",className:"rounded-lg px-3 py-2 text-sm font-medium text-gray-600 no-underline transition-colors hover:bg-gray-100 hover:text-gray-900",children:"Pricing"}),(0,a.jsx)(r.default,{href:"/blog",className:"rounded-lg px-3 py-2 text-sm font-medium text-gray-600 no-underline transition-colors hover:bg-gray-100 hover:text-gray-900",children:"Blog"})]}),(0,a.jsx)("div",{className:"flex items-center gap-3",children:n?(0,a.jsx)("div",{className:"h-8 w-8 animate-pulse rounded-full bg-gray-200"}):t&&e?(0,a.jsxs)("div",{className:"relative",ref:u,children:[(0,a.jsxs)("button",{onClick:()=>m(e=>!e),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-gray-700 transition-colors hover:bg-gray-100",children:[e.image?(0,a.jsx)(s.default,{src:e.image,alt:e.name||"User",width:28,height:28,className:"rounded-full ring-2 ring-hack-primary/30"}):(0,a.jsx)("div",{className:"h-7 w-7 rounded-full bg-gray-300 ring-2 ring-hack-primary/30"}),(0,a.jsx)("span",{className:"hidden sm:inline max-w-[120px] truncate",children:e.name}),(0,a.jsx)("svg",{className:"h-4 w-4 opacity-50",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),d&&(0,a.jsxs)("div",{className:"absolute right-0 mt-2 w-56 origin-top-right rounded-xl border border-gray-200 bg-white py-1.5 shadow-lg shadow-gray-200/50",children:[(0,a.jsxs)("div",{className:"border-b border-gray-100 px-4 py-2.5",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:e.name}),(0,a.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.email}),(0,a.jsxs)("p",{className:"mt-1.5 flex items-center gap-1 text-xs",children:[(0,a.jsx)("span",{className:"text-gray-400",children:"Balance"}),(0,a.jsxs)("span",{className:"font-medium text-hack-success",children:["$",e.credits.toFixed(4)]})]})]}),(0,a.jsxs)(r.default,{href:"/history",onClick:()=>m(!1),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-sm text-gray-600 no-underline transition-colors hover:bg-gray-50",children:[(0,a.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"History"]}),(0,a.jsxs)("button",{onClick:()=>{m(!1),c()},className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-sm text-gray-600 transition-colors hover:bg-gray-50 hover:text-hack-danger",children:[(0,a.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),"Sign out"]})]})]}):(0,a.jsx)(r.default,{href:"/login",className:"inline-flex items-center gap-2 rounded-lg bg-hack-primary px-4 py-2 text-sm font-medium text-white no-underline transition-all hover:bg-indigo-600 active:scale-95",children:"Sign in"})})]})})}function d(){return(0,a.jsx)("footer",{className:"border-t border-gray-200 bg-gray-50",children:(0,a.jsxs)("div",{className:"mx-auto flex max-w-7xl flex-col items-center justify-between gap-4 px-4 py-8 sm:flex-row sm:px-6 lg:px-8",children:[(0,a.jsxs)(r.default,{href:"/",className:"flex items-center gap-2 text-gray-600 no-underline transition-colors hover:text-gray-900",children:[(0,a.jsx)(s.default,{src:o.Z,alt:"HackDemo",width:28,height:28,className:"rounded-md"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:"HackDemo"})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)("a",{href:"https://hackradar.win",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-full border border-blue-200 bg-blue-50 px-3 py-0.5 text-sm text-blue-600 transition-colors hover:border-blue-300 hover:bg-blue-100",children:"HackRadar"}),(0,a.jsx)("span",{className:"text-xs text-gray-400",children:"Browse and find upcoming hackathons which reward cash from across the web."})]}),(0,a.jsxs)("nav",{className:"flex items-center gap-6 text-sm text-gray-600",children:[(0,a.jsx)(r.default,{href:"/privacy",className:"no-underline transition-colors hover:text-gray-900",children:"Privacy"}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)(r.default,{href:"/terms",className:"no-underline transition-colors hover:text-gray-900",children:"Terms"}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)("a",{href:"mailto:[email protected]",className:"transition-colors hover:text-gray-900",children:"Contact"}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("span",{children:["\xa9 ",new Date().getFullYear()," HackDemo"]})]})]})})}function m(e){let{data:t}=e;return(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}})}function u(e){let{children:t,breadcrumbs:n}=e;return(0,a.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,a.jsx)(c,{}),(0,a.jsx)("main",{className:"flex-1",children:t}),(0,a.jsx)(d,{}),n&&n.length>0&&(0,a.jsx)(m,{data:{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:n.map((e,t)=>({"@type":"ListItem",position:t+1,name:e.name,item:e.href}))}})]})}},4362:function(e,t,n){n.d(t,{H:function(){return u},a:function(){return h}});var a=n(7437),r=n(2265);let s=n(257).env.NEXT_PUBLIC_BACKEND_URL||"";function i(e){return"".concat(s).concat(e)}let l=null;async function o(e){try{let t=await fetch(i("/api/auth/token"),{credentials:"include"});if(!t.ok)return;let n=await t.json();n.token&&(l={source:"hackdemo-web",type:"AUTH_TOKEN",token:n.token,user:{name:e.name,email:e.email,image:e.image}},c())}catch(e){}}function c(){l&&("undefined"!=typeof document&&document.documentElement.setAttribute("data-hackdemo-auth",JSON.stringify(l)),window.postMessage(l,window.location.origin))}function d(){"undefined"!=typeof document&&document.documentElement.removeAttribute("data-hackdemo-auth"),window.postMessage({source:"hackdemo-web",type:"LOGOUT"},window.location.origin)}window.addEventListener("message",function(e){var t,n;(null===(t=e.data)||void 0===t?void 0:t.source)==="hackdemo-cs"&&(null===(n=e.data)||void 0===n?void 0:n.type)==="CS_READY"&&l&&c()});let m=(0,r.createContext)(void 0);function u(e){let{children:t}=e,[n,s]=(0,r.useState)(null),[l,c]=(0,r.useState)(!0);async function u(){try{let n=await fetch(i("/api/auth/session"),{credentials:"include"});if(!n.ok)throw Error("Session fetch failed: ".concat(n.status));let a=await n.json();if(null==a?void 0:a.user){var e,t;let n=a.user;s({name:n.name||"User",email:n.email||"",image:n.image||(t=n.name||"User","https://ui-avatars.c
1om/api/?name=".concat(encodeURIComponent(t),"&background=6366f1&color=fff")),credits:null!==(e=n.credits)&&void 0!==e?e:0}),o({name:n.name||"User",email:n.email||"",image:n.image||void 0})}else s(null),d()}catch(e){s(null)}finally{c(!1)}}(0,r.useEffect)(()=>{u()},[]);let h=(0,r.useCallback)(()=>{if("undefined"==typeof document)return;let e=document.createElement("form");e.method="POST",e.action=i("/api/auth/signin/google");let t=document.createElement("input");t.type="hidden",t.name="callbackUrl",t.value=window.location.origin+"/",e.appendChild(t),document.body.appendChild(e),e.submit()},[]),x=(0,r.useCallback)(()=>{if(d(),"undefined"==typeof document)return;let e=document.createElement("form");e.method="POST",e.action=i("/api/auth/signout");let t=document.createElement("input");t.type="hidden",t.name="callbackUrl",t.value=window.location.origin+"/",e.appendChild(t),document.body.appendChild(e),e.submit(),s(null)},[]);return(0,a.jsx)(m.Provider,{value:{user:n,isAuthenticated:!!n,isLoading:l,login:h,logout:x,refresh:u},children:t})}function h(){let e=(0,r.useContext)(m);if(!e)throw Error("useAuth must be used within an AuthProvider");return e}},6096:function(e,t){t.Z={src:"/_next/static/media/normal.309642f2.png",height:320,width:320,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAgVBMVEXs7vnLzvJ/Xvq2u+uFVfpUc9tFYLxOaLpCYcwIONYUHe7BZPuubPyhSfs0XtpMasZObs/Q1/kiQuJFY9Rdbe8cO6xrY/ZqfOJMRumaqNuIl94CM702WcPf4vVfFPi1pvaMGPrt0Pyqq/VXWfZJK/hSX+uOifphVfc7WuUdN+FdRPoXuhbbAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAR0lEQVR4nBXGxRGAQAAEsOVccXe3/gtkyCsIrpd5bxcc5tyZmy3uB9s6jQ6hBgZK2B/V0pqg7xrNK1NCFEKpLM0RSCmjmCcfpmoEDaAq1F4AAAAASUVORK5CYII=",blurWidth:8,blurHeight:8}}}]);
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.