import{G as c,L as g,E as m,T as h,a as u}from"./tkf-logo-2-5e3a4881.js";import{_ as f,A as _}from"./_plugin-vue_export-helper-8019582c.js";import{o as a,c as n,a as i,b as s,f as b,t as x,g as l,v as d,F as w}from"./index-454c8244.js";const L={name:"LoginPage",setup(){},components:{},props:{},data(){return{GovtLogo:c,Logo:g,EPILogo:m,errors:null,loading:!1,message:"",form:{phone:"",password:""}}},mounted(){localStorage.getItem("user")&&this.$router.push({path:"/dashboard"})},methods:{TKFLogo2(){return h},EPILogo2(){return u},async handleSubmit(){this.loading=!0;const o=(await _.post("login",this.form)).data;o.status==="success"?(this.loading=!1,localStorage.setItem("user",JSON.stringify(o.data)),this.message=o.message,this.loading=!1,console.log(o),this.$router.push({path:"/user/attendance"})):(this.loading=!1,this.message=o.message),this.loading=!1}}},v={key:0,class:"loader"},y=s("span",null,null,-1),P=s("span",null,null,-1),I=[y,P],S={class:"form-section px-15 top-space section-b-space"},T={class:"d-flex justify-content-around align-items-center gap-3 mb-5"},E=["src"],F=["src"],k=["src"],N=s("div",{class:"mb-4"},[s("h1",null,"Issue Tracker"),s("h2",{class:"fw-bold"},"Third Party Field Monitoring (TPFM) for routine immunization activities")],-1),G={key:0,class:"alert alert-danger",role:"alert"},M={class:"form-group mb-4"},V=s("label",{for:"phone"},"Phone Number",-1),B={class:"form-group mb-4"},K=s("label",{for:"password"},"Password",-1),A=s("button",{type:"submit",class:"btn btn-primary w-100"},"Sign in",-1);function D(p,o,U,j,e,r){return a(),n(w,null,[e.loading?(a(),n("div",v,I)):i("",!0),s("section",S,[s("div",T,[s("img",{src:r.EPILogo2(),class:"shadow",alt:"epi-logo",style:{height:"100px",width:"100px",border:"1px solid #757575","border-radius":"10px",padding:"5px"}},null,8,E),s("img",{src:e.GovtLogo,class:"shadow",alt:"govt-logo",style:{height:"100px",width:"100px",border:"1px solid #757575","border-radius":"10px",padding:"5px"}},null,8,F),s("img",{src:r.TKFLogo2(),class:"shadow",alt:"tkf-logo",style:{height:"100px",width:"100px",border:"1px solid #757575","border-radius":"10px",padding:"5px"}},null,8,k)]),N,s("form",{onSubmit:o[2]||(o[2]=b((...t)=>r.handleSubmit&&r.handleSubmit(...t),["prevent"]))},[e.message?(a(),n("div",G,x(e.message),1)):i("",!0),s("div",M,[V,l(s("input",{type:"text",class:"form-control",id:"phone","onUpdate:modelValue":o[0]||(o[0]=t=>e.form.phone=t),name:"phone",placeholder:"Registered Phone Number"},null,512),[[d,e.form.phone]])]),s("div",B,[K,l(s("input",{type:"password",class:"form-control",id:"password","onUpdate:modelValue":o[1]||(o[1]=t=>e.form.password=t),name:"password",placeholder:"password"},null,512),[[d,e.form.password]])]),A],32)])],64)}const O=f(L,[["render",D]]);export{O as default};
