import{c as x,r as b,q as f,x as a,z as t,L as i,Q as y,u as o,P as d,Y as w,K as u,aq as c,O as p,y as n}from"./vue-vendor-DfnFpxGJ.js";import{_,u as v}from"./index-KCMFVMd0.js";import"./element-plus-BaMaLFJp.js";import"./vendor-BDiMbLwQ.js";const h={class:"flex min-h-screen items-center justify-center p-4 sm:p-6"},k={class:"glass-strong w-full max-w-md rounded-xl p-6 shadow-2xl sm:rounded-2xl sm:p-8 md:rounded-3xl md:p-10"},L={class:"mb-6 text-center sm:mb-8"},S={class:"mx-auto mb-4 flex h-16 w-16 items-center justify-center overflow-hidden rounded-xl border border-gray-300/30 bg-gradient-to-br from-blue-500/20 to-purple-500/20 backdrop-blur-sm sm:mb-6 sm:h-20 sm:w-20 sm:rounded-2xl"},V=["src"],I={key:1,class:"fas fa-cloud text-2xl text-gray-700 sm:text-3xl"},N={key:1,class:"h-10 w-10 animate-pulse rounded bg-gray-300/50 sm:h-12 sm:w-12"},q={key:0,class:"header-title mb-2 text-2xl font-bold text-white sm:text-3xl"},D={key:1,class:"mx-auto mb-2 h-8 w-48 animate-pulse rounded bg-gray-300/50 sm:h-9 sm:w-64"},E=["disabled"],j={key:0,class:"fas fa-sign-in-alt mr-2"},B={key:1,class:"loading-spinner mr-2"},M={key:0,class:"mt-4 rounded-lg border border-red-500/30 bg-red-500/20 p-3 text-center text-xs text-red-800 backdrop-blur-sm sm:mt-6 sm:rounded-xl sm:p-4 sm:text-sm"},F={__name:"LoginView",setup(O){const e=v(),m=x(()=>e.oemLoading),l=b({username:"",password:""});f(()=>{e.loadOemSettings()});const g=async()=>{await e.login(l.value)};return(T,s)=>(n(),a("div",h,[t("div",k,[t("div",L,[t("div",S,[m.value?(n(),a("div",N)):(n(),a(y,{key:0},[o(e).oemSettings.siteIconData||o(e).oemSettings.siteIcon?(n(),a("img",{key:0,alt:"Logo",class:"h-10 w-10 object-contain sm:h-12 sm:w-12",src:o(e).oemSettings.siteIconData||o(e).oemSettings.siteIcon,onError:s[0]||(s[0]=r=>r.target.style.display="none")},null,40,V)):(n(),a("i",I))],64))]),!m.value&&o(e).oemSettings.siteName?(n(),a("h1",q,d(o(e).oemSettings.siteName),1)):m.value?(n(),a("div",D)):i("",!0),s[3]||(s[3]=t("p",{class:"text-base text-gray-600 sm:text-lg"},"管理后台",-1))]),t("form",{class:"space-y-4 sm:space-y-6",onSubmit:w(g,["prevent"])},[t("div",null,[s[4]||(s[4]=t("label",{class:"mb-2 block text-sm font-semibold text-gray-900 sm:mb-3"},"用户名",-1)),u(t("input",{"onUpdate:modelValue":s[1]||(s[1]=r=>l.value.username=r),class:"form-input w-full",placeholder:"请输入用户名",required:"",type:"text"},null,512),[[c,l.value.username]])]),t("div",null,[s[5]||(s[5]=t("label",{class:"mb-2 block text-sm font-semibold text-gray-900 sm:mb-3"},"密码",-1)),u(t("input",{"onUpdate:modelValue":s[2]||(s[2]=r=>l.value.password=r),class:"form-input w-full",placeholder:"请输入密码",required:"",type:"password"},null,512),[[c,l.value.password]])]),t("button",{class:"btn btn-primary w-full px-4 py-3 text-base font-semibold sm:px-6 sm:py-4 sm:text-lg",disabled:o(e).loginLoading,type:"submit"},[o(e).loginLoading?i("",!0):(n(),a("i",j)),o(e).loginLoading?(n(),a("div",B)):i("",!0),p(" "+d(o(e).loginLoading?"登录中...":"登录"),1)],8,E)],32),o(e).loginError?(n(),a("div",M,[s[6]||(s[6]=t("i",{class:"fas fa-exclamation-triangle mr-2"},null,-1)),p(d(o(e).loginError),1)])):i("",!0)])]))}},K=_(F,[["__scopeId","data-v-1990a2ea"]]);export{K as default};