1import{r as d,j as e,u as Q,a as O,L as B}from"./index-DuapSmdQ.js";import{a as H}from"./EappQuizDialog-Ci7_qzdx.js";import{u as P}from"./use-elite-onboarding-CHks_EMP.js";import"./elite-onboarding-CsF2RymR.js";const D="rgba(217,173,92,0.25)",L="var(--ax-gold)",y="var(--ax-muted)",w=[{name:"Robert (Client 1)",fields:[["DOB","August 28, 1961"],["Gender","Male"],["Email","[email protected]"],["Phone","(376) 456-2323"],["Address","1234 Main Street, Denver, CO 80202"],["Marital status","Married"],["Birthplace","Ohio"],["Height",`5'11"`],["Weight","215 lbs"],["Tobacco","TU (Tobacco User)"],["State","OH"],["SSN","543-45-7658"],["Health answers","No, Yes, No to the rest"]],questions:[{id:"c1q1",prompt:"What type of policy/combo will this be?",kind:"select",options:["Senior Combo","Super Combo"],accept:["senior combo","senior"]},{id:"c1q2",prompt:"The face amount is $25,000. What is the monthly premium?",kind:"money",answer:293.19},{id:"c1q3",prompt:"What would the premium be for a $15,000 face amount instead?",kind:"money",answer:1
175.92},{id:"c1q4",prompt:"If this client has a budget of $100/month, what face amount should you pitch them?",kind:"money",range:[5500,7e3]}]},{name:"Maria (Client 2)",fields:[["DOB","July 15, 1998"],["Gender","Female"],["Email","[email protected]"],["Phone","(376) 456-2323"],["Address","1234 Main Street, Riverside, CA 92501"],["Marital status","Married"],["Birthplace","CA"],["Height",`5'2"`],["Weight","135 lbs"],["Tobacco","NTU (Non-Tobacco User)"],["State","CA"],["SSN","543-45-7658"],["Health answers","No to all"]],questions:[{id:"c2q1",prompt:"What type of policy/combo will this be?",kind:"select",options:["Senior Combo","Super Combo"],accept:["super combo","super"]},{id:"c2q2",prompt:"She wants guaranteed coverage that can also help with retirement at age 65 â what product is the best fit?",kind:"text",accept:["lpu 65","lpu-65","lpu65"]},{id:"c2q3",prompt:"The face amount is $200,000. What is the monthly premium?",kind:"money",answer:265.5},{id:"c2q4",prompt:"She wants more coverage, but her budget caps at $260/month. What product do you pivot to?",kind:"text",accept:["select life","selectlife"]},{id:"c2q5",prompt:"What face amount of Select Life can she get for $260/month?",kind:"money",answer:369772}]},{name:"Thomas (Client 3)",fields:[["DOB","June 7, 1958"],["Gender","Male"],["Email","[email protected]"],["Phone","(376) 456-2323"],["Address","1234 Main Street, Dallas, TX 75202"],["Marital status","Married"],["Birthplace","TX"],["Height",`6'2"`],["Weight","290 lbs"],["Tobacco","NTU (Non-Tobacco User)"],["State","TX"],["SSN","543-45-7658"],["Health conditions","Asthma, High Blood Pressure"]],questions:[{id:"c3q1",prompt:"What type of policy/combo will this be?",kind:"select",options:["Senior Combo","Super Combo"],accept:["senior combo","senior"]},{id:"c3q2",prompt:"Given his asthma and high blood pressure (medication stable, no recent changes), should you submit this as Trial or Standard?",kind:"select",options:["Trial","Standard"],accept:["standard"]},{id:"c3q3",prompt:"Now suppose his high blood pressure medication was increased within the last 3 months. Does that change your answer â Trial or Standard?",kind:"select",options:["Trial","Standard"],accept:["trial"],explanation:"A recent medication increase can signal more underlying issues in the medical history than the basic health questions capture â when in doubt, submit trial."},{id:"c3q4",prompt:"The face amount is $7,000. What is the monthly premium?",kind:"money",answer:76.89},{id:"c3q5",prompt:"If this client has a budget of $125/month, what face amount should you pitch them?",kind:"money",answer:11280}]}],W=w.reduce((t,o)=>t+o.questions.length,0);function U(t){const o=Number(t.replace(/[$,\s]/g,""));return Number.isFinite(o)&&t.trim()!==""?o:null}function I(t){const o=t.replace(/[^0-9.]/g,""),[n,...r]=o.split("."),u=n?Number(n).toLocaleString("en-US"):"";return r.length?`${u}.${r.join("").slice(0,2)}`:u}function F(t,o){if(t.kind==="money"){const r=U(o);return r==null?!1:t.range?r>=t.range[0]&&r<=t.range[1]:Math.abs(r-(t.answer??NaN))<=3}const n=o.trim().toLowerCase().replace(/\s+/g," ");return(t.accept??[]).some(r=>n===r||n.replace(/-/g," ")===r.replace(/-/g," "))}function G(t){return t.kind==="money"?t.range?`$${t.range[0].toLocaleString()} â $${t.range[1].toLocaleString()}`:`$${(t.answer??0).toLocaleString(void 0,{minimumFractionDigits:(t.answer??0)%1?2:0})}`:(t.accept?.[0]??"").replace(/\b\w/g,n=>n.toUpperCase())}function X(){const[t,o]=d.useState(0),[n,r]=d.useState(0),[u,j]=d.use
1State(""),[f,c]=d.useState("idle"),[$,p]=d.useState({}),[v,h]=d.useState(0),[N,k]=d.useState(!1),[A,m]=d.useState(!1),x=w[t],a=x?.questions[n],M=d.useMemo(()=>w.slice(0,t).reduce((s,g)=>s+g.questions.length,0)+n,[t,n]),q=()=>{o(0),r(0),j(""),c("idle"),p({}),h(0),k(!1),m(!1)};if(A||!a){const s=Math.round(v/W*100);return e.jsxs("div",{style:R,children:[e.jsx("div",{style:{fontSize:32,textAlign:"center"},children:"ð"}),e.jsx("h3",{style:{textAlign:"center",color:"var(--ax-gold-text)",margin:"8px 0"},children:"Numbers Trainer Complete"}),e.jsxs("p",{style:{textAlign:"center",color:y,fontSize:13},children:["You nailed ",v," of ",W," questions on the first try (",s,"% first-try accuracy)."]}),e.jsx("div",{style:{textAlign:"center",marginTop:12},children:e.jsx("button",{onClick:q,style:E,children:"Restart"})})]})}const i=()=>{if(!u.trim())return;const s=($[a.id]??0)+1;p(g=>({...g,[a.id]:s})),F(a,u)?(s===1&&h(g=>g+1),c("right")):c("wrong")},l=()=>{j(""),c("idle"),k(!1),n<x.questions.length-1?r(n+1):t<w.length-1?(o(t+1),r(0)):m(!0)},b=f==="right"?"#22c55e":f==="wrong"?"#ef4444":D;return e.jsxs("div",{style:{display:"grid",gap:14},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:12,color:y},children:[e.jsxs("span",{children:["Client ",t+1," of ",w.length]}),e.jsxs("span",{children:["Question ",M+1," of ",W]})]}),e.jsxs("div",{style:{...R,background:"var(--ax-card2)"},children:[e.jsx("div",{style:{fontWeight:800,fontSize:14,color:"var(--ax-gold-text)"},children:x.name}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))",gap:"6px 14px",marginTop:10},children:x.fields.map(([s,g])=>e.jsxs("div",{style:{fontSize:12},children:[e.jsxs("span",{style:{color:y},children:[s,": "]}),e.jsx("span",{children:g})]},s))})]}),e.jsxs("div",{style:{...R,border:`1px solid ${b}`},children:[e.jsxs("div",{style:{fontSize:11,color:y},children:["Question ",n+1," of ",x.questions.length]}),e.jsx("div",{style:{fontSize:15,fontWeight:700,margin:"8px 0 14px",lineHeight:1.5},children:a.prompt}),a.kind==="select"?e.jsx("div",{style:{display:"grid",gap:8},children:a.options.map(s=>{const g=u===s;return e.jsx("button",{disabled:f==="right",onClick:()=>{j(s),c("idle")},style:{textAlign:"left",padding:"12px 14px",borderRadius:8,cursor:"pointer",fontSize:13,border:`1px solid ${g?L:D}`,background:g?"rgba(217,173,92,0.16)":"transparent",color:"var(--ax-text)"},children:s},s)})}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.kind==="money"&&e.jsx("span",{style:{fontSize:20,color:"var(--ax-gold-text)"},children:"$"}),e.jsx("input",{value:u,disabled:f==="right",inputMode:a.kind==="money"?"decimal":"text",onChange:s=>{j(a.kind==="money"?I(s.target.value):s.target.value),c("idle")},onKeyDown:s=>s.key==="Enter"&&i(),placeholder:a.kind==="money"?"0":"Type your answer",style:{flex:1,padding:"12px 14px",borderRadius:8,fontSize:18,background:"var(--ax-card2)",border:`1px solid ${b}`,color:"var(--ax-text)"}})]}),f==="wrong"&&e.jsxs("div",{style:{marginTop:10,fontSize:13,color:"#ef4444"},children:["â Not quite â try again.",($[a.id]??0)>=3&&(N?e.jsxs("div",{style:{color:y,marginTop:6},children:["Correct answer: ",G(a)]}):e.jsx("button",{onClick:()=>k(!0),style:{marginLeft:8,background:"none",border:"none",color:y,textDecoration:"underline",cursor:"pointer",fontSize:12},children:"Need a hint?"}))]}),f==="right"&&e.jsxs("div",{style:{marginTop:10,fontSize:13,color:"#22c55e"},children:["â Correct",a.explanation&&e.jsx("div",{style:{color:y,marginTop:6,lineHeight:1.5},children:a.explanation})]}),e.jsx("div",{style:{marginTop:16},children:f==="right"?e.jsx("button",{onClick:l,style:E,children:n===x.questions.length-1&&t===w.length-1?"Finish":"Next Question"}):e.jsx("button",{onClick:i,disabled:!u.trim(),style:{...E,opacity:u.trim()?1:.5},children:"Submit"})})]})]})}const R={padding:16,border:`1px solid ${D}`,borderRadius:10,background:"var(--ax-deep)"},E={padding:"10px 18px",borderRadius:8,fontSize:13,fontWeight:700,cursor:"pointer",border:`1px solid ${L}`,background:L,color:"#000"},z="rgba(217,173,92,0.25)",S="var(--ax-gold)",T="var(--ax-muted)";function Y(t){const o=[...t];for(let n=o.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[o[n],o[r]]=[o[r],o[n]]}return o}function Z(){const{user:t}=Q(),o=O(),[n,r]=d.useState("quiz"),{recordQuizAttempt:u}=P(t?.email),[j,f]=d.useState(0),[c,$]=d.useState(H);d.useEffect(()=>{$(Y(H))},[j]);
1const[p,v]=d.useState(0),[h,N]=d.useState({}),[k,A]=d.useState(!1),m=c.length,x=c.reduce((i,l,b)=>i+(h[b]===l.correct?1:0),0),a=k&&x===m,M=async()=>{A(!0),await u(x,m,x===m)},q=()=>{f(i=>i+1),v(0),N({}),A(!1)};return e.jsx("main",{style:{minHeight:"100vh",background:"var(--ax-page)",color:"var(--ax-text)",padding:"36px 16px"},children:e.jsxs("div",{style:{maxWidth:720,margin:"0 auto"},children:[e.jsx(B,{to:"/onboarding",style:{color:T,fontSize:12,textDecoration:"none"},children:"â Back to onboarding"}),e.jsx("h1",{style:{fontSize:22,margin:"12px 0 4px",color:"var(--ax-gold-text)"},children:n==="quiz"?"eApp Mastery Quiz":"eApp Numbers Trainer"}),e.jsx("p",{style:{color:T,fontSize:13},children:n==="quiz"?"18 questions · you must score 18/18 to pass.":"3 client scenarios · practice premiums, face amounts, and trial vs. standard."}),e.jsx("div",{style:{display:"flex",gap:8,margin:"14px 0 4px"},children:["quiz","numbers"].map(i=>e.jsx("button",{onClick:()=>r(i),style:{padding:"8px 14px",borderRadius:999,fontSize:12,fontWeight:700,cursor:"pointer",border:`1px solid ${S}`,background:n===i?S:"transparent",color:n===i?"#000":"var(--ax-text)"},children:i==="quiz"?"Mastery Quiz":"Numbers Practice"},i))}),n==="numbers"?e.jsx("div",{style:{marginTop:16},children:e.jsx(X,{})}):k?a?e.jsxs("div",{style:{marginTop:20,padding:26,border:`1px solid ${S}`,borderRadius:12,textAlign:"center",background:"rgba(217,173,92,0.12)"},children:[e.jsx("div",{style:{fontSize:34},children:"ð"}),e.jsx("h2",{style:{color:"var(--ax-gold-text)",margin:"10px 0 6px"},children:"18 / 18 â Passed"}),e.jsx("p",{style:{color:T,fontSize:13},children:"eApp is checked off and Post-Sale Process is unlocked."}),e.jsx("button",{onClick:()=>o({to:"/onboarding"}),style:{...C(!0),marginTop:14},children:"Back to onboarding"})]}):e.jsxs("div",{style:{marginTop:20},children:[e.jsxs("div",{style:{padding:18,border:`1px solid ${z}`,borderRadius:10},children:[e.jsxs("h2",{style:{margin:0,fontSize:18},children:[x," / ",m," â not a pass"]}),e.jsx("p",{style:{color:T,fontSize:13},children:"100% is required. Review the misses below, then retake."}),e.jsx("button",{onClick:q,style:{...C(!0),marginTop:8},children:"Retake Quiz"})]}),e.jsx("div",{style:{display:"grid",gap:10,marginTop:14},children:c.map((i,l)=>h[l]===i.correct?null:e.jsxs("div",{style:{padding:14,border:`1px solid ${z}`,borderRadius:8,background:"var(--ax-deep)"},children:[e.jsx("div",{style:{fontSize:13,fontWeight:700},children:i.q}),e.jsxs("div",{style:{fontSize:12,color:"#ef4444",marginTop:6},children:["Your answer: ",h[l]!=null?i.options[h[l]]:"â"]}),e.jsxs("div",{style:{fontSize:12,color:"#22c55e"},children:["Correct: ",i.options[i.correct]]}),e.jsx("div",{style:{fontSize:12,color:T,marginTop:6},children:i.explanation})]},l))})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"flex",gap:5,flexWrap:"wrap",margin:"16px 0"},children:c.map((i,l)=>e.jsx("span",{style:{width:9,height:9,borderRadius:999,background:h[l]!=null?S:"transparent",border:`1px solid ${l===p?"var(--ax-gold-text)":z}`}},l))}),e.jsxs("div",{style:{padding:18,border:`1px solid ${z}`,borderRadius:10,background:"var(--ax-deep)"},children:[e.jsxs("div",{style:{fontSize:11,color:T},children:["Question ",p+1," of ",m]}),e.jsx("div",{style:{fontSize:15,fontWeight:700,margin:"8px 0 14px",lineHeight:1.5},children:c[p].q}),e.jsx("div",{style:{display:"grid",gap:8},children:c[p].options.map((i,l)=>{const b=h[p]===l;return e.jsx("button",{onClick:()=>N(s=>({...s,[p]:l})),style:{textAlign:"left",padding:"12px 14px",borderRadius:8,cursor:"pointer",fontSize:13,border:`1px solid ${b?S:z}`,background:b?"rgba(217,173,92,0.16)":"transparent",color:"var(--ax-text)"},children:i},l)})})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:16,gap:10},children:[e.jsx("button",{onClick:()=>v(i=>Math.max(0,i-1)),disabled:p===0,style:C(!1),children:"Back"}),p<m-1?e.jsx("button",{onClick:()=>v(i=>i+1),disabled:h[p]==null,style:C(!0),children:"Next"}):e.jsx("button",{onClick:M,disabled:Object.keys(h).length<m,style:C(!0),children:"Submit"})]})]})]})})}function C(t){return{padding:"10px 18px",borderRadius:8,fontSize:13,fontWeight:700,cursor:"pointer",border:`1px solid ${S}`,background:t?S:"transparent",color:t?"#000":"var(--ax-text)"}}export{Z 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.