import{a as r,N as t,i as a}from"./Notification-CBsCzcFI.js";import{R as o}from"./ResourceCard-DqgvG2uO.js";import{a as i}from"./fetch_utils-B73kExl8.js";import"./SimpleIcon-DJPBKV0m.js";import"./file-text-B9jaTKZU.js";let n=r({components:{ResourceCard:o,Notification:t},data(){return{error:null,success:!1,loading:!1,passwordData:{newUsername:"sunshine",newPassword:"",confirmNewPassword:""}}},methods:{save(){this.error=null,this.loading=!0,i("./api/password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.passwordData)}).then(s=>{this.loading=!1,s.status===200?s.json().then(e=>{this.success=e.status,this.success===!0?setTimeout(()=>{document.location.reload()},5e3):this.error=e.error}):this.error="Internal Server Error"})}}});a(n);
