(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[116],{47:(e,n,s)=>{Promise.resolve().then(s.bind(s,869))},869:(e,n,s)=>{"use strict";s.d(n,{LoginForm:()=>a});var i=s(8886),t=s(9398);function a(){let[e,n]=(0,t.useState)("admin@midnytsiren.com"),[s,a]=(0,t.useState)(""),[l,r]=(0,t.useState)(""),[o,d]=(0,t.useState)(!1);async function c(){d(!0),r("");let n=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:s})});if(d(!1),!n.ok)return void r("Invalid admin credentials.");window.location.href="/admin"}return(0,i.jsxs)("section",{className:"login-card",children:[(0,i.jsx)("span",{className:"eyebrow",children:"Admin CMS"}),(0,i.jsx)("h1",{children:"Control the whole siren."}),(0,i.jsx)("p",{children:"Use the admin credentials configured for this store."}),(0,i.jsxs)("div",{className:"grid gap-3",children:[(0,i.jsxs)("label",{children:["Email",(0,i.jsx)("input",{value:e,onChange:e=>n(e.target.value),type:"email"})]}),(0,i.jsxs)("label",{children:["Password",(0,i.jsx)("input",{value:s,onChange:e=>a(e.target.value),type:"password"})]}),l?(0,i.jsx)("p",{className:"text-red-300",children:l}):null,(0,i.jsx)("button",{className:"button button-primary",type:"button",onClick:c,disabled:o,children:o?"Signing in...":"Sign In"})]})]})}}},e=>{e.O(0,[480,920,358],()=>e(e.s=47)),_N_E=e.O()}]);