import{_ as v}from"./CKBvstet.js";import{c as d,a as e,l as h,m as x,q as k,v as b,j as a,k as c,M as y,s as _,d as u,t as j,b as M,w as B,x as V,r as m,o as p,z as i,y as C}from"./DuD5s02W.js";import{_ as L}from"./DVbguE1Z.js";import{_ as S}from"./Dmtnqq3B.js";const N={class:"bg-gray-50 min-h-screen"},z={class:"flex min-h-screen"},A={class:"w-full lg:w-1/2 flex items-center justify-center p-8 md:p-16"},T={class:"max-w-md w-full"},D={class:"relative"},E=["disabled"],H={key:0,class:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},K={class:"text-center"},O={__name:"forgot-password",setup(R){const f=V().public.apiBase,l=m(""),s=m(!1),o=C({}),g=async()=>{if(o.email=!l.value.trim(),o.email){i.warning("Harap masukkan alamat email Anda");return}s.value=!0;const n=i.loading("Mengirim link reset password...");try{await $fetch(`${f}/forgot-password`,{method:"POST",body:{email:l.value}}),i.success("Berhasil! Silakan cek email Anda untuk instruksi selanjutnya",{id:n})}catch(t){const r=t.data?.message||"Email tidak ditemukan atau terjadi kesalahan";i.error(r,{id:n})}finally{s.value=!1}};return(n,t)=>{const r=v;return p(),d("div",N,[e("div",z,[t[5]||(t[5]=e("div",{class:"hidden lg:block lg:w-1/2 relative"},[e("img",{src:L,alt:"Masjid",class:"absolute inset-0 w-full h-full object-cover"}),e("div",{class:"absolute inset-0 bg-black/20"})],-1)),e("div",A,[e("div",T,[t[4]||(t[4]=h('<div class="flex items-center justify-center lg:justify-start gap-2 mb-8"><img src="'+S+'" alt="Logo Sajada" class="h-8 w-auto"></div><div class="mb-8 text-center lg:text-left"><h1 class="text-3xl font-bold text-gray-800 mb-2">Lupa Kata Sandi?</h1><p class="text-gray-600">Masukkan email Anda untuk menerima instruksi pengaturan ulang kata sandi.</p></div>',2)),e("form",{onSubmit:x(g,["prevent"]),class:"space-y-5"},[e("div",null,[e("div",D,[t[1]||(t[1]=e("span",{class:"absolute inset-y-0 left-0 flex items-center pl-3 text-gray-400"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})])],-1)),k(e("input",{"onUpdate:modelValue":t[0]||(t[0]=w=>y(l)?l.value=w:null),type:"email",placeholder:"Email Terdaftar",class:c(["w-full pl-10 pr-4 py-3 border rounded-xl focus:ring-2 focus:ring-[#166534] outline-none transition-all",a(o).email?"border-red-400 bg-red-50":"border-gray-200"])},null,2),[[b,a(l)]])])]),e("button",{type:"submit",disabled:a(s),class:c(["w-full bg-[#166534] hover:bg-[#0f4a26] text-white font-semibold py-3.5 rounded-xl shadow-lg transition-all transform active:scale-[0.98] flex items-center justify-center gap-2",a(s)?"opacity-50 cursor-not-allowed":""])},[a(s)?(p(),d("svg",H,[...t[2]||(t[2]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"#065f46","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"white",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"},null,-1)])])):_("",!0),u(" "+j(a(s)?"Mohon Tunggu...":"Kirim Link Reset"),1)],10,E),e("div",K,[M(r,{to:"/login",class:"text-sm font-medium text-[#D4AF37] hover:underline flex items-center justify-center gap-2"},{default:B(()=>[...t[3]||(t[3]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 19l-7-7m0 0l7-7m-7 7h18"})],-1),u(" Kembali ke Login ",-1)])]),_:1})])],32)])])])])}}};export{O as default};
