PageSourceSearch

https://shampaignegraves.com/assets/login-feJBrRHg.js

js shampaignegraves.com collected 2026-10-07 02:36:44 UTC 11,650 bytes, 1 lines download raw bytes

1import{c as L,a as w,b,u as M,d as k,r,s as S,j as e,L as F,o as _}from"./index-FChnTuic.js";import{M as A}from"./mail-D8o_BK2J.js";import{S as O}from"./shield-check-amUsyHp2.js";const R=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],W=L("arrow-left",R);const D=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],P=L("key-round",D);const z=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],U=L("lock",z),I=w({method:"POST"}).handler(b("3d10f8b385a14f0d9e1bead38cb8a87e8b5d5914ac23393838161a26249eea27")),Q=w({method:"GET"}).handler(b("ddf5cfc66d9449af1a08b52a3afb60d34a25d97d4eebd2381179eda719adbc33")),B=w({method:"POST"}).handler(b("803ea66ea7c5882b08678f051a45a4ca83624030baf217f9e579838913f7b22c")),G=w({method:"POST"}).handler(b("3051e602137852e6b47c092978ec47191fdd2f55c7ca90ef82b868e81d14b727")),V=w({method:"GET"}).handler(b("c4f7267b6adf4c2b9f6bab4a3465321742bad074e91f5ac6d549779c5ff211e2")),Y=w({method:"POST"}).handler(b("b34e80b3bb4db5789229d66fce390125a8c244c2521c1345e94c49773b12def5"));w({method:"POST"}).handler(b("ae768f9349953543c5082dec8f909819127a90b1d3114a9480106267ff769154"));const $=["In what city were you born?","What was the name of your first pet?","What is your mother’s maiden name?","What was the make of your first car?","What elementary school did you attend?","What is the name of the street you grew up on?","What is your favorite book?","What was your childhood nickname?"];function ae(){const t=M(),c=k(Q),o=k(B),u=k(G),x=k(V),p=k(Y),f=k(I),[m,d]=r.useState("credentials"),[i,a]=r.useState(""),[n,s]=r.useState(""),[l,g]=r.useState(null),[y,T]=r.useState(!1);r.useEffect(()=>{(async()=>{try{await f()}catch{}const{data:h}=await S.auth.getSession();h.session&&await C()})()},[]);async function C(){try{const h=await c();if(!h.isTeam){g({kind:"error",text:"This account is not a team member."}),await S.auth.signOut(),d("credentials");return}if(h.mustResetPassword){d("reset");return}if(!h.hasSecurityQuestions){d("setup-questions");return}if(h.secondFactorPassed){t({to:"/admin"});return}d("challenge")}catch(h){g({kind:"error",text:h?.message??"Unable to load session."})}}async function E(h){h.preventDefault(),g(null),T(!0);try{const{error:v}=await S.auth.signInWithPassword({email:i,password:n});if(v)throw v;await C()}catch(v){g({kind:"error",text:v?.message??"Sign in failed."})}finally{T(!1)}}return e.jsxs("div",{className:"min-h-screen bg-ink text-cream flex flex-col relative",children:[e.jsx("div",{"aria-hidden":!0,className:"absolute inset-x-0 top-0 h-[60vh] opacity-40 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 0%, oklch(0.72 0.22 0) / 0.5, transparent 60%), radial-gradient(ellipse at 80% 20%, oklch(0.65 0.25 350) / 0.35, transparent 55%)"}}),e.jsx("header",{className:"relative z-10 mx-auto w-full max-w-7xl px-6 py-8",children:e.jsxs(F,{to:"/",className:"inline-flex items-center gap-2 text-xs uppercase tracking-[0.2em] text-cream/70 hover:text-cream transition-colors",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),"Back to site"]})}),e.jsx("main",{className:"relative z-10 flex-1 flex items-center justify-center px-6 pb-16",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"eyebrow text-pink-soft",children:"Private access"}),e.jsxs("h1",{className:"display mt-4 text-5xl md:text-6xl text-cream",children:["Admin ",e.jsx("em",{className:"italic text-pink-soft",children:"portal."})]}),e.jsx(H,{step:m})]}),e.jsxs("div",{className:"mt-10 rounded-3xl border border-cream/10 bg-cream/[0.03] p-8 backdrop-blur-xl shadow-2xl",children:[m==="credentials"&&e.jsx(K,{email:i,password:n,setEmail:a,setPassword:s,onSubmit:E,loading:y,message:l}),m==="reset"&&e.jsx(J,{onDone:async()=>{g({kind:"info",text:"Password updated. Set your security questions next."}),await C()},resetPwd:o}),m==="setup-questions"&&e.jsx(X,{onDone:async()=>{g(null),t({to:"/admin"})},saveQuestions:u}),m==="challenge"&&e.jsx(Z,{getChallenge:x,verify:p,onDone:()=>t({to:"/admin"})})]}),e.jsx("p",{className:"mt-8 text-center text-[10px] uppercase tracking-[0.25em] text-cream/70",children:"Authorized personnel only · Shampaigne Graves Media"})]})})]})}function H({step:t}){const c=t==="credentials"?"Sign in to manage subscribers, analytics, and campaigns.":t==="reset"?"Choose a new password to replace the temporary one.":t==="setup-questions"?"Set three security questions — used as your second factor.":t==="challenge"?"Answer your security question to finish signing in.":"";return e.jsx("p",{className:"mt-3 text-sm text-cream/70",children:c})}function j({label:t,icon:c,...o}){return e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs uppercase tracking-widest text-cream/60 mb-2",children:t}),e.jsxs("div",{className:"relative",children:[e.jsx(c,{className:"absolute left-4 top-1/2 -translate-y-1/2 h-4 w-4 text-cream/70"}),e.jsx("input",{...o,className:"w-full rounded-xl border border-cream/15 bg-ink/40 pl-11 pr-4 py-3 text-sm text-cream placeholder:text-cream/60 outline-none focus:border-pink-soft focus:ring-2 focus:ring-pink-soft/20 transition"})]})]})}function N({loading:t,children:c}){return e.jsxs("button",{type:"submit",disabled:t,className:"w-full inline-flex items-center justify-center gap-2 rounded-full bg-pink-soft px-6 py-3.5 text-sm font-semibold uppercase tracking-widest text-ink hover:bg-cream transition-colors disabled:opacity-60 disabled:cursor-not-allowed",children:[t&&e.jsx(_,{className:"h-4 w-4 animate-spin"}),t?"Please wait…":c]})}function q({message:t}){return t?e.jsx("p",{className:`text-sm rounded-lg px-3 py-2 ${t.kind==="error"?"bg-destructive/15 text-destructive-foreground border border-destructive/30":"bg-pink-soft/15 text-pink-soft border border-pink-soft/30"}`,children:t.text}):null}function K(t){return e.jsxs("form",{onSubmit:t.onSubmit,className:"space-y-5",children:[e.jsx(j,{label:"Email",icon:A,type:"email",required:!0,autoComplete:"email",value:t.email,onChange:c=>t.setEmail(c.target.value),placeholder:"[email protected]"}),e.jsx(j,{label:"Password",icon:U,type:"password",required:!0,minLength:8,autoComplete:"current-password",value:t.password,onChange:c=>t.setPassword(c.target.value),placeholder:"Your password"}),e.jsx(q,{message:t.message}),e.jsx(N,{loading:t.loading,children:"Sign in"})]})}function J({onDone:t,resetPwd:c}){const[o,u]=r.useState(""),[x,p]=r.useState(""),[f,m]=r.useState(!1),[d,i]=r.useState(null);return e.jsxs("form",{onSubmit:async a=>{if(a.preventDefault(),i(null),o.length<10){i({kind:"error",text:"Use at least 10 characters."});return}if(o!==x){i({kind:"error",text:"Passwords do not match."});return}if(o==="boldifi1234"){i({kind:"error",text:"Pick a password different from the temporary one."});return}m(!0);try{const{error:n}=await S.auth.updateUser({password:o});if(n)throw n;await c(),t()}catch(n){i({kind:"error",text:n?.message??"Could not reset password."})}finally{m(!1)}},className:"space-y-5",children:[e.jsx(j,{label:"New password",icon:P,type:"password",required:!0,minLength:10,autoComplete:"new-password",value:o,onChange:a=>u(a.target.value),placeholder:"At least 10 characters"}),e.jsx(j,{label:"Confirm new password",icon:P,type:"password",required:!0,minLength:10,autoComplete:"new-password",value:x,onChange:a=>p(a.target.value),placeholder:"Re-enter password"}),e.jsx(q,{message:d}),e.jsx(N,{loading:f,children:"Update password"})]})}function X({onDone:t,saveQuestions:c}){const o=$,[u,x]=r.useState([{question:o[0],answer:""},{question:o[1],answer:""},{question:o[2],answer:""}]),[p,f]=r.useState(!1),[m,d]=r.useState(null);return e.jsxs("form",{onSubmit:async i=>{i.preventDefault(),d(null);const a=u.map(s=>({question:s.question.trim(),answer:s.answer.trim()}));if(a.some(s=>!s.question||!s.answer)){d({kind:"error",text:"Fill every question and answer."});return}const n=a.map(s=>s.question.toLowerCase());
1if(new Set(n).size!==3){d({kind:"error",text:"Choose three different questions."});return}f(!0);try{await c({data:{items:a}}),t()}catch(s){d({kind:"error",text:s?.message??"Could not save questions."})}finally{f(!1)}},className:"space-y-6",children:[u.map((i,a)=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"block text-xs uppercase tracking-widest text-cream/60",children:["Question ",a+1]}),e.jsxs("select",{value:o.includes(i.question)?i.question:"__custom",onChange:n=>{const s=n.target.value,l=[...u];l[a]={...l[a],question:s==="__custom"?"":s},x(l)},className:"w-full rounded-xl border border-cream/15 bg-ink/40 px-4 py-3 text-sm text-cream outline-none focus:border-pink-soft focus:ring-2 focus:ring-pink-soft/20",children:[o.map(n=>e.jsx("option",{value:n,className:"bg-ink",children:n},n)),e.jsx("option",{value:"__custom",className:"bg-ink",children:"Custom…"})]}),!o.includes(i.question)&&e.jsx("input",{type:"text",maxLength:200,placeholder:"Write your custom question",value:i.question,onChange:n=>{const s=[...u];s[a]={...s[a],question:n.target.value},x(s)},className:"w-full rounded-xl border border-cream/15 bg-ink/40 px-4 py-3 text-sm text-cream placeholder:text-cream/60 outline-none focus:border-pink-soft focus:ring-2 focus:ring-pink-soft/20"}),e.jsx("input",{type:"text",required:!0,maxLength:120,placeholder:"Your answer",value:i.answer,onChange:n=>{const s=[...u];s[a]={...s[a],answer:n.target.value},x(s)},className:"w-full rounded-xl border border-cream/15 bg-ink/40 px-4 py-3 text-sm text-cream placeholder:text-cream/60 outline-none focus:border-pink-soft focus:ring-2 focus:ring-pink-soft/20"})]},a)),e.jsx("p",{className:"text-[11px] text-cream/50",children:"Answers are case- and whitespace-insensitive. They are salted + hashed before storage."}),e.jsx(q,{message:m}),e.jsx(N,{loading:p,children:"Save & continue"})]})}function Z({getChallenge:t,verify:c,onDone:o}){const[u,x]=r.useState(null),[p,f]=r.useState(null),[m,d]=r.useState(""),[i,a]=r.useState(!1),[n,s]=r.useState(null);return r.useEffect(()=>{(async()=>{try{const l=await t();l.locked?f(l.lockedUntil):x({question:l.question,index:l.index})}catch(l){s({kind:"error",text:l?.message??"Could not load challenge."})}})()},[]),p?e.jsxs("div",{className:"text-sm text-cream/80 space-y-2",children:[e.jsx("p",{className:"font-semibold text-cream",children:"Too many wrong answers."}),e.jsxs("p",{children:["Try again after ",new Date(p).toLocaleTimeString(),"."]})]}):u?e.jsxs("form",{onSubmit:async l=>{l.preventDefault(),s(null),a(!0);try{await c({data:{index:u.index,answer:m}}),o()}catch(g){s({kind:"error",text:g?.message??"Incorrect answer."});try{const y=await t();y.locked?f(y.lockedUntil):x({question:y.question,index:y.index}),d("")}catch{}}finally{a(!1)}},className:"space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-3 rounded-2xl border border-cream/10 bg-cream/[0.04] p-4",children:[e.jsx(O,{className:"h-5 w-5 text-pink-soft mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm text-cream",children:u.question})]}),e.jsx(j,{label:"Your answer",icon:P,type:"text",required:!0,value:m,onChange:l=>d(l.target.value),placeholder:"Type your answer",autoFocus:!0}),e.jsx(q,{message:n}),e.jsx(N,{loading:i,children:"Verify & continue"})]}):e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx(_,{className:"h-5 w-5 animate-spin text-cream/60"})})}export{ae 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.