PageSourceSearch

https://angstromdesigns.com/_nuxt/Br94v-Ax.js

js angstromdesigns.com collected 2026-09-30 12:22:06 UTC 9,753 bytes, 1 lines download raw bytes

1import{_ as H}from"./BT35lNvC.js";import{u as F,y as K,h as O,c as s,b as G,a as t,l as M,m as f,z as q,k as L,t as C,g as d,v as A,q as J,A as Q,n,B as W,o}from"./DoiER03y.js";import{u as X}from"./DsH0x2yO.js";const Z={class:"flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8"},ee={class:"max-w-md w-full space-y-8"},te={key:0},se={key:1},oe={class:"space-y-4"},ae={class:"relative"},re=["type"],ne={key:0,class:"h-5 w-5 text-gray-400 hover:text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},le={key:1,class:"h-5 w-5 text-gray-400 hover:text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},ie={class:"relative"},ue=["type"],de={key:0,class:"h-5 w-5 text-gray-400 hover:text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},ce={key:1,class:"h-5 w-5 text-gray-400 hover:text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},pe={key:0,class:"text-red-500 text-sm text-center"},me=["disabled"],ve={key:0},ye={key:1},we={class:"space-y-4"},fe={key:0,class:"text-red-500 text-sm text-center"},ge=["disabled"],he={key:0},ke={key:1},xe={key:0,class:"alert alert-error"},be={class:"block"},_e={key:1,class:"alert alert-success"},Pe={class:"block"},Ce={class:"flex flex-col gap-4"},Ee=["disabled"],Me={key:0},Ae={key:1},Le={__name:"reset-password",setup(Se){const S=W(),i=Q(),{handlePasswordUpdate:B,handleLogin:N,handlePasswordReset:j,error:u}=F(),R=J(),V=K(R.public.SUPABASE_URL,R.public.SUPABASE_KEY),T={headlineTop:"Reset Password",image:"home-hero.jpg"},v=n(!1),c=n(""),g=n(""),h=n(!1),D=n(""),k=n(!1),x=n(!1),E=n(!1),y=n({email:"",password:""}),b=n(""),_=n(!1),p=n(""),m=n(""),w=n(""),P=n(!1);O(()=>{let a=i.query.token||i.query.token_hash||i.query.access_token||i.query.refresh_token||i.query.type||i.query[""];if(!a&&typeof window<"u"){const e=new URLSearchParams(window.location.hash.substring(1));a=a||e.get("token")||e.get("access_token")||e.get("type");const l=window.location.href,r=l.match(/[?&]token=([^&]+)/);r&&(a=a||r[1]);const U=l.match(/access_token=([^&]+)/);U&&(a=a||U[1])}v.value=!!a});const z=async()=>{if(c.value!==g.value){u.value="Passwords do not match";return}if(c.value.length<6){u.value="Password must be at least 6 characters long";return}h.value=!0,u.value="",D.value="";try{const{data:a,error:e}=await B(c.value);if(e)u.value=e.message||"An error occurred while updating your password";else{try{const{data:{session:l}}=await V.auth.getSession(),r=l?.user?.email||i.query.email;r&&await $fetch("/.netlify/functions/sendPasswordConfirmation",{method:"POST",body:{email:r,firstName:l?.user?.user_metadata?.first_name,lastName:l?.user?.user_metadata?.last_name}})}catch{}E.value=!0,c.value="",g.value=""}}catch(a){u.value=a.message||"An error occurred while updating your password"}finally{h.value=!1}},I=async()=>{_.value=!0,b.value="";try{await N(y.value),S.push("/")}catch(a){b.value=a.message||"An error occurred while signing in"}finally{_.value=!1}},Y=async()=>{if(!p.value){m.value="Please enter a valid email address";return}P.value=!0,m.value="",w.value="";try{const{data:a,error:e}=await j(p.value);e?m.value=e.message||"An error occurred while sending the reset link":(w.value=`If you are an authenticated user, a password reset link has been sent to ${p.value}. Please check your inbox and follow the instructions.`,p.value="",setTimeout(()=>{w.value=""},8e3))}catch(a){m.value=a.message||"An error occurred while sending the reset link"}finally{P.value=!1}},$=()=>{S.push("/")};return X({title:"Reset Password | Angstrom Designs",meta:[{name:"description",content:"Reset your password for your Angstrom Designs account."}]}),(a,e)=>{const l=H;return o(),s("div",null,[G(l,{hero:T,"show-cta":!1,height:"300px"}),t("div",Z,[t("div",ee,[v.value?(o(),s("div",te,[...e[7]||(e[7]=[t("h2",{class:"mt-6 text-center text-3xl font-extrabold text-gray-900"}," Enter Your New Password ",-1),t("p",{class:"mt-2 text-center text-sm text-gray-600"}," Enter your new password below ",-1)])])):(o(),s("div",se,[...e[8]||(e[8]=[t("h2",{class:"mt-6 text-center text-3xl font-extrabold text-gray-900"}," Reset Your Password ",-1),t("p",{class:"mt-2 text-center text-sm text-gray-600"}," Enter your email address to receive a password reset link ",-1)])])),v.value&&!E.value?(o(),s("form",{key:2,class:"mt-8 space-y-6",onSubmit:M(z,["prevent"])}
1,[t("div",oe,[t("div",ae,[e[11]||(e[11]=t("label",{for:"password",class:"sr-only"},"New Password",-1)),f(t("input",{id:"password","onUpdate:modelValue":e[0]||(e[0]=r=>c.value=r),name:"password",type:k.value?"text":"password",required:"",class:"input input-bordered w-full pr-10",placeholder:"New Password"},null,8,re),[[q,c.value]]),t("button",{type:"button",class:"absolute inset-y-0 right-0 pr-3 flex items-center",onClick:e[1]||(e[1]=r=>k.value=!k.value)},[k.value?(o(),s("svg",ne,[...e[9]||(e[9]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"},null,-1)])])):(o(),s("svg",le,[...e[10]||(e[10]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])]))])]),t("div",ie,[e[14]||(e[14]=t("label",{for:"passwordConfirm",class:"sr-only"},"Confirm New Password",-1)),f(t("input",{id:"passwordConfirm","onUpdate:modelValue":e[2]||(e[2]=r=>g.value=r),name:"passwordConfirm",type:x.value?"text":"password",required:"",class:"input input-bordered w-full pr-10",placeholder:"Confirm New Password"},null,8,ue),[[q,g.value]]),t("button",{type:"button",class:"absolute inset-y-0 right-0 pr-3 flex items-center",onClick:e[3]||(e[3]=r=>x.value=!x.value)},[x.value?(o(),s("svg",de,[...e[12]||(e[12]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"},null,-1)])])):(o(),s("svg",ce,[...e[13]||(e[13]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])]))])])]),L(u)?(o(),s("div",pe,C(L(u)),1)):d("",!0),t("div",null,[t("button",{type:"submit",class:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-primary hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",disabled:h.value},[h.value?(o(),s("span",ve,"Updating Password...")):(o(),s("span",ye,"Change Password"))],8,me)])],32)):d("",!0),v.value&&E.value?(o(),s("form",{key:3,class:"mt-8 space-y-6",onSubmit:M(I,["prevent"])},[e[18]||(e[18]=t("div",{class:"text-center mb-6"},[t("div",{class:"text-green-500 text-sm mb-4"}," ✅ Password updated successfully! You can now log in with your new password. ")],-1)),t("div",we,[e[17]||(e[17]=t("h3",{class:"text-lg font-medium text-gray-900 mb-2"}," Login Now ",-1)),t("div",null,[e[15]||(e[15]=t("label",{for:"loginEmail",class:"block text-sm font-medium text-gray-700"},"Email",-1)),f(t("input",{id:"loginEmail","onUpdate:modelValue":e[4]||(e[4]=r=>y.value.email=r),type:"email",required:"",class:"input input-bordered w-full",placeholder:"Enter your email"},null,512),[[A,y.value.email]])]),t("div",null,[e[16]||(e[16]=t("label",{for:"loginPassword",class:"block text-sm font-medium text-gray-700"},"Password",-1)),f(t("input",{id:"loginPassword","onUpdate:modelValue":e[5]||(e[5]=r=>y.value.password=r),type:"password",required:"",class:"input input-bordered w-full",placeholder:"Enter your password"},null,512),[[A,y.value.password]])])]),b.value?(o(),s("div",fe,C(b.value),1)):d("",!0),t("div",null,[t("button",{type:"submit",class:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-primary hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",disabled:_.value},[_.value?(o(),s("span",he,"Signing In...")):(o(),s("span",ke,"Sign In"))],8,ge)])],32)):d("",!0),v.value?d("",!0):(o(),s("form",{key:4,class:"mt-8 space-y-4",onSubmit:M(Y,["prevent"])},[e[20]||(e[20]=t("div",{class:"text-center mb-4"},[t("h3",{class:"text-lg font-medium text-gray-900"}," Authenticated User Reset Password "),t("p",{class:"text-sm text-gray-600 mt-1"}," If you are already an authenticated user, please enter your email address and we'll send you a link to reset your password. ")],-1)),t("div",null,[e[19]||(e[19]=t("label",{class:"block text-sm font-medium text-gray-700"},"Email",-1)),f(t("input",{"onUpdate:modelValue":e[6]||(e[6]=r=>p.value=r),type:"email",required:"",class:"input input-bordered w-full",autocomplete:"email"},null,512),[[A,p.value]])]),m.value?(o(),s("div",xe,[t("span",be,C(m.value),1)])):d("",!0),w.value?(o(),s("div",_e,[t("span",Pe,C(w.value),1)])):d("",!0),t("div",Ce,[t("button",{type:"submit",class:"btn btn-primary btn-block",disabled:P.value},[P.value?(o(),s("span",Me,"Sending...")):(o(),s("span",Ae,"Send Password Reset Link"))],8,Ee),t("button",{type:"button",class:"btn btn-outline btn-block",onClick:$}," Back to Home ")])],32))])])])}}};export{Le 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.