1"use strict";(self.webpackChunkwebsite_react=self.webpackChunkwebsite_react||[]).push([[5817],{5817:(S,u,o)=>{o.r(u),o.d(u,{default:()=>O});var s=o(70579),n=o(65043),h=o(61201),y=o(58359),P=Object.defineProperty,v=Object.defineProperties,_=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,p=(r,e,t)=>e in r?P(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e)=>{for(var t in e||(e={}))j.call(e,t)&&p(r,t,e[t]);if(m)for(var t of m(e))N.call(e,t)&&p(r,t,e[t]);return r},c=(r,e)=>v(r,_(e));const b={currentPassword:"",newPassword:"",confirmPassword:""},C=(r,e)=>typeof r=="string"?r:r&&typeof r=="object"&&"message"in r?String(r.message||e):e,O=()=>{const{user:r}=(0,n.useContext)(h.A),[e,t]=(0,n.useState)(b),[w,f]=(0,n.useState)(!1),[g,d]=(0,n.useState)(null),[i,x]=(0,n.useState)(!1),E=async a=>{if(a.preventDefault(),d(null),x(!1),e.newPassword!==e.confirmPassword){d("The new passwords do not match.");return}f(!0);try{await(0,y.YC)(e),t(b),x(!0),d("Your password has been updated.")}catch(k){d(C(k,"We could not update your password."))}finally{f(!1)}};return(0,s.jsx)("main",{className:"ml-64 min-h-screen bg-gray-50 px-6 py-8",children:(0,s.jsxs)("div",{className:"max-w-2xl",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-ekc-blue",children:"Account security"}),(0,s.jsx)("h1",{className:"mt-1 text-3xl font-semibold tracking-tight text-gray-950",children:"Account & Password"}),(0,s.jsxs)("p",{className:"mt-2 text-sm leading-6 text-gray-600",children:["Signed in as ",(0,s.jsx)("strong",{className:"font-semibold text-gray-900",children:r==null?void 0:r.username}),". Use this page to choose a private password only you know."]}),(r==null?void 0:r.mustChangePassword)&&!i&&(0,s.jsxs)("section",{"aria-label":"Password change required",className:"mt-6 border-l-4 border-amber-500 bg-amber-50 px-4 py-3 text-sm leading-6 text-amber-950",children:[(0,s.jsx)("strong",{className:"font-semibold",children:"Choose a new password before continuing."})," ","An administrator gave you a temporary password. Your other CMS tools will become available after you replace it."]}),g&&(0,s.jsx)("div",{role:"status",className:`mt-6 rounded-md border px-4 py-3 text-sm ${i?"border-emerald-200 bg-emerald-50 text-emerald-950":"border-red-200 bg-red-50 text-red-800"}`,children:g}),(0,s.jsxs)("form",{onSubmit:E,className:"mt-6 border-t border-gray-200 pt-6",children:[(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"currentPassword",className:"block text-sm font-semibold text-gray-900",children:"Current password"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Use the temporary password here if your account was reset."}),(0,s.jsx)("input",{id:"currentPassword",type:"password",autoComplete:"current-password",value:e.currentPassword,onChange:a=>t(c(l({},e),{currentPassword:a.target.value})),className:"mt-2 block w-full rounded-md border border-gray-300 bg-white px-3 py-2.5 text-gray-950 shadow-sm focus:border-ekc-blue focus:outline-none focus:ring-2 focus:ring-ekc-blue/20",required:!0})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"newPassword",className:"block text-sm font-semibold text-gray-900",children:"New password"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Use at least 12 characters and do not include your username."}),(0,s.jsx)("input",{id:"newPassword",type:"password",autoComplete:"new-password",minLength:12,value:e.newPassword,onChange:a=>t(c(l({},e),{newPassword:a.target.value})),className:"mt-2 block w-full rounded-md border border-gray-300 bg-white px-3 py-2.5 text-gray-950 shadow-sm focus:border-ekc-blue focus:outline-none focus:ring-2 focus:ring-ekc-blue/20",required:!0})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"confirmPassword",className:"block text-sm font-semibold text-gray-900",children:"Confirm new password"}),(0,s.jsx)("input",{id:"confirmPassword",type:"password",autoComplete:"new-password",minLength:12,value:e.confirmPassword,onChange:a=>t(c(l({},e),{confirmPassword:a.target.value})),className:"mt-2 block w-full rounded-md border border-gray-300 bg-white px-3 py-2.5 text-gray-950 shadow-sm focus:border-ekc-blue focus:outline-none focus:ring-2 focus:ring-ekc-blue/20",required:!0})]})]}),(0,s.jsxs)("div",{className:"mt-6 flex flex-wrap items-center gap-4",children:[(0,s.jsx)("button",{type:"submit",disabled:w,className:"rounded-md bg-ekc-blue px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-opacity-85 focus:outline-none focus:ring-2 focus:ring-ekc-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",children:w?"Updating\u2026":"Update password"}),i&&(0,s.jsx)("a",{href:"/dashboard",className:"text-sm font-semibold text-ekc-blue underline decoration-blue-300 underline-offset-4 hover:
1decoration-ekc-blue",children:"Continue to the dashboard"})]})]})]})})}}}]); 2 3//# sourceMappingURL=5817.188622fa.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.