Files
monisuo/monisuo-admin/dist/assets/settings-Dk3H9hkV.js
2026-03-22 23:32:23 +08:00

1 line
4.9 KiB
JavaScript

import{Ct as e,D as t,E as n,Et as r,N as i,Ot as a,S as o,Tt as s,V as c,_ as l,b as u,d,mt as f,nt as p,v as m,w as h,x as g,z as _}from"./vue.runtime.esm-bundler-DQjudA8G.js";import{a as v,i as y,n as b,r as x,t as S}from"./SelectContent-Bb2H68dj.js";import{t as C}from"./utils-BB02OBq2.js";import{n as w}from"./lib-Cz3jviUu.js";import{Q as T,c as E,f as D,m as O,p as k,u as A}from"./index-CcML0o3b.js";import"./Teleport-CLYBkdRb.js";import{t as j}from"./SelectGroup-CFM1aDq9.js";import{t as M}from"./Separator-5drwYWrN.js";import{t as N}from"./Button-2mdP_ygs.js";import{t as P}from"./Input-dHyiQP9I.js";import{c as F,i as I,n as L,o as R,r as z,s as B,t as V,u as H}from"./FormMessage-DO2c5bWz.js";import{t as U}from"./FormDescription-DwQJgDgd.js";import{t as W}from"./Textarea-DpC456Mi.js";import"./global-layout-BuXj6D-T.js";import{t as G}from"./settings-layout-DVMhlnCW.js";var K=D({username:k().min(2,{error:`Username must be at least 2 characters.`}).max(30,{error:`Username must not be longer than 30 characters.`}),email:A({error:`Please select an email to display.`}),bio:k().max(160,{error:`Bio must not be longer than 160 characters.`}).min(4,{error:`Bio must be at least 2 characters.`}),urls:E(D({value:O({error:`Please enter a valid URL.`})})).optional()}),q={class:`relative flex items-center`},J=[`onClick`],Y={class:`flex justify-start gap-2`},X=h({__name:`profile-form`,setup(h){let E=f([`m@example.com`,`m@google.com`,`m@support.com`]),{handleSubmit:D,resetForm:O}=H({validationSchema:R(K),initialValues:{bio:`I own a computer.`,urls:[{value:`https://shadcn.com`},{value:`http://twitter.com/shadcn`}]}}),k=D(e=>{w(`You submitted the following values:`,{description:t(`pre`,{class:`mt-2 w-[340px] rounded-md bg-slate-950 p-4`},t(`code`,{class:`text-white`},JSON.stringify(e,null,2)))})});return(t,f)=>(_(),u(d,null,[f[12]||=l(`div`,null,[l(`h3`,{class:`text-lg font-medium`},` Profile `),l(`p`,{class:`text-sm text-muted-foreground`},` This is how others will see you on the site. `)],-1),o(e(M),{orientation:`horizontal`,class:`my-4`}),l(`form`,{class:`space-y-8`,onSubmit:f[0]||=(...t)=>e(k)&&e(k)(...t)},[o(e(B),{name:`username`},{default:p(({componentField:t})=>[o(e(z),null,{default:p(()=>[o(e(L),null,{default:p(()=>[...f[1]||=[g(`Username`,-1)]]),_:1}),o(e(I),null,{default:p(()=>[o(e(P),i({type:`text`,placeholder:`shadcn`},t),null,16)]),_:2},1024),o(e(U),null,{default:p(()=>[...f[2]||=[g(` This is your public display name. It can be your real name or a pseudonym. You can only change this once every 30 days. `,-1)]]),_:1}),o(e(V))]),_:2},1024)]),_:1}),o(e(B),{name:`email`},{default:p(({componentField:t})=>[o(e(z),null,{default:p(()=>[o(e(L),null,{default:p(()=>[...f[3]||=[g(`Email`,-1)]]),_:1}),o(e(v),r(n(t)),{default:p(()=>[o(e(I),null,{default:p(()=>[o(e(x),null,{default:p(()=>[o(e(b),{placeholder:`Select an email`})]),_:1})]),_:1}),o(e(S),null,{default:p(()=>[o(e(j),null,{default:p(()=>[(_(!0),u(d,null,c(e(E),t=>(_(),m(e(y),{key:t,value:t},{default:p(()=>[g(a(t),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},16),o(e(U),null,{default:p(()=>[...f[4]||=[g(` You can manage verified email addresses in your email settings. `,-1)]]),_:1}),o(e(V))]),_:2},1024)]),_:1}),o(e(B),{name:`bio`},{default:p(({componentField:t})=>[o(e(z),null,{default:p(()=>[o(e(L),null,{default:p(()=>[...f[5]||=[g(`Bio`,-1)]]),_:1}),o(e(I),null,{default:p(()=>[o(e(W),i({placeholder:`Tell us a little bit about yourself`},t),null,16)]),_:2},1024),o(e(U),null,{default:p(()=>[...f[6]||=[g(` You can `,-1),l(`span`,null,`@mention`,-1),g(` other users and organizations to link to them. `,-1)]]),_:1}),o(e(V))]),_:2},1024)]),_:1}),l(`div`,null,[o(e(F),{name:`urls`},{default:p(({fields:t,push:n,remove:r})=>[(_(!0),u(d,null,c(t,(t,n)=>(_(),u(`div`,{key:`urls-${t.key}`,class:`mb-2`},[o(e(B),{name:`urls[${n}].value`},{default:p(({componentField:t})=>[o(e(z),null,{default:p(()=>[o(e(L),{class:s(e(C)(n!==0&&`sr-only`))},{default:p(()=>[...f[7]||=[g(` URLs `,-1)]]),_:1},8,[`class`]),o(e(U),{class:s(e(C)(n!==0&&`sr-only`))},{default:p(()=>[...f[8]||=[g(` Add links to your website, blog, or social media profiles. `,-1)]]),_:1},8,[`class`]),l(`div`,q,[o(e(I),null,{default:p(()=>[o(e(P),i({type:`url`},{ref_for:!0},t),null,16)]),_:2},1024),l(`button`,{type:`button`,class:`absolute py-2 pe-3 end-0 text-muted-foreground`,onClick:e=>r(n)},[o(e(T),{class:`w-3`})],8,J)]),o(e(V))]),_:2},1024)]),_:2},1032,[`name`])]))),128)),o(e(N),{type:`button`,variant:`outline`,size:`sm`,class:`w-20 mt-2 text-xs`,onClick:e=>n({value:``})},{default:p(()=>[...f[9]||=[g(` Add URL `,-1)]]),_:1},8,[`onClick`])]),_:1})]),l(`div`,Y,[o(e(N),{type:`submit`},{default:p(()=>[...f[10]||=[g(` Update profile `,-1)]]),_:1}),o(e(N),{type:`button`,variant:`outline`,onClick:e(O)},{default:p(()=>[...f[11]||=[g(` Reset form `,-1)]]),_:1},8,[`onClick`])])],32)],64))}}),Z=h({__name:`index`,setup(e){return(e,t)=>(_(),m(G,null,{default:p(()=>[o(X)]),_:1}))}});export{Z as default};