1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6309],{487:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>d});var t=a(7876),r=a(4232),i=a(9099),l=a(6848),n=a(323),o=a(8467);function d(){let[e,s]=(0,r.useState)({email:"",password:""}),[a,d]=(0,r.useState)(""),[c,m]=(0,r.useState)(!1),u=(0,i.useRouter)(),x=async s=>{s.preventDefault(),m(!0),d("");try{let s=await (0,n.x9)(o.auth,e.email,e.password);localStorage.setItem("adminAuth","true"),localStorage.setItem("adminUser",JSON.stringify({email:s.user.email,uid:s.user.uid,displayName:s.user.displayName})),window.dispatchEvent(new CustomEvent("adminStatusChanged")),u.push("/blog/create")}catch(e){console.error("Firebase auth error:",e),d("Invalid credentials. Please check your email and password.")}m(!1)},h=a=>{s({...e,[a.target.name]:a.target.value})};return(0,t.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-blue-900 to-slate-800 flex items-center justify-center px-6",children:(0,t.jsxs)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"bg-white rounded-xl shadow-2xl p-8 w-full max-w-md",children:[(0,t.jsxs)("div",{className:"text-center mb-8",children:[(0,t.jsx)(l.P.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.6,delay:.2},className:"w-16 h-16 bg-blue-900 rounded-lg flex items-center justify-center mx-auto mb-4",children:(0,t.jsx)("svg",{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Admin Access"}),(0,t.jsx)("p",{className:"text-slate-600",children:"Sign in with your Firebase Authentication credentials to manage content and upload images"})]}),(0,t.jsxs)("form",{onSubmit:x,className:"space-y-6",children:[a&&(0,t.jsx)(l.P.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-md text-sm",children:a}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-slate-700 mb-2",children:"Email Address"}),(0,t.jsx)("input",{type:"email",id:"email",name:"email",value:e.email,onChange:h,required:!0,className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors",placeholder:"Enter your email address"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-slate-700 mb-2",children:"Password"}),(0,t.jsx)("input",{type:"password",id:"password",name:"password",value:e.password,onChange:h,required:!0,className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors",placeholder:"Enter your password"})]}),(0,t.jsx)("button",{type:"submit",disabled:c,className:"w-full bg-blue-900 text-white py-3 px-4 rounded-md hover:bg-blue-800 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors font-medium disabled:opacity-50 disabled:cursor-not-allowed",children:c?(0,t.jsxs)("div",{className:"flex items-center justify-center",children:[(0,t.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",fill:"none",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Signing in..."]}):"Sign In"})]}),(0,t.jsx)("div",{className:"mt-8 text-center",children:(0,t.jsx)("p",{className:"text-xs text-slate-500",children:"Authorized personnel only. Access is logged and monitored."})})]})})}},8210:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return a(487)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=8210)),_N_E=e.O()}]);
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.