(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5565],{285:function(e,r,t){Promise.resolve().then(t.bind(t,3621))},3621:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return i}});var n=t(7437),a=t(2265),s=t(9376),u=t(8706),o=t(6175);function i(){let[e,r]=(0,a.useState)(""),[t,i]=(0,a.useState)(""),d=(0,s.useRouter)(),c=(0,s.useSearchParams)().get("phone")||"",l=(0,u.T)(),[m,{isLoading:f}]=(0,o.oq)();async function h(r){r.preventDefault(),i("");try{let r=await m({phone:c,code:e}).unwrap();r.success?d.push("/password/rewrite-password?phone=".concat(encodeURIComponent(c),"&code=").concat(encodeURIComponent(e))):i(r.message||l("invalid_code",{defaultValue:"Kodi eshte i gabuar."}))}catch(e){i(l("generic_error",{defaultValue:"Ndodhi nje gabim."}))}}return(0,n.jsx)("div",{className:"min-h-[60vh] flex items-center justify-center px-4 py-12",children:(0,n.jsxs)("div",{className:"w-full max-w-md",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-center mb-6",children:l("verify_code",{defaultValue:"Verifiko Kodin"})}),(0,n.jsxs)("div",{className:"bg-white rounded-xl p-8 shadow-sm",children:[(0,n.jsx)("p",{className:"text-gray-600 text-sm mb-6",children:l("verify_code_desc",{defaultValue:"Shkruaj kodin qe mor\xebt me SMS ne numrin e telefonit tuaj."})}),t&&(0,n.jsx)("div",{className:"bg-red-50 text-red-600 p-3 rounded-lg mb-4 text-sm",children:t}),(0,n.jsxs)("form",{onSubmit:h,className:"space-y-4",children:[(0,n.jsx)("div",{children:(0,n.jsx)("input",{type:"text",value:e,onChange:e=>r(e.target.value),placeholder:l("enter_code",{defaultValue:"Shkruaj kodin"}),required:!0,maxLength:6,className:"w-full border border-gray-300 rounded-lg px-4 py-3 text-center text-2xl tracking-widest focus:ring-2 focus:ring-orange-500 focus:border-transparent outline-none"})}),(0,n.jsx)("button",{type:"submit",disabled:f,className:"w-full bg-orange-500 hover:bg-orange-600 disabled:bg-orange-300 text-white font-semibold px-6 py-3 rounded-lg transition-colors",children:f?l("verifying",{defaultValue:"Duke verifikuar..."}):l("verify",{defaultValue:"Verifiko"})})]})]})]})})}},9376:function(e,r,t){"use strict";var n=t(5475);t.o(n,"useParams")&&t.d(r,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})},6175:function(e,r,t){"use strict";t.d(r,{$h:function(){return d},cv:function(){return s},er:function(){return u},oq:function(){return i},s:function(){return o}});var n=t(3557),a=t(9523);let s=(0,n.LC)({reducerPath:"miscApi",baseQuery:(0,a.ni)({baseUrl:"/"}),endpoints:e=>({registerFcmToken:e.mutation({query:e=>({url:"api/fcm",method:"POST",body:e})}),sendPasswordSms:e.mutation({query:e=>({url:"api/password/send-sms",method:"POST",body:e})}),verifyPasswordCode:e.mutation({query:e=>({url:"api/password/verify-code",method:"POST",body:e})}),changePassword:e.mutation({query:e=>({url:"api/password/change",method:"POST",body:e})})})}),{useRegisterFcmTokenMutation:u,useSendPasswordSmsMutation:o,useVerifyPasswordCodeMutation:i,useChangePasswordMutation:d}=s}},function(e){e.O(0,[8706,3557,2971,2117,1744],function(){return e(e.s=285)}),_N_E=e.O()}]);