import{T as h}from"./Input-b786da58.js";import{T as w}from"./InputError-8d3cfe49.js";import{T as g}from"./DialogModal-d32a0a51.js";import{T}from"./DangerButton-a5a78b3b.js";import{T as C}from"./ActionSection-4deeb4ab.js";import{T as U}from"./SecondaryButton-7ef0b567.js";import{_ as k,r as n,o as D,d as b,e as o,h as s,t,a,g as c,q as $,n as A}from"./app-32ed258c.js";import"./Modal-291f355a.js";import"./SectionTitle-8b846035.js";const B={components:{TecInput:h,TecInputError:w,TecDialogModal:g,TecDangerButton:T,TecActionSection:C,TecSecondaryButton:U},data(){return{confirmingUserDeletion:!1,form:this.$inertia.form({password:""})}},methods:{confirmUserDeletion(){this.confirmingUserDeletion=!0,setTimeout(()=>this.$refs.password.focus(),250)},deleteUser(){this.form.delete(route("current-user.destroy"),{preserveScroll:!0,onSuccess:()=>this.closeModal(),onError:()=>this.$refs.password.focus(),onFinish:()=>this.form.reset()})},closeModal(){this.confirmingUserDeletion=!1,this.form.reset()}}},V={class:"text-gray-600"},v={class:"mt-5"},M={class:"mt-4"};function S(e,i,K,N,r,l){const d=n("tec-danger-button"),m=n("tec-input"),u=n("tec-input-error"),p=n("tec-secondary-button"),f=n("tec-dialog-modal"),_=n("tec-action-section");return D(),b(_,null,{title:o(()=>[s(t(e.$t("delete_x",{x:e.$t("Account")})),1)]),description:o(()=>[s(t(e.$t("Permanently delete your account.")),1)]),content:o(()=>[a("div",V,t(e.$t("Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.")),1),a("div",v,[c(d,{onClick:l.confirmUserDeletion},{default:o(()=>[s(t(e.$t("delete_x",{x:e.$t("Account")})),1)]),_:1},8,["onClick"])]),c(f,{show:r.confirmingUserDeletion,onClose:l.closeModal},{title:o(()=>[s(t(e.$t("delete_x",{x:e.$t("Account")})),1)]),content:o(()=>[s(t(e.$t("Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account."))+" ",1),a("div",M,[c(m,{ref:"password",type:"password",class:"mt-1 block w-3/4",placeholder:"Password",modelValue:r.form.password,"onUpdate:modelValue":i[0]||(i[0]=y=>r.form.password=y),onKeyup:$(l.deleteUser,["enter"])},null,8,["modelValue","onKeyup"]),c(u,{message:r.form.errors.password,class:"mt-2"},null,8,["message"])])]),footer:o(()=>[c(p,{onClick:l.closeModal},{default:o(()=>[s(t(e.$t("Cancel")),1)]),_:1},8,["onClick"]),c(d,{class:A(["ml-2",{"opacity-25":r.form.processing}]),onClick:l.deleteUser,disabled:r.form.processing},{default:o(()=>[s(t(e.$t("delete_x",{x:e.$t("Account")})),1)]),_:1},8,["onClick","class","disabled"])]),_:1},8,["show","onClose"])]),_:1})}const G=k(B,[["render",S]]);export{G as default};
