1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[40072],{80666:(e,a,r)=>{"use strict";r.r(a),r.d(a,{default:()=>d});var t=r(21772),s=r(10816),n=r(91624),i=r(53341),l=r(6449),c=r(25916),o=r(34857);function d(){return(0,t.jsx)(s.Suspense,{children:(0,t.jsx)(u,{})})}function u(){let e=(0,n.useRouter)(),a=(0,n.useSearchParams)().get("redirect")||"/app",{trackEvent:r,identify:d}=(0,i.s)(),[u,h]=(0,s.useState)(""),[p,m]=(0,s.useState)(""),[g,f]=(0,s.useState)(null),[_,j]=(0,s.useState)(!1),[x,y]=(0,s.useState)(!1),[b,L]=(0,s.useState)(null),[N,w]=(0,s.useState)(!1);async function S(t){t.preventDefault(),f(null),j(!0);try{let t=await fetch("/api/v1/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u,password:p})}),s=await t.json();if(!t.ok)return void f("string"==typeof s.error?s.error:"Login failed");if(s.deletionScheduled){y(!0),L(s.deletionDate);return}s.userId&&d(s.userId,{plan:s.tier??"free"}),r((0,l.Ek)("email"));let n=s?.migration?.skippedCompanionSlugs,i=s?.migration?.renamedCompanionSlugs,c=Array.isArray(i)&&i.length>0,o=Array.isArray(n)&&n.length>0;if(c||o)try{sessionStorage.setItem("wilds_migration_warning",JSON.stringify({skippedCompanionSlugs:o?n:[],renamedCompanionSlugs:c?i:[]}))}catch{}e.push(a)}catch{f("Network error")}finally{j(!1)}}async function v(){w(!0);try{let r=await fetch("/api/v1/account/restore",{method:"POST"});if(r.ok)y(!1),e.push(a);else{let e=await r.json();f(e.error||"Restore failed")}}catch{f("Network error")}finally{w(!1)}}return(0,s.useEffect)(()=>{fetch("/api/v1/auth/me",{credentials:"include",headers:(0,o.buildOptionalAuthHeaders)()}).then(e=>e.ok?e.json():null).then(r=>{r?.id&&e.replace(a)}).catch(()=>{})},[e,a]),(0,t.jsx)("div",{className:"auth-page",children:(0,t.jsxs)("div",{className:"auth-card",children:[x&&(0,t.jsxs)("div",{className:"auth-card__banner auth-card__banner--warning",children:[(0,t.jsxs)("p",{children:["Your account is scheduled for deletion",b&&` on ${new Date(b).toLocaleDateString()}`,". Your content has been permanently destroyed."]}),(0,t.jsx)("button",{onClick:v,disabled:N,className:"auth-card__banner-btn",children:N?"Restoring...":"Restore Account"})]}),(0,t.jsx)("div",{className:"auth-card__logo",children:(0,t.jsxs)("svg",{width:48,height:48,viewBox:"0 0 64 64",children:[(0,t.jsx)("path",{d:"M9,50 L24,22 L32,32 L40,22 L55,50 L47,50 L40,34 L32,44 L24,34 L17,50 Z",fill:"currentColor",opacity:"0.25"}),(0,t.jsx)("path",{d:"M9,50 L22,28 L32,40 L42,28 L55,50 L47,50 L42,38 L32,50 L22,38 L17,50 Z",fill:"currentColor",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"16",r:"5",fill:"currentColor",opacity:"0.4"})]})}),(0,t.jsx)("h1",{className:"auth-card__title",children:"Welcome back"}),(0,t.jsx)("p",{className:"auth-card__subtitle",children:"Log in to your wilds.ai account"}),(0,t.jsx)(c.z,{callbackUrl:a}),(0,t.jsx)("div",{className:"auth-card__divider",children:(0,t.jsx)("span",{children:"or log in with email"})}),(0,t.jsxs)("form",{onSubmit:S,className:"auth-card__form",children:[(0,t.jsxs)("label",{className:"auth-card__field",children:[(0,t.jsx)("span",{children:"Email or username"}),(0,t.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),required:!0,autoComplete:"username",placeholder:"[email protected] or username"})]}),(0,t.jsxs)("label",{className:"auth-card__field",children:[(0,t.jsx)("span",{children:"Password"}),(0,t.jsx)("input",{type:"password",value:p,onChange:e=>m(e.target.value),required:!0,autoComplete:"current-password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"})]}),(0,t.jsx)("a",{href:"/forgot-password",className:"auth-card__link",children:"Forgot password?"}),g&&(0,t.jsx)("p",{className:"auth-card__error",children:g}),(0,t.jsx)("button",{type:"submit",disabled:_,className:"auth-card__submit btn-primary btn-block btn-lg",children:_?"Logging in...":"Log In"})]}),(0,t.jsxs)("p",{className:"auth-card__switch",children:["No account? ",(0,t.jsx)("a",{href:"/signup",children:"Sign up"})]})]})})}},90411:(e,a,r)=>{Promise.resolve().then(r.bind(r,80666))}},e=>{e.O(0,[98190,13033,14116,77358],()=>e(e.s=90411)),_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.