PageSourceSearch

https://postclick.ppc.io/assets/login-CI708B0V.js

js ppc.io collected 2026-10-03 19:53:16 UTC 13,022 bytes, 1 lines download raw bytes

1import{r as t,ag as F,j as e,a9 as C,P as v,K as Z,fV as N,u as I,fW as H,s as x,R as O}from"./index-V72ovg5l.js";import{G as _,b as B,a as j,p as D}from"./GoogleButton-DkgC3whQ.js";import{A as S,a as A,b as M}from"./AuthFrame-KaPv7GC_.js";const W=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M236,137A108.13,108.13,0,1,1,119,20,12,12,0,0,1,121,44,84.12,84.12,0,1,0,212,135,12,12,0,1,1,236,137ZM116,76v52a12,12,0,0,0,12,12h52a12,12,0,0,0,0-24H140V76a12,12,0,0,0-24,0Zm92,20a16,16,0,1,0-16-16A16,16,0,0,0,208,96ZM176,64a16,16,0,1,0-16-16A16,16,0,0,0,176,64Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),t.createElement("path",{d:"M232,136.66A104.12,104.12,0,1,1,119.34,24,8,8,0,0,1,120.66,40,88.12,88.12,0,1,0,216,135.34,8,8,0,0,1,232,136.66ZM120,72v56a8,8,0,0,0,8,8h56a8,8,0,0,0,0-16H136V72a8,8,0,0,0-16,0Zm40-24a12,12,0,1,0-12-12A12,12,0,0,0,160,48Zm36,24a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm24,36a12,12,0,1,0-12-12A12,12,0,0,0,220,108Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208,96a12,12,0,1,1,12,12A12,12,0,0,1,208,96ZM196,72a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm28.66,56a8,8,0,0,0-8.63,7.31A88.12,88.12,0,1,1,120.66,40,8,8,0,0,0,119.34,24,104.12,104.12,0,1,0,232,136.66,8,8,0,0,0,224.66,128ZM128,56a72,72,0,1,1-72,72A72.08,72.08,0,0,1,128,56Zm-8,72a8,8,0,0,0,8,8h48a8,8,0,0,0,0-16H136V80a8,8,0,0,0-16,0Zm40-80a12,12,0,1,0-12-12A12,12,0,0,0,160,48Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M230,136.49A102.12,102.12,0,1,1,119.51,26a6,6,0,0,1,1,12A90.13,90.13,0,1,0,218,135.51a6,6,0,1,1,12,1ZM122,72v56a6,6,0,0,0,6,6h56a6,6,0,0,0,0-12H134V72a6,6,0,0,0-12,0Zm38-26a10,10,0,1,0-10-10A10,10,0,0,0,160,46Zm36,24a10,10,0,1,0-10-10A10,10,0,0,0,196,70Zm24,36a10,10,0,1,0-10-10A10,10,0,0,0,220,106Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232,136.66A104.12,104.12,0,1,1,119.34,24,8,8,0,0,1,120.66,40,88.12,88.12,0,1,0,216,135.34,8,8,0,0,1,232,136.66ZM120,72v56a8,8,0,0,0,8,8h56a8,8,0,0,0,0-16H136V72a8,8,0,0,0-16,0Zm40-24a12,12,0,1,0-12-12A12,12,0,0,0,160,48Zm36,24a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm24,36a12,12,0,1,0-12-12A12,12,0,0,0,220,108Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228,136.33A100.13,100.13,0,1,1,119.67,28a4,4,0,1,1,.66,8A92.13,92.13,0,1,0,220,135.67a4,4,0,1,1,8,.66ZM128,132h56a4,4,0,0,0,0-8H132V72a4,4,0,0,0-8,0v56A4,4,0,0,0,128,132Zm32-88a8,8,0,1,0-8-8A8,8,0,0,0,160,44Zm36,24a8,8,0,1,0-8-8A8,8,0,0,0,196,68Zm24,36a8,8,0,1,0-8-8A8,8,0,0,0,220,104Z"}))]]),$=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M144.49,136.49l-40,40a12,12,0,0,1-17-17L107,140H24a12,12,0,0,1,0-24h83L87.51,96.49a12,12,0,0,1,17-17l40,40A12,12,0,0,1,144.49,136.49ZM200,28H136a12,12,0,0,0,0,24h52V204H136a12,12,0,0,0,0,24h64a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),t.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M141.66,133.66l-40,40A8,8,0,0,1,88,168V136H24a8,8,0,0,1,0-16H88V88a8,8,0,0,1,13.66-5.66l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M138.83,130.83l-40,40a4,4,0,0,1-5.66-5.66L126.34,132H24a4,4,0,0,1,0-8H126.34L93.17,90.83a4,4,0,0,1,5.66-5.66l40,40A4,4,0,0,1,138.83,130.83ZM200,36H136a4,4,0,0,0,0,8h60V212H136a4,4,0,0,0,0,8h64a4,4,0,0,0,4-4V40A4,4,0,0,0,200,36Z"}))]]),V=t.forwardRef((a,r)=>t.createElement(F,{ref:r,...a,weights:W}));V.displayName="ClockCountdownIcon";const Y=V,R=t.forwardRef((a,r)=>t.createElement(F,{ref:r,...a,weights:$}));
1R.displayName="SignInIcon";const U=R;function z({onLogin:a,onEmailLink:r,onForgotPassword:s,recoveryMode:i=!1,onResetPassword:m,recoveryLink:E}){const[d,p]=t.useState(""),[y,f]=t.useState(""),[o,l]=t.useState("idle"),[k,c]=t.useState("");if(i)return e.jsx(q,{onResetPassword:m,link:E});const L=async b=>{if(b.preventDefault(),!a||n)return;l("sending"),c("");const w=await j(()=>a(d.trim().toLowerCase(),y));w?(l("error"),c(w)):l("opening")},u=async()=>{if(!s||n)return;const b=d.trim().toLowerCase();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(b)){l("error"),c("Enter your email above first, then request a reset link.");return}l("recovery-sending"),c("");const w=await j(()=>s(b));w?(l("error"),c(w)):l("recovery-sent")},h=async()=>{if(!r||n)return;const b=d.trim().toLowerCase();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(b)){l("error"),c("Enter your email above first.");return}l("link-sending"),c("");const w=await j(()=>r(b));w?(l("error"),c(w)):l("link-sent")},n=o==="sending"||o==="link-sending"||o==="recovery-sending"||o==="opening",g=o==="opening";return e.jsx(S,{state:g?"opening":"idle",header:e.jsx(v,{rich:!0,title:e.jsxs(e.Fragment,{children:["Pick up where you ",e.jsx(Z,{icon:U,children:"left off"})]})}),card:e.jsxs("form",{onSubmit:L,children:[e.jsx(_,{label:"Sign in with Google"}),e.jsx(A,{label:"Email",type:"email",value:d,onChange:p,placeholder:"[email protected]",autoComplete:"email"}),e.jsx(A,{label:"Password",type:"password",value:y,onChange:f,placeholder:"Enter your password",autoComplete:"current-password",aside:e.jsx("button",{type:"button",className:"r5auth-mutelink",onClick:()=>{u()},disabled:!s||n,children:o==="recovery-sending"?"Sending reset link…":"Forgot password?"})}),e.jsx(C,{type:"submit",size:"lg",className:"r5auth-submit",busy:o==="sending"||g,disabled:n,children:g?"Opening your workspace…":o==="sending"?"Logging in…":"Log in"}),e.jsx("div",{className:"r5auth-alt",children:e.jsx("button",{type:"button",className:"r5auth-mutelink",onClick:()=>{h()},disabled:!r||n,children:o==="link-sending"?"Sending your link…":"Email me a sign-in link instead"})}),o==="error"&&k&&e.jsx(M,{children:k}),o==="link-sent"&&e.jsx("div",{className:"r5auth-mintstrip r5auth-mintstrip--success",role:"status",style:{marginTop:16,marginBottom:0},children:e.jsxs("div",{children:[e.jsx("div",{className:"r5auth-mintstrip-title",children:"Check your inbox"}),e.jsx("div",{className:"r5auth-mintstrip-sub",children:"If that account exists, its one-click sign-in link is on the way."})]})}),o==="recovery-sent"&&e.jsx("div",{className:"r5auth-mintstrip r5auth-mintstrip--success",role:"status",style:{marginTop:16,marginBottom:0},children:e.jsxs("div",{children:[e.jsx("div",{className:"r5auth-mintstrip-title",children:"Check your inbox"}),e.jsx("div",{className:"r5auth-mintstrip-sub",children:"If an account exists for that email, its secure reset link is on the way."})]})})]}),underCard:e.jsxs("p",{children:["New to Postclick?"," ",e.jsx("a",{className:"r5auth-link",href:"/signup",children:"Start your audit"})]}),desk:g?{checklistTitle:"Come on in.",sub:"Your audits, builds and progress are loading.",mascotBubble:"Right this way!"}:{checklistTitle:"Still in your workspace.",sub:"Everything is where you left it: audits, builds, and progress.",mascotBubble:"Welcome back!"}})}const T={margin:"14px 0 0",fontSize:14,lineHeight:1.5,color:"var(--ppc-text-muted)"};function G({message:a}){return e.jsx(S,{header:e.jsx(v,{rich:!0,title:e.jsxs(e.Fragment,{children:["That link no longer ",e.jsx(Z,{icon:Y,children:"works"})]})}),card:e.jsxs("div",{children:[e.jsx(M,{children:a}),e.jsx("p",{style:T,children:"On the login page, choose “Forgot password?” and we email a fresh link."}),e.jsx(C,{href:"/login",size:"lg",className:"r5auth-submit",style:{marginTop:20},children:"Ask for a new link"})]}),desk:{checklistTitle:"Your password has not changed.",sub:"A link that has run out cannot open your workspace. Ask for a new one and try again.",mascotBubble:"Let's try again."}})}function K(){return e.jsx(S,{header:e.jsx(v,{rich:!0,title:e.jsxs(e.Fragment,{children:["Checking your reset ",e.jsx(Z,{icon:N,children:"link"})]})}),card:e.jsx("p",{style:{...T,margin:0},role:"status",children:"One moment while we check that the link still works."}),desk:{checklistTitle:"Your workspace stays safe.",sub:"Only your password changes. Everything else stays put.",mascotBubble:"One moment."}})}function q({onResetPassword:a,link:r}){const[s,i]=t.useState(""),[m,E]=t.useState(""),[d,p]=t.useState("idle"),[y,f]=t.useState("");
1if(r?.state==="dead")return e.jsx(G,{message:r.message});if(r?.state==="checking")return e.jsx(K,{});const o=async l=>{if(l.preventDefault(),!a||d==="sending")return;const k=D(s);if(k){p("error"),f(k);return}if(s!==m){p("error"),f("Those passwords don't match yet.");return}p("sending"),f("");const c=await j(()=>a(s));c&&(p("error"),f(c))};return e.jsx(S,{header:e.jsx(v,{rich:!0,title:e.jsxs(e.Fragment,{children:["Choose a new ",e.jsx(Z,{icon:N,children:"password"})]})}),card:e.jsxs("form",{onSubmit:o,children:[e.jsx(A,{label:"New password",type:"password",value:s,onChange:i,placeholder:B,autoComplete:"new-password"}),e.jsx(A,{label:"Confirm new password",type:"password",value:m,onChange:E,placeholder:"Enter it once more",autoComplete:"new-password"}),e.jsx(C,{type:"submit",size:"lg",className:"r5auth-submit",busy:d==="sending",disabled:!a,children:d==="sending"?"Saving…":"Save new password"}),d==="error"&&y&&e.jsx(M,{children:y})]}),underCard:e.jsxs("p",{children:["Need a fresh link?"," ",e.jsx("a",{className:"r5auth-link",href:"/login",children:"Return to login"})]}),desk:{checklistTitle:"Your workspace stays safe.",sub:"Only your password changes. Everything else stays put.",mascotBubble:"Nearly there!"}})}const J="This reset link has expired, or it has already been used.",P="We could not confirm this reset link.";function X(a,r){for(const s of[a,r]){if(typeof s!="string"||s.length===0)continue;const i=new URLSearchParams(s.replace(/^[#?]/,""));if(!i.has("error")&&!i.has("error_code"))continue;const m=`${i.get("error_code")??""} ${i.get("error")??""}`;return/expired|otp|access_denied/i.test(m)?J:P}return null}function Q(a,r,s){const i=X(a,r);return i?{state:"dead",message:i}:s===null?{state:"checking",message:""}:s?{state:"live",message:""}:{state:"dead",message:P}}function ee(a){return a.recoveryMode?"form":a.assumeSignedIn&&a.hasSession!==!1?"shell":"form"}function ne(){const a=I(),r=H.useSearch(),s=r.reset===!0,i=r.next??"/dashboard",[m,E]=t.useState(null),[d,p]=t.useState(null),{assumeSignedIn:y}
1=H.useLoaderData();t.useEffect(()=>{E({hash:window.location.hash,search:window.location.search})},[]),t.useEffect(()=>{let u=!0;x.auth.getSession().then(({data:n})=>{u&&(p(!!n.session),n.session&&!s&&a({to:i}))});const{data:h}=x.auth.onAuthStateChange((n,g)=>{u&&g&&p(!0)});return()=>{u=!1,h.subscription.unsubscribe()}},[a,s,i]);const f=m?Q(m.hash,m.search,d):{state:"checking",message:""},o=async(u,h)=>{const n=u.trim().toLowerCase(),{error:g}=await x.auth.signInWithPassword({email:n,password:h});return g?/invalid login credentials/i.test(g.message)?"That email or password is incorrect. Try again, or reset your password.":g.message:(a({to:i}),null)},l=async u=>{const h=u.trim().toLowerCase(),{error:n}=await x.auth.resetPasswordForEmail(h,{redirectTo:`${window.location.origin}/login?reset=1`});return n?"We couldn't send the reset link. Please try again in a moment.":null},k=async u=>{const h=await fetch("/api/public/auth/email-link",{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({email:u,next:i})}),n=await h.json().catch(()=>null);return h.ok?null:n?.error??"We couldn't send that link. Try again in a moment."},c=async u=>{const{data:h}=await x.auth.getSession();if(!h.session)return"This reset link is invalid or has expired. Return to login and request a fresh link.";const{error:n}=await x.auth.updateUser({password:u});return n?n.message:(a({to:"/dashboard"}),null)},L=ee({assumeSignedIn:y,hasSession:d,recoveryMode:s});return e.jsx(O,{config:"bare",active:null,children:L==="form"?e.jsx(z,{onLogin:o,onEmailLink:k,onForgotPassword:l,recoveryMode:s,onResetPassword:c,recoveryLink:f}):null})}export{ne as component};

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.