1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8295],{7984:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return t(79307)}])},11508:(e,a,t)=>{"use strict";t.d(a,{A:()=>i});let i=(0,t(17963).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},30860:(e,a,t)=>{"use strict";t.d(a,{A:()=>i});let i=(0,t(17963).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},50847:(e,a,t)=>{"use strict";t.d(a,{jQ:()=>l,p7:()=>r,vB:()=>o,xd:()=>s}),t(37876);var i=t(14232);let n={google:!1,apple:!1};function r(){let[e,a]=(0,i.useState)(n);return(0,i.useEffect)(()=>{let e=!1;return fetch("/api/public/oauth-config").then(async e=>e.ok?e.json():null).then(t=>{!e&&(null==t?void 0:t.providers)&&a({google:!0===t.providers.google,apple:!0===t.providers.apple})}).catch(()=>{}),()=>{e=!0}},[]),e}let s={google:"Google",apple:"Apple"},l=["google","apple"];function o(e,a,t){let i=t?"&invite=".concat(encodeURIComponent(t)):"";return"/api/auth/oauth/".concat(e,"/start?return=").concat(encodeURIComponent(a)).concat(i)}},56732:(e,a,t)=>{"use strict";t.d(a,{A:()=>i});let i=(0,t(17963).A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},79247:(e,a,t)=>{"use strict";t.d(a,{A:()=>i});let i=(0,t(17963).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},79307:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>b});var i=t(37876),n=t(14232),r=t(89099),s=t(48230),l=t.n(s),o=t(79247),c=t(11508),d=t(56732),u=t(30860),p=t(28419),h=t(52885),m=t(84722),y=t(41404),g=t(35535),x=t(50847),v=t(11145),f=t(59069),w=t(71381),j=t(27214);let k=(0,g.h)("login");function b(){let e=(0,r.useRouter)(),{user:a,isAuthenticated:t,isLoading:s,checkAuth:g}=(0,m.A)(),b=(0,y.n)(),N="".concat(b.replace(/\/$/,""),"/demo"),[_,C]=(0,n.useState)({email:"",password:""}
1),[S,A]=(0,n.useState)(!1),[q,R]=(0,n.useState)(!1),[E,T]=(0,n.useState)(!1),[P,F]=(0,n.useState)(null),[M,I]=(0,n.useState)(null),[O,D]=(0,n.useState)(null),[Y,B]=(0,n.useState)(null),W=function(e){let a=Array.isArray(e)?e[0]:e;return a&&a.startsWith("/")&&!a.startsWith("//")&&!/[\\\u0000-\u001f]/.test(a)?a.slice(0,500):"/desk"}(e.query.redirect),z=(0,x.p7)(),H=(0,n.useCallback)(e=>!0===e?"/signup?resume=plan":W,[W]),G=async a=>{window.dispatchEvent(new CustomEvent("user-login-success")),await g(),e.push(H(a))};(0,n.useEffect)(()=>{if(T(!0),"1"===e.query.session_expired){F("idle"),e.replace("/login",void 0,{shallow:!0});return}let a=(0,j.KK)();if(a){(0,j.ac)(),I(a);return}(0,j.ac)()&&F("expired")},[e.query.session_expired]),(0,n.useEffect)(()=>{let a=e.query.oauth_error,t=Array.isArray(a)?a[0]:a;t&&I(function(e){switch(e){case"no_account":return"There is no Refinix account for that sign-in. Refinix is available by invitation. Request a demo and we will be in touch.";case"organization_locked":return"Your organisation's access to Refinix has ended. Contact us to continue.";case"cancelled":return"Sign-in was cancelled. You can try again or use your email and password.";case"email_unverified":return"That provider has not verified your email address, so it cannot be used to sign in.";case"provider_unavailable":return"That sign-in provider is not available right now.";default:return"Could not complete sign-in. Please try again."}}(t))},[e.query.oauth_error]),(0,n.useEffect)(()=>{t&&e.replace(H(null==a?void 0:a.payment_required))},[H,t,e,null==a?void 0:a.payment_required]);let J=e=>{let{name:a,value:t,type:i,checked:n}=e.target;C(e=>({...e,[a]:"checkbox"===i?n:t})),M&&("email"===a||"password"===a)&&I(null)},K=async e=>{e.preventDefault(),R(!0),I(null);try{let e=(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){return""}})(),t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json",...e?{"x-timezone":e}:{}},credentials:"include",body:JSON.stringify({email:_.email,password:_.password,rememberMe:!0})}),i=await t.json().catch(()=>({}));if((null==i?void 0:i.reactivation)&&(null==i?void 0:i.reactivationToken))return void D({token:i.reactivationToken,message:i.message||""});if(t.ok&&(null==i?void 0:i.success)){var a;await G(null==i||null==(a=i.user)?void 0:a.payment_required)}else I((null==i?void 0:i.message)||"Invalid credentials. Please try again.")}catch(e){k.warn("Login error:",e),I("Network error. Please check your connection.")}finally{R(!1)}},L=async()=>{if(O){R(!0),B(null);try{let a=await fetch("/api/auth/reactivate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:O.token,rememberMe:!0})}),t=await a.json().catch(()=>({}));if(a.ok&&(null==t?void 0:t.success)){var e;await G(null==t||null==(e=t.user)?void 0:e.payment_required)}else B((null==t?void 0:t.message)||"Could not reactivate. Please sign in again."),D(null)}catch(e){k.warn("Reactivation error:",e),B("Network error. Please try again.")}finally{R(!1)}}};if(!E||s||t)return null;let Q=x.jQ.filter(e=>"google"===e&&z[e]);return(0,i.jsxs)(w.l,{description:"Sign in to your Refinix desk.",heading:"Welcome back",title:"Sign In",children:[P&&(0,i.jsxs)("div",{role:"status",className:w.d.notice,children:[(0,i.jsx)(o.A,{"aria-hidden":"true"}),(0,i.jsxs)("span",{children:[(0,i.jsx)("strong",{children:"idle"===P?"You were signed out after 30 minutes of inactivity.":"Your session expired."})," ","Sign in again to pick up where you left off."]})]}),Y&&!O&&(0,i.jsxs)("div",{role:"alert",className:w.d.notice,"data-tone":"error",children:[(0,i.jsx)(c.A,{"aria-hidden":"true"}),(0,i.jsx)("span",{children:Y})]}),O&&(0,i.jsxs)("div",{className:w.d.reactivate,children:[(0,i.jsx)("p",{children:O.message||"Your Refinix beta seat was paused because the account was inactive. Reactivate to pick up right where you left off."}),(0,i.jsx)("button",{type:"button",onClick:L,disabled:q,className:w.d.primary,children:q?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:w.d.spinner,"aria-hidden":"true"}),"Reactivatingâ¦"]}):"Reactivate my account"}),(0,i.jsx)("button",{type:"button",onClick:()=>{D(null),B(null)},disabled:q,className:w.d.secondary,children:"Back to sign in"})]}),!O&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("form",{onSubmit:K,className:w.d.form,children:[(0,i.jsxs)(v.M_,{className:w.d.fields,children:[(0,i.jsxs)(v.D0,{children:[(0,i.jsx)(v.dh,{htmlFor:"email",children:"Email"}),(0,i.jsx)(f.p,{id:"email",name:"email",type:"text",required:!0,autoComplete:"email",value:_.email,onChange:J,disabled:q,placeholder:"[email protected]"})]}),(0,i.jsxs)(v.D0,{children:[(0,i.jsxs)("div",{className:w.d.fieldHead,children:[(0,i.jsx)(v.dh,{htmlFor:"password",children:"Password"}),(0,i.jsx)("button",{type:"button",onClick:()=>e.push("/forgot-password"),className:w.d.forgot,children:"Forgot password?"})]}),(0,i.jsxs)("div",{className:w.d.inputWrap,children:[(0,i.jsx)(f.p,{id:"password",name:"password",type:S?"text":"password",required:!0,autoComplete:"current-password",value:_.password,onChange:J,disabled:q,placeholder:"Password"}),(0,i.jsx)("button",{type:"button",onClick:()=>A(!S),className:w.d.reveal,"aria-label":S?"Hide password":"Show password",tabIndex:-1,
1children:S?(0,i.jsx)(d.A,{"aria-hidden":"true"}):(0,i.jsx)(u.A,{"aria-hidden":"true"})})]})]})]}),M&&(0,i.jsx)("p",{role:"alert",className:w.d.error,children:M}),(0,i.jsx)("button",{type:"submit",disabled:q,className:w.d.primary,children:q?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:w.d.spinner,"aria-hidden":"true"}),"Signing inâ¦"]}):(0,i.jsxs)(i.Fragment,{children:["Sign in ",(0,i.jsx)(p.A,{"aria-hidden":"true"})]})})]}),Q.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:w.d.divider,children:"or"}),(0,i.jsx)("div",{className:w.d.providers,children:Q.map(e=>(0,i.jsxs)("a",{href:(0,x.vB)(e,W),className:w.d.provider,children:[(0,i.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",children:(0,i.jsx)("path",{d:"google"===e?h.MGH.path:h.DYI.path})}),"Continue with ",x.xd[e]]},e))})]}),(0,i.jsxs)("p",{className:w.d.switch,children:["Don't have an account? ",(0,i.jsx)(l(),{href:N,children:"Contact us"})]})]})]})}}},e=>{e.O(0,[5466,8230,7414,4587,6601,1089,636,6593,8792],()=>e(e.s=7984)),_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.