PageSourceSearch

https://amorev.ru/_nuxt/ChkfK2Ru.js

js amorev.ru collected 2026-10-02 05:34:57 UTC 4,579 bytes, 1 lines download raw bytes

1import{_ as h}from"./CnlGvc_x.js";import{k as V,a0 as C,a4 as B,g as o,d as t,V as k,W as s,j as n,ai as b,ak as N,f as w,i as m,R as j,G as a,b as z,N as u}from"./Bo5NI7es.js";import{r as P}from"./4CYLQGpj.js";import{v as M}from"./BxGg2dkS.js";import"./C88Jc1zx.js";const E={class:"flex min-h-[calc(100vh-8rem)] items-center justify-center py-6 sm:py-10"},H={class:"w-full max-w-md"},R={class:"surface-card p-8"},S={class:"mb-8 text-center"},U={class:"text-2xl font-semibold text-slate-950 dark:text-white"},q={key:0,class:"space-y-5"},A={key:1,class:"space-y-5"},D={key:0,class:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200"},G=["disabled"],I={key:0,class:"inline-flex items-center"},T={key:1},W={key:3,class:"mt-6 text-center"},Q=V({__name:"reset-password",setup($){const{title:y}=C(),g=B(),p=z(()=>{const l=g.query.token;return typeof l=="string"&&l.trim()!==""?l.trim():null}),r=u({password:"",confirm:""}),i=u(!1),d=u(null),c=u(!1),_=async()=>{const l=M(r.value.password);if(l){d.value=l;return}if(r.value.password!==r.value.confirm){d.value="Пароли не совпадают";return}i.value=!0,d.value=null;try{await P({token:p.value??"",newPassword:r.value.password}),c.value=!0}catch(e){d.value=e?.response?.data?.message??e?.data?.message??"Не удалось изменить пароль. Попробуйте позже."}finally{i.value=!1}};return(l,e)=>{const x=j("router-link"),v=h;return a(),o("div",E,[t("div",H,[t("div",R,[t("div",S,[e[2]||(e[2]=t("div",{class:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-brand-600 text-white shadow-soft"},[t("svg",{class:"h-7 w-7",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})])],-1)),t("h1",U,k(s(y)),1),e[3]||(e[3]=t("p",{class:"mt-2 text-sm text-slate-500 dark:text-slate-400"},"Смена пароля по ссылке из письма",-1))]),s(p)?s(c)?(a(),o("div",A,[e[7]||(e[7]=t("div",{class:"rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-700 dark:border-emerald-900/50 dark:bg-emerald-950/40 dark:text-emerald-200"}," Пароль изменён. Войдите с новым паролем. ",-1)),n(x,{to:"/login",class:"btn-primary block w-full text-center"},{default:b(()=>[...e[6]||(e[6]=[m("← Войти",-1)])]),_:1})])):(a(),o("form",{key:2,onSubmit:N(_,["prevent"]),class:"space-y-5"},[t("div",null,[e[8]||(e[8]=t("label",{class:"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300"},"Новый пароль",-1)),n(v,{modelValue:s(r).password,"onUpdate:modelValue":e[0]||(e[0]=f=>s(r).password=f),placeholder:"••••••",autocomplete:"new-password"},null,8,["modelValue"])]),t("div",null,[e[9]||(e[9]=t("label",{class:"mb-2 block text-sm font-medium text-slate-700 dark:text-slate-300"},"Повторите пароль",-1)),n(v,{modelValue:s(r).confirm,"onUpdate:modelValue":e[1]||(e[1]=f=>s(r).confirm=f),placeholder:"••••••",autocomplete:"new-password"},null,8,["modelValue"])]),s(d)?(a(),o("div",D,k(s(d)),1)):w("",!0),t("button",{type:"submit",disabled:s(i),class:"btn-primary w-full"},[s(i)?(a(),o("span",I,[...e[10]||(e[10]=[t("svg",{class:"-ml-1 mr-2 h-4 w-4 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),m(" Сохраняем... ",-1)])])):(a(),o("span",T,"Сменить пароль"))],8,G)],32)):(a(),o("div",q,[e[5]||(e[5]=t("div",{class:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200"}," Ссылка недействительна или истекла ",-1)),n(x,{to:"/forgot-password",class:"btn-primary block w-full text-center"},{default:b(()=>[...e[4]||(e[4]=[m("Запросить новую ссылку",-1)])]),_:1})])),s(p)&&!s(c)?(a(),o("div",W,[n(x,{to:"/login",class:"text-sm text-brand-600 hover:text-brand-700 dark:text-brand-400 dark:hover:text-brand-300"},{default:b(()=>[...e[11]||(e[11]=[m("← Войти",-1)])]),_:1})])):w("",!0)])])])}}});
1export{Q 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.