PageSourceSearch

https://deal-savvy-stacks-ai.vercel.app/assets/SimplifiedDashboard-DSvrVtW2.js

js deal-savvy-stacks-ai.vercel.app collected 2026-10-03 06:33:28 UTC 14,908 bytes, 10 lines download raw bytes

1import{f as g,j as e}from"./vendor-react-Dqm4a0k5.js";import{N as S}from"./MobileTabGrid-JEar-RlT.js";import{C as x,a as N,B as p,e as w,f as _,g as k,c as v,u as L}from"./index-BHf2tiJc.js";import{u as f}from"./use-toast-BX82szIn.js";import{ar as h,T as C,D as A,p as b,a as $,af as z,j as I,au as D,a5 as T}from"./vendor-icons-Dv6Y7wXg.js";import{h as P,g as U}from"./TrialEndedToast-CrcZO6YR.js";import{a as B}from"./vendor-utils-KLhAiGEE.js";import{U as E}from"./UncategorizedProductsBanner-Ci4-IMn4.js";import{M as V,a as O,b as W}from"./MobileOptimizedLayout-BnqD3pjO.js";import{M as y,d as H,e as K}from"./ComprehensiveEmailSystemTester-CuqbATBk.js";import{a as Q,j as F}from"./FullShell-CiznBeeB.js";import{u as Y,W as j}from"./WidgetErrorBoundary-D7BFYu5I.js";import{u as q}from"./useDashboardMetrics-BYsgfhp4.js";import"./Breadcrumbs-kri267LD.js";import"./tapIntent-BgrE-drh.js";import"./vendor-query-BQV4-hhd.js";import"./MobilePageTransitionAnimated-DvKDXSCu.js";import"./vendor-motion-uI1IlCbt.js";import"./vendor-radix-DFc8vCWX.js";import"./radix-react-compose-refs-IIetlP92.js";import"./radix-react-slot-CrO6XSQS.js";import"./shimmer-e-hacH0I.js";import"./useSupportTickets-CIRwQa3a.js";import"./validation-CVdXWsbw.js";import"./licenseCodes-C4f8VhAY.js";import"./bulkCategorize-CIBeF6EK.js";import"./theme-logo-aRv7589c.js";import"./useEarnStack-BpQk6kZ4.js";import"./useWatchlistFlag-BK-hUZt6.js";import"./CommandPalette-DVkaRD5W.js";import"./command-DtbJTXeT.js";import"./useOwnedToolCount-BTZwZu6r.js";import"./vendor-supabase-RijQlDjE.js";import"./useDebounce-C_KKe4Ko.js";import"./PlanComparisonDrawer-Bd1MPSPI.js";import"./usePlanManagement-COMtkkWI.js";import"./featureVisits-3dg9nsFu.js";import"./useTeamTools-akNJYVco.js";import"./useBugReports-hokBZi0c.js";import"./PageHeader-kDn446Do.js";import"./ConsoleKit-CGUSjAVc.js";import"./dropdown-menu-Cy-wqCfB.js";function G({metrics:o}){const r=g(),n=f();if(!o)return e.jsx("div",{className:`grid gap-4 ${n?"grid-cols-1":"grid-cols-3"}`,children:[1,2,3].map(a=>e.jsx(x,{className:"p-6 animate-pulse",children:e.jsx("div",{className:"h-20 bg-muted rounded"})},a))});const c=[{title:"Active Tools",value:o.active_tools,description:"Ready to use",icon:h,action:()=>r("/app/tools?status=Purchased,Redeemed,Activated"),variant:"default",priority:1},{title:"Need Attention",value:o.expiring_tools+o.refund_window_tools,description:"Deadlines approaching",icon:C,action:()=>r("/app/tools?attention=true"),variant:o.expiring_tools+o.refund_window_tools>0?"destructive":"outline",priority:2},{title:"Investment",value:`$${o.total_investment.toFixed(0)}`,description:"Total invested",icon:A,action:()=>r("/app/tools?view=financial"),variant:"secondary",priority:3}];return e.jsx("div",{className:`grid gap-4 ${n?"grid-cols-1":"grid-cols-3"}`,children:c.map(a=>{const i=a.icon,l=a.priority<=2,t=a.title==="Need Attention"&&typeof a.value=="number"&&a.value>0;return e.jsx(x,{className:`
2              cursor-pointer transition-all duration-200 hover:shadow-md
3              ${t?"border-destructive/50 bg-destructive/5":""}
4              ${l?"border-primary/30":""}
5            `,onClick:a.action,children:e.jsxs(N,{className:"p-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(i,{className:`h-5 w-5 ${t?"text-destructive":"text-primary"}`}),e.jsx("h3",{className:"font-medium text-foreground",children:a.title})]}),e.jsx("div",{className:`text-2xl font-bold ${t?"text-destructive":"text-foreground"}`,children:a.value}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.description})]}),t&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-destructive animate-pulse"})]}),n&&e.jsx(p,{variant:"ghost",size:"sm",className:"w-full mt-3 text-xs",onClick:s=>{s.stopPropagation(),a.action()},children:"View Details →"})]})},a.title)})})}function J({tools:o}){const r=g(),n=f(),c=o.filter(i=>i.last_accessed||i.created_at).sort((i,l)=>{const t=new Date(i.last_accessed||i.created_at||0);return new Date(l.last_accessed||l.created_at||0).getTime()-t.getTime()}).slice(0,n?3:6),a=i=>{const l=U(i);l?window.open(l,"_blank","noopener,noreferrer"):r("/app/tools")};return c.length===0?e.jsxs(x,{children:[e.jsx(w,{children:e.jsxs(_,{className:"flex items-center gap-2 text-lg",children:[e.jsx(b,{className:"h-5 w-5"}),"Recent Tools"]})}),e.jsx(N,{children:e.jsxs("div",{className:"text-center py-8",children:[e.jsx(b,{className:"h-8 w-8 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"No recent activity"}),e.jsx(p,{variant:"outline",onClick:()=>r("/app/tools"),children:"Browse Tools"})]})})]}):e.jsxs(x,{className:"min-w-0 max-w-full overflow-hidden",children:[e.jsx(w,{className:"pb-3 min-w-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(_,{className:"flex items-center gap-2 text-lg",children:[e.jsx(b,{className:"h-5 w-5"}),"Recent Tools"]}),e.jsxs(p,{variant:"ghost",size:"sm",onClick:()=>r("/app/tools"),className:"gap-1",children:["View All",e.jsx($,{className:"h-4 w-4"})]})]})}),e.jsxs(N,{className:"pt-0 min-w-0 overflow-hidden",children:[e.jsx("div",{className:`grid gap-3 min-w-0 ${n?"grid-cols-1":"grid-cols-2 lg:grid-cols-3"}`,children:c.map(i=>{const l=i.last_accessed||i.created_at,t=l?B(new Date(l),{addSuffix:!0}):null;return e.jsx("div",{role:"button",tabIndex:0,className:"p-3 rounded-lg border border-border/50 hover:border-primary/50 transition-all cursor-pointer group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",onClick:()=>a(i),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),a(i))},children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("h4",{className:"font-medium text-sm group-hover:text-primary transition-colors line-clamp-1",children:i.title}),P(i)&&e.jsx(z,{className:"h-3 w-3 text-muted-foreground group-hover:text-primary transition-colors flex-shrink-0"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[i.category&&e.jsx(k,{variant:"outline",className:"text-xs",children:i.category}),t&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t})]})]})},i.id)})}),n&&c.length>3&&e.jsx(p,{variant:"ghost",className:"w-full mt-3",onClick:()=>r("/app/tools"),children:"View All Tools"})]})]})}function X({products:o,metrics:r}
5){const n=g(),c=f();if(!r)return null;const a=r.expiring_tools>0,i=r.refund_window_tools>0,l=o.some(s=>!s.category),t=[];if(a&&t.push({id:"expiring",title:"Expiring Soon",description:`${r.expiring_tools} tool${r.expiring_tools!==1?"s":""} expire within 7 days`,icon:b,variant:"destructive",action:()=>n("/app/tools?expiring=true"),priority:1}),i&&t.push({id:"refund",title:"Refund Window",description:`${r.refund_window_tools} tool${r.refund_window_tools!==1?"s":""} can still be refunded`,icon:C,variant:"warning",action:()=>n("/app/tools?refund=true"),priority:2}),l){const s=o.filter(d=>!d.category).length;t.push({id:"uncategorized",title:"Needs Organization",description:`${s} product${s!==1?"s":""} need categorization`,icon:h,variant:"secondary",action:()=>n("/app/appsumo-import"),priority:3})}return t.length===0?null:(t.sort((s,d)=>s.priority-d.priority),e.jsxs(x,{className:"border-amber-200 bg-amber-50/50 dark:border-amber-800 dark:bg-amber-900/20",children:[e.jsx(w,{className:"pb-3",children:e.jsxs(_,{className:"flex items-center gap-2 text-lg text-amber-800 dark:text-amber-200",children:[e.jsx(C,{className:"h-5 w-5"}),"Action Required"]})}),e.jsxs(N,{className:"pt-0",children:[e.jsx("div",{className:`space-y-3 ${c?"":"max-h-48 overflow-y-auto"}`,children:t.slice(0,c?3:5).map(s=>{const d=s.icon;return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-background/80 border border-border/30 hover:border-primary/50 transition-all cursor-pointer group",onClick:s.action,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`
6                    w-8 h-8 rounded-full flex items-center justify-center
7                    ${s.variant==="destructive"?"bg-destructive/10 text-destructive":""}
8                    ${s.variant==="warning"?"bg-amber-100 text-amber-600":""}
9                    ${s.variant==="secondary"?"bg-primary/10 text-primary":""}
10                  `,children:e.jsx(d,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm text-foreground group-hover:text-primary transition-colors",children:s.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{variant:s.variant==="destructive"?"destructive":"secondary",className:"text-xs",children:"Urgent"}),e.jsx($,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors"})]})]},s.id)})}),t.length>(c?3:5)&&e.jsx(p,{variant:"ghost",className:"w-full mt-3 text-xs",onClick:()=>n("/app/tools"),children:"View All Alerts"})]})]}))}function Z({metrics:o=[],recentActivity:r=[],quickActions:n=[]}){const c=f(),a=g(),i=[{title:"View Tools",icon:h,onClick:()=>a("/app/tools"),color:"bg-secondary text-secondary-foreground"},{title:"Analytics",icon:I,onClick:()=>a("/app/analytics"),color:"bg-accent text-accent-foreground"}],l=n.length>0?n:i;return c?e.jsx(V,{headerContent:e.jsx(W,{title:"DealKeep",subtitle:"Your software investments"}),children:e.jsxs(O,{spacing:"normal",children:[o.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(y,{title:"Overview"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:o.map((t,s)=>{const d=t.icon;return e.jsx(H,{touchable:!!t.onClick,onTouch:t.onClick,className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:v("w-8 h-8 rounded-lg flex items-center justify-center",t.color||"bg-primary/10"),children:e.jsx(d,{className:v("h-4 w-4",t.color?"text-white":"text-primary")})}),t.trend&&e.jsxs("div",{className:v("text-xs font-medium",t.trend.isPositive?"text-success":"text-destructive"),children:[t.trend.isPositive?"+":"",t.trend.value,"%"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:t.value}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.title}),t.subtitle&&e.jsx("p",{className:"text-xs text-muted-foreground/70 truncate",children:t.subtitle})]})]})},s)})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(y,{title:"Quick Actions"}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:l.map((t,s)=>{const d=t.icon;return e.jsxs(K,{variant:"outline",onClick:t.onClick,className:v("flex flex-col items-center gap-2 h-20","border-2 border-border/50",t.color||"hover:bg-accent"),touchSize:"lg",children:[e.jsx(d,{className:"h-5 w-5"}),e.jsx("span",{className:"text-xs font-medium text-center",children:t.title})]},s)})})]}),r.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(y,{title:"Recent Activity",action:e.jsx(p,{variant:"ghost",size:"sm",onClick:()=>a("/app/tools"),className:"text-primary",children:"View All"})}),e.jsx("div",{className:"space-y-2",children:r.slice(0,5).map((t,s)=>{const d=t.icon||D;return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-card/50 border border-border/50",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(d,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.subtitle})]}),e.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:t.timestamp})]},s)})})]})]})}):null}function Oe(){const{user:o}=L(),r=g(),n=f();Y();const{data:c=[],isLoading:a}=Q(),{data:i=[],isLoading:l}=F(),{data:t,isLoading:s}=q(),d=a||l||s,m=t?{value:t.total_tools,label:"Total Tools",change:t.growth_percentage}:null,M=t?[{title:"Total Tools",value:t.total_tools?.toString()||"0",subtitle:"in your library",icon:h,trend:t.growth_percentage&&typeof t.growth_percentage=="number"?{value:t.growth_percentage,isPositive:t.growth_percentage>0}:void 0,onClick:()=>r("/app/tools")},{title:"Total Investment",value:`$${t.total_investment?.toLocaleStr
10ing()||"0"}`,subtitle:"lifetime deals",icon:A,color:"bg-green-500",onClick:()=>r("/app/analytics")},{title:"Active Tools",value:t.active_tools?.toString()||"0",subtitle:"currently using",icon:T,color:"bg-blue-500",onClick:()=>r("/app/tools?status=active")},{title:"Recent",value:i.slice(0,5).length.toString()||"0",subtitle:"added recently",icon:D,color:"bg-purple-500",onClick:()=>r("/app/tools")}]:[],R=i.slice(0,5).map(u=>({title:u.title||"Unnamed Tool",subtitle:u.status||"No status",timestamp:u.created_at?new Date(u.created_at).toLocaleDateString():"Recent",icon:h}));return n?e.jsx(Z,{metrics:M,recentActivity:R}):e.jsx(S,{children:e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"p-8 max-w-7xl mx-auto space-y-6",children:[e.jsxs("div",{className:"text-center space-y-4",children:[e.jsxs("h1",{className:"text-5xl font-bold text-foreground",children:["Welcome back",o?.email?`, ${o.email.split("@")[0]}`:""]}),m&&e.jsxs(x,{className:"inline-flex items-center gap-4 p-4 bg-primary/5 border-primary/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"text-2xl font-bold text-primary",children:m.value}),e.jsx("div",{className:"text-sm text-muted-foreground",children:m.label})]})]}),m.change&&typeof m.change=="number"&&m.change>0&&e.jsxs("div",{className:"text-sm text-green-600 font-medium",children:["+",m.change,"%"]})]})]}),e.jsx(j,{name:"UncategorizedProductsBanner",children:e.jsx(E,{})}),d?e.jsx("div",{className:"space-y-6",children:[1,2,3].map(u=>e.jsx(x,{className:"p-6 h-32 animate-pulse bg-muted/50"},u))}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(j,{name:"SimplifiedMetrics",children:e.jsx(G,{metrics:t})}),e.jsx(j,{name:"RecentToolsList",children:e.jsx(J,{tools:i})}),e.jsx(j,{name:"ActionableAlerts",children:e.jsx(X,{products:c,metrics:t})})]}),e.jsx("div",{className:"text-center pt-8",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("a",{href:"/app/tools?tab=add",className:"text-primary underline underline-offset-4 hover:text-primary/80 transition-colors font-medium",children:"Add your first tool"})," ","to start tracking your investments"]})})]})})})}export{Oe 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.