import"./rolldown-runtime-BM3Ffeng.js";import{D as e,O as t,dt as n,ot as r}from"./element-plus-vendor-BF9PNysW.js";import{Ct as i,D as a,G as o,N as s,O as c,P as l,Pt as u,Tt as d,Z as f,et as p,ht as m,q as h,s as g,y as _}from"./vue-vendor-DMUmTARL.js";import{s as v,v as y}from"./index-kSn5YXd0.js";import{t as b}from"./AuthSplitLayout-CtvaJ7pp.js";import{n as x,t as S}from"./install-CtpGKz5A.js";var C={class:`space-y-5`},w={class:`group relative w-full`},T={class:`group relative w-full`},E={class:`group relative w-full`},D={__name:`index`,setup(D){let O=y(),k=g(),A=i({siteName:``,username:``,password:``}),j=d({siteName:[{required:!0,message:`请输入站点名称`,trigger:[`change`,`blur`]}],username:[{required:!0,message:`请输入管理员账号`,trigger:[`change`,`blur`]}],password:[{required:!0,message:`请输入管理员密码`,trigger:[`change`,`blur`]}]}),M=d(!1),N=d(),P=d(),F=async()=>{await N.value.validate(e=>{e?(M.value=!0,S(A).then(()=>{v.confirm(`系统初始化成功, 点击确定跳转到登录页面。`,`提示`,{confirmButtonText:`前往登录`,showCancelButton:!1,showCloseButton:!1,closeOnClickModal:!1,closeOnPressEscape:!1,type:`success`}).then(()=>{k.push(`/login`)})}).finally(()=>{M.value=!1})):O.warning(`请检查输入项是否正确`)})};return f(()=>{o(()=>{P.value?.focus?.()})}),h(()=>{x().then(e=>{e.data&&k.push(`/`)})}),(i,o)=>{let d=n,f=t,h=r,g=e,v=b;return p(),c(v,null,{leftText:m(()=>[...o[3]||=[a(`h3`,{class:`mb-4 font-mono text-xs font-semibold uppercase tracking-widest text-zfile-sidebar-muted`},` ZFile Installation `,-1),a(`h1`,{class:`mb-4 text-3xl font-bold leading-tight text-zfile-sidebar-primary xl:text-4xl`},[s(` 快速部署`),a(`br`),s(` 即刻开启 `)],-1),a(`p`,{class:`max-w-sm text-sm leading-relaxed text-zfile-sidebar-secondary opacity-90 xl:text-base`},` 只需简单配置，即可搭建属于您的私有云存储管理平台。 `,-1)]]),rightHeader:m(()=>[...o[4]||=[a(`h2`,{class:`text-3xl font-bold tracking-tight text-primary`},`系统初始化`,-1),a(`p`,{class:`mt-2 text-sm text-secondary`},`请填写以下信息以完成安装`,-1)]]),default:m(()=>[l(g,{ref_key:`installFormRef`,ref:N,rules:u(j),model:u(A),class:`space-y-6`,size:`large`,onSubmit:_(F,[`prevent`])},{default:m(()=>[a(`div`,C,[l(f,{prop:`siteName`},{default:m(()=>[a(`div`,w,[o[5]||=a(`div`,{class:`mb-1.5 ml-0.5 flex items-center`},[a(`label`,{class:`block text-sm font-medium text-regular`},`站点名称`)],-1),l(d,{ref_key:`siteNameInputRef`,ref:P,modelValue:u(A).siteName,"onUpdate:modelValue":o[0]||=e=>u(A).siteName=e,tabindex:`1`,placeholder:`例如：我的个人网盘`,class:`zf-ds-clean-input`},null,8,[`modelValue`])])]),_:1}),l(f,{prop:`username`},{default:m(()=>[a(`div`,T,[o[6]||=a(`div`,{class:`mb-1.5 ml-0.5 flex items-center`},[a(`label`,{class:`block text-sm font-medium text-regular`},`管理员账号`)],-1),l(d,{modelValue:u(A).username,"onUpdate:modelValue":o[1]||=e=>u(A).username=e,modelModifiers:{trim:!0},tabindex:`2`,placeholder:`设置您的管理员账号`,class:`zf-ds-clean-input`},null,8,[`modelValue`])])]),_:1}),l(f,{prop:`password`},{default:m(()=>[a(`div`,E,[o[7]||=a(`div`,{class:`mb-1.5 ml-0.5 flex items-center`},[a(`label`,{class:`block text-sm font-medium text-regular`},`管理员密码`)],-1),l(d,{modelValue:u(A).password,"onUpdate:modelValue":o[2]||=e=>u(A).password=e,modelModifiers:{trim:!0},tabindex:`3`,type:`password`,"show-password":``,placeholder:`设置您的管理员密码`,class:`zf-ds-clean-input`},null,8,[`modelValue`])])]),_:1})]),l(h,{tabindex:`4`,"native-type":`submit`,loading:u(M),class:`!h-[48px] w-full !rounded-lg !text-[15px] !font-semibold !tracking-wide transition-all active:!scale-[0.99]`,type:`primary`},{default:m(()=>[...o[8]||=[s(` 开始安装 `,-1)]]),_:1},8,[`loading`])]),_:1},8,[`rules`,`model`])]),_:1})}}};export{D as default};