1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9766],{99485:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/verifyOTP",function(){return s(97761)}])},24980:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});var n=s(85893),r=s(37380);function a(){return(0,n.jsx)("div",{children:(0,n.jsx)("div",{className:"relative min-h-screen",style:{backgroundImage:"url('/new-images/login-bg.png')",backgroundSize:"cover",backgroundRepeat:"no-repeat"},children:(0,n.jsxs)("div",{className:"absolute flex flex-col items-center justify-center bg-[#0E65FB]/90 w-full h-full",style:{backgroundImage:"url('/new-images/login-bg.png')",backgroundSize:"cover",backgroundRepeat:"no-repeat"},children:[(0,n.jsx)("img",{src:"/new-images/circle-img.png",alt:""}),(0,n.jsxs)("div",{className:"flex justify-center items-center text-center flex-col text-white py-5",children:[(0,n.jsx)("p",{className:"text-2xl ",children:"Effortless"}),(0,n.jsxs)("p",{className:"text-2xl ",children:["Management with ",r.lW]}),(0,n.jsx)("hr",{className:"w-1/4 my-2 bg-gray-300 border-none h-[1px]"}),(0,n.jsx)("p",{className:"!text-xs w-2/3 mx-auto",children:"Embrace the digital transformation that simplifies assessment creation, optimizes distribution, and provides real-time analytics for informed decision-making."})]})]})})})}s(67294)},37380:function(e,t,s){"use strict";s.d(t,{G2:function(){return r},lW:function(){return n},qz:function(){return a}});let n="Troven",r="/troven-white-logo.png",a={toolbar:[[{header:"1"},{header:"2"},{font:[]}],[{size:[]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}],["link","image","video"],["clean"]]}},97761:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return j}});var n=s(85893),r=s(11163),a=s(67294),o=s(22653),i=s(9473),l=s(4528),c=s(24289),d=s(96245),u=s(87536),m=s(55678);s(71399);var f=s(31955);s(41664);var p=s(58386),x=s(24980),h=s(20373),g=s(5434),v=s(30381),b=s.n(v),y=s(46107);function j(){var e;let[t,s]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!0),[k,O]=(0,a.useState)(null),[S,P]=(0,a.useState)(),[_,T]=(0,a.useState)(null),[E,C]=(0,a.useState)(""),[I,Z]=(0,a.useState)(null),[z,M]=(0,a.useState)(!1),[R,A]=(0,a.useState)(!1),[F,D]=(0,a.useState)(null),[W,B]=(0,a.useState)(!0),[L,V]=(0,a.useState)(null),q=(0,r.useRouter)(),{asPath:X}=q,[G,H]=(0,a.useState)(6e4),{register:$,handleSubmit:J,watch:K,formState:{errors:Q}}=(0,u.cI)({mode:"all"}),U=(0,i.I0)(),Y=(0,i.v9)(e=>e.user);(0,a.useEffect)(()=>{let e=f.Z.get("token");if(e){let t=(0,d.Z)(e);T(t),t.otpVerified&&q.push("/admin/dashboard")}else q.push("/admin/login")},[q]),(0,a.useEffect)(()=>{let e=f.Z.get("token");if(e){P(e);let t=(0,d.Z)(e),s=!!t.isMfa&&!t.forgotPassword;O(s),T(t),console.log(!!t.isMfa,"mfa"),localStorage.getItem("user"),N(!1)}},[]),(0,a.useEffect)(()=>{let e=setInterval(()=>{H(e=>e-1e3)},1e3);return()=>clearInterval(e)},[]);let ee=async e=>{e.preventDefault(),j(!0),console.log(k);let t=Y.temporaryDetails.verifyOTPFrom,s="login"===t?l.PLt:"forgotPassword"===t?l.PLt:void 0;I?(0,c.l_)(o.zA+s,{otp:I},S).then(e=>{if(console.log(e,"vikas"),505===e.data.status_code)(0,m.Am)(e.data.errorMsg),j(!1);else if(200===e.data.status_code){let s=e.data.access_token;f.Z.set("token",s,{expires:7}),U(y.Nw.updateTemporaryData({email:"",verifyOTPFrom:""})),e.data.data,j(!1),"login"===t?q.push("/admin/dashboard"):q.push("/admin/resetPassword")}else 404===e.data.status_code?(j(!1),D(e.data.message)):(console.log(e.data.details,"details"),j(!1),m.Am.error(e.data.message))}):(D("Please Enter OTP"),j(!1))},et=()=>{B(!1),(0,c.l_)(o.zA+l.R5F,{},S).then(e=>{if(console.log(e,"vikas"),505===e.data.status_code)(0,m.Am)(e.data.errorMsg),j(!1);else if(200===e.data.status_code){if(_.isMfa){let t=e.data.access_token;f.Z.set("token",t),window.location.reload()}m.Am.success("OTP sent successfully"),Z(null),H(6e4)}else j(!1),m.Am.error(e.data.message)})},es=()=>{f.Z.remove("token"),q.push("/admin/login")};return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:" flex flex-row bg-white h-screen",children:[(0,n.jsx)("div",{className:"lg:w-[45%] h-full w-full ",children:(0,n.jsxs)("div",{className:" w-[90%] md:w-[65%] mx-auto lg:w-[55%] lg:max-w-[55%] flex flex-col mt-24",children:[(0,n.jsxs)("div",{onClick:()=>{es()},className:"flex w-30 items-center space-x-0 text-gray-500 cursor-pointer hover:text-blue-600",children:[(0,n.jsx)(g.dWm,{className:"w-10 scale-x-120 !h-6 "}),(0,n.jsx)("p",{children:"Back "})]}),(0,n.jsxs)("div",{className:"mt-28",children:[(0,n.jsx)("img",{className:"h-8 w-auto",src:"/troven-logo.png",alt:"logo"}),(0,n.jsx)("h2",{className:"mt-6 text-xl font-semibold text-gray-900",children:"Verify OTP"}),(0,n.jsxs)("p",{className:"mt-2 text-sm text-gray-600 ",children:["We have sent you a One Time Password on",(0,n.jsx)("span",{className:"text-black block font-semibold",children:null==Y?void 0:null===(e=Y.temporaryDetails)||void 0===e?void 0:e.email})]})]}),!w&&(0,n.jsx)("div",{className:" rounded-md",children:(0,n.jsxs)("div",{className:"py-4 pb-8 ",children:[(0,n.jsx)("form",{className:"space-y-6",onSubmit:ee,action:"#",method:"POST",children:(0,n.jsxs)("div",{className:"",children:[(0,n.jsx)("div",{className:"",children:(0,n.jsx)(p.Z,{onChange:Z,shouldAutoFocus:!0,value:
1I,numInputs:6,renderSeparator:(0,n.jsx)("span",{children:" "}),renderInput:e=>(0,n.jsx)("input",{className:"otp-input",...e,style:{borderStyle:"solid",borderWidth:"1px",borderColor:"#d1d5db",borderRadius:"2px",width:"42px",height:"30px",margin:"5px",textAlign:"center"}}),inputStyle:{width:"49px",height:"30px",fontSize:"20px",color:"blue"}})}),(0,n.jsx)("p",{className:"text-red-500 w-1/2 text-center mt-2",children:F}),(0,n.jsxs)("div",{className:"flex items-center space-x-5 ",children:[(0,n.jsx)("div",{className:"w-[45%]",children:G>=1e3?(0,n.jsx)("p",{className:"",children:function(e){let t=b().duration(e),s=b().utc(t.asMilliseconds()).format("mm:ss");return s}(G)}):(0,n.jsx)("div",{className:"text-sm text-gray-600",children:(0,n.jsxs)("p",{children:["Did't got the OTP?",(0,n.jsx)("span",{onClick:()=>{et()},className:"text-blue-500 hover:text-blue-600 cursor-pointer pl-2 antialiased",children:"Resend"})]})})}),(0,n.jsx)("div",{className:"flex justify-center items-center mr-14 ",children:v?(0,n.jsx)("button",{type:"submit",disabled:!0,className:"bg-primary ml-auto rounded w-28 h-10 px-3 text-gray-100 text-xs flex items-center justify-center",children:(0,n.jsx)(h.Z,{color:"#fff",size:23})}):(0,n.jsx)("button",{type:"submit",className:"ml-auto flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm w-28 h-10 font-medium text-white bg-primary hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:"Verify OTP"})})]})]})}),(0,n.jsx)(m.Ix,{position:"top-center",autoClose:2e3,hideProgressBar:!1,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!1,theme:"light"})]})})]})}),(0,n.jsx)("div",{className:"w-[55%] min-h-screen hidden lg:block",children:(0,n.jsx)(x.Z,{})})]})})}},20373:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var n=s(67294),r={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function a(e){var t=function(e){if("number"==typeof e)return{value:e,unit:"px"};var t,s=(e.match(/^[0-9.]*/)||"").toString();t=s.includes(".")?parseFloat(s):parseInt(s,10);var n=(e.match(/[^0-9]*$/)||"").toString();return r[n]?{value:t,unit:n}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}(e);return"".concat(t.value).concat(t.unit)}var o=function(){return(o=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var r in t=arguments[s])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)0>t.indexOf(n[r])&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(s[n[r]]=e[n[r]]);return s},l=function(e,t,s){var n="react-spinners-".concat(e,"-").concat(s);if("undefined"==typeof window||!window.document)return n;var r=document.createElement("style");document.head.appendChild(r);var a=r.sheet,o="\n @keyframes ".concat(n," {\n ").concat(t,"\n }\n ");return a&&a.insertRule(o,0),n}("ClipLoader","0% {transform: rotate(0deg) scale(1)} 50% {transform: rotate(180deg) scale(0.8)} 100% {transform: rotate(360deg) scale(1)}","clip"),c=function(e){var t=e.loading,s=e.color,r=void 0===s?"#000000":s,c=e.speedMultiplier,d=e.cssOverride,u=e.size,m=void 0===u?35:u,f=i(e,["loading","color","speedMultiplier","cssOverride","size"]),p=o({background:"transparent !important",width:a(m),height:a(m),borderRadius:"100%",border:"2px solid",borderTopColor:r,borderBottomColor:"transparent",borderLeftColor:r,borderRightColor:r,display:"inline-block",animation:"".concat(l," ").concat(.75/(void 0===c?1:c),"s 0s infinite linear"),animationFillMode:"both"},void 0===d?{}:d);return void 0===t||t?n.createElement("span",o({style:p},f)):null}}},function(e){e.O(0,[1228,4885,1664,7536,3643,4528,9774,2888,179],function(){return e(e.s=99485)}),_N_E=e.O()}]);
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.