(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[116],{63:(e,r,t)=>{"use strict";var s=t(7260);t.o(s,"usePathname")&&t.d(r,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(r,{useRouter:function(){return s.useRouter}})},313:(e,r,t)=>{"use strict";t.d(r,{A:()=>n});var s=t(2115),a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},n=(e,r)=>{let t=(0,s.forwardRef)((t,n)=>{let{color:i="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:d,children:u,...c}=t;return(0,s.createElement)("svg",{ref:n,...a,width:l,height:l,stroke:i,strokeWidth:d?24*Number(o)/Number(l):o,className:"lucide lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),...c},[...r.map(e=>{let[r,t]=e;return(0,s.createElement)(r,t)}),...(Array.isArray(u)?u:[u])||[]])});return t.displayName="".concat(e),t}},2123:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>o});var s=t(5155),a=t(2115),n=t(63),i=t(8731);let l=(0,t(313).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);function o(){let[e,r]=(0,a.useState)({username:"",password:""}),[t,o]=(0,a.useState)(""),[d,u]=(0,a.useState)(!1),c=(0,n.useRouter)(),m=async r=>{r.preventDefault(),u(!0),o("");try{(await fetch("/api/admin/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok?c.push("/admin/dashboard"):o("Credenciais inv\xe1lidas")}catch(e){o("Erro ao fazer login")}finally{u(!1)}};return(0,s.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-secondary to-primary flex items-center justify-center px-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl p-8 w-full max-w-md",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center text-white font-bold text-2xl mx-auto mb-4",children:"D"}),(0,s.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Admin Login"}),(0,s.jsx)("p",{className:"text-gray-600 mt-2",children:"Dalodur Solutions Ltd"})]}),(0,s.jsxs)("form",{onSubmit:m,className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-2",children:"Usu\xe1rio"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(i.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:20}),(0,s.jsx)("input",{type:"text",id:"username",value:e.username,onChange:t=>r({...e,username:t.target.value}),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent outline-none transition",placeholder:"Digite seu usu\xe1rio",required:!0})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-2",children:"Senha"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(l,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:20}),(0,s.jsx)("input",{type:"password",id:"password",value:e.password,onChange:t=>r({...e,password:t.target.value}),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent outline-none transition",placeholder:"Digite sua senha",required:!0})]})]}),t&&(0,s.jsx)("div",{className:"bg-red-50 border border-red-200 text-red-800 px-4 py-3 rounded-lg text-sm",children:t}),(0,s.jsx)("button",{type:"submit",disabled:d,className:"w-full btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:d?"Entrando...":"Entrar"})]}),(0,s.jsx)("p",{className:"text-center text-gray-600 text-sm mt-6",children:"Credenciais padr\xe3o: admin / admin123"})]})})}},6775:(e,r,t)=>{Promise.resolve().then(t.bind(t,2123))},8731:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});let s=(0,t(313).A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])}},e=>{e.O(0,[441,255,358],()=>e(e.s=6775)),_N_E=e.O()}]);