1import{ae as D,u as M,b as F,a4 as N,b2 as j,a2 as A,Z as H,ai as d,aj as c,ak as s,an as a,ap as e,ar as I,aH as T,ao as V,b3 as B,aL as w,N as L,ay as U,r,h as z,aK as K}from"./B8Eytsuk.js";const Z={class:"min-h-screen flex items-center justify-center bg-white px-4 py-10"},G={class:"w-full max-w-[400px] flex flex-col items-center text-center"},J={class:"text-5.5 font-700 text-ink mb-6"},O={key:0,class:"text-3.5 text-fg-placeholder leading-snug"},Q={class:"text-3.5 text-fg-placeholder mb-6 leading-snug"},W={class:"text-4 font-600 text-ink mb-1 self-start"},X={class:"text-3.5 text-fg-placeholder mb-6 leading-snug self-start"},Y={class:"w-full mb-3 relative"},ee=["type","placeholder"],te={key:0,class:"mt-1 text-3 text-red-500 pl-1 text-left"},se={class:"w-full mb-5 relative"},oe=["type","placeholder"],re={key:0,class:"mt-1 text-3 text-red-500 pl-1 text-left"},ae=["disabled"],ie=D({__name:"reset",setup(ne){const x=M(),{t:o,locale:g}=F(),{openLoginDialog:$}=N(),{resetPassword:E}=j(),{success:R}=z();A({title:()=>o("resetPassword.title"),meta:[{property:"og:title",content:()=>o("resetPassword.title")},{property:"og:url",content:()=>`${K}/${g.value}/reset`},{property:"og:locale",content:()=>g.value},{name:"robots",content:"noindex, nofollow"}]});const v=r(""),y=r(""),_=r(!1);H(()=>{const h=x.query.id,t=x.query.email;typeof h=="string"&&h&&typeof t=="string"&&t&&(v.value=h,y.value=decodeURIComponent(decodeURIComponent(t)),_.value=!0)});const n=r(""),f=r(""),m=r(!1),b=r(!1),i=r(""),u=r(""),p=r(!1),k=r(!1);function P(){return n.value.length<6||n.value.length>18?(i.value=o("auth.email.errorPasswordLength"),!1):(i.value="",!0)}function C(){return n.value!==f.value?(u.value=o("auth.email.errorPasswordMismatch"),!1):(u.value="",!0)}async function S(){if(!(!P()||!C()||p.value)){p.value=!0;try{await E({id:v.value,password:n.value}),k.value=!0,R(o("resetPassword.success"))}catch{}finally{p.value=!1}}}function q(){$()}return(h,t)=>(d(),c("div",Z,[s("div",G,[s("h1",J,a(e(o)("resetPassword.title")),1),e(_)?e(k)?(d(),c(I,{key:1},[s("p",Q,a(e(o)("resetPassword.success")),1),s("button",{type:"button",class:"px-6 h-11 rounded-2 bg-primary text-ink text-3.5 font-600 border-0 cursor-pointer hover:bg-primary-hover transition-colors",onClick:q},a(e(o)("resetPassword.logIn")),1)],64)):(d(),c(I,{key:2},[s("p",W,a(e(o)("resetPassword.greeting",{email:e(y)})),1),s("p",X,a(e(o)("resetPassword.description")),1),s("form",{class:"w-full flex flex-col items-stretch",onSubmit:T(S,["prevent"])},[s("div",Y,[V(s("input",{"onUpdate:modelValue":t[0]||(t[0]=l=>L(n)?n.value=l:null),type:e(m)?"text":"password",autocomplete:"new-password",placeholder:e(o)("auth.email.passwordPlaceholder"),maxlength:"18",class:w(["w-full h-11 px-4 pr-11 rounded-2 border text-3.5 text-ink bg-fill-3 outline-none transition-colors",e(i)?"border-red-400 bg-white":"border-line focus:border-primary focus:bg-white"]),onBlur:P,onInput:t[1]||(t[1]=l=>i.value="")},null,42,ee),[[B,e(n)]]),s("button",{type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 border-0 bg-transparent cursor-pointer p-0 flex items-center",onClick:t[2]||(t[2]=l=>m.value=!e(m))},[s("span",{class:w(["w-5 h-5 text-fg-weak",e(m)?"i-icons-eye-open":"i-icons-eye-close"]),"aria-hidden":"true"},null,2)]),e(i)?(d(),c("p",te,a(e(i)),1)):U("",!0)]),s("div",se,[V(s("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>L(f)?f.value=l:null),type:e(b)?"text":"password",autocomplete:"new-password",placeholder:e(o)("auth.email.confirmPasswordPlaceholder"),maxlength:"18",class:w(["w-full h-11 px-4 pr-11 rounded-2 border text-3.5 text-ink bg-fill-3 outline-none transition-colors",e(u)?"border-red-400 bg-white":"border-line focus:border-primary focus:bg-white"]),onBlur:C,onInput:t[4]||(t[4]=l=>u.value="")},null,42,oe),[[B,e(f)]]),s("button",{type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 border-0 bg-transparent cursor-pointer p-0 flex items-center",onClick:t[5]||(t[5]=l=>b.value=!e(b))},[s("span",{class:w(["w-5 h-5 text-fg-weak",e(b)?"i-icons-eye-open":"i-icons-eye-close"]),"aria-hidden":"true"},null,2)]),e(u)?(d(),c("p",re,a(e(u)),1)):U("",!0)]),s("button",{type:"submit",class:"w-full h-11 rounded-2 bg-primary text-white text-4 font-600 border-0 cursor-pointer hover:bg-primary-hover transition-colors disabled:bg-line-disabled disabled:cursor-not-allowed",disabled:e(p)},a(e(p)?"...":e(o)("auth.email.submitBtn")),9,ae)],32)],64)):(d(),c("p",O,a(e(o)("resetPassword.invalidLink")),1))])]))}});
1export{ie as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.