import{a as e,c as t,d as n,i as r,n as i,o as a,t as o}from"./app-BJ7g6sa8.js";import{t as s}from"./AuthenticatedLayout-CrB9BCoI.js";import{t as c}from"./swal-DZXjpqDE.js";import{n as l,r as u,t as d}from"./filepond-plugin-file-validate-type-CBUe71W_.js";var f=n(t(),1),p=u(),m=n(l(),1),h=n(d(),1),g=o();(0,p.registerPlugin)(m.default,h.default);function _({title:e,description:t,children:n,delay:r=`0s`}){return(0,g.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden h-full flex flex-col anim-up`,style:{animationDelay:r},children:[(0,g.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e}),(0,g.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold tracking-tight mt-1`,children:t})]}),(0,g.jsx)(`div`,{className:`p-6 flex-1`,children:n})]})}function v({label:e,id:t,type:n=`text`,value:r,onChange:i,error:a,placeholder:o,required:s=!1,...c}){return(0,g.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,g.jsxs)(`label`,{htmlFor:t,className:`block text-xs font-bold text-gray-400 tracking-tight ml-1`,children:[e,` `,s&&(0,g.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,g.jsx)(`input`,{id:t,type:n,value:r,onChange:i,placeholder:o,className:`w-full px-4 py-2.5 rounded-xl border text-sm font-bold transition-all outline-none ${a?`border-red-300 bg-red-50`:`border-gray-100 bg-gray-50/30 focus:border-[#D4A017] focus:bg-white`}`,...c}),a&&(0,g.jsx)(`p`,{className:`text-sm text-red-500 font-bold ml-1`,children:a})]})}function y({mustVerifyEmail:t,status:n}){let{auth:o}=a().props,{user:l}=o,[u,d]=(0,f.useState)([]),m=e({first_name:l.first_name||``,last_name:l.last_name||``,email:l.email||``,phone:l.phone||``,bio:l.bio||``,avatar_file:null,_method:`PATCH`}),h=e({current_password:``,password:``,password_confirmation:``}),y=e=>{e.preventDefault(),m.post(route(`profile.update`),{preserveScroll:!0,onSuccess:()=>c.success(`Success`,`Profile identity synchronized.`)})},b=e=>{e.preventDefault(),h.put(route(`password.update`),{preserveScroll:!0,onSuccess:()=>{h.reset(),c.success(`Success`,`Security token updated.`)}})},x=`${l.first_name?.charAt(0)||``}${l.last_name?.charAt(0)||``}`.toUpperCase();return(0,g.jsxs)(s,{children:[(0,g.jsx)(i,{title:`Account Settings`}),(0,g.jsxs)(`div`,{className:`mb-6 anim-down`,children:[(0,g.jsx)(`h1`,{className:`text-lg font-bold text-[#3D4E4B] dark:text-white tracking-tight leading-none`,children:`Account Settings`}),(0,g.jsx)(`p`,{className:`text-xs font-semibold text-gray-400 tracking-tight mt-2`,children:`Personal Identity & Security Governance`})]}),(0,g.jsxs)(`div`,{className:`w-full grid grid-cols-1 lg:grid-cols-2 gap-6 pb-20`,children:[(0,g.jsx)(`div`,{className:`space-y-6`,children:(0,g.jsx)(_,{title:`Identity Configuration`,description:`Manage your personal credentials`,delay:`0s`,children:(0,g.jsxs)(`form`,{onSubmit:y,className:`space-y-6`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center gap-6 mb-4`,children:[(0,g.jsx)(`div`,{className:`w-24 h-24 rounded-2xl flex items-center justify-center text-white text-3xl font-bold shrink-0 border border-gray-100 dark:border-white/5 ${l.avatar_url?`bg-white dark:bg-white/5`:`bg-[#3D4E4B]`}`,children:l.avatar_url?(0,g.jsx)(`img`,{src:l.avatar_url,className:`w-full h-full object-cover rounded-2xl`}):x}),(0,g.jsxs)(`div`,{className:`flex-1 w-full`,children:[(0,g.jsx)(`label`,{className:`text-[10px] font-black text-gray-400 uppercase tracking-widest mb-2 block`,children:`Identity Portrait`}),(0,g.jsx)(p.FilePond,{files:u,onupdatefiles:e=>{d(e),m.setData(`avatar_file`,e[0]?.file||null)},allowMultiple:!1,maxFiles:1,labelIdle:`Portrait update`})]})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,g.jsx)(v,{label:`First Designation`,id:`first_name`,value:m.data.first_name,onChange:e=>m.setData(`first_name`,e.target.value),error:m.errors.first_name,required:!0,placeholder:`e.g. Alex`}),(0,g.jsx)(v,{label:`Last Designation`,id:`last_name`,value:m.data.last_name,onChange:e=>m.setData(`last_name`,e.target.value),error:m.errors.last_name,required:!0,placeholder:`e.g. Johnson`})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,g.jsx)(v,{label:`Communication Channel (Email)`,id:`email`,type:`email`,value:m.data.email,onChange:e=>m.setData(`email`,e.target.value),error:m.errors.email,required:!0,placeholder:`alex@company.com`}),(0,g.jsx)(v,{label:`Contact Number (Phone)`,id:`phone`,type:`tel`,value:m.data.phone,onChange:e=>m.setData(`phone`,e.target.value),error:m.errors.phone,placeholder:`+62...`})]}),(0,g.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,g.jsx)(`label`,{className:`block text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1`,children:`Professional Bio`}),(0,g.jsx)(`textarea`,{value:m.data.bio,onChange:e=>m.setData(`bio`,e.target.value),rows:4,className:`input-field py-3 resize-none`,placeholder:`Tell us about yourself...`})]}),(0,g.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,g.jsx)(`button`,{type:`submit`,disabled:m.processing,className:`px-8 py-3 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20`,children:m.processing?`Synchronizing...`:`Update Identity`})})]})})}),(0,g.jsxs)(`div`,{className:`space-y-6 flex flex-col`,children:[(0,g.jsx)(_,{title:`Security Protocols`,description:`Authentication & Token Lifecycle`,delay:`0.1s`,children:(0,g.jsxs)(`form`,{onSubmit:b,className:`space-y-4`,children:[(0,g.jsx)(v,{label:`Current Security Token`,id:`current_password`,type:`password`,value:h.data.current_password,onChange:e=>h.setData(`current_password`,e.target.value),error:h.errors.current_password,required:!0,placeholder:`••••••••`}),(0,g.jsx)(v,{label:`New Security Token`,id:`password`,type:`password`,value:h.data.password,onChange:e=>h.setData(`password`,e.target.value),error:h.errors.password,required:!0,placeholder:`••••••••`}),(0,g.jsx)(v,{label:`Verify Token`,id:`password_confirmation`,type:`password`,value:h.data.password_confirmation,onChange:e=>h.setData(`password_confirmation`,e.target.value),error:h.errors.password_confirmation,required:!0,placeholder:`••••••••`}),(0,g.jsx)(`div`,{className:`pt-4`,children:(0,g.jsx)(`button`,{type:`submit`,disabled:h.processing,className:`w-full py-3 bg-[#D4A017] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#B88B14] transition-all`,children:h.processing?`...`:`Rotate Security Tokens`})})]})}),(0,g.jsxs)(`div`,{className:`bg-white rounded-2xl border border-red-100 p-6 shadow-sm anim-up`,style:{animationDelay:`0.2s`},children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,g.jsx)(`h3`,{className:`text-sm font-bold text-red-800 tracking-tight`,children:`Termination Zone`}),(0,g.jsx)(`span`,{className:`px-2 py-0.5 bg-red-50 text-red-600 text-sm font-bold rounded-md border border-red-100`,children:`Critical`})]}),(0,g.jsx)(`p`,{className:`text-xs text-red-600 font-semibold leading-relaxed mb-4`,children:`Once account liquidation is initiated, the process is irreversible. All associated data assets will be purged.`}),(0,g.jsx)(`button`,{onClick:()=>{c.confirmDelete(`Your Entire Account`).then(e=>{e.isConfirmed&&r.delete(route(`profile.destroy`))})},className:`w-full py-3 border border-red-100 text-red-600 text-xs font-bold tracking-tight rounded-xl hover:bg-red-50 transition-colors`,children:`Initiate Liquidation`})]})]})]})]})}export{y as default};