1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39164],{6298:(e,t,s)=>{s.d(t,{A:()=>p});var a=s(95155),r=s(12115),i=s(91078),l=s(26983),n=s(1524),o=s(30814),c=s(57828),d=s(21786),x=s(56154),h=s(25563),m=s(95740),g=s(89715),u=s(16485);function p(e){let{goals:t,creditSummary:s,onExecuteAction:p,onToggleMilestone:b,maxItems:w=5,compact:j=!1}=e,N=(0,r.useMemo)(()=>{let e=[];if(t.forEach(t=>{t.milestones.filter(e=>!e.completed).forEach(s=>{s.actionType&&"manual"!==s.actionType&&e.push({id:"".concat(t.id,"-").concat(s.id),title:s.title,description:'Part of "'.concat(t.title,'"'),type:"milestone",priority:"start_dispute"===s.actionType||"view_report"===s.actionType?"high":"normal",actionType:s.actionType,actionLabel:s.actionLabel,icon:function(e){switch(e){case"view_report":case"review_accounts":return(0,a.jsx)(c.A,{className:"w-4 h-4"});case"upload_documents":return(0,a.jsx)(d.A,{className:"w-4 h-4"});case"connect_report":return(0,a.jsx)(o.A,{className:"w-4 h-4"});case"start_dispute":return(0,a.jsx)(g.A,{className:"w-4 h-4"});case"check_score":return(0,a.jsx)(n.A,{className:"w-4 h-4"});case"pay_bills":return(0,a.jsx)(u.A,{className:"w-4 h-4"});default:return(0,a.jsx)(h.A,{className:"w-4 h-4"})}}(s.actionType),goalId:t.id,milestoneId:s.id})});let s=function(e){let t=new Date(e),s=new Date;return Math.ceil((t.getTime()-s.getTime())/864e5)}(t.targetDate);s<0?e.push({id:"overdue-".concat(t.id),title:'"'.concat(t.title,'" is overdue'),description:"".concat(Math.abs(s)," days past deadline"),type:"reminder",priority:"urgent",icon:(0,a.jsx)(i.A,{className:"w-4 h-4"}),goalId:t.id}):s<=7&&t.progress<80&&e.push({id:"deadline-".concat(t.id),title:'"'.concat(t.title,'" deadline approaching'),description:"".concat(s," days left, ").concat(t.progress,"% complete"),type:"reminder",priority:"high",icon:(0,a.jsx)(l.A,{className:"w-4 h-4"}),goalId:t.id})}),s&&(s.creditUtilization&&s.creditUtilization>30&&e.push({id:"utilization-reminder",title:"Consider making a payment",description:"Utilization at ".concat(s.creditUtilization,"% - aim for under 30%"),type:"suggestion",priority:s.creditUtilization>50?"high":"normal",actionType:"review_accounts",actionLabel:"Review Accounts",icon:(0,a.jsx)(n.A,{className:"w-4 h-4"})}),s.equifaxScore||s.experianScore||s.transunionScore||e.push({id:"connect-report",title:"Connect your credit report",description:"Get personalized insights and track your progress",type:"suggestion",priority:"high",actionType:"connect_report",actionLabel:"Connect Report",icon:(0,a.jsx)(o.A,{className:"w-4 h-4"})})),t.length>0){let s=new Date().getDay();1===s&&e.push({id:"weekly-review",title:"Weekly credit review",description:"Check your credit report for any changes",type:"suggestion",priority:"normal",actionType:"view_report",actionLabel:"View Report",icon:(0,a.jsx)(c.A,{className:"w-4 h-4"})}),t.some(e=>"remove-negatives"===e.templateId)&&3===s&&e.push({id:"upload-reminder",title:"Upload supporting documents",description:"Strong documentation helps with disputes",type:"suggestion",priority:"normal",actionType:"upload_documents",actionLabel:"Upload Documents",icon:(0,a.jsx)(d.A,{className:"w-4 h-4"})})}let r={urgent:0,high:1,normal:2};return e.sort((e,t)=>r[e.priority]-r[t.priority]),e.slice(0,w)},[t,s,w]);return 0===N.length?null:(0,a.jsxs)("div",{className:j?"space-y-2":"space-y-4",children:[!j&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"p-1.5 rounded-lg bg-gradient-to-r from-blue-500/20 to-purple-500/20",children:(0,a.jsx)(x.A,{className:"w-4 h-4 text-blue-400"})}),(0,a.jsx)("h3",{className:"font-semibold text-white",children:"Today's Actions"}),(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full bg-white/10 text-white/60",children:[N.length," item",1!==N.length?"s":""]})]}),(0,a.jsx)("div",{className:j?"space-y-1.5":"space-y-2",children:N.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-xl transition-all ".concat("urgent"===e.priority?"bg-red-500/10 border border-red-500/20":"high"===e.priority?"bg-amber-500/10 border border-amber-500/20":"bg-white/5 border border-white/10 hover:bg-white/10"),children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ".concat("urgent"===e.priority?"bg-red-500/20 text-red-400":"high"===e.priority?"bg-amber-500/20 text-amber-400":"bg-blue-500/20 text-blue-400"),children:e.icon}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-white ".concat(j?"text-sm":""),children:e.title}),!j&&(0,a.jsx)("p",{className:"text-xs text-white/50 truncate",children:e.description})]}),e.actionType&&"manual"!==e.actionType&&p&&(0,a.jsx)("button",{onClick:()=>p(e.actionType),className:"px-3 py-1.5 rounded-lg text-xs font-medium transition-all shrink-0 ".concat("urgent"===e.priority?"bg-red-500 hover:bg-red-600 text-white":"high"===e.priority?"bg-amber-500 hover:bg-amber-600 text-white":"bg-blue-500/20 hover:bg-blue-500/30 text-blue-300"),children:e.actionLabel||"Action"}),"milestone"===e.type&&e.goalId&&e.milestoneId&&b&&(0,a.jsx)("button",{onClick:()=>b(e.goalId,e.milestoneId),className:"p-1.5 rounded-lg bg-white/10 hover:bg-green-500/20 text-white/40 hover:text-green-400 transition-all",title:"Mark as complete",children:(0,a.jsx)(h.A,{className:"w-4 h-4"})})]},e.id))}),!j&&t.length>0&&(0,a.jsx)("div",{className:"text-center",children:(0,a.jsxs)("p",{className:"text-xs text-white/40",children:[(0,a.jsx)(m.A,{className:"w-3 h-3 inline mr-1"}),"Complete these actions to make progress on your goals"]})})]})}},39164:(e,t,s)=>{s.r(t),s.d(t,{default:()=>D});var a=s(95155),r=s(12115),i=s(35626),l=s(30814),n=s(6191),o=s(95740),c=s(1524),d=s(6613),x=s(52472),h=s(71360),m=s(26983),g=s(57828),u=s(21786),p=s(4788),b=s(89715),w=s(16485),j=s(39347),N=s(8198),f=s(25563),v=s(9582),y=s(19708),A=s(93726),S=s(45150),k=s(6298),C=s(66519);function D(e){let{isOpen:t,onClose:s,userId:o,currentScore:c,creditSummary:d,onViewReport:x,onUploadDocuments:h,onConnectReport:m,onStartDispute:g,onCheckScore:u}=e,[p,b]=(0,r.useState)([]),[w,j]=(0,r.useState)(null),[N,f]=(0,r.useState)(!0),[v,k]=(0,r.useState)(!1),[D,z]=(0,r.useState)(null),[I,E]=(0,r.useState)(null),L={manual:void 0,view_report:x,upload_documents:h,connect_report:m,start_dispute:g,check_score:u,pay_bills:void 0,review_accounts:x,external_link:void 0};(0,r.useEffect)(()=>
1{if(!o||!t)return;let e=(0,y.onSnapshot)((0,y.doc)(A.db,"users",o),e=>{if(e.exists()){var t;let s=e.data();b((null==s?void 0:s.goals)||[]),!w&&(null==s||null==(t=s.goals)?void 0:t.length)>0&&j(s.goals[0])}f(!1)},e=>{console.error("Error loading goals:",e),f(!1)});return()=>e()},[o,t]);let U=async(e,t)=>{let s=p.map(s=>{if(s.id===e){let e=s.milestones.map(e=>e.id===t?{...e,completed:!e.completed,completedDate:e.completed?void 0:new Date().toISOString()}:e),a=Math.round(e.filter(e=>e.completed).length/e.length*100);return{...s,milestones:e,progress:a}}return s});b(s);let a=s.find(t=>t.id===e);a&&(null==w?void 0:w.id)===e&&j(a);try{await (0,C.T)(o,e,t)}catch(e){console.error("Error updating milestone:",e)}},G=async e=>{let t=p.filter(t=>t.id!==e);b(t),E(null),(null==w?void 0:w.id)===e&&j(t[0]||null);try{await (0,y.setDoc)((0,y.doc)(A.db,"users",o),{goals:t,updatedAt:new Date},{merge:!0})}catch(e){console.error("Error deleting goal:",e)}},P=async(e,t)=>{let s=p.map(s=>{if(s.id===e){let e={id:"milestone_".concat(Date.now()),title:t,completed:!1},a=[...s.milestones,e],r=Math.round(a.filter(e=>e.completed).length/a.length*100);return{...s,milestones:a,progress:r}}return s});b(s);let a=s.find(t=>t.id===e);a&&j(a);try{await (0,y.setDoc)((0,y.doc)(A.db,"users",o),{goals:s,updatedAt:new Date},{merge:!0})}catch(e){console.error("Error adding milestone:",e)}},q=async(e,t)=>{let s=p.map(s=>{if(s.id===e){let e=s.milestones.filter(e=>e.id!==t),a=e.filter(e=>e.completed).length,r=e.length>0?Math.round(a/e.length*100):0;return{...s,milestones:e,progress:r}}return s});b(s);let a=s.find(t=>t.id===e);a&&j(a);try{await (0,y.setDoc)((0,y.doc)(A.db,"users",o),{goals:s,updatedAt:new Date},{merge:!0})}catch(e){console.error("Error deleting milestone:",e)}};return t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"fixed inset-0 z-[60] bg-gradient-to-br from-slate-900 via-purple-900/95 to-slate-900 overflow-hidden",children:[(0,a.jsxs)("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[(0,a.jsx)("div",{className:"absolute top-0 left-1/4 w-96 h-96 bg-purple-500/20 rounded-full blur-3xl"}),(0,a.jsx)("div",{className:"absolute bottom-0 right-1/4 w-96 h-96 bg-blue-500/20 rounded-full blur-3xl"})]}),(0,a.jsxs)("div",{className:"relative h-full flex flex-col",children:[(0,a.jsx)("div",{className:"shrink-0 px-6 py-4 border-b border-white/10 bg-black/20 backdrop-blur-xl",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("button",{onClick:s,className:"p-2 rounded-xl bg-white/10 hover:bg-white/20 transition-colors",children:(0,a.jsx)(i.A,{className:"w-5 h-5 text-white"})}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center shadow-lg shadow-amber-500/30",children:(0,a.jsx)(l.A,{className:"w-5 h-5 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-bold text-white",children:"Goal Dashboard"}),(0,a.jsxs)("p",{className:"text-sm text-white/60",children:[p.length," active goal",1!==p.length?"s":""]})]})]})]}),(0,a.jsxs)("button",{onClick:()=>k(!0),className:"flex items-center gap-2 px-4 py-2 rounded-xl bg-gradient-to-r from-emerald-500 to-teal-600 text-white font-semibold shadow-lg shadow-emerald-500/30 hover:shadow-xl hover:scale-105 transition-all",children:[(0,a.jsx)(n.A,{className:"w-4 h-4"}),"New Goal"]})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden flex",children:N?(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"w-16 h-16 border-4 border-white/20 border-t-white rounded-full animate-spin mx-auto mb-4"}),(0,a.jsx)("p",{className:"text-white/60",children:"Loading your goals..."})]})}):0===p.length?(0,a.jsx)(_,{onCreateGoal:()=>k(!0)}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"w-80 shrink-0 border-r border-white/10 bg-black/20 overflow-y-auto",children:(0,a.jsx)("div",{className:"p-4 space-y-3",children:p.map(e=>(0,a.jsx)(T,{goal:e,isSelected:(null==w?void 0:w.id)===e.id,onClick:()=>j(e),onDelete:()=>E(e.id)},e.id))})}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto",children:w?(0,a.jsx)(M,{goal:w,currentScore:c,creditSummary:d,onToggleMilestone:e=>U(w.id,e),onAddMilestone:e=>P(w.id,e),onDeleteMilestone:e=>q(w.id,e),onExecuteAction:e=>{let t=L[e];t&&t()}}):(0,a.jsx)("div",{className:"h-full flex items-center justify-center text-white/40",children:"Select a goal to view details"})})]})})]}),I&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"bg-slate-800 rounded-2xl p-6 max-w-sm w-full mx-4 border border-white/20 shadow-2xl",children:[(0,a.jsx)("h3",{className:"text-xl font-bold text-white mb-2",children:"Delete Goal?"}),(0,a.jsx)("p",{className:"text-white/60 mb-6",children:"This action cannot be undone. All milestones will be deleted."}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:()=>E(null),className:"flex-1 py-3 rounded-xl bg-white/10 hover:bg-white/20 text-white font-medium transition-colors",children:"Cancel"}),(0,a.jsx)("button",{onClick:()=>G(I),className:"flex-1 py-3 rounded-xl bg-red-500 hover:bg-red-600 text-white font-semibold transition-colors",children:"Delete"})]})]})})]}),(0,a.jsx)(S.default,{isOpen:v,onClose:()=>k(!1),userId:o,currentScore:c,onGoalCreated:e=>{j(e)}})]}):null}function _(e){let{onCreateGoal:t}=e;return(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,a.jsxs)("div",{className:"text-center max-w-md",children:[(0,a.jsxs)("div",{className:"relative mb-8",children:[(0,a.jsx)("div",{className:"w-32 h-32 mx-auto rounded-3xl bg-gradient-to-br from-amber-400/20 to-orange-500/20 flex items-center justify-center",children:(0,a.jsx)(l.A,{className:"w-16 h-16 text-amber-400"})}),(0,a.jsx)("div",{className:"absolute -top-2 -right-2 w-12 h-12 rounded-xl bg-gradient-to-br from-purple-500 to-pink-500 flex items-center justify-center rotate-12 shadow-lg",children:(0,a.jsx)(o.A,{className:"w-6 h-6 text-white"})})]}),(0,a.jsx)("h2",{className:"text-2xl font-bold text-white mb-3",children:"No Goals Yet"}),(0,a.jsx)("p",{className:"text-white/60 mb-8",children:"Set your first credit goal and start your journey to financial freedom. Track your progress with milestones and celebrate every win!"}),(0,a.jsxs)("button",{onClick:t,className:"inline-flex items-center gap-2 px-6 py-3 rounded-xl bg-gradient-to-r from-amber-400 to-orange-500 text-white font-semibold shadow-lg shadow-amber-500/30 hover:shadow-xl hover:scale-105 transition-all",children:[(0,a.jsx)(n.A,{className:"w-5 h-5"}),"Create Your First Goal"]}),(0,a.jsxs)("div",{className:"mt-8 grid grid-cols-3 gap-4 text-center",children:[(0,a.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-white/10",children:[(0,a.jsx)(c.A,{className:"w-6 h-6 text-emerald-400 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-xs text-white/60",children:"Track Progress"})]}),(0,a.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-white/10",children:[(0,a.jsx)(d.A,{className:"w-6 h-6 text-amber-400 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-xs text-white/60",children:"Hit Milestones"})]}),(0,a.jsxs)("div",{className:"p-4 rounded-xl bg-white/5 border border-white/10",children:[(0,a.jsx)(x.A,{className:"w-6 h-6 text-purple-400 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-xs text-white/60",children:"Achieve Goals"})]})]})]})})}function T(e){let{goal:t,isSelected:s,onClick:r,onDelete:i}=e,n=function(e){let t=new Date(e),s=new Date;return Math.ceil((t.getTime()-s.getTime())/864e5)}(t.targetDate);return(0,a.jsxs)("div",{onClick:r,className:"p-4 rounded-2xl cursor-pointer transition-all duration-300 group ".concat(s?"bg-white/15 border-2 border-white/30 shadow-lg":"bg-white/5 border border-white/10 hover:bg-white/10"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br ".concat(t.gradient," flex items-center justify-center shadow-lg"),children:(0,a.jsx)(l.A,{className:"w-5 h-5 text-white"})}),(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),i()},className:"p-1.5 rounded-lg bg-white/0 hover:bg-red-500/20 text-white/40 hover:text-red-400 transition-all opacity-0 group-hover:opacity-100",children:(0,a.jsx)(h.A,{className:"w-4 h-4"})})]}),(0,a.jsx)("h3",{className:"font-semibold text-white mb-1 truncate",children:t.title}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-white/60 mb-3",children:[(0,a.jsx)(m.A,{className:"w-3 h-3"}),(0,a.jsx)("span",{children:n>0?"".concat(n," days left"):0===n?"Due today":"".concat(Math.abs(n)," days overdue")})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,a.jsx)("span",{className:"text-white/60",children:"Progress"}),(0,a.jsxs)("span",{className:"font-medium ".concat(t.progress>=75?"text-green-400":t.progress>=50?"text-yellow-400":t.progress>=25?"text-orange-400":"text-white/60"),children:[t.progress,"%"]})]}),(0,a.jsx)("div",{className:"h-2 bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r ".concat(t.gradient," transition-all duration-500"),style:{width:"".concat(t.progress,"%")}})})]}),(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-1",children:[t.milestones.slice(0,5).map((e,t)=>(0,a.jsx)("div",{className:"w-2 h-2 rounded-full transition-colors ".concat(e.completed?"bg-green-400":"bg-white/20")},e.id)),t.milestones.length>5&&(0,a.jsxs)("span",{className:"text-xs text-white/40 ml-1",children:["+",t.milestones.length-5]})]})]})}function M(e){let{goal:t,currentScore:s,creditSummary:i,onToggleMilestone:o,onAddMilestone:x,onDeleteMilestone:v,onExecuteAction:y}=e,[A,S]=(0,r.useState)(""),C=function(e){let t=new Date(e),s=new Date;return Math.ceil((t.getTime()-s.getTime())/864e5)}(t.targetDate),D=t.milestones.filter(e=>e.completed).length,_=()=>{A.trim()&&(x(A.trim()),S(""))};return(0,a.jsxs)("div",{className:"p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br ".concat(t.gradient," flex items-center justify-center shadow-xl"),children:(0,a.jsx)(l.A,{className:"w-8 h-8 text-white"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold text-white mb-1",children:t.title}),(0,a.jsxs)("div",{className:"flex items-center gap-4 text-sm text-white/60",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(w.A,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Target: ",new Date(t.targetDate).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 ".concat(C<30?"text-orange-400":""),children:[(0,a.jsx)(m.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:C>0?"".concat(C," days remaining"):0===C?"Due today!":"".concat(Math.abs(C)," days overdue")})]})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{className:"p-4 rounded-2xl bg-white/5 border border-white/10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-white/60 mb-2",children:[(0,a.jsx)(c.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{className:"text-sm",children:"Current Score"})]}),(0,a.jsx)("p",{className:"text-3xl font-bold text-white",children:s||t.currentScore||"---"}),t.startScore&&s&&(0,a.jsxs)("p",{className:"text-xs mt-1 ".concat(s>=t.startScore?"text-green-400":"text-red-400"),children:[s>=t.startScore?"+":"",s-t.startScore," pts since start"]})]}),(0,a.jsxs)("div",{className:"p-4 rounded-2xl bg-white/5 border border-white/10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-white/60 mb-2",children:[(0,a.jsx)(j.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{className:"text-sm",children:"Target Score"})]}),(0,a.jsx)("p",{className:"text-3xl font-bold bg-gradient-to-r ".concat(t.gradient," bg-clip-text text-transparent"),children:t.targetScore||"---"}),t.targetScore&&s&&(0,a.jsx)("p",{className:"text-xs text-white/50 mt-1",children:t.targetScore-s>0?"".concat(t.targetScore-s," pts to go"):"Target reached!"})]}),(0,a.jsxs)("div",{className:"p-4 rounded-2xl bg-white/5 border border-white/10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-white/60 mb-2",children:[(0,a.jsx)(N.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{className:"text-sm",children:"Progress"})]}),(0,a.jsxs)("p",{className:"text-3xl font-bold ".concat(t.progress>=75?"text-green-400":t.progress>=50?"text-yellow-400":t.progress>=25?"text-orange-400":"text-white"),children:[t.progress,"%"]})]})]}),i&&(0,a.jsx)(z,{creditSummary:i,goal:t,currentScore:s}),(0,a.jsx)(k.A,{goals:[t],creditSummary:i,onExecuteAction:y,onToggleMilestone:(e,t)=>o(t),maxItems:3}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,a.jsx)("span",{className:"text-white/60",children:"Overall Progress"}),(0,a.jsxs)("span",{className:"text-white",children:[D,"/",t.milestones.length," milestones"]})]}),(0,a.jsx)("div",{className:"h-4 bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r ".concat(t.gradient," transition-all duration-700 ease-out"),style:{width:"".concat(t.progress,"%")}})})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[(0,a.jsx)(f.A,{className:"w-5 h-5 text-green-400"}),"Milestones"]}),(0,a.jsxs)("span",{className:"text-sm text-white/60",children:[D," of ",t.milestones.length," completed"]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:A,onChange:e=>S(e.target.value),onKeyPress:e=>"Enter"===e.key&&_(),placeholder:"Add a new milestone...",className:"flex-1 px-4 py-3 rounded-xl bg-white border border-gray-200 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all shadow-sm"}),(0,a.jsxs)("button",{onClick:_,disabled:!A.trim(),className:"px-4 py-3 rounded-xl font-medium transition-all flex items-center gap-2 ".concat(A.trim()?"bg-gradient-to-r ".concat(t.gradient," text-white shadow-lg hover:shadow-xl"):"bg-white/5 text-white/30 curs
1or-not-allowed"),children:[(0,a.jsx)(n.A,{className:"w-4 h-4"}),"Add"]})]}),(0,a.jsx)("div",{className:"space-y-2",children:t.milestones.map((e,s)=>{let r;return(0,a.jsxs)("div",{className:"group flex items-center gap-3 p-4 rounded-xl transition-all duration-300 ".concat(e.completed?"bg-green-500/10 border border-green-500/20":"bg-white/5 border border-white/10 hover:bg-white/10"),children:[(0,a.jsx)("button",{onClick:()=>o(e.id),className:"w-6 h-6 rounded-full border-2 flex items-center justify-center transition-all shrink-0 ".concat(e.completed?"border-green-400 bg-green-400":"border-white/30 hover:border-white/50"),children:e.completed&&(0,a.jsx)(f.A,{className:"w-4 h-4 text-white"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium transition-all ".concat(e.completed?"text-white/60 line-through":"text-white"),children:e.title}),e.completed&&e.completedDate&&(0,a.jsxs)("p",{className:"text-xs text-green-400/60 mt-1",children:["Completed ",new Date(e.completedDate).toLocaleDateString()]})]}),!e.completed&&(r=e.actionType)&&"manual"!==r&&"external_link"!==r&&"pay_bills"!==r&&(0,a.jsxs)("button",{onClick:()=>y(e.actionType),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all bg-gradient-to-r ".concat(t.gradient," text-white shadow-md hover:shadow-lg hover:scale-105"),children:[(e=>{switch(e){case"view_report":case"review_accounts":return(0,a.jsx)(g.A,{className:"w-3.5 h-3.5"});case"upload_documents":return(0,a.jsx)(u.A,{className:"w-3.5 h-3.5"});case"connect_report":return(0,a.jsx)(p.A,{className:"w-3.5 h-3.5"});case"start_dispute":return(0,a.jsx)(b.A,{className:"w-3.5 h-3.5"});case"check_score":return(0,a.jsx)(c.A,{className:"w-3.5 h-3.5"});case"pay_bills":return(0,a.jsx)(w.A,{className:"w-3.5 h-3.5"});default:return null}})(e.actionType),(0,a.jsx)("span",{children:e.actionLabel||"Action"})]}),!e.completed&&"pay_bills"===e.actionType&&(0,a.jsx)("span",{className:"px-2 py-1 rounded-lg text-xs bg-amber-500/20 text-amber-300 border border-amber-500/30",children:"Manual"}),(0,a.jsx)("button",{onClick:()=>v(e.id),className:"p-2 rounded-lg bg-white/0 hover:bg-red-500/20 text-white/40 hover:text-red-400 transition-all opacity-0 group-hover:opacity-100",children:(0,a.jsx)(h.A,{className:"w-4 h-4"})})]},e.id)})}),0===t.milestones.length&&(0,a.jsxs)("div",{className:"text-center py-8 text-white/40",children:[(0,a.jsx)(f.A,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),(0,a.jsx)("p",{children:"No milestones yet. Add your first one above!"})]})]}),100===t.progress&&(0,a.jsxs)("div",{className:"p-6 rounded-2xl bg-gradient-to-r ".concat(t.gradient," text-center"),children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-white/20 mb-4",children:(0,a.jsx)(d.A,{className:"w-8 h-8 text-white"})}),(0,a.jsx)("h3",{className:"text-xl font-bold text-white mb-2",children:"\uD83C\uDF89 Goal Complete!"}),(0,a.jsx)("p",{className:"text-white/80",children:"Congratulations! You've completed all milestones for this goal."})]})]})}function z(e){let{creditSummary:t,goal:s,currentScore:r}=e,i=[];return(t.totalCollections&&t.totalCollections>0&&i.push({type:"warning",message:"".concat(t.totalCollections," collection").concat(t.totalCollections>1?"s":""," affecting your score"),icon:(0,a.jsx)(v.A,{className:"w-4 h-4"})}),t.creditUtilization&&t.creditUtilization>30&&i.push({type:"warning",message:"Credit utilization at ".concat(t.creditUtilization,"% (target: below 30%)"),icon:(0,a.jsx)(c.A,{className:"w-4 h-4"})}),t.totalChargeOffs&&t.totalChargeOffs>0&&i.push({type:"warning",message:"".concat(t.totalChargeOffs," charge-off").concat(t.totalChargeOffs>1?"s":""," on your report"),icon:(0,a.jsx)(v.A,{className:"w-4 h-4"})}),t.totalLatePayments&&t.totalLatePayments>0&&i.push({type:"info",message:"".concat(t.totalLatePayments," late payment").concat(t.totalLatePayments>1?"s":""," in history"),icon:(0,a.jsx)(w.A,{className:"w-4 h-4"})}),t.totalInquiries&&t.totalInquiries>5&&i.push({type:"info",message:"".concat(t.totalInquiries," inquiries on your report"),icon:(0,a.jsx)(g.A,{className:"w-4 h-4"})}),t.creditUtilization&&t.creditUtilization<30&&i.push({type:"success",message:"Good credit utilization at ".concat(t.creditUtilization,"%"),icon:(0,a.jsx)(f.A,{className:"w-4 h-4"})}),r&&s.targetScore&&r>=s.targetScore&&i.push({type:"success",message:"You've reached your target score of ".concat(s.targetScore,"!"),icon:(0,a.jsx)(d.A,{className:"w-4 h-4"})}),0===i.length)?null:(0,a.jsxs)("div",{className:"p-4 rounded-2xl bg-gradient-to-br from-white/5 to-white/10 border border-white/10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("div",{className:"p-1.5 rounded-lg bg-blue-500/20",children:(0,a.jsx)(g.A,{className:"w-4 h-4 text-blue-400"})}),(0,a.jsx)("h4",{className:"font-semibold text-white",children:"Credit Insights"})]}),(t.equifaxScore||t.experianScore||t.transunionScore)&&(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[t.equifaxScore&&(0,a.jsxs)("div",{className:"p-2 rounded-lg bg-black/20 text-center",children:[(0,a.jsx)("p",{className:"text-xs text-white/50 mb-1",children:"Equifax"}),(0,a.jsx)("p",{className:"text-lg font-bold text-white",children:t.equifaxScore})]}),t.experianScore&&(0,a.jsxs)("div",{className:"p-2 rounded-lg bg-black/20 text-center",children:[(0,a.jsx)("p",{className:"text-xs text-white/50 mb-1",children:"Experi
1an"}),(0,a.jsx)("p",{className:"text-lg font-bold text-white",children:t.experianScore})]}),t.transunionScore&&(0,a.jsxs)("div",{className:"p-2 rounded-lg bg-black/20 text-center",children:[(0,a.jsx)("p",{className:"text-xs text-white/50 mb-1",children:"TransUnion"}),(0,a.jsx)("p",{className:"text-lg font-bold text-white",children:t.transunionScore})]})]}),(0,a.jsx)("div",{className:"space-y-2",children:i.slice(0,4).map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-lg text-sm ".concat("warning"===e.type?"bg-amber-500/10 text-amber-300 border border-amber-500/20":"success"===e.type?"bg-green-500/10 text-green-300 border border-green-500/20":"bg-blue-500/10 text-blue-300 border border-blue-500/20"),children:[e.icon,(0,a.jsx)("span",{children:e.message})]},t))})]})}}}]);
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.