(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8243],{8096:function(e,t,u){Promise.resolve().then(u.bind(u,5653))},5653:function(e,t,u){"use strict";u.r(t),u.d(t,{default:function(){return o}});var r=u(7437),a=u(2265),s=u(9376),n=u(8706),i=u(3239);function o(){let e=(0,s.useSearchParams)(),t=(0,s.useRouter)(),u=(0,n.T)(),[o,l]=(0,a.useState)("loading"),[c,d]=(0,a.useState)(""),[h]=(0,i.gX)(),m=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(m.current)return;m.current=!0;let r=e.get("token"),a=Number(e.get("id"));if(!r||!a){l("error"),d(u("invalid_link",{defaultValue:"Linku eshte i pavlefshem."}));return}h({userId:a,activationCode:r}).unwrap().then(e=>{e.success?(l("success"),d(u("account_activated",{defaultValue:"Llogaria u aktivizua me sukses! Mund te hyni tani."})),setTimeout(()=>t.push("/login"),3e3)):(l("error"),d(e.error||u("activation_failed",{defaultValue:"Aktivizimi deshtoi."})))}).catch(()=>{l("error"),d(u("generic_error",{defaultValue:"Ndodhi nje gabim."}))})},[e,t,u,h]),(0,r.jsx)("div",{className:"min-h-[60vh] flex items-center justify-center px-4 py-12",children:(0,r.jsxs)("div",{className:"w-full max-w-md text-center",children:["loading"===o&&(0,r.jsx)("div",{className:"text-gray-600",children:u("activating",{defaultValue:"Duke aktivizuar llogarine..."})}),"success"===o&&(0,r.jsxs)("div",{className:"bg-green-50 text-green-600 p-6 rounded-xl",children:[(0,r.jsx)("div",{className:"text-4xl mb-4",children:"✓"}),(0,r.jsx)("p",{children:c})]}),"error"===o&&(0,r.jsxs)("div",{className:"bg-red-50 text-red-600 p-6 rounded-xl",children:[(0,r.jsx)("div",{className:"text-4xl mb-4",children:"✗"}),(0,r.jsx)("p",{children:c})]})]})})}},9376:function(e,t,u){"use strict";var r=u(5475);u.o(r,"useParams")&&u.d(t,{useParams:function(){return r.useParams}}),u.o(r,"usePathname")&&u.d(t,{usePathname:function(){return r.usePathname}}),u.o(r,"useRouter")&&u.d(t,{useRouter:function(){return r.useRouter}}),u.o(r,"useSearchParams")&&u.d(t,{useSearchParams:function(){return r.useSearchParams}})},3239:function(e,t,u){"use strict";u.d(t,{LP:function(){return n},YA:function(){return i},_y:function(){return l},gX:function(){return c},iJ:function(){return s},l4:function(){return o},sz:function(){return d}});var r=u(3557),a=u(9523);let s=(0,r.LC)({reducerPath:"authApi",baseQuery:(0,a.ni)({baseUrl:"/"}),tagTypes:["Session"],endpoints:e=>({getSession:e.query({query:()=>"api/auth/session",providesTags:["Session"],keepUnusedDataFor:300}),login:e.mutation({query:e=>({url:"api/auth/login",method:"POST",body:e}),invalidatesTags:e=>(null==e?void 0:e.success)?["Session"]:[]}),register:e.mutation({query:e=>({url:"api/auth/register",method:"POST",body:e})}),logout:e.mutation({query:()=>({url:"api/auth/logout",method:"POST"}),invalidatesTags:["Session"]}),activate:e.mutation({query:e=>({url:"api/auth/activate",method:"POST",body:e}),invalidatesTags:e=>(null==e?void 0:e.success)?["Session"]:[]}),resendActivation:e.mutation({query:e=>({url:"api/auth/resend-activation",method:"POST",body:e})}),resetPassword:e.mutation({query:e=>({url:"api/auth/reset-password",method:"POST",body:e})}),googleVerify:e.mutation({query:e=>({url:"api/auth/google/verify",method:"POST",body:e}),invalidatesTags:e=>(null==e?void 0:e.success)||(null==e?void 0:e.authenticated)?["Session"]:[]})})}),{useGetSessionQuery:n,useLoginMutation:i,useRegisterMutation:o,useLogoutMutation:l,useActivateMutation:c,useResendActivationMutation:d,useResetPasswordMutation:h,useGoogleVerifyMutation:m}=s}},function(e){e.O(0,[8706,3557,2971,2117,1744],function(){return e(e.s=8096)}),_N_E=e.O()}]);