PageSourceSearch

https://123content.ai/assets/SignInDesign-DA_Lilrt.js

js 123content.ai collected 2026-10-05 13:18:26 UTC 19,837 bytes, 8 lines download raw bytes

1import{s as A,u as he,Z as me,k as pe,r as w,gC as X,gD as z,eF as q,gE as ge,bA as xe,gF as we,a as b,j as e,x as Y,L as Q,bj as fe}from"./index-ClXUUzrz.js";import{l as be}from"./logo-icon-Bv2PFMLx.js";import{A as ee}from"./arrow-right-Du9csHx0.js";import{E as ye}from"./eye-off-UHzFAQQ5.js";import"./vendor-code-T_ntHSS4.js";import"./vendor-cutout-DAVIqhoW.js";const ve=1,je="a9d0ab18-a4a9-4751-a56a-c7d8252629bd",ke="03414bd7-e709-44e3-9b33-492302112e57",Ne="/__l5e/assets-v1/a9d0ab18-a4a9-4751-a56a-c7d8252629bd/login-background.jpg",_e="a/v1/03414bd7-e709-44e3-9b33-492302112e57/a9d0ab18-a4a9-4751-a56a-c7d8252629bd/login-background.jpg",Ee="login-background.jpg",Se=632629,Pe="image/jpeg",Ae="2026-09-22T16:25:22Z",Ce={version:ve,asset_id:je,project_id:ke,url:Ne,r2_key:_e,original_filename:Ee,size:Se,content_type:Pe,created_at:Ae};var Te={name:"@lovable.dev/cloud-auth-js",version:"1.1.2",description:"Lovable Cloud Auth JS",main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist"],scripts:{build:"tsup src/index.ts --format cjs,esm --dts --outDir dist",dev:"tsup src/index.ts --format cjs,esm --dts --watch",test:"vitest run",typecheck:"tsgo --noEmit",prepublishOnly:"npm run clean && npm run build",clean:"rimraf dist"},keywords:["lovable","oauth","authentication"],license:"MIT",devDependencies:{"@types/node":"^22",jsdom:"^26",rimraf:"^5.0.0",tsup:"^7.2.0",typescript:"^5",vitest:"^4.1.0"}},Oe="authorization_response",Ie="/~oauth/initiate",Re=["https://oauth.lovable.app","https://lovable.dev"],Le="lovable://oauth-callback",De="http://127.0.0.1/iframe-oauth/callback",Ue=500,Fe=12e4;function Me(r){let t;const i=new Promise(c=>{t=c}),s=c=>{if(!r.some(x=>c.origin===x))return;const m=c.data;!m||typeof m!="object"||m.type===Oe&&t(m.response)},l=()=>{window.removeEventListener("message",s)};return window.addEventListener("message",s),{cleanup:l,messagePromise:i}}function $e(r){const t=window.screenX!==0||window.screenY!==0||!r,i=t?window.outerWidth*.5:window.screen.width*.5,s=t?window.outerHeight*.5:window.screen.height*.5,l=t?window.screenX+(window.outerWidth-i)/2:(window.screen.width-i)/2,c=t?window.screenY+(window.outerHeight-s)/2:(window.screen.height-s)/2;return{width:i,height:s,left:l,top:c}}function te(r,t){return r.state!==t?{error:new Error("State is invalid")}:r.error?r.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(r.error_description??"Sign in failed")}:!r.access_token||!r.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:r.access_token,refresh_token:r.refresh_token},error:null}}function We(){const r=navigator.userAgent;return!!(/iPhone|iPad|iPod|Android/i.test(r)||/Macintosh/i.test(r)&&navigator.maxTouchPoints>1)}function Be(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(r=>r.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function He(r={}){const t=r.oauthBrokerUrl??Ie,i=r.supportedOAuthOrigins??Re;async function s(l,c={}){let g=!1;try{g=window.self!==window.top}catch{g=!0}const m=navigator.userAgent,x=/LovableApp\//.test(m),y=!x&&/lovable/i.test(m),a=Be();let C=c.redirect_uri??window.location.origin;x&&g?C=Le:y&&g&&(C=De);const u=new URLSearchParams({...c.extraParams,provider:l,redirect_uri:C,state:a});if(!g)return window.location.href=`${t}?${u.toString()}`,{error:null,redirected:!0};!x&&!y&&u.set("response_mode","web_message");const F=`${t}?${u.toString()}`,p=y?[...i,window.location.origin]:i,{messagePromise:R,cleanup:h}=Me(p);let j;if(We())j=window.open(F,"_blank");else{const{width:o,height:S,left:d,top:O}=$e(g);j=window.open(F,"oauth",`width=${o},height=${S},left=${d},top=${O}`)}if(!j&&(x||y)){let o;const S=new Promise((d,O)=>{o=setTimeout(()=>{O(new Error("OAuth timed out waiting for response"))},Fe)});try{const d=await Promise.race([R,S]);return te(d,a)}catch(d){return{error:d instanceof Error?d:new Error(String(d))}}finally{o&&clearTimeout(o),h()}}if(!j)return h(),{error:new Error("Popup was blocked")};let k;const $=new Promise((o,S)=>{k=setInterval(()=>{j.closed&&(clearInterval(k),S(new Error("Sign in was cancelled")))},Ue)});try{const o=await Promise.race([R,$]);return te(o,a)}catch(o){return{error:o instanceof Error?o:new Error(String(o))}}finally{clearInterval(k),h(),j==null||j.close()}}return{signInWithOAuth:s}}typeof window<"u"&&(window.__lovable_cloud_auth_js_version=Te.version);function Ve(r={}){return He(r)}const Ke=Ve(),Ge={auth:{signInWithOAuth:async(r,t)=>{const i=await Ke.signInWithOAuth(r,{redirect_uri:t==null?void 0:t.redirect_uri,extraParams:{...t==null?void 0:t.extraParams}});if(i.redirected||i.error)return i;try{await A.auth.setSession(i.tokens)}
1catch(s){return{error:s instanceof Error?s:new Error(String(s))}}return i}}},se="signup:selected-plan",ze="/home/hellocreator",Ye=r=>{const t=new Set(["creator","creatoraddon"]);try{const i=localStorage.getItem(se);if(!i)return!1;const s=JSON.parse(i);return!!(s!=null&&s.plan)&&t.has(s.plan)||!!(s!=null&&s.trialPlan)&&t.has(s.trialPlan)}catch{return!1}},Ze="/home/helloproducer",Je=r=>{const t=new Set(["startup"]);try{const i=localStorage.getItem(se);if(!i)return!1;const s=JSON.parse(i);return!!(s!=null&&s.plan)&&t.has(s.plan)||!!(s!=null&&s.trialPlan)&&t.has(s.trialPlan)}catch{return!1}},Xe=()=>e.jsxs("svg",{viewBox:"0 0 24 24",className:"w-4 h-4","aria-hidden":!0,children:[e.jsx("path",{fill:"#4285F4",d:"M23.5 12.27c0-.85-.08-1.67-.22-2.45H12v4.64h6.45a5.52 5.52 0 0 1-2.39 3.62v3h3.86c2.26-2.08 3.58-5.15 3.58-8.81Z"}),e.jsx("path",{fill:"#34A853",d:"M12 24c3.24 0 5.96-1.08 7.94-2.92l-3.86-3c-1.07.72-2.44 1.15-4.08 1.15-3.13 0-5.78-2.11-6.73-4.96H1.28v3.09A12 12 0 0 0 12 24Z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.27 14.27a7.2 7.2 0 0 1 0-4.54V6.64H1.28a12 12 0 0 0 0 10.72l3.99-3.09Z"}),e.jsx("path",{fill:"#EA4335",d:"M12 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C17.95 1.18 15.23 0 12 0A12 12 0 0 0 1.28 6.64l3.99 3.09C6.22 6.86 8.87 4.75 12 4.75Z"})]}),E=({label:r,type:t,placeholder:i,value:s,onChange:l,disabled:c,readOnly:g})=>{const[m,x]=w.useState(!1),y=t==="password";return e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-[0.3em] text-white/60",children:r}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:y&&m?"text":t,value:s,onChange:a=>l(a.target.value),placeholder:i,disabled:c,readOnly:g,className:`mt-2 w-full rounded-full border border-white/40 bg-white/10 px-5 py-3 text-[14px] text-white placeholder:text-white/40 backdrop-blur-md focus:outline-none focus:border-white/90 focus:bg-white/20 transition-colors disabled:opacity-50 ${y?"pr-12":""}`}),y&&e.jsx("button",{type:"button",onClick:()=>x(a=>!a),"aria-label":m?"Hide password":"Show password",className:"absolute right-4 top-1/2 -translate-y-1/2 mt-1 text-white/60 hover:text-white transition-colors",children:m?e.jsx(ye,{className:"w-4 h-4"}):e.jsx(fe,{className:"w-4 h-4"})})]})]})},qe={creator:{name:"CREATOR",price:"€29 / month",monthly:29},startup:{name:"Start-up Brand or Producers",price:"€39 / month",monthly:39}},Qe=7,et="signup:selected-plan",lt=()=>{const r=he(),[t]=me(),{session:i,loading:s}=pe(),l=t.get("plan")||"",c=qe[l]??null,g=t.get("seats"),m=(t.get("email")||"").trim(),x=t.get("invite")||"",y=t.get("ws")||"",a=!!m,C=t.get("portal")==="1",[u,F]=w.useState("signin"),[p,R]=w.useState(m),[h,j]=w.useState(""),[k,$]=w.useState(""),[o,S]=w.useState(""),[d,O]=w.useState(""),[W,re]=w.useState(""),[L,I]=w.useState(null),f=L!==null,[ne,B]=w.useState(!1),[ie,Z]=w.useState(t.get("forgot")==="1"),[ae,H]=w.useState(!1),M=[o.trim(),d.trim()].filter(Boolean).join(" "),V=o.trim().length>=2&&d.trim().length>=2;w.useEffect(()=>{if(c)try{localStorage.setItem(et,JSON.stringify({plan:l,trialPlan:l,seats:g,clientPortal:C,chosenAt:new Date().toISOString()}))}catch{}},[c,l,g,C]);const J=t.get("next")||(l==="creator"||l==="creatoraddon"||Ye()?ze:l==="startup"||Je()?Ze:"/"),D="login:redirect-after-auth";w.useEffect(()=>{if(s||!i)return;let n=!1;try{n=sessionStorage.getItem(D)==="1"}catch{}if(!n&&!t.get("next"))return;let v=!1;return(async()=>{var P,U,K;try{if(x){try{await A.functions.invoke("workspace-invite",{body:{action:"accept",token:x}})}catch{}const N=(P=(await X())[0])==null?void 0:P.workspace;N!=null&&N.id&&z(N.id);try{sessionStorage.removeItem(D)}catch{}v||r(q((N==null?void 0:N.plan_key)??null),{replace:!0});return}const _=await X();if(!v){let T;if(_.length>0)T=_[0].workspace.id,z(T);else{const G=W.trim()||M.trim()||"My workspace";T=(await ge(G,{planKey:l,source:t.get("source")||"pricing"})).id,z(T)}if(xe(l))try{await we(T,l,t.get("source")||"pricing")}catch{}try{sessionStorage.removeItem(D)}catch{}const N=((K=(U=_.find(G=>G.workspace.id===T))==null?void 0:U.workspace)==null?void 0:K.plan_key)??null,ue=t.get("next")||(N?q(N):J);r(ue,{replace:!0})}}catch(_){b.error((_==null?void 0:_.message)||"Could not prepare your workspace.")}})(),()=>{v=!0}},[s,i,r,J,W,M,t,l,x]);const oe=async()=>
1{if(!(!p||!h)){if(u==="signup"){if(h.length<6){b.error("Use at least 6 characters for your password.");return}if(h!==k){b.error("The two passwords don't match.");return}}if(a){if(h.length<6){b.error("Use at least 6 characters for your password.");return}if(!V){b.error("Please enter your first and last name.");return}}I("studio");try{sessionStorage.setItem(D,"1")}catch{}try{if(a){const n=M.trim(),{data:v,error:P}=await A.auth.signUp({email:p,password:h,options:{emailRedirectTo:x?`${window.location.origin}/login/invite/${x}`:`${window.location.origin}/login`,data:{display_name:n,first_name:o.trim(),last_name:d.trim()}}});if(P){const U=`${P.message}`.toLowerCase();if(!(U.includes("already")||U.includes("registered")))throw P;const{error:_}=await A.auth.signInWithPassword({email:p,password:h});if(_)throw new Error("This account already exists. Use its password, or ask your admin to send a password reset.")}else if(!v.session){B(!0),b.success("Check your email to confirm your account.");return}try{await A.auth.updateUser({data:{display_name:n,first_name:o.trim(),last_name:d.trim()}})}catch{}b.success("Welcome")}else if(u==="signin"){const{error:n}=await A.auth.signInWithPassword({email:p,password:h});if(n)throw n;b.success("Signed in")}else{const{data:n,error:v}=await A.auth.signUp({email:p,password:h,options:{emailRedirectTo:`${window.location.origin}/`,data:{display_name:M||p.split("@")[0],first_name:o.trim(),last_name:d.trim()}}});if(v)throw v;n.session?b.success("Account created"):(B(!0),b.success("Check your email to confirm your account."))}}catch(n){b.error((n==null?void 0:n.message)||"Auth failed")}finally{I(null)}}},le=async()=>{I("google");try{sessionStorage.setItem(D,"1")}catch{}try{const n=await Ge.auth.signInWithOAuth("google",{redirect_uri:`${window.location.origin}/login`});if(n.error)throw new Error(n.error.message||"Google sign-in failed")}catch(n){b.error((n==null?void 0:n.message)||"Google sign-in failed")}finally{I(null)}},ce=()=>{const n=window.location.hostname;return`${n==="localhost"||n==="127.0.0.1"||n.endsWith("123content.ai")?
1window.location.origin:"https://123content.ai"}/reset-password`},de=async()=>{if(p){I("reset");try{await A.auth.resetPasswordForEmail(p.trim(),{redirectTo:ce()})}catch{}I(null),H(!0)}};return ie?e.jsx("div",{className:"min-h-screen bg-zinc-900 text-white flex items-center justify-center px-6",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.4em] text-white/60 mb-4",children:"123CONTENT"}),ae?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight",children:"Check your inbox"}),e.jsx("p",{className:"mt-3 text-[13px] text-white/70",children:"If an account exists for this email address, we've sent you a link to reset your password."})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight",children:"Reset your password"}),e.jsx("p",{className:"mt-3 text-[13px] text-white/70",children:"We'll email you a secure link to choose a new password."}),e.jsxs("form",{className:"mt-8 text-left",onSubmit:n=>{n.preventDefault(),de()},children:[e.jsx(E,{label:"Email address",type:"email",placeholder:"[email protected]",value:p,onChange:R,disabled:f}),e.jsxs("button",{type:"submit",disabled:f||!p,className:"mt-6 w-full flex items-center justify-center gap-3 rounded-full bg-white px-6 py-3.5 text-zinc-900 hover:bg-white/90 transition-colors disabled:opacity-50",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.3em]",children:"Send reset link"}),L==="reset"?e.jsx(Y,{className:"w-4 h-4 animate-spin"}):e.jsx(ee,{className:"w-4 h-4"})]})]})]}),e.jsx("button",{type:"button",onClick:()=>{Z(!1),H(!1)},className:"mt-8 text-[11px] font-semibold uppercase tracking-[0.3em] underline underline-offset-4 hover:no-underline",children:"Back to login"})]})}):ne?e.jsx("div",{className:"min-h-screen bg-zinc-900 text-white flex items-center justify-center px-6",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.4em] text-white/60 mb-4",children:"123CONTENT"}),e.jsx("h1",{className:"text-3xl font-semibold tracking-tight",children:"Check your inbox"}),e.jsxs("p",{className:"mt-3 text-[13px] text-white/70",children:["We sent a confirmation link to ",e.jsx("span",{className:"font-medium text-white",children:p}),". Click it to finish creating your account, then sign in."]}),e.jsx("button",{type:"button",onClick:()=>B(!1),className:"mt-8 text-[11px] font-semibold uppercase tracking-[0.3em] underline underline-offset-4 hover:no-underline",children:"Back to sign in"})]})}):e.jsxs("div",{className:"relative min-h-screen w-full overflow-hidden bg-zinc-900",children:[e.jsx("img",{src:Ce.url,alt:"Editorial studio photograph of a model in a sculptural outfit",className:"absolute inset-0 h-full w-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/30"}),e.jsx("div",{className:"relative min-h-screen flex items-center justify-center px-5 py-14",children:e.jsxs("div",{className:"w-full max-w-[980px] grid grid-cols-1 lg:grid-cols-[1.15fr_0.85fr] overflow-hidden rounded-[28px] border border-white/25 shadow-[0_30px_80px_-30px_rgba(0,0,0,0.6)]",children:[e.jsxs("div",{className:"bg-white/10 backdrop-blur-2xl px-7 sm:px-12 py-12 border-b lg:border-b-0 lg:border-r border-white/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:be,alt:"123CONTENT",className:"h-7 w-auto object-contain invert"}),e.jsx("span",{className:"text-lg font-black tracking-tight text-white",children:"CONTENT"})]}),e.jsx("h1",{className:"mt-6 text-4xl sm:text-[42px] font-semibold tracking-tight text-white leading-[1.02]",children:a?y?`Set up your account for ${y}.`:"Set up your account.":u==="signin"?"Welcome back.":"Open the studio."}),a&&e.jsxs("p",{className:"mt-4 text-[13px] text-white/75",children:["Your invitation is for ",e.jsx("span",{className:"font-medium text-white",children:m}),". Add your first and last name and choose a password to create your account."]}),c&&u==="signup"&&e.jsxs("div",{className:"mt-6 rounded-2xl border border-white/25 bg-white/10 px-4 py-3 backdrop-blur-md",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.3em] text-white/60",children:"Free trial — 100 credits"}),e.jsx("div",{className:"mt-1.5 text-[13px] font-medium text-white",children:c.name}),e.jsxs("div",{className:"text-[12px] text-white/70",children:[C&&c.monthly?`€${c.monthly+Qe} / month`:c.price,g?` · ${g} seats`:""]})]}),e.jsxs("div",{className:"mt-8 space-y-4",children:[a&&e.jsxs("div",{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(E,{label:"First name",type:"text",placeholder:"Jessy",value:o,onChange:S,disabled:f}),e.jsx(E,{label:"Last name",type:"text",placeholder:"de Vries",value:d,onChange:O,disabled:f})]}),(o.trim().length>0||d.trim().length>0)&&!V&&e.jsx("p",{className:"mt-2 text-[11px] text-white/70",children:"Please fill in both your first and last name."})]}),u==="signup"&&!a&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(E,{label:"First name",type:"text",placeholder:"Rosa",value:o,onChange:S,disabled:f}),e.jsx(E,{label:"Last name",type:"text",placeholder:"de Vries",value:d,onChange:O,disabled:f})]}),e.jsx(E,{label:"Company / brand",type:"text",placeholder:"Atelier Veld",value:W,onChange:re,disabled:f})]}),e.jsx(E,{label:"Email",type:"email",placeholder:"[email protected]",value:p,onChange:R,disabled:f||a,readOnly:a}),e.jsx(E,{label:"Password",type:"password",placeholder:"••••••••",value:h,onChange:j,disabled:f}),u==="signin"&&!a&&e.jsx("button",{type:"button",onClick:()=>{H(!1),Z(!0)},className:"text-[10px] font-semibold uppercase tracking-[0.3em] text-white/70 underline underline-offset-4 hover:text-white hover:no-underline",children:"Forgot password?"}),u==="signup"&&!a&&e.jsxs("div",{children:[e.jsx(E,{label:"Confirm password",type:"password",placeholder:"••••••••",value:k,onChange:$,disabled:f}),k&&k!==h&&e.jsx("p",{className:"mt-2 text-[11px] text-white/70",children:"Passwords don't match yet."})]})]}),e.jsxs("button",{type:"button",disabled:f||!p||!h||a&&!V||u==="signup"&&!a&&(!k||k!==h),onClick:oe,className:"group mt-8 w-full flex items-center justify-center gap-3 rounded-full bg-white px-6 py-3.5 text-zinc-900 hover:bg-white/90 transition-colors disabled:opacity-50",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.3em]",children:a?"Set password and continue":u==="signin"?"Enter the studio":"Create account"}),L==="studio"?e.jsx(Y,{className:"w-4 h-4 animate-spin"}):e.jsx(ee,{className:"w-4 h-4 transition-transform group-hover:translate-x-1"})]}),e.jsxs("button",{type:"button",disabled:f,onClick:le,className:`mt-3 w-full flex items-center justify-center gap-3 rounded-full border border-white/40 bg-white/10 px-4 py-3.5 text-[12px] font-semibold tracking-tight text-white backdrop-blur-md hover:bg-white/20 transition-colors ${L==="google"?"opacity-50":""}`,children:[L==="google"?e.jsx(Y,{className:"w-4 h-4 animate-spin"}):e.jsx(Xe,{}),"Continue with Google"]}),!a&&e.jsxs("div",{className:"mt-7 text-center text-[11px] text-white/60",children:[u==="signin"?"Don't have an account?":"Already have an account?"," ",e.jsx("button",{type:"button",disabled:f,onClick:()=>F(u==="signin"?"signup":"signin"),className:"font-medium text-white/90 underline underline-offset-4 hover:text-white disabled:opacity-50",children:u==="signin"?"Set up now":"Sign in"})]})]}),e.jsxs("div",{className:"relative bg-white/20 backdrop-blur-3xl p-10 flex flex-col justify-between min-h-[220px]",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.4em] text-white/70",children:`
2`}),e.jsx("div",{className:"grid grid-cols-3 lg:grid-cols-1 gap-6 lg:gap-8",children:[[`
3`,`
4`],[`
5`,`
6`],[`
7`,`
8`]].map(([n,v],P)=>e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-semibold tracking-tight text-white",children:n}),e.jsx("div",{className:"mt-1 text-[9px] font-semibold uppercase tracking-[0.25em] text-white/60",children:v})]},P))}),e.jsxs("p",{className:"text-[10px] leading-relaxed text-white/60",children:["By continuing you agree to our"," ",e.jsx(Q,{to:"/terms",className:"underline hover:text-white/80 transition-colors",children:"terms"})," ","and"," ",e.jsx(Q,{to:"/privacy",className:"underline hover:text-white/80 transition-colors",children:"privacy policy"}),"."]})]})]})})]})};export{lt as default};

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.