import{n as e}from"./chunk-QTnfLwEv.js";import{$ as t,C as n,D as r,E as i,F as a,I as o,J as s,M as c,O as l,P as u,R as d,U as f,V as p,W as m,X as h,Z as g,a as _,b as v,g as y,h as b,s as x,w as S,x as C}from"./app-CF_tOhgx.js";import{t as w}from"./i18n-DQ8qjn2c.js";import{t as T}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as E,t as D}from"./TextInput-BWL2S2Ld.js";import{t as O}from"./InputLabel-DzHsxXl5.js";import{t as k}from"./SecondaryButton-Bfm6mgDe.js";var A={},j={class:`inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 active:bg-red-700 dark:focus:ring-offset-gray-800`};function M(e,t){return o(),S(`button`,j,[d(e.$slots,`default`)])}var N=T(A,[[`render`,M]]),P={class:`fixed inset-0 z-50 overflow-y-auto px-4 py-6 sm:px-0`,"scroll-region":``},F=l({__name:`Modal`,props:{show:{type:Boolean,default:!1},maxWidth:{default:`2xl`},closeable:{type:Boolean,default:!0}},emits:[`close`],setup(e,{emit:t}){let i=e,c=t,l=s(),h=s(i.show);p(()=>i.show,()=>{i.show?(document.body.style.overflow=`hidden`,h.value=!0,l.value?.showModal()):(document.body.style.overflow=``,setTimeout(()=>{l.value?.close(),h.value=!1},200))});let _=()=>{i.closeable&&c(`close`)},y=e=>{e.key===`Escape`&&(e.preventDefault(),i.show&&_())};u(()=>document.addEventListener(`keydown`,y)),a(()=>{document.removeEventListener(`keydown`,y),document.body.style.overflow=``});let w=v(()=>({sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`})[i.maxWidth]);return(t,i)=>(o(),S(`dialog`,{class:`z-50 m-0 min-h-full min-w-full overflow-y-auto bg-transparent backdrop:bg-transparent`,ref_key:`dialog`,ref:l},[C(`div`,P,[r(x,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:f(()=>[m(C(`div`,{class:`fixed inset-0 transform transition-all`,onClick:_},[...i[0]||=[C(`div`,{class:`absolute inset-0 bg-gray-500 opacity-75 dark:bg-gray-900`},null,-1)]],512),[[b,e.show]])]),_:1}),r(x,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,"enter-to-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-to-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`},{default:f(()=>[m(C(`div`,{class:g([`mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full dark:bg-gray-800`,w.value])},[h.value?d(t.$slots,`default`,{key:0}):n(``,!0)],2),[[b,e.show]])]),_:3})])],512))}}),I={class:`space-y-6`},L={class:`text-lg font-medium text-gray-900 dark:text-gray-100`},R={class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},z={class:`p-6`},B={class:`text-lg font-medium text-gray-900 dark:text-gray-100`},V={class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},H={class:`mt-6`},U={class:`mt-6 flex justify-end`},W=l({__name:`DeleteUserForm`,setup(e){let n=s(!1),a=s(null),l=_({password:``}),u=()=>{n.value=!0,c(()=>a.value?.focus())},d=()=>{l.delete(route(`profile.destroy`),{preserveScroll:!0,onSuccess:()=>p(),onError:()=>a.value?.focus(),onFinish:()=>{l.reset()}})},p=()=>{n.value=!1,l.clearErrors(),l.reset()};return(e,s)=>(o(),S(`section`,I,[C(`header`,null,[C(`h2`,L,t(h(w)(`Delete Account`)),1),C(`p`,R,t(h(w)(`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)]),r(N,{onClick:u},{default:f(()=>[i(t(h(w)(`Delete Account`)),1)]),_:1}),r(F,{show:n.value,onClose:p},{default:f(()=>[C(`div`,z,[C(`h2`,B,t(h(w)(`Are you sure you want to delete your account?`)),1),C(`p`,V,t(h(w)(`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),C(`div`,H,[r(O,{for:`password`,value:h(w)(`Password`),class:`sr-only`},null,8,[`value`]),r(D,{id:`password`,ref_key:`passwordInput`,ref:a,modelValue:h(l).password,"onUpdate:modelValue":s[0]||=e=>h(l).password=e,type:`password`,class:`mt-1 block w-3/4`,placeholder:h(w)(`Password`),onKeyup:y(d,[`enter`])},null,8,[`modelValue`,`placeholder`]),r(E,{message:h(l).errors.password,class:`mt-2`},null,8,[`message`])]),C(`div`,U,[r(k,{onClick:p},{default:f(()=>[i(t(h(w)(`Cancel`)),1)]),_:1}),r(N,{class:g([`ms-3`,{"opacity-25":h(l).processing}]),disabled:h(l).processing,onClick:d},{default:f(()=>[i(t(h(w)(`Delete Account`)),1)]),_:1},8,[`class`,`disabled`])])])]),_:1},8,[`show`])]))}}),G=e({default:()=>K}),K=W;export{G as n,K as t};