PageSourceSearch

https://ineedleads.co.uk/assets/ResellerPortal-Bq9R-ySN.js

js ineedleads.co.uk collected 2026-10-09 22:57:48 UTC 56,024 bytes, 1 lines download raw bytes

1import{r as j,j as e,u as T}from"./index-DKJ0tKwF.js";import{u as ye}from"./useDesktopToolbarAction-BjAss24h.js";import{u as ae,a as be,b as je,R as q}from"./ResellerLayout-aHIiTjQ3.js";import{aE as Y,bo as N,f as z,aQ as P,dS as V,b2 as ve,$ as G,m as ne,ap as we,cZ as Se,c7 as ke,aq as Ce,ar as _e,as as Ne,at as Ie,S as Be,dK as Re,cA as Te,aZ as ze,ea as ie,fB as le,e6 as oe,cx as De,cy as Fe,gs as de}from"./App-CL-mfmhu.js";import{P as We}from"./PointsDisplay-DPBLo3hE.js";import{S as Me}from"./SessionStats-CWEP2E2n.js";import{D as A}from"./DailyPaymentBadge-Cfzkx-nq.js";import{R as Pe,am as F,al as W,F as C,C as Ae,O as ce,d as Ee,c as $e,B as Le,e as qe,n as Oe}from"./V2Layout-DEbe2yZA.js";import{S as He}from"./slider-wKlj6rAS.js";import{q as ge,p as E,J as v,t as S,k as Ge,P as _,o as $,D as K,Y as M,S as pe,g as xe,V as Ke,G as me,e as he,d as O,i as Ue}from"./button-DFML8rOM.js";import{R as Ye,T as Ve,W as Qe}from"./generateCategoricalChart-b5rLhkau.js";import{A as Ze,a as J}from"./AreaChart-BJYXKA2p.js";import{C as Xe}from"./CartesianGrid-B9QQOuAa.js";import{X as Je,Y as er}from"./YAxis-juuueSy8.js";import{x as I,g as Q,u as U,a as rr,H as tr,A as sr,s as ar}from"./v3LegalOverrides-BUgTGJPl.js";import{Z as k,L as ee}from"./tracker-DzJH7QDt.js";import{C as ue}from"./mouse-pointer-2-CzsmklB8.js";import"./index-BNGwt955.js";import"./SEOHead-B5IBZJEm.js";import"./types-DU7944Yl.js";import"./confetti.module-B5JVzsfH.js";import"./value-DqH_WevB.js";const nr=[{id:"marketing",name:"Marketing Package",firstInvoiceCommission:.2,recurringCommission:.05,basePrice:2500,commissionLabel:"£500 first + £125/mo recurring",maxPerMonth:5},{id:"ai",name:"AI Subscription",recurringCommission:.2,firstInvoiceCommission:0,basePrice:799,commissionLabel:"£159.80/mo recurring each",maxPerMonth:10},{id:"website",name:"Website",firstInvoiceCommission:.2,basePrice:999,commissionLabel:"£199.80 one-time",maxPerMonth:5},{id:"seo",name:"SEO Package",firstInvoiceCommission:.2,basePrice:999,commissionLabel:"£199.80 first invoice",maxPerMonth:5},{id:"appBuilding",name:"AI App Building",firstInvoiceCommission:.2,basePrice:19995,commissionLabel:"£3,999 one-time!",maxPerMonth:3}];function ir(){const[r,s]=j.useState({marketing:2,ai:5,website:2,seo:1,appBuilding:1}),o=(a,g)=>{s(n=>({...n,[a]:Math.max(0,g)}))},i=j.useMemo(()=>Array.from({length:24},(a,g)=>{const n=g+1,m=r.marketing*n,t=r.ai*n,h=m*2500*.05,w=t*799*.2,p=h+w,y=r.marketing*2500*.2+r.website*999*.2+r.seo*999*.2+r.appBuilding*19995*.2;return{month:n,marketingRecurring:h,aiRecurring:w,totalRecurring:p,monthlyOneTime:y,totalMonthly:p+y}}),[r]),c=j.useMemo(()=>{const a=i[5],g=i[11],n=i[23];return{month6Recurring:a.totalRecurring,month12Recurring:g.totalRecurring,month24Recurring:n.totalRecurring,yearOneTotal:i.slice(0,12).reduce((m,t)=>m+t.totalMonthly,0),year2Passive:g.totalRecurring*12}},[i]),d=i.map(a=>({month:`M${a.month}`,"Marketing (5%)":Math.round(a.marketingRecurring),"AI (20%)":Math.round(a.aiRecurring),total:Math.round(a.totalRecurring)})),l=a=>`£${a.toLocaleString("en-GB",{minimumFractionDigits:0,maximumFractionDigits:0})}`;return e.jsxs("div",{style:{background:"var(--win-bg-layer2, #2C2C2C)",border:"1px solid var(--win-divider, rgba(255,255,255,0.08))",borderRadius:10,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid var(--win-divider)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:2},children:[e.jsx(Pe,{className:"h-4 w-4",style:{color:"var(--win-accent)"}}),e.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--win-text-primary)"},children:"Build Your Recurring Empire"})]}),e.jsx("div",{style:{fontSize:11,color:"var(--win-text-secondary)"},children:"How many NEW clients per month?"})]}),e.jsx(A,{variant:"compact"})]}),e.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:16},children:[nr.map(a=>e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},children:[e.jsx(F,{className:"text-sm font-medium",children:a.name}),e.jsx("span",{style:{fontSize:11,color:"#10B981",fontWeight:500},children:a.commissionLabel})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx(He,{value:[r[a.id]||0],onValueChange:([g])=>o(a.id,g),max:a.maxPerMonth,step:1,className:"flex-1"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(W,{type:"number",value:r[a.id]||0,onChange:g=>o(a.id,parseInt(g.target.value)||0),className:"w-14 text-center",min:0,max:20}
1),e.jsx("span",{style:{fontSize:10,color:"var(--win-text-secondary)"},children:"/mo"})]})]})]},a.id)),e.jsxs("div",{style:{paddingTop:12,borderTop:"1px solid var(--win-divider)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:12,fontSize:13,fontWeight:600,color:"var(--win-text-primary)"},children:[e.jsx(ge,{className:"h-4 w-4",style:{color:"#10B981"}})," Revenue Snowball"]}),e.jsx("div",{style:{height:200},children:e.jsx(Ye,{width:"100%",height:"100%",children:e.jsxs(Ze,{data:d,margin:{top:5,right:5,left:0,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"cMarketing",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"var(--win-accent, #0078D4)",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"var(--win-accent, #0078D4)",stopOpacity:0})]}),e.jsxs("linearGradient",{id:"cAI",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#a855f7",stopOpacity:.4}),e.jsx("stop",{offset:"95%",stopColor:"#a855f7",stopOpacity:0})]})]}),e.jsx(Xe,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.06)"}),e.jsx(Je,{dataKey:"month",tick:{fontSize:9,fill:"rgba(255,255,255,0.4)"},tickLine:!1,axisLine:!1}),e.jsx(er,{tick:{fontSize:9,fill:"rgba(255,255,255,0.4)"},tickFormatter:a=>`£${(a/1e3).toFixed(0)}k`,tickLine:!1,axisLine:!1}),e.jsx(Ve,{formatter:a=>[`£${a.toLocaleString()}`,""],contentStyle:{backgroundColor:"var(--win-bg-layer3, #383838)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,fontSize:11,color:"#fff"}}),e.jsx(Qe,{wrapperStyle:{fontSize:10}}),e.jsx(J,{type:"monotone",dataKey:"Marketing (5%)",stackId:"1",stroke:"var(--win-accent)",fill:"url(#cMarketing)"}),e.jsx(J,{type:"monotone",dataKey:"AI (20%)",stackId:"1",stroke:"#a855f7",fill:"url(#cAI)"})]})})})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},children:[{label:"Month 6",value:l(c.month6Recurring),color:"var(--win-accent, #0078D4)"},{label:"Month 12",value:l(c.month12Recurring),color:"#10B981"},{label:"Month 24",value:l(c.month24Recurring),color:"#8B5CF6"}].map(a=>e.jsxs("div",{style:{textAlign:"center",padding:12,borderRadius:8,background:`${a.color}10`,border:`1px solid ${a.color}30`},children:[e.jsxs("div",{style:{fontSize:10,color:"var(--win-text-secondary)",marginBottom:4},children:[a.label," Recurring"]}),e.jsx("div",{style:{fontSize:18,fontWeight:700,color:a.color},children:a.value}),e.jsx("div",{style:{fontSize:10,color:"var(--win-text-secondary)"},children:"/month"})]},a.label))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[{icon:E,label:"Year 1 Total",value:l(c.yearOneTotal),sub:"One-time + recurring",color:"#F59E0B"},{icon:I,label:"Year 2 Passive",value:l(c.year2Passive),sub:"Stop selling after Y1",color:"#10B981"}].map(a=>e.jsxs("div",{style:{padding:12,borderRadius:8,background:`${a.color}08`,border:`1px solid ${a.color}20`},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[e.jsx(a.icon,{className:"h-3.5 w-3.5",style:{color:a.color}}),e.jsx("span",{style:{fontSize:10,color:"var(--win-text-secondary)"},children:a.label})]}),e.jsx("div",{style:{fontSize:20,fontWeight:700,color:a.color},children:a.value}),e.jsx("div",{style:{fontSize:10,color:"var(--win-text-secondary)",marginTop:2},children:a.sub})]},a.label))}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:10,borderRadius:8,background:"rgba(16,185,129,0.06)",border:"1px solid rgba(16,185,129,0.15)"},children:[e.jsx(k,{className:"h-4 w-4",style:{color:"#10B981"}}),e.jsxs("span",{style:{fontSize:11,color:"var(--win-text-secondary)"},children:[e.jsx("span",{style:{color:"#10B981",fontWeight:600},children:"Paid daily"})," — client pays, you get paid same day"]})]})]})]})}function fe(){const{workspace:r}=Y(),{effectiveUserId:s}=N();return z({queryKey:["reseller-challenges",r==null?void 0:r.id,s],queryFn:async()=>{if(!(r!=null&&r.id))return[];const o=new Date().toISOString(),{data:i,error:c}=await v.from("reseller_challenges").select("*").eq("workspace_id",r.id).eq("is_active",!0).lte("start_date",o).gte("end_date",o).order("end_date",{ascending:!0});if(c)throw c;if(!(i!=null&&i.length))return[];const d=i.map(g=>g.id),{data:l,error:a}=await v.from("reseller_challenge_progress").select("*").eq("user_id",s).in("challenge_id",d);if(a)throw a;return i.map(g=>{const n=l==null?void 0:l.find(h=>h.challenge_id===g.id),m=(n==null?void 0:n.current_value)||0,t=Math.min(100,m/g.target_value*100);return{...g,progress:{current_value:m,completed:(n==null?void 0:n.completed)||!1,completed_at:(n==null?void 0:n.completed_at)||null,percentage:t}}})},enabled:!!(r!=null&&r.id)&&!!s})}function lr(){const{data:r}=fe(),s=(r==null?void 0:r.length)||0,o=(r==null?void 0:r.filter(d=>d.progress.completed).length)||0,i=(r==null?void 0:r.reduce((d,l)=>d+l.bonus_points,0))||0,c=(r==null?void 0:r.filter(d=>d.progress.completed).reduce((d,l)=>d+l.bonus_points,0))||0;return{totalChallenges:s,completedChallenges:o,totalBonusAvailable:i,earnedBonus:c,allCompleted:s>0&&o===s}}const or={calls:e.jsx(_,{className:"h-3.5 w-3.5"}),talk_time:e.jsx(Q,{className:"h-3.5 w-3.5"}),appointments:e.jsx(Ae,{className:"h-3.5 w-3.5"}),points:e.jsx(k,{className:"h-3.5 w-3.5"}),objections:e.jsx(Ge,{className:"h-3.5 w-3.5"})},re={daily:{bg:"rgba(59,130,246,0.1)",text:"#60A5FA",border:"rgba(59,130,246,0.3)"},weekly:{bg:"rgba(139,92,246,0.1)",text:"#A78BFA",border:"rgba(139,92,246,0.3)"},monthly:{bg:"rgba(16,185,129,0.1)",text:"#34D399",border:"rgba(16,185,129,0.3)"},special:{bg:"rgba(249,115,22,0.1)",text:"#FB923C",border:"rgba(249,115,22,0.3)"}};function dr({className:r,compact:s=!1}){const{data:o,isLoading:i}=fe(),{completedChallenges:c,totalChallenges:d,allCompleted:l,earnedBonus:a,totalBonusAvailable:g}=lr();return i?e.jsx("div",{className:S(r),style:{background:"var(--win-bg-layer2)",border:"1px solid var(--win-divider)",borderRadius:10,padding:16},children:[1,2,3].map(n=>e.jsx("div",{style:{height:60,borderRadius:8,background:"rgba(255,255,255,0.04)",marginBottom:8}},n))}):o!=null&&o.length?e.jsxs("div",{className:S(r),style:{background:"var(--win-bg-layer2, #2C2C2C)",border:`1px solid ${l?"rgba(16,185,129,0.4)":"var(--win-divider, rgba(255,255,255,0.08))"}`,borderRadius:10,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--win-divider)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(E,{className:"h-4 w-4",style:{color:"var(--win-accent)"}}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--win-text-primary)"},children:"Today's Challenges"}),l&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:3,background:"rgba(16,185,129,0.15)",borderRadius:10,padding:"2px 8px",fontSize:10,fontWeight:600,color:"#10B981"},children:[e.jsx(C,{className:"h-3 w-3"})," All Complete!"]})]}),e.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"var(--win-text-primary)",fontFamily:"monospace"},children:[c,"/",d]})]}),e.jsxs("div",{style:{padding:"8px 16px",display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{flex:1},children:e.jsx(P,{value:c/d*100,className:"h-1.5"})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--win-text-secondary)"},children:[e.jsx(V,{className:"h-3 w-3"}),e.jsxs("span",{children:["+",a]}),e.jsxs("span",{style:{color:"var(--win-accent)"},children:["/ +",g]})]})]}),e.jsxs("div",{style:{padding:"4px 12px 12px",display:"flex",flexDirection:"column",gap:6},children:[o.slice(0,s?3:void 0).map(n=>{const m=re[n.challenge_type]||re.daily;return e.jsxs("div",{style:{padding:"10px 12px",borderRadius:8,background:n.progress.completed?"rgba(16,185,129,0.06)":"rgba(255,255,255,0.02)",border:`1px solid ${n.progress.completed?"rgba(16,185,129,0.2)":"rgba(255,255,255,0.04)"}`,transition:"border-color 0.15s"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:6},children:[e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--win-text-primary)"},children:n.name}
1),n.progress.completed&&e.jsx(ue,{className:"h-3.5 w-3.5",style:{color:"#10B981"}})]}),e.jsx("div",{style:{fontSize:10,color:"var(--win-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.description})]}),e.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"2px 6px",borderRadius:4,background:m.bg,color:m.text,border:`1px solid ${m.border}`,marginLeft:8,flexShrink:0},children:n.challenge_type})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4,fontSize:11},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,color:"var(--win-text-secondary)"},children:[or[n.metric],e.jsxs("span",{style:{fontFamily:"monospace"},children:[n.progress.current_value," / ",n.target_value]})]}),e.jsxs("span",{style:{fontWeight:600,color:n.progress.completed?"#10B981":"var(--win-accent)",fontSize:10},children:["+",n.bonus_points," pts"]})]}),e.jsx(P,{value:n.progress.percentage,className:S("h-1",n.progress.completed&&"[&>div]:bg-emerald-500")}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:4,fontSize:10,color:"var(--win-text-secondary)"},children:[e.jsxs("span",{children:[Math.round(n.progress.percentage),"%"]}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[e.jsx(Q,{className:"h-2.5 w-2.5"}),"Ends ",ve(n.end_date,{addSuffix:!0})]})]})]},n.id)}),s&&o.length>3&&e.jsx("a",{href:"/reseller/training",style:{textDecoration:"none",display:"block"},children:e.jsxs("button",{style:{width:"100%",padding:"7px 12px",borderRadius:6,background:"rgba(255,255,255,0.04)",border:"1px solid var(--win-divider)",color:"var(--win-text-secondary)",fontSize:11,cursor:"pointer"},children:["View All ",o.length," Challenges"]})})]})]}):e.jsxs("div",{className:S(r),style:{background:"var(--win-bg-layer2)",border:"1px solid var(--win-divider)",borderRadius:10,padding:24,textAlign:"center"},children:[e.jsx(I,{className:"h-10 w-10",style:{margin:"0 auto 8px",opacity:.3,color:"var(--win-text-secondary)"}}),e.jsx("div",{style:{fontSize:13,fontWeight:500,color:"var(--win-text-secondary)"},children:"No active challenges"}),e.jsx("div",{style:{fontSize:11,color:"var(--win-text-secondary)",marginTop:2},children:"Check back later!"})]})}function Z(){const{workspace:r}=Y(),{effectiveUserId:s,realUserId:o,isImpersonating:i}=N(),c=new Date().toISOString().split("T")[0];return z({queryKey:["daily-goals",s,c],queryFn:async()=>{const{data:d,error:l}=await v.from("reseller_daily_goals").select("*").eq("user_id",s).eq("goal_date",c).maybeSingle();if(l&&l.code!=="PGRST116")throw l;if(!d&&(r!=null&&r.id)&&!i&&s===o){const a=new Date;a.setDate(a.getDate()-1);const g=a.toISOString().split("T")[0],{data:n}=await v.from("reseller_daily_goals").select("streak_count, completed").eq("user_id",o).eq("goal_date",g).maybeSingle(),m=n!=null&&n.completed?(n.streak_count||0)+1:0,{data:t,error:h}=await v.from("reseller_daily_goals").insert({user_id:o,workspace_id:r.id,goal_date:c,target_calls:50,target_connects:10,target_demos:3,actual_calls:0,actual_connects:0,actual_demos:0,completed:!1,streak_count:m}).select().single();if(h)throw h;return t}return d},enabled:!!s&&!!(r!=null&&r.id)})}function cr(){const{data:r}=Z();if(!r)return{calls:{current:0,target:50,percentage:0},connects:{current:0,target:10,percentage:0},demos:{current:0,target:3,percentage:0},allGoalsMet:!1};const s=r.actual_calls||0,o=r.actual_connects||0,i=r.actual_demos||0,c=r.target_calls||50,d=r.target_connects||10,l=r.target_demos||3,a={current:s,target:c,percentage:Math.min(100,s/c*100)},g={current:o,target:d,percentage:Math.min(100,o/d*100)},n={current:i,target:l,percentage:Math.min(100,i/l*100)};return{calls:a,connects:g,demos:n,allGoalsMet:a.percentage>=100&&g.percentage>=100&&n.percentage>=100}}function gr(){const r=ce(),{effectiveUserId:s,isImpersonating:o}=N(),i=new Date().toISOString().split("T")[0];return G({mutationFn:async c=>{if(o)throw new Error("Cannot update goals while impersonating");const{error:d}=await v.from("reseller_daily_goals").update(c).eq("user_id",s).eq("goal_date",i);if(d)throw d},onSuccess:()=>{r.invalidateQueries({queryKey:["daily-goals",s]}),T.success("Goals updated!")},onError:c=>{T.error("Failed to update goals: "+c.message)}})}function pr(){const{effectiveUserId:r}=N();return z({queryKey:["streak-history",r],queryFn:async()=>{const s=new Date;s.setDate(s.getDate()-30);const{data:o,error:i}=await v.from("reseller_daily_goals").select("goal_date, completed, actual_calls, target_calls, streak_count").eq("user_id",r).gte("goal_date",s.toISOString().split("T")[0]).order("goal_date",{ascending:!0});if(i)throw i;return o||[]},enabled:!!r})}function xr(){const{data:r}=Z();return(r==null?void 0:r.streak_count)||0}function mr({className:r,compact:s=!1}){const{data:o,isLoading:i}=Z(),c=cr(),d=xr(),{data:l}=pr(),a=gr(),[g,n]=j.useState(!1),[m,t]=j.useState({calls:(o==null?void 0:o.target_calls)||50,connects:(o==null?void 0:o.target_connects)||10,demos:(o==null?void 0:o.target_demos)||3}),h=()=>{a.mutate({target_calls:m.calls,target_connects:m.connects,target_demos:m.demos}),n(!1)};if(i)return e.jsx("div",{className:S(r),style:{padding:16,borderRadius:10,background:"var(--win-bg-layer2)",border:"1px solid var(--win-divider)"},children:e.jsx("div",{style:{height:100,borderRadius:8,background:"rgba(255,255,255,0.04)"}})});const w=[{id:"calls",label:"Calls",icon:_,color:"#3B82F6",...c.calls},{id:"connects",label:"Connects",icon:ne,color:"#8B5CF6",...c.connects},{id:"demos",label:"Demos",icon:Ee,color:"#10B981",...c.demos}];return e.jsxs("div",{className:S(r),style:{background:"var(--win-bg-layer2, #2C2C2C)",border:`1px solid ${c.allGoalsMet?"rgba(16,185,129,0.4)":"var(--win-divider, rgba(255,255,255,0.08))"}`,borderRadius:10,overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--win-divider, rgba(255,255,255,0.08))"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(E,{className:"h-4 w-4",style:{color:"var(--win-accent)"}}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--win-text-primary)"},children:"My Daily Goals"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d>0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,background:"rgba(249,115,22,0.1)",border:"1px solid rgba(249,115,22,0.3)",borderRadius:12,padding:"2px 8px",fontSize:11,fontWeight:500,color:"#F97316"},children:[e.jsx(C,{className:"h-3 w-3"})," ",d," day streak"]}),c.allGoalsMet&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,background:"rgba(16,185,129,0.15)",borderRadius:12,padding:"2px 8px",fontSize:11,fontWeight:600,color:"#10B981"},children:[e.jsx($,{className:"h-3 w-3"})," All Crushed!"]}),e.jsxs(we,{open:g,onOpenChange:n,children:[e.jsx(Se,{asChild:!0,children:e.jsx("button",{style:{background:"transparent",border:"none",cursor:"pointer",padding:4,borderRadius:4,color:"var(--win-text-secondary)"},children:e.jsx(ke,{className:"h-3.5 w-3.5"})})}),e.jsxs(Ce,{children:[e.jsxs(_e,{children:[e.jsx(Ne,{children:"Set Daily Targets"}),e.jsx(Ie,{children:"Customize your daily goals"})]}),e.jsxs("div",{className:"space-y-4 pt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{children:"Target Calls"}),e.jsx(W,{type:"number",value:m.calls,onChange:p=>t(y=>({...y,calls:parseInt(p.target.value)||0}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{children:"Target Connects"}),e.jsx(W,{type:"number",value:m.connects,onChange:p=>t(y=>({...y,connects:parseInt(p.target.value)||0}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{children:"Target Demos"}),e.jsx(W,{type:"number",value:m.demos,onChange:p=>t(y=>({...y,demos:parseInt(p.target.value)||0}))})]}),e.jsx(K,{onClick:h,className:"w-full",disabled:a.isPending,children:"Save Targets"})]})]})]})]})]}),e.jsxs("div",{style:{padding:"12px 16px",display:"flex",flexDirection:"column",gap:12},children:[w.map(p=>e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{padding:4,borderRadius:5,background:`${p.color}15`}
1,children:e.jsx(p.icon,{className:"h-3.5 w-3.5",style:{color:p.color}})}),e.jsx("span",{style:{fontSize:12,fontWeight:500,color:"var(--win-text-primary)"},children:p.label})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsxs("span",{style:{fontSize:12,fontFamily:"monospace",color:"var(--win-text-primary)"},children:[p.current," / ",p.target]}),p.percentage>=100&&e.jsx(ue,{className:"h-3.5 w-3.5",style:{color:"#10B981"}})]})]}),e.jsx(P,{value:p.percentage,className:S("h-1.5",p.percentage>=100&&"[&>div]:bg-emerald-500")})]},p.id)),!s&&l&&l.length>0&&e.jsxs("div",{style:{paddingTop:12,borderTop:"1px solid var(--win-divider)"},children:[e.jsx("p",{style:{fontSize:10,color:"var(--win-text-secondary)",marginBottom:6},children:"Last 30 Days"}),e.jsx("div",{style:{display:"flex",gap:2,flexWrap:"wrap"},children:Array.from({length:30}).map((p,y)=>{const B=new Date;B.setDate(B.getDate()-(29-y));const L=B.toISOString().split("T")[0],x=l.find(b=>b.goal_date===L);let u="rgba(255,255,255,0.06)";if(x){if(x.completed)u="#10B981";else if(x.actual_calls>0){const b=x.actual_calls/x.target_calls*100;b>=75?u="#34D399":b>=50?u="#EAB308":b>=25?u="#F97316":u="rgba(239,68,68,0.5)"}}return e.jsx("div",{style:{width:12,height:12,borderRadius:2,background:u},title:`${L}: ${x!=null&&x.completed?"Complete":x!=null&&x.actual_calls?`${x.actual_calls}/${x.target_calls} calls`:"No data"}`},y)})})]})]})]})}const D=60*60;function hr(){const{workspace:r}=Y(),{effectiveUserId:s,isImpersonating:o}=N(),i=ce(),[c,d]=j.useState(!1),[l,a]=j.useState(D),[g,n]=j.useState({calls:0,connects:0,talkTime:0}),[m,t]=j.useState(null),{data:h,isLoading:w}=z({queryKey:["power-hour-session",s],queryFn:async()=>{const x=new Date;x.setHours(x.getHours()-1);const{data:u,error:b}=await v.from("reseller_power_hours").select("*").eq("user_id",s).is("ended_at",null).gte("started_at",x.toISOString()).maybeSingle();if(b&&b.code!=="PGRST116")throw b;return u},enabled:!!s});j.useEffect(()=>{if(h&&!h.ended_at){const x=new Date(h.started_at).getTime(),u=Date.now(),b=Math.floor((u-x)/1e3),X=Math.max(0,D-b);X>0&&(d(!0),a(X),t(h.id),n({calls:h.calls_made||0,connects:h.connects||0,talkTime:h.talk_time_seconds||0}))}},[h]),j.useEffect(()=>{if(!c||l<=0)return;const x=setInterval(()=>{a(u=>u<=1?(d(!1),0):u-1)},1e3);return()=>clearInterval(x)},[c,l]);const p=G({mutationFn:async()=>{if(o)throw new Error("Cannot start Power Hour while impersonating");if(!s||!(r!=null&&r.id))throw new Error("Not authenticated");const{data:x,error:u}=await v.from("reseller_power_hours").insert({user_id:s,workspace_id:r.id,started_at:new Date().toISOString(),duration_seconds:0,calls_made:0,connects:0,talk_time_seconds:0,points_earned:0,multiplier:2,completed:!1}).select().single();if(u)throw u;return x},onSuccess:x=>{d(!0),a(D),n({calls:0,connects:0,talkTime:0}),t(x.id),i.invalidateQueries({queryKey:["power-hour-session"]}),T.success("🔥 Power Hour Started! 2x points for the next 60 minutes!")},onError:x=>{T.error("Failed to start Power Hour: "+x.message)}}),y=G({mutationFn:async()=>{if(!m)return;const{error:x}=await v.from("reseller_power_hours").update({ended_at:new Date().toISOString(),duration_seconds:D-l,completed:l<=0}).eq("id",m);if(x)throw x},onSuccess:()=>{d(!1),t(null),i.invalidateQueries({queryKey:["power-hour-session"]}),i.invalidateQueries({queryKey:["power-hour-history"]}),T.success("Power Hour ended! Great work! 💪")}}),B=j.useCallback(async x=>{if(!m)return;const u={calls:x.calls??g.calls,connects:x.connects??g.connects,talkTime:x.talkTime??g.talkTime};n(u),await v.from("reseller_power_hours").update({calls_made:u.calls,connects:u.connects,talk_time_seconds:u.talkTime}).eq("id",m)},[m,g]);return{isActive:c,isLoading:w,timeRemaining:l,formattedTime:(x=>{const u=Math.floor(x/60),b=x%60;return`${u.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}`})(l),sessionStats:g,startSession:p.mutate,endSession:y.mutate,updateSessionStats:B,isStarting:p.isPending,multiplier:2}}function ur(){const{effectiveUserId:r}=N();return z({queryKey:["power-hour-history",r],queryFn:async()=>{const s=new Date;s.setDate(s.getDate()-30);const{data:o,error:i}=await v.from("reseller_power_hours").select("*").eq("user_id",r).eq("completed",!0).gte("started_at",s.toISOString()).order("started_at",{ascending:!1});if(i)throw i;return o},enabled:!!r})}function fr(){const{data:r}=ur(),s=(r==null?void 0:r.length)||0,o=(r==null?void 0:r.reduce((d,l)=>d+(l.calls_made||0),0))||0,i=(r==null?void 0:r.reduce((d,l)=>d+(l.talk_time_seconds||0),0))||0,c=(r==null?void 0:r.filter(d=>{const l=new Date(d.started_at),a=new Date;return l.getMonth()===a.getMonth()&&l.getFullYear()===a.getFullYear()}).length)||0;return{totalSessions:s,totalCallsInPowerHours:o,totalTalkTimeMinutes:Math.round(i/60),thisMonthSessions:c}}function yr({className:r,compact:s=!1}){const{isActive:o,isLoading:i,formattedTime:c,timeRemaining:d,sessionStats:l,startSession:a,endSession:g,isStarting:n,multiplier:m}=hr(),{totalSessions:t,thisMonthSessions:h}=fr(),w=(3600-d)/3600*100;return s&&!o?e.jsx("div",{className:S(r),style:{background:"var(--win-bg-layer2, #2C2C2C)",border:"1px solid var(--win-divider, rgba(255,255,255,0.08))",borderRadius:10,padding:14},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{padding:8,borderRadius:8,background:"rgba(249,115,22,0.1)"},children:e.jsx(k,{className:"h-5 w-5",style:{color:"#F97316"}})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--win-text-primary)"},children:"Power Hour"}),e.jsx("div",{style:{fontSize:11,color:"var(--win-text-secondary)"},children:"2x points for 60 min"})]})]}),e.jsxs("button",{onClick:()=>a(),disabled:n||i,style:{background:"var(--win-accent, #0078D4)",border:"none",borderRadius:6,padding:"6px 14px",color:"#fff",fontSize:12,fontWeight:500,cursor:"pointer",display:"flex",alignItems:"center",gap:4,opacity:n||i?.6:1},children:[n?e.jsx(ee,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(U,{className:"h-3.5 w-3.5"}),"Start"]})]})}):e.jsxs("div",{className:S(r),style:{background:"var(--win-bg-layer2, #2C2C2C)",border:`1px solid ${o?"rgba(249,115,22,0.4)":"var(--win-divider, rgba(255,255,255,0.08))"}`,borderRadius:10,overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--win-divider, rgba(255,255,255,0.08))"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(k,{className:"h-4 w-4",style:{color:o?"#F97316":"var(--win-text-secondary)"}}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--win-text-primary)"},children:"Power Hour"})]}),o&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,background:"rgba(249,115,22,0.15)",borderRadius:12,padding:"2px 10px",fontSize:11,fontWeight:600,color:"#F97316"},children:[e.jsx(C,{className:"h-3 w-3"})," ",m,"x ACTIVE"]})]}),e.jsx("div",{style:{padding:16},children:o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{textAlign:"center",padding:"16px 0"},children:[e.jsx("div",{style:{fontSize:40,fontFamily:"monospace",fontWeight:700,color:"#F97316",letterSpacing:2},children:c}),e.jsx("div",{style:{fontSize:11,color:"var(--win-text-secondary)",marginTop:4},children:"remaining"}),e.jsx(P,{value:w,className:"h-1.5 mt-4 [&>div]:bg-gradient-to-r [&>div]:from-orange-500 [&>div]:to-red-500"})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8,margin:"12px 0"},children:[{icon:_,value:l.calls,label:"Calls",color:"#3B82F6"},{icon:ne,value:l.connects,label:"Connects",color:"#8B5CF6"},{icon:Q,value:Math.floor(l.talkTime/60),label:"Talk Min",color:"#10B981"}].map(p=>e.jsxs("div",{style:{textAlign:"center",padding:10,borderRadius:8,background:"rgba(255,255,255,0.04)"}
1,children:[e.jsx(p.icon,{className:"h-3.5 w-3.5",style:{margin:"0 auto 4px",color:p.color}}),e.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--win-text-primary)",fontFamily:"monospace"},children:p.value}),e.jsx("div",{style:{fontSize:10,color:"var(--win-text-secondary)"},children:p.label})]},p.label))}),e.jsxs("div",{style:{padding:10,borderRadius:8,background:"rgba(249,115,22,0.08)",border:"1px solid rgba(249,115,22,0.2)",display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsx("span",{style:{fontSize:12,fontWeight:500,color:"var(--win-text-primary)"},children:"Points Multiplier"}),e.jsx("span",{style:{fontSize:16,fontWeight:700,color:"#F97316"},children:"2x"})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("a",{href:"/reseller/dialler",style:{flex:1,textDecoration:"none"},children:e.jsxs(K,{className:"w-full gap-2",children:[e.jsx(_,{className:"h-4 w-4"})," Open Dialler"]})}),e.jsxs(K,{variant:"outline",onClick:()=>g(),className:"gap-1",children:[e.jsx(Be,{className:"h-4 w-4"})," End"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{textAlign:"center",padding:"20px 0"},children:[e.jsx("div",{style:{width:56,height:56,borderRadius:28,background:"rgba(249,115,22,0.1)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 12px"},children:e.jsx(k,{className:"h-8 w-8",style:{color:"#F97316"}})}),e.jsx("div",{style:{fontSize:16,fontWeight:600,color:"var(--win-text-primary)",marginBottom:4},children:"Focus Mode"}),e.jsxs("div",{style:{fontSize:12,color:"var(--win-text-secondary)",marginBottom:16},children:["60 min session — earn ",e.jsx("span",{style:{color:"#F97316",fontWeight:600},children:"2x points"})]}),e.jsxs("button",{onClick:()=>a(),disabled:n||i,style:{background:"linear-gradient(135deg, #F97316, #EF4444)",border:"none",borderRadius:8,padding:"10px 24px",color:"#fff",fontSize:14,fontWeight:600,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:8,opacity:n||i?.6:1},children:[n?e.jsx(ee,{className:"h-5 w-5 animate-spin"}):e.jsx(U,{className:"h-5 w-5"}),"Start Power Hour"]})]}),!s&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,paddingTop:14,borderTop:"1px solid var(--win-divider)"},children:[{icon:I,value:t,label:"Total Sessions",color:"#EAB308"},{icon:C,value:h,label:"This Month",color:"#F97316"}].map(p=>e.jsxs("div",{style:{textAlign:"center",padding:10,borderRadius:8,background:"rgba(255,255,255,0.04)"},children:[e.jsx(p.icon,{className:"h-3.5 w-3.5",style:{margin:"0 auto 4px",color:p.color}}),e.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--win-text-primary)"},children:p.value}),e.jsx("div",{style:{fontSize:10,color:"var(--win-text-secondary)"},children:p.label})]},p.label))})]})})]})}const br=[{icon:_,label:"Dialler",href:"/reseller/dialler",gradient:"linear-gradient(135deg, hsl(215 90% 55%), hsl(225 90% 50%))",glow:"hsl(215 90% 55% / 0.45)"},{icon:Te,label:"Contacts",href:"/reseller/contacts",gradient:"linear-gradient(135deg, hsl(165 75% 45%), hsl(180 80% 40%))",glow:"hsl(170 75% 45% / 0.45)"},{icon:$e,label:"Companies",href:"/reseller/companies",gradient:"linear-gradient(135deg, hsl(220 25% 50%), hsl(220 25% 35%))",glow:"hsl(220 25% 45% / 0.4)"},{icon:ze,label:"Pipeline",href:"/reseller/pipeline",gradient:"linear-gradient(135deg, hsl(265 80% 60%), hsl(280 80% 55%))",glow:"hsl(270 80% 60% / 0.45)"},{icon:ie,label:"Lead Finder",href:"/reseller/lead-finder",gradient:"linear-gradient(135deg, hsl(155 75% 45%), hsl(170 75% 40%))",glow:"hsl(160 75% 45% / 0.45)"},{icon:rr,label:"Prospecting",href:"/reseller/prospecting",gradient:"linear-gradient(135deg, hsl(330 85% 60%), hsl(345 85% 55%))",glow:"hsl(335 85% 60% / 0.45)"},{icon:$,label:"AI Assistant",href:"/reseller/assistant",gradient:"linear-gradient(135deg, hsl(285 85% 65%), hsl(265 85% 60%))",glow:"hsl(275 85% 65% / 0.45)"},{icon:xe,label:"Scripts",href:"/reseller/scripts",gradient:"linear-gradient(135deg, hsl(35 90% 55%), hsl(20 90% 55%))",glow:"hsl(28 90% 55% / 0.45)"},{icon:Le,label:"Products",href:"/reseller/products",gradient:"linear-gradient(135deg, hsl(260 75% 60%), hsl(245 75% 55%))",glow:"hsl(252 75% 60% / 0.45)"},{icon:Ke,label:"Demos",href:"/reseller/demos",gradient:"linear-gradient(135deg, hsl(0 80% 60%), hsl(15 80% 55%))",glow:"hsl(8 80% 60% / 0.45)"},{icon:le,label:"Training",href:"/reseller/training",gradient:"linear-gradient(135deg, hsl(190 85% 55%), hsl(205 85% 50%))",glow:"hsl(195 85% 55% / 0.45)"},{icon:V,label:"Rewards",href:"/reseller/rewards",gradient:"linear-gradient(135deg, hsl(45 95% 55%), hsl(35 95% 55%))",glow:"hsl(40 95% 55% / 0.5)"},{icon:I,label:"Leaderboard",href:"/reseller/leaderboard",gradient:"linear-gradient(135deg, hsl(45 90% 55%), hsl(30 90% 50%))",glow:"hsl(38 90% 55% / 0.5)"},{icon:qe,label:"Performance",href:"/reseller/performance",gradient:"linear-gradient(135deg, hsl(220 80% 60%), hsl(235 80% 55%))",glow:"hsl(225 80% 60% / 0.45)"},{icon:tr,label:"Call History",href:"/reseller/call-history",gradient:"linear-gradient(135deg, hsl(220 20% 55%), hsl(220 20% 40%))",glow:"hsl(220 20% 50% / 0.4)"},{icon:Oe,label:"Marketplace",href:"/reseller/lead-marketplace",gradient:"linear-gradient(135deg, hsl(140 70% 45%), hsl(160 70% 40%))",glow:"hsl(150 70% 45% / 0.45)"},{icon:oe,label:"Invoices",href:"/reseller/invoices",gradient:"linear-gradient(135deg, hsl(170 70% 45%), hsl(185 70% 40%))",glow:"hsl(178 70% 45% / 0.45)"},{icon:me,label:"White Label",href:"/reseller/white-label",gradient:"linear-gradient(135deg, hsl(210 30% 55%), hsl(210 30% 40%))",glow:"hsl(210 30% 50% / 0.4)"},{icon:he,label:"Chatbot",href:"/reseller/chatbot",gradient:"linear-gradient(135deg, hsl(290 75% 60%), hsl(305 75% 55%))",glow:"hsl(298 75% 60% / 0.45)"}],te={Bronze:"hsl(28 70% 55%)",Silver:"hsl(215 15% 70%)",Gold:"hsl(45 95% 55%)",Platinum:"hsl(190 85% 65%)"};function jr(){var h,w;const{effectiveUser:r}=N(),{data:s}=ae(),o=be(),{data:i}=je(),c=((w=(h=r==null?void 0:r.user_metadata)==null?void 0:h.full_name)==null?void 0:w.split(" ")[0])||"Reseller",d=(s==null?void 0:s.current_streak_days)??0,l=(s==null?void 0:s.rank)??"Bronze",a=(s==null?void 0:s.level)??1,g=te[l]??te.Bronze,n=(i==null?void 0:i.total_calls)??0,m=(i==null?void 0:i.connected_calls)??0,t=(i==null?void 0:i.points_earned)??0;return e.jsxs("div",{className:"px-4 pt-4 pb-2 space-y-5",children:[e.jsxs("section",{className:"relative overflow-hidden rounded-3xl border border-white/[0.08] p-5",style:{background:"linear-gradient(135deg, hsl(265 85% 28%), hsl(225 85% 22%) 55%, hsl(190 85% 25%))",boxShadow:"0 18px 50px -18px hsl(265 85% 30% / 0.6), inset 0 1px 0 0 rgba(255,255,255,0.08)"}
1,children:[e.jsx("div",{"aria-hidden":!0,className:"absolute -top-16 -right-10 w-56 h-56 rounded-full pointer-events-none",style:{background:"radial-gradient(closest-side, hsl(190 85% 65% / 0.45), transparent 70%)"}}),e.jsx("div",{"aria-hidden":!0,className:"absolute -bottom-20 -left-12 w-64 h-64 rounded-full pointer-events-none",style:{background:"radial-gradient(closest-side, hsl(285 85% 60% / 0.4), transparent 70%)"}}),e.jsxs("div",{className:"relative flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[12px] uppercase tracking-[0.14em] font-semibold text-white/60",children:"Welcome back"}),e.jsx("h1",{className:"text-[26px] leading-tight font-bold text-white mt-0.5 truncate",children:c}),e.jsx("p",{className:"text-[13px] text-white/70 mt-1 inline-flex items-center gap-1.5",children:d>0?e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"w-3.5 h-3.5",style:{color:"hsl(28 95% 60%)"}}),d," day streak — keep it going"]}):"Ready to crush your targets today?"})]}),e.jsx(A,{variant:"compact"})]}),e.jsxs("div",{className:"relative mt-5 flex items-end gap-3",children:[e.jsx(Re,{className:"w-7 h-7",style:{color:g,marginBottom:2}}),e.jsx("div",{className:"text-[44px] font-bold text-white leading-none tabular-nums tracking-tight",children:o.toLocaleString()}),e.jsx("div",{className:"text-[13px] text-white/70 mb-1.5",children:"points"})]}),e.jsxs("div",{className:"relative mt-4 flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] font-semibold border",style:{color:g,borderColor:`${g.replace(")"," / 0.4)")}`,background:`${g.replace(")"," / 0.12)")}`},children:[e.jsx(I,{className:"w-3 h-3"}),l," · Level ",a]}),d>0&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] font-semibold border",style:{color:"hsl(28 95% 65%)",borderColor:"hsl(28 95% 60% / 0.4)",background:"hsl(28 95% 60% / 0.12)"},children:[e.jsx(C,{className:"w-3 h-3"}),d,"d streak"]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] font-semibold border",style:{color:"hsl(155 70% 65%)",borderColor:"hsl(155 70% 50% / 0.4)",background:"hsl(155 70% 50% / 0.12)"},children:[e.jsx(k,{className:"w-3 h-3"}),"Daily payments"]})]}),e.jsxs(M,{to:"/reseller/dialler",className:"relative mt-5 flex items-center justify-center gap-2 w-full h-12 rounded-2xl font-semibold text-[15px] active:scale-[0.98] transition-transform",style:{background:"linear-gradient(180deg, hsl(0 0% 100%), hsl(0 0% 96%))",color:"hsl(222 47% 11%)",boxShadow:"0 10px 24px -8px rgba(0,0,0,0.45), inset 0 1px 0 0 rgba(255,255,255,0.5)"},children:[e.jsx(_,{className:"w-5 h-5",strokeWidth:2.4}),"Start dialling"]})]}),e.jsxs("section",{className:"grid grid-cols-3 gap-2.5",children:[e.jsx(H,{label:"Calls",value:n,accent:"hsl(215 90% 60%)"}),e.jsx(H,{label:"Connected",value:m,accent:"hsl(155 75% 50%)"}),e.jsx(H,{label:"Points",value:t,accent:"hsl(45 95% 55%)"})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 px-0.5",children:[e.jsx("h2",{className:"text-[12px] uppercase tracking-[0.14em] font-bold text-white/55",children:"Apps"}),e.jsxs(M,{to:"/reseller/leaderboard",className:"text-[12px] font-semibold text-white/70 active:text-white inline-flex items-center gap-1",children:[e.jsx(pe,{className:"w-3.5 h-3.5"}),"Find"]})]}),e.jsx("div",{className:"grid gap-x-1.5 gap-y-4",style:{gridTemplateColumns:"repeat(4, minmax(0, 1fr))"},children:br.map(p=>e.jsx(vr,{app:p},p.href))})]}),e.jsx("section",{children:e.jsxs(M,{to:"/reseller/leaderboard",className:"flex items-center justify-between rounded-2xl p-4 border border-white/[0.08] active:scale-[0.99] transition-transform",style:{background:"linear-gradient(135deg, hsl(45 95% 50% / 0.15), hsl(35 95% 50% / 0.08))",boxShadow:"0 8px 24px -12px hsl(45 95% 50% / 0.4)"},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, hsl(45 95% 55%), hsl(30 95% 50%))",boxShadow:"0 6px 18px -4px hsl(40 95% 50% / 0.55)"},children:e.jsx(I,{className:"w-5 h-5 text-white",strokeWidth:2.4})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[15px] font-semibold text-white",children:"Leaderboard"}),e.jsx("div",{className:"text-[12px] text-white/60 truncate",children:"See where you rank this week"})]})]}),e.jsx(sr,{className:"w-5 h-5 text-white/70 flex-shrink-0"})]})}),e.jsx("div",{className:"h-2"})]})}function H({label:r,value:s,accent:o}){return e.jsxs("div",{className:"rounded-2xl p-3 border border-white/[0.08]",style:{background:"linear-gradient(180deg, hsl(222 47% 10% / 0.7), hsl(222 47% 7% / 0.7))",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)"},children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:o},children:r}),e.jsx("div",{className:"text-[22px] leading-none font-bold text-white tabular-nums",children:s})]})}function vr({app:r}){const s=r.icon;return e.jsxs(M,{to:r.href,className:"flex flex-col items-center gap-1.5 active:scale-[0.93] transition-transform",children:[e.jsx("div",{className:"w-[60px] h-[60px] rounded-[18px] flex items-center justify-center relative",style:{background:r.gradient,boxShadow:`0 8px 20px -6px ${r.glow}, inset 0 1px 0 0 rgba(255,255,255,0.12)`},children:e.jsx(s,{className:"w-7 h-7 text-white",strokeWidth:2.2,style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.25))"}})}),e.jsx("span",{className:"text-[11px] font-medium text-white/85 text-center leading-tight px-0.5 truncate w-full",style:{textShadow:"0 1px 2px rgba(0,0,0,0.5)"},children:r.label})]})}const wr=[{id:"marketing",name:"Marketing",price:"From £2,500/mo",commission:"20% + 5% recurring",icon:Ue,color:"#3B82F6"},{id:"ai",name:"AI Subscription",price:"From £799/mo",commission:"20% recurring",icon:he,color:"#8B5CF6"},{id:"website",name:"Website",price:"From £999",commission:"20% first invoice",icon:me,color:"#10B981"},{id:"seo",name:"SEO",price:"From £999/mo",commission:"20% first invoice",icon:pe,color:"#F59E0B"},{id:"app-building",name:"AI App Building",price:"From £19,995",commission:"20% = £3,999+",icon:$,color:"#EC4899",highlight:!0}],Sr=[{id:"dialler",label:"Dialler",icon:_,href:"/reseller/dialler",color:"#3B82F6",gradient:"linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05))"},{id:"lead-finder",label:"Lead Finder",icon:ie,href:"/reseller/lead-finder",color:"#10B981",gradient:"linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05))"},{id:"scripts",label:"Scripts",icon:xe,href:"/reseller/scripts",color:"#F59E0B",gradient:"linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05))"},{id:"demos",label:"Demos",icon:U,href:"/reseller/demos",color:"#EF4444",gradient:"linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05))"},{id:"products",label:"Products",icon:de,href:"/reseller/products",color:"#8B5CF6",gradient:"linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05))"},{id:"prospecting",label:"Prospecting",icon:E,href:"/reseller/prospecting",color:"#EC4899",gradient:"linear-gradient(135deg, rgba(236,72,153,0.15), rgba(236,72,153,0.05))"},{id:"training",label:"Training",icon:le,href:"/reseller/training",color:"#06B6D4",gradient:"linear-gradient(135deg, rgba(6,182,212,0.15), rgba(6,182,212,0.05))"},{id:"invoices",label:"Invoices",icon:oe,href:"/reseller/invoices",color:"#14B8A6",gradient:"linear-gradient(135deg, rgba(20,184,166,0.15), rgba(20,184,166,0.05))"}],kr=[{label:"Rank",key:"rank",icon:I,color:"#F59E0B",gradient:"linear-gradient(135deg, rgba(245,158,11,0.18), rgba(245,158,11,0.04))",glowColor:"rgba(245,158,11,0.25)"},{label:"Level",key:"level",icon:ge,color:"#3B82F6",gradient:"linear-gradient(135deg, rgba(59,130,246,0.18), rgba(59,130,246,0.04))",glowColor:"rgba(59,130,246,0.25)"},{label:"Streak",key:"streak",icon:C,color:"#EF4444",gradient:"linear-gradient(135deg, rgba(239,68,68,0.18), rgba(239,68,68,0.04))",glowColor:"rgba(239,68,68,0.25)"},{label:"Longest Streak",key:"longestStreak",icon:k,color:"#10B981",gradient:"linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.04))",glowColor:"rgba(16,185,129,0.25)"}],f={font:"'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif",accent:"var(--win-accent, #0078D4)",divider:"var(--win-divider, rgba(255,255,255,0.08))",text1:"var(--win-text-primary, #fff)",text2:"var(--win-text-secondary, rgba(255,255,255,0.6))"};function R({children:r,style:s,onClick:o,hover:i=!0,glowColor:c,...d}){return e.jsx("div",{style:{background:"rgba(255,255,255,0.04)",border:`1px solid ${f.divider}`,borderRadius:10,backdropFilter:"blur(12px)",transition:"border-color 0.2s, box-shadow 0.2s, transform 0.15s",...s},onClick:o,onMouseEnter:i?l=>{l.currentTarget.style.borderColor="rgba(255,255,255,0.18)",l.currentTarget.style.boxShadow=c?`0 8px 32px rgba(0,0,0,0.35), 0 0 20px ${c}`:"0 8px 32px rgba(0,0,0,0.35)",l.currentTarget.style.transform="translateY(-2px)"}:void 0,onMouseLeave:i?l=>{l.currentTarget.style.borderColor=f.divider,l.currentTarget.style.boxShadow="none",l.currentTarget.style.transform="translateY(0)"}:void 0,...d,children:r})}function se(){return e.jsxs("div",{style:{padding:24,background:"transparent"},children:[e.jsx("div",{style:{height:80,borderRadius:12,background:"rgba(255,255,255,0.03)",marginBottom:16}}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:12,marginBottom:16},children:[1,2,3,4].map(r=>e.jsx("div",{style:{height:90,borderRadius:10,background:"rgba(255,255,255,0.03)"}},r))}),e.jsx("div",{style:{height:200,borderRadius:12,background:"rgba(255,255,255,0.03)"}})]})}function Ur(){var n,m;const{effectiveUser:r}=N(),{data:s,isLoading:o}=ae(),i=De(),c=Fe();ye("reseller",{"New Lead":()=>{},Dialler:()=>{},Pipeline:()=>{}});const d=((m=(n=r==null?void 0:r.user_metadata)==null?void 0:n.full_name)==null?void 0:m.split(" ")[0])||"Reseller",l=(s==null?void 0:s.current_streak_days)||0;if(c&&!i)return e.jsx(q,{children:e.jsx(jr,{})});if(o)return i?e.jsx(se,{}):e.jsx(q,{children:e.jsx(se,{})});const a={rank:(s==null?void 0:s.rank)||"Bronze",level:(s==null?void 0:s.level)||1,streak:`${l} days`,longestStreak:`${(s==null?void 0:s.longest_streak_days)||0} days`},g=e.jsxs("div",{style:{fontFamily:f.font,color:f.text1,padding:i?20:16,minHeight:"100%",background:"transparent"},children:[e.jsxs("div",{style:{background:`linear-gradient(135deg, ${f.accent}, rgba(139,92,246,0.5), rgba(236,72,153,0.3))`,borderRadius:12,padding:"20px 24px",marginBottom:20,border:"1px solid rgba(255,255,255,0.15)",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12,backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.12)"},children:[e.jsxs("div",{children:[e.jsxs("h1",{style:{fontSize:22,fontWeight:600,margin:0,color:"#fff"},children:["Welcome back, ",d]}),e.jsx("p",{style:{fontSize:13,margin:"4px 0 0",opacity:.85},children:l>0?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(C,{className:"h-4 w-4",style:{color:"#FBBF24"}}),l," day streak — keep it going!"]}):"Ready to crush your targets today?"})]}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[e.jsx(A,{variant:"compact"}),e.jsx("a",{href:"/reseller/rewards",children:e.jsxs("button",{style:{background:"rgba(255,255,255,0.15)",border:"1px solid rgba(255,255,255,0.25)",borderRadius:8,padding:"7px 16px",color:"#fff",fontSize:12,fontWeight:500,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6,transition:"background 0.15s, transform 0.15s"},onMouseEnter:t=>{t.currentTarget.style.background="rgba(255,255,255,0.25)"},onMouseLeave:t=>{t.currentTarget.style.background="rgba(255,255,255,0.15)"}
1,children:[e.jsx(V,{className:"h-3.5 w-3.5",style:{color:"#FBBF24"}})," Rewards"]})}),e.jsx("a",{href:"/reseller/dialler",children:e.jsxs("button",{style:{background:"#fff",border:"none",borderRadius:8,padding:"7px 16px",color:"#1e293b",fontSize:12,fontWeight:600,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6,transition:"opacity 0.15s",boxShadow:"0 2px 8px rgba(0,0,0,0.2)"},onMouseEnter:t=>{t.currentTarget.style.opacity="0.9"},onMouseLeave:t=>{t.currentTarget.style.opacity="1"},children:[e.jsx(_,{className:"h-3.5 w-3.5"})," Start Dialling"]})})]})]}),e.jsx("div",{style:{marginBottom:20},children:e.jsx(We,{variant:"large"})}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:12,marginBottom:20},children:kr.map(t=>e.jsxs(R,{glowColor:t.glowColor,style:{padding:"14px 16px",background:t.gradient,borderColor:`${t.color}30`},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:e.jsx("div",{style:{padding:7,borderRadius:8,background:`${t.color}20`,boxShadow:`0 0 12px ${t.color}25`},children:e.jsx(t.icon,{className:"h-4 w-4",style:{color:t.color}})})}),e.jsx("div",{style:{fontSize:22,fontWeight:700,letterSpacing:"-0.02em"},children:a[t.key]}),e.jsx("div",{style:{fontSize:11,color:f.text2,marginTop:2},children:t.label})]},t.label))}),e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("h2",{style:{fontSize:14,fontWeight:600,marginBottom:10,color:f.text2,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Quick Actions"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:10},children:Sr.map(t=>e.jsx("a",{href:t.href,style:{textDecoration:"none"},children:e.jsxs(R,{glowColor:`${t.color}40`,style:{padding:"16px 12px",textAlign:"center",cursor:"pointer",background:t.gradient,borderColor:`${t.color}25`},children:[e.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:8},children:e.jsx("div",{style:{padding:10,borderRadius:10,background:`${t.color}18`,boxShadow:`0 0 16px ${t.color}20`},children:e.jsx(t.icon,{className:"h-5 w-5",style:{color:t.color}})})}),e.jsx("span",{style:{fontSize:12,fontWeight:500,color:f.text1},children:t.label})]})},t.id))})]}),e.jsxs(R,{glowColor:"rgba(16,185,129,0.2)",style:{padding:"14px 18px",marginBottom:20,display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12,background:"linear-gradient(135deg, rgba(16,185,129,0.1), rgba(59,130,246,0.06))",borderColor:"rgba(16,185,129,0.2)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{padding:8,borderRadius:8,background:"rgba(16,185,129,0.15)",boxShadow:"0 0 12px rgba(16,185,129,0.2)"},children:e.jsx(de,{className:"h-5 w-5",style:{color:"#10B981"}})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:13,fontWeight:600},children:"Your Commission Structure"}),e.jsxs("div",{style:{fontSize:12,color:f.text2,marginTop:2},children:["Earn ",e.jsx("strong",{style:{color:"#10B981"},children:"20% on first invoice"})," + ",e.jsx("strong",{style:{color:"#3B82F6"},children:"5% recurring"})," on marketing"]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsxs("div",{style:{textAlign:"right"},children:[e.jsx("div",{style:{fontSize:10,color:f.text2},children:"Payments"}),e.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"#10B981",display:"flex",alignItems:"center",gap:4},children:[e.jsx(k,{className:"h-3 w-3"})," DAILY"]})]}),e.jsx("a",{href:"/reseller/products",children:e.jsxs("button",{style:{background:"rgba(16,185,129,0.12)",border:"1px solid rgba(16,185,129,0.3)",borderRadius:8,padding:"7px 14px",color:"#10B981",fontSize:11,fontWeight:600,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:4,transition:"background 0.15s"},onMouseEnter:t=>{t.currentTarget.style.background="rgba(16,185,129,0.22)"},onMouseLeave:t=>{t.currentTarget.style.background="rgba(16,185,129,0.12)"},children:["View Products ",e.jsx(O,{className:"h-3 w-3"})]})})]})]}),e.jsxs("div",{style:{marginBottom:20},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:10},children:[e.jsx("h2",{style:{fontSize:14,fontWeight:600,color:f.text2,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Products You Can Sell"}),e.jsxs("a",{href:"/reseller/products",style:{fontSize:11,color:f.accent,textDecoration:"none",display:"flex",alignItems:"center",gap:4},children:["See All ",e.jsx(O,{className:"h-3 w-3"})]})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:10},children:wr.map(t=>e.jsxs(R,{glowColor:`${t.color}35`,style:{padding:14,position:"relative",background:`linear-gradient(135deg, ${t.color}15, ${t.color}05)`,borderColor:`${t.color}30`},children:[t.highlight&&e.jsx("div",{style:{position:"absolute",top:8,right:8,background:`linear-gradient(135deg, ${t.color}, ${t.color}CC)`,color:"#fff",fontSize:9,fontWeight:700,padding:"2px 8px",borderRadius:6,boxShadow:`0 2px 8px ${t.color}50`},children:"NEW"}),e.jsx("div",{style:{width:36,height:36,borderRadius:10,background:`${t.color}20`,display:"flex",alignItems:"center",justifyContent:"center",marginBottom:10,boxShadow:`0 0 16px ${t.color}20`},children:e.jsx(t.icon,{className:"h-4.5 w-4.5",style:{color:t.color,width:18,height:18}})}),e.jsx("div",{style:{fontSize:13,fontWeight:600,marginBottom:2},children:t.name}),e.jsx("div",{style:{fontSize:11,color:f.text2,marginBottom:6},children:t.price}
1),e.jsxs("div",{style:{fontSize:10,color:"#10B981",fontWeight:500,display:"flex",alignItems:"center",gap:3},children:[e.jsx(ar,{className:"h-3 w-3"})," ",t.commission]})]},t.id))})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:16,marginBottom:20},children:[e.jsx(Me,{}),e.jsx(yr,{compact:!0})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:16},children:[e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:16},children:e.jsx(ir,{})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(mr,{compact:!0}),e.jsx(dr,{compact:!0}),e.jsx(A,{variant:"detailed"}),e.jsxs(R,{glowColor:"rgba(236,72,153,0.2)",style:{padding:16,background:"linear-gradient(135deg, rgba(236,72,153,0.1), rgba(139,92,246,0.06))",borderColor:"rgba(236,72,153,0.2)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:10},children:[e.jsx($,{className:"h-4 w-4",style:{color:"#EC4899"}}),e.jsx("span",{style:{fontSize:13,fontWeight:600},children:"Hot Product"}),e.jsx("span",{style:{fontSize:9,fontWeight:700,background:"linear-gradient(135deg, #EC4899, #8B5CF6)",color:"#fff",padding:"2px 8px",borderRadius:6},children:"NEW"})]}),e.jsx("div",{style:{fontSize:12,color:f.text2,marginBottom:10},children:"AI App Building — sell custom AI-powered apps from £19,995"}),e.jsxs("div",{style:{background:"rgba(16, 185, 129, 0.1)",border:"1px solid rgba(16, 185, 129, 0.25)",borderRadius:8,padding:"10px 12px",marginBottom:10},children:[e.jsxs("div",{style:{fontSize:13,fontWeight:600,color:"#10B981"},children:["Your commission: ",e.jsx("span",{style:{fontSize:18,fontWeight:700},children:"£3,999+"})]}),e.jsx("div",{style:{fontSize:10,color:f.text2},children:"per sale (20%)"})]}),e.jsx("a",{href:"/reseller/scripts",children:e.jsxs("button",{style:{width:"100%",background:"linear-gradient(135deg, rgba(236,72,153,0.12), rgba(139,92,246,0.08))",border:"1px solid rgba(236,72,153,0.25)",borderRadius:8,padding:"8px 12px",color:"#EC4899",fontSize:12,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:6,transition:"background 0.15s"},onMouseEnter:t=>{t.currentTarget.style.background="rgba(236,72,153,0.2)"},onMouseLeave:t=>{t.currentTarget.style.background="linear-gradient(135deg, rgba(236,72,153,0.12), rgba(139,92,246,0.08))"},children:["Get Sales Scripts ",e.jsx(O,{className:"h-3 w-3"})]})})]})]})]})]});return i?g:e.jsx(q,{children:g})}export{Ur 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.