import{m,j as e}from"./login-aN2dRsX6.js";import{B as u}from"./button_submit-wN0ayemz.js";import{a as p,L as h}from"./app-gmlkJjeD.js";const x="/build/assets/koperasi-DRsvaDrr.png";function g(){const l=p(),{data:n,setData:t,processing:r,errors:a,reset:o,post:i}=m({username:"",password:""}),d=async()=>{i("/login",{onError:s=>{s.password&&o("password")},onSuccess:()=>{l("/app/dashboard")}})},c=async s=>(s.preventDefault(),await d());return console.log(r),e.jsx("div",{className:"d-flex justify-content-center align-items-center",style:{height:"100vh"},children:e.jsx("form",{onSubmit:c,children:e.jsxs("div",{className:"card card-sign",children:[e.jsxs("div",{className:"card-header mb-2 text-center",children:[e.jsx(h,{to:"/login",className:"mb-4",children:e.jsx("img",{src:x,width:200,height:200})}),e.jsx("h3",{className:"card-title",children:"Selamat Datang"}),e.jsx("p",{className:"card-text",children:"Silahkan masuk untuk melanjutkan."})]}),e.jsxs("div",{className:"card-body py-0",children:[a.username&&e.jsx("div",{className:"alert alert-danger mb-0",children:a.username}),a.password&&e.jsx("div",{className:"alert alert-danger mb-0",children:a.password})]}),e.jsxs("div",{className:"card-body py-2",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"form-label",children:"Username"}),e.jsx("input",{type:"text",className:"form-control",placeholder:"Username",value:n.username,onChange:s=>t("username",s.target.value),required:!0})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"form-label d-flex justify-content-between",children:"Password"}),e.jsx("input",{type:"password",className:"form-control",placeholder:"Password",value:n.password,onChange:s=>t("password",s.target.value),required:!0})]}),e.jsxs(u,{className:"btn btn-primary btn-sign",disable:r,children:[r&&e.jsx("span",{className:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"}),"Sign In"]})]}),e.jsx("div",{className:"card-footer"})]})})})}const N=Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"}));export{g as L,N as a,x as l};
