import{I as e,Q as t,Y as n,_ as r,at as i,b as a,g as o,h as s,s as c,ut as l,v as u,wt as d,x as f,y as p,yt as m}from"./vue.runtime.esm-bundler-DS0mm12S.js";import{t as h}from"./createLucideIcon-BHlxd6NP.js";import{t as g}from"./eye-off-C5q6VhPh.js";import{t as _}from"./Spinner-DJesLX-i.js";import{P as v}from"./index-aDrlI3dP.js";import{n as y}from"./button-DQxx5HZh.js";import{t as b}from"./Label-BaWF5yt7.js";import{t as x}from"./Input-Bq5OMrfM.js";import"./monisuo-admin.api-CkHxxpNg.js";import{t as S}from"./use-auth-BpY0Bq3D.js";import{t as C}from"./route-block-DB3S2hJK.js";import{t as w}from"./Card-BGPZ9IQg.js";import{t as T}from"./CardContent-3txdLIvu.js";import{r as E,t as D}from"./Alert-D6kQmAs7.js";import{n as O,r as k,t as A}from"./CardTitle-CRchcdrq.js";var j=h(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),M=h(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),N=h(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),P={class:`min-h-screen flex items-center justify-center bg-gradient-to-br from-background to-muted p-4`},F={class:`flex justify-center mb-4`},I={class:`size-12 rounded-xl bg-primary flex items-center justify-center`},L={class:`space-y-2`},R={class:`relative`},z={class:`space-y-2`},B={class:`relative`},V=f({__name:`sign-in`,setup(f){let h=l(``),C=l(``),V=l(!1),{login:H,loading:U,error:W,isLogin:G}=S(),K=v();n(()=>{m(G)&&K.push(`/monisuo/dashboard`)});async function q(){!h.value||!C.value||await H(h.value,C.value)}return(n,l)=>{let f=A,v=O,S=k,H=b,G=x,K=E,J=D,Y=_,X=y,Z=T,Q=w;return e(),u(`div`,P,[a(Q,{class:`w-full max-w-md`},{default:t(()=>[a(S,{class:`space-y-1 text-center`},{default:t(()=>[s(`div`,F,[s(`div`,I,[a(m(M),{class:`size-6 text-primary-foreground`})])]),a(f,{class:`text-2xl font-bold`},{default:t(()=>[...l[3]||=[p(` Monisuo Admin `,-1)]]),_:1}),a(v,null,{default:t(()=>[...l[4]||=[p(` 管理员登录 `,-1)]]),_:1})]),_:1}),a(Z,null,{default:t(()=>[s(`form`,{onSubmit:c(q,[`prevent`]),class:`space-y-4`},[s(`div`,L,[a(H,{for:`username`},{default:t(()=>[...l[5]||=[p(`用户名`,-1)]]),_:1}),s(`div`,R,[a(m(N),{class:`absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),a(G,{id:`username`,modelValue:m(h),"onUpdate:modelValue":l[0]||=e=>i(h)?h.value=e:null,type:`text`,placeholder:`请输入用户名`,class:`pl-9`,disabled:m(U)},null,8,[`modelValue`,`disabled`])])]),s(`div`,z,[a(H,{for:`password`},{default:t(()=>[...l[6]||=[p(`密码`,-1)]]),_:1}),s(`div`,B,[a(m(M),{class:`absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),a(G,{id:`password`,modelValue:m(C),"onUpdate:modelValue":l[1]||=e=>i(C)?C.value=e:null,type:m(V)?`text`:`password`,placeholder:`请输入密码`,class:`pl-9 pr-9`,disabled:m(U)},null,8,[`modelValue`,`type`,`disabled`]),s(`button`,{type:`button`,class:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:l[2]||=e=>V.value=!m(V)},[m(V)?(e(),o(m(g),{key:1,class:`size-4`})):(e(),o(m(j),{key:0,class:`size-4`}))])])]),m(W)?(e(),o(J,{key:0,variant:`destructive`},{default:t(()=>[a(K,null,{default:t(()=>[p(d(m(W)),1)]),_:1})]),_:1})):r(``,!0),a(X,{type:`submit`,class:`w-full`,disabled:m(U)},{default:t(()=>[m(U)?(e(),o(Y,{key:0,class:`size-4 mr-2`})):r(``,!0),p(` `+d(m(U)?`登录中...`:`登录`),1)]),_:1},8,[`disabled`])],32)]),_:1})]),_:1})])}}});typeof C==`function`&&C(V);var H=V;export{H as default};