import{c as r,i as t}from"./_plugin-vue_export-helper-C-rNcquJ.js";import{R as a}from"./ResourceCard-B7VPnqji.js";let o=r({components:{ResourceCard:a},data(){return{error:null,success:!1,loading:!1,passwordData:{newUsername:"sunshine",newPassword:"",confirmNewPassword:""}}},methods:{save(){this.error=null,this.loading=!0,fetch("./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"})}}});t(o);