import{W as p,j as s}from"./BulkImageUpload-DGPbX05r.js";import{A as w}from"./Authenticated-DQno4VYw.js";import{I as l}from"./Input-CR3dcIBA.js";import{P as x}from"./Panel-CCKAj23D.js";import{P as j}from"./PageTitle-feHaMeNG.js";import{S as f}from"./sweetalert2.all-CGGHY7K6.js";import"./bootstrap.esm-e_F80uXB.js";const C=e=>{const{data:o,setData:c,post:i,processing:n,errors:a,clearErrors:t,reset:m}=p({oldpassword:"",password:"",password_confirmation:""}),d=r=>{c(r.target.name,r.target.type==="checkbox"?r.target.checked:r.target.value),t(r.target.name)},h=r=>{r.preventDefault(),i(route("change-password"),{onSuccess:()=>{m(),f.fire("Password Change Successfully !","","success")}})};return s.jsxs(w,{auth:e.auth,errors:e.errors,current:e.current,children:[s.jsx(j,{title:"Password Settings",path:"Settings",pathurl:""}),s.jsx(x,{title:"Change Admin Password",md:"6",children:s.jsxs("form",{className:"p-4",onSubmit:h,id:"catform",children:[s.jsxs("div",{className:"form-group  row",children:[s.jsxs("div",{className:"col-sm-4",children:[s.jsx("label",{htmlFor:"",children:"Old Password"}),s.jsx("span",{className:"form-indicat",children:":"})]}),s.jsxs("div",{className:"col-sm-8 sticky",children:[s.jsx(l,{type:"password",className:a.oldpassword&&"inerror",name:"oldpassword",value:o.oldpassword,placeholder:"Enter Old Password",handleChange:d}),a.oldpassword&&s.jsx("div",{className:"smart-valid",children:a.oldpassword})]})]}),s.jsxs("div",{className:"form-group  row",children:[s.jsxs("div",{className:"col-sm-4",children:[s.jsx("label",{htmlFor:"",children:"New Password"}),s.jsx("span",{className:"form-indicat",children:":"})]}),s.jsxs("div",{className:"col-sm-8 sticky",children:[s.jsx(l,{type:"password",className:a.password&&"inerror",name:"password",value:o.password,placeholder:"Enter New Password",handleChange:d}),a.password&&s.jsx("div",{className:"smart-valid",children:a.password})]})]}),s.jsxs("div",{className:"form-group  row",children:[s.jsxs("div",{className:"col-sm-4",children:[s.jsx("label",{htmlFor:"",children:"Confirm Password"}),s.jsx("span",{className:"form-indicat",children:":"})]}),s.jsxs("div",{className:"col-sm-8 sticky",children:[s.jsx(l,{type:"password",className:a.password_confirmation&&"inerror",name:"password_confirmation",value:o.password_confirmation,placeholder:"Enter Confirm Password",handleChange:d}),a.password_confirmation&&s.jsx("div",{className:"smart-valid",children:a.password_confirmation})]})]}),s.jsxs("div",{className:"form-group  row",children:[s.jsx("div",{className:"col-sm-4"}),s.jsx("div",{className:"col-sm-8 text-end",children:s.jsx("button",{disabled:n,className:"btn  btn-primary",children:"Change Password"})})]})]})})]})};export{C as default};
