UNPKG

manifest

Version:

Self-hosted Manifest LLM router with embedded server, SQLite database, and dashboard

2 lines (1 loc) 3.64 kB
import{D as M,g as n,T as D,M as Y,S as C,a as o,i as s,m as S,h as $,A as k,t as i,d as B}from"./vendor-C-Y5oNOq.js";import{s as T}from"./index-C4Qw7vZo.js";import"./auth-CU91cd7V.js";var N=i("<div class=auth-header><h1 class=auth-header__title>Reset your password</h1><p class=auth-header__subtitle>"),A=i("<form class=auth-form><label class=auth-form__label>Email<input class=auth-form__input type=email placeholder=you@example.com required></label><button class=auth-form__submit type=submit>"),y=i("<div class=auth-footer>"),q=i("<div class=auth-form__error role=alert>"),F=i("<span class=spinner>"),j=i("<div class=auth-header><h1 class=auth-header__title>Set new password</h1><p class=auth-header__subtitle>"),z=i('<form class=auth-form><label class=auth-form__label>New password<input class=auth-form__input type=password placeholder="Enter new password"required minlength=8></label><label class=auth-form__label>Confirm password<input class=auth-form__input type=password placeholder="Confirm new password"required minlength=8></label><button class=auth-form__submit type=submit>'),G=i("<div class=auth-form><div class=auth-form__success>Your password has been updated. You can now sign in with your new password.");const H=()=>{const[d,u]=o(""),[h,g]=o(!1),[b,m]=o(""),[_,p]=o(!1),v=async r=>{r.preventDefault(),m(""),p(!0);const{error:a}=await T.requestPasswordReset({email:d(),redirectTo:"/reset-password"});if(p(!1),a){m(a.message??"Failed to send reset email");return}g(!0)};return[(()=>{var r=N(),a=r.firstChild,f=a.nextSibling;return s(f,()=>h()?"Check your email for a reset link":"Enter your email to receive a reset link"),r})(),n(C,{get when(){return!h()},get children(){var r=A(),a=r.firstChild,f=a.firstChild,e=f.nextSibling,t=a.nextSibling;return r.addEventListener("submit",v),s(r,(()=>{var l=S(()=>!!b());return()=>l()&&(()=>{var w=q();return s(w,b),w})()})(),a),e.$$input=l=>u(l.currentTarget.value),s(t,(()=>{var l=S(()=>!!_());return()=>l()?F():"Send reset link"})()),$(()=>t.disabled=_()),$(()=>e.value=d()),r}}),(()=>{var r=y();return s(r,n(k,{href:"/login",class:"auth-footer__link",children:"Back to sign in"})),r})()]},I=d=>{const[u,h]=o(""),[g,b]=o(""),[m,_]=o(""),[p,v]=o(!1),[r,a]=o(!1),f=async e=>{if(e.preventDefault(),_(""),u()!==g()){_("Passwords do not match");return}v(!0);const{error:t}=await T.resetPassword({newPassword:u(),token:d.token});if(v(!1),t){_(t.message??"Failed to reset password");return}a(!0)};return[(()=>{var e=j(),t=e.firstChild,l=t.nextSibling;return s(l,()=>r()?"Your password has been reset":"Enter your new password"),e})(),n(C,{get when(){return!r()},get fallback(){return[G(),(()=>{var e=y();return s(e,n(k,{href:"/login",class:"auth-footer__link",children:"Sign in"})),e})()]},get children(){return[(()=>{var e=z(),t=e.firstChild,l=t.firstChild,w=l.nextSibling,E=t.nextSibling,L=E.firstChild,P=L.nextSibling,x=E.nextSibling;return e.addEventListener("submit",f),s(e,(()=>{var c=S(()=>!!m());return()=>c()&&(()=>{var R=q();return s(R,m),R})()})(),t),w.$$input=c=>h(c.currentTarget.value),P.$$input=c=>b(c.currentTarget.value),s(x,(()=>{var c=S(()=>!!p());return()=>c()?F():"Reset password"})()),$(()=>x.disabled=p()),$(()=>w.value=u()),$(()=>P.value=g()),e})(),(()=>{var e=y();return s(e,n(k,{href:"/login",class:"auth-footer__link",children:"Back to sign in"})),e})()]}})]},Q=()=>{const[d]=M(),u=()=>d.token;return[n(D,{children:"Reset Password - Manifest"}),n(Y,{name:"description",content:"Reset your Manifest account password."}),n(C,{get when(){return u()},get fallback(){return n(H,{})},children:h=>n(I,{get token(){return h()}})})]};B(["input"]);export{Q as default};