PageSourceSearch

https://www.teapotinvestments.com/_next/static/chunks/6668-269f14e4427af7a6.js

js teapotinvestments.com collected 2026-10-08 08:01:21 UTC 47,246 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6668],{76668:(e,t,a)=>{a.r(t),a.d(t,{InvestmentTracker:()=>ea,default:()=>es});var s=a(37876),r=a(14232),n=a(77328),l=a.n(n),o=a(45105),i=a.n(o),c=a(89099),d=a(70294),m=a(89165),u=a(23270),h=a(35535),x=a(56911),g=a(17599),p=a(28960),b=a(73388),f=a(82851),v=a(49038),y=a(55124),j=a(15556),w=a(70898),k=a(35022),N=a(3824);let S="Unclassified",C={title:"Unclassified and Non-Stock Holdings",description:"Sector weights are based on your stock holdings only. That means direct stocks plus the equity sleeve of any ETFs or mutual funds. Cash, bonds, and other asset classes are left out of this breakdown, so the weights show how your stock exposure is spread across sectors rather than how the whole portfolio is allocated.\n\nUnclassified is the part of your stock holdings we could not match to a sector. This is usually a ticker with no sector data available, not a cash or bond position."},_=e=>"".concat((100*e).toFixed(1),"%"),T=e=>{let{apiClient:t,enabled:a=!0,filterQuery:n="",refreshKey:l}=e,[o,i]=(0,r.useState)(null),[c,m]=(0,r.useState)([]),[u,h]=(0,r.useState)(""),[x,g]=(0,r.useState)("ACWI"),[p,b]=(0,r.useState)([]),[f,v]=(0,r.useState)([]),[y,j]=(0,r.useState)(!1),[w,k]=(0,r.useState)(!1),[T,A]=(0,r.useState)(!1),[I,L]=(0,r.useState)(!1),[E,M]=(0,r.useState)({col:"portfolio",dir:"desc"});(0,r.useEffect)(()=>{if(!t||!a)return;let e=!1;return j(!0),k(!1),t.get("/api/sector_breakdown?benchmark=".concat(encodeURIComponent(x)).concat(n)).then(t=>{var a,s,r,n,l;!e&&(i(null!=(s=null==t?void 0:t.sectors)?s:[]),m(null!=(r=null==t?void 0:t.benchmark_sectors)?r:[]),h(null!=(n=null==t?void 0:t.benchmark_label)?n:""),v(null!=(l=null==t?void 0:t.unclassified_tickers)?l:[]),(null==t||null==(a=t.benchmark_options)?void 0:a.length)&&b(t.benchmark_options))}).catch(()=>{e||k(!0)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[t,a,x,n,l]);let R=(0,r.useMemo)(()=>{if(!o)return[];let e=new Map(c.map(e=>[e.sector,e.weight])),t=new Set([...o.map(e=>e.sector),...c.map(e=>e.sector)]),a=new Map(o.map(e=>[e.sector,e.weight]));return[...t].map(t=>{var s,r;let n=null!=(s=a.get(t))?s:0,l=null!=(r=e.get(t))?r:0;return{sector:t,portfolio:n,benchmark:l,relative:n-l}})},[o,c]),F=(0,r.useMemo)(()=>{let e=[...R],{col:t,dir:a}=E,s="asc"===a?1:-1;return e.sort((e,a)=>e.sector===S&&a.sector!==S?1:a.sector===S&&e.sector!==S?-1:"sector"===t?s*e.sector.localeCompare(a.sector):s*(e[t]-a[t])),e},[R,E]),B=e=>M(t=>t.col===e?{col:e,dir:"asc"===t.dir?"desc":"asc"}:{col:e,dir:"sector"===e?"asc":"desc"});if(!a||w)return null;if(y)return(0,s.jsx)("div",{className:"mt-4 mb-8 max-w-4xl mx-auto",children:(0,s.jsxs)("div",{className:"bg-themeIvory rounded-lg p-6 shadow-sm border border-gray-100",children:[(0,s.jsx)("h2",{className:"section-heading-black mb-4",children:"Sector Allocation"}),(0,s.jsx)("div",{className:"animate-pulse space-y-3",children:[...Array(6)].map((e,t)=>(0,s.jsx)("div",{className:"h-4 bg-gray-200 rounded w-full"},t))})]})});if(!o||0===o.length)return null;let D=e=>E.col===e?(0,s.jsx)("span",{className:"text-gray-500",children:"asc"===E.dir?"▲":"▾"}):(0,s.jsx)("span",{className:"text-gray-300",children:"▾"}),O=p.length?p:[{ticker:"ACWI",label:"Global Equity (ACWI)"},{ticker:"SPY",label:"US Equity (SPY)"}];return(0,s.jsxs)("div",{className:"mt-4 mb-8 max-w-4xl mx-auto",children:[(0,s.jsxs)("div",{className:"bg-themeIvory rounded-lg p-6 shadow-sm border border-gray-100",children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsx)("h2",{className:"section-heading-black",children:"Sector Allocation"}),(0,s.jsx)("div",{className:"inline-flex rounded-lg border border-gray-200 bg-white p-0.5",role:"group","aria-label":"Benchmark",children:O.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>g(e.ticker),"aria-pressed":x===e.ticker,className:"rounded-md px-2.5 py-1 text-xs font-medium transition-colors ".concat(x===e.ticker?"bg-brandGold/20 text-gray-900":"text-gray-500 hover:text-gray-700"),children:e.label},e.ticker))})]}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-gray-200 text-gray-500",children:[(0,s.jsx)("th",{className:"py-2 pr-3 text-left font-semibold",children:(0,s.jsxs)("button",{type:"button",onClick:()=>B("sector"),className:"inline-flex items-center gap-1 hover:text-gray-700",children:["Sector ",D("sector")]})}),(0,s.jsx)("th",{className:"py-2 px-3 text-right font-semibold",children:(0,s.jsxs)("button",{type:"button",onClick:()=>B("portfolio"),className:"inline-flex items-center gap-1 hover:text-gray-700",children:["Portfolio (Equity) ",D("portfolio")]})}),(0,s.jsx)("th",{className:"py-2 px-3 text-right font-semibold",children:(0,s.jsxs)("button",{type:"button",onClick:()=>B("benchmark"),className:"inline-flex items-center gap-1 hover:text-gray-700",children:[u||"Benchmark"," ",D("benchmark")]})}),(0,s.jsx)("th",{className:"py-2 pl-3 text-right font-semibold",children:(0,s.jsxs)("button",{type:"button",onClick:()=>B("relative"),className:"inline-flex items-center gap-1 hover:text-gray-700",children:["+/- ",D("relative")]})})]})}),(0,s.jsx)("tbody",{children:F.map(e=>{let t=e.sector===S,a=e.relative>5e-4?"text-emerald-600":e.relative<-5e-4?"text-red-500":"text-gray-400",n=e.relative>5e-4?"+":"";return(0,s.jsxs)(r.Fragment,{children:[(0,s.jsxs)("tr",{className:"border-b border-gray-100 last:border-0",children:[(0,s.jsx)("td",{className:"py-2 pr-3 text-gray-700",children:(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[e.sector,t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",onClick:()=>A(!0),className:"text-blue-500 hover:text-blue-600 transition-colors","aria-label":"What is Unclassified?","data-tip":"What is Unclassified?",children:(0,s.jsx)(d.S8s,{size:13})}),f.length>0&&(0,s.jsx)("button",{type:"button",onClick:()=>L(e=>!e),className:"text-gray-400 hover:text-gray-600 transition-colors","aria-label":I?"Hide unclassified holdings":"Show unclassified holdings",children:I?(0,s.jsx)(d.wAb,{size:14}):(0,s.jsx)(d.fK4,{size:14})})]})]})}),(0,s.jsx)("td",{className:"py-2 px-3 text-right tabular-nums font-medium text-gray-900",children:_(e.portfolio)}),(0,s.jsx)("td",{className:"py-2 px-3 text-right tabular-nums text-gray-600",children:_(e.benchmark)}),(0,s.jsxs)("td",{className:"py-2 pl-3 text-right tabular-nums font-medium ".concat(a),children:[n,_(e.relative)]})]}),t&&I&&f.length>0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:4,className:"pb-2",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:f.map(e=>(0,s.jsx)("span",{className:"rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600",children:e},e))})})})]},e.sector)})})]})}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-3",children:"Sector weights across your stock holdings only, including the stocks held within your ETFs and mutual funds. Cash, bonds, and other asset classes are not included. The benchmark column shows the same breakdown for global stocks, and +/- is your relative overweight or underweight."})]}),(0,s.jsx)(N.Wh,{isOpen:T,onClose:()=>A(!1),info:C})]})};var A=a(79057),I=a(40232);let L=[{key:"stLoss",label:"Short-Term Loss",grad:"from-brandRed/90 to-brandRuby/80",active:"border-brandRed border-4 scale-105 ring-2 ring-brandRed/50",idle:"border-brandRed/30",chevron:"text-brandRuby"},{key:"ltLoss",label:"Long-Term Loss",grad:"from-brandOrange/85 to-brandRed/60",active:"border-brandOrange border-4 scale-105 ring-2 ring-brandOrange/50",idle:"border-brandOrange/30",chevron:"text-brandTeal"},{key:"ltGain",label:"Long-Term Gain",grad:"from-brandTeal/80 to-brandDarkGreen/75",active:"border-brandTeal border-4 scale-105 ring-2 ring-brandTeal/50",idle:"border-brandTeal/30",chevron:"text-brandGreen"},{key:"stGain",label:"Short-Term Gain",grad:"from-brandGreen/85 to-brandDarkGreen/80",active:"border-brandGreen border-4 scale-105 ring-2 ring-brandGreen/50",idle:"border-brandGreen/30",chevron:null}],E=e=>{let{tallies:t,selected:a,onSelect:n,isLoading:l=!1,className:o=""}=e;return(0,s.jsxs)("div",{className:"mb-6 bg-themeIvory rounded-lg shadow-sm border border-gray-200 p-4 ".concat(o),children:[(0,s.jsx)("h2",{className:"section-heading-black mb-2",children:"Tax Efficient Selling Order"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"In tax efficie
1nt selling order. Click to filter current investments by gain or loss type."}),l||!t?(0,s.jsx)("div",{className:"flex flex-col md:flex-row items-center justify-start gap-2 md:gap-3 flex-wrap animate-pulse",children:[0,1,2,3].map(e=>(0,s.jsx)("div",{className:"h-20 bg-gray-200 rounded-lg flex-1 min-w-[140px] max-w-[200px]"},e))}):(0,s.jsx)("div",{className:"flex flex-col md:flex-row items-center justify-start gap-2 md:gap-3 flex-wrap",children:L.map(e=>(0,s.jsxs)(r.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>n(e.key),"aria-pressed":a===e.key,className:"bg-gradient-to-br ".concat(e.grad," border rounded-lg p-3 md:p-4 flex-1 min-w-0 w-full md:w-auto md:min-w-[140px] md:max-w-[200px] shadow-md hover:shadow-lg transition-all cursor-pointer ").concat(a===e.key?e.active:e.idle),children:[(0,s.jsx)("div",{className:"text-xs text-white/90 mb-1 uppercase tracking-wide font-semibold",children:e.label}),(0,s.jsx)("div",{className:"text-xl md:text-2xl font-bold text-white overflow-hidden text-ellipsis whitespace-nowrap",children:(0,I.ML)(t[e.key])})]}),e.chevron&&(0,s.jsx)(d.wi,{className:"".concat(e.chevron," flex-shrink-0 hidden md:block"),size:28,style:{strokeWidth:2.5}})]},e.key))})]})};var M=a(87432),R=a(70611),F=a(73241),B=a(49157),D=a(78948),O=a(52712),P=a(91593),U=a(7378),G=a(57263),H=a(65193),V=a(99199),W=a(8307),Y=a(8347);let q=e=>{let{isOpen:t,onClose:a,ytdAmount:r,startOfYearBalance:n,targetAmount:l,progressPct:o}=e,i=new Date().getFullYear();return(0,s.jsx)(Y.A,{isOpen:t,onClose:a,maxWidth:"md",children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold mb-1",children:"Your Progress This Year"}),(0,s.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Investment gains in ",i,", so far"]}),(0,s.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 mb-4 text-center",children:[(0,s.jsx)("div",{className:"text-3xl font-bold ".concat(r<0?"text-red-600":"text-emerald-600"),children:(e=>"".concat(e>=0?"+":"−","$").concat(Math.abs(Math.round(e)).toLocaleString()))(r)}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"earned year to date from market performance"}),null!==o&&(0,s.jsx)("div",{className:"text-sm text-gray-700 mt-2",children:null!==o&&o>=100?(0,s.jsxs)(s.Fragment,{children:["You've ",(0,s.jsx)("span",{className:"font-semibold text-emerald-600",children:"reached your target"})," of $",Math.round(l).toLocaleString(),"!"]}):(0,s.jsxs)(s.Fragment,{children:["That's ",(0,s.jsxs)("span",{className:"font-semibold",children:[Math.round(o),"%"]})," of your $",Math.round(l).toLocaleString()," target"]})})]}),(0,s.jsx)("h4",{className:"font-medium mb-2",children:"How we measure it"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-3",children:"We start from your balance at the beginning of the year and apply your portfolio's return over the year. This shows what your money has earned from the market alone.  Money you added or withdrew during the year is not counted."}),(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:["Your ",(0,s.jsx)("span",{className:"font-medium",children:"target"})," is what you'd need to earn this year to stay on track for retirement (your expected return plus inflation). The progress circle shows how close you are."]})]})})},K=e=>{let{pct:t,size:a=26,strokeWidth:n=6,negative:l=!1,onClick:o,ariaLabel:i}=e,c=(a-n)/2,d=2*Math.PI*c,m=Math.max(0,Math.min(100,t)),u="pr-gradient-".concat(r.useId().replace(/:/g,"")),h=l?["#f87171","#dc2626"]:["#fde047","#facc15","#ca8a04"];return(0,s.jsx)(o?"button":"div",{type:o?"button":void 0,onClick:o,"aria-label":i,className:"relative inline-flex items-center justify-center shrink-0 ".concat(o?"cursor-pointer transition-transform hover:scale-105":""),style:{width:a,height:a},children:(0,s.jsxs)("svg",{width:a,height:a,className:"-rotate-90",children:[(0,s.jsx)("defs",{children:(0,s.jsx)("linearGradient",{id:u,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:h.map((e,t)=>(0,s.jsx)("stop",{offset:"".concat(t/(h.length-1)*100,"%"),stopColor:e},t))})}),(0,s.jsx)("circle",{cx:a/2,cy:a/2,r:c,fill:"none",stroke:l?"#fee2e2":"#fef9c3",strokeWidth:n}
1),(0,s.jsx)("circle",{cx:a/2,cy:a/2,r:c,fill:"none",stroke:"url(#".concat(u,")"),strokeWidth:n,strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:d*(1-m/100),style:{transition:"stroke-dashoffset 0.5s ease"}})]})})};var $=a(17833),z=a(35925),Q=a(63653),J=a(65672),X=a(17014),Z=a(71683),ee=a(47637),et=a(40115);let ea=e=>{var t,a,n,o,N,S,C,_,L;let{isAdvisorView:Y=!1,clientName:ea,onBack:es,advisorClientId:er}=e,en=(0,r.useContext)(j.ApiClientContext),el=(0,r.useContext)(j.SupabaseContext),eo=(0,c.useRouter)(),[ei,ec]=(0,r.useState)(!1),[ed,em]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(null),[ex,eg]=(0,r.useState)(!1),[ep,eb]=(0,r.useState)(!1),[ef,ev]=(0,r.useState)(!0),[ey,ej]=(0,r.useState)(!1),[ew,ek]=(0,r.useState)(!1),[eN,eS]=(0,r.useState)(null),[eC,e_]=(0,r.useState)(""),{productData:eT}=(0,et.tg)(),[eA,eI]=(0,r.useState)(null),{hasPremium:eL,isLoading:eE,error:eM,refresh:eR}=(0,O.o7)(),eF=!!eM&&!eE,{openPositions:eB,openLots:eD,totalValue:eO,isLoadingPositions:eP,isLoadingLots:eU,refreshPortfolio:eG,error:eH,priceHistoryWarning:eV,clearError:eW,isRetrying:eY,retryAttempt:eq,selectedBroker:eK,searchQuery:e$,availableBrokers:ez,filteredPositions:eQ,filteredLots:eJ,filteredTotalValue:eX,filteredAccountTypeTotals:eZ,filteredPortfolioSeries:e0,filteredPortfolioReturns:e1,missingTickers:e2,weeklyPriceData:e4,historyLateStarters:e3,historyStart:e6,transactions:e5,setHistoryProxyData:e8,setSelectedBroker:e7,setSearchQuery:e9,clearFilters:te,lastUpdated:tt}=(0,R.Yp)(!!eu),ta=(0,r.useMemo)(()=>en?{getSettings:()=>en.get("/api/user_settings"),saveProxies:e=>en.post("/api/user_settings",{history_proxies:e}),post:(e,t)=>en.post(e,t)}:null,[en]),ts=(0,r.useMemo)(()=>(e5||[]).map(e=>String(e.date||"").slice(0,10)).filter(Boolean).sort()[0],[e5]),tr=(0,V.Q)(eu?ta:null,ts),[tn,tl]=(0,r.useState)({});(0,r.useEffect)(()=>{e8(tr.proxies,tr.prices)},[tr.proxies,tr.prices,e8]);let[to,ti]=(0,r.useState)(null),tc=(0,r.useMemo)(()=>Y?(0,A.H4)(eJ||[]):null,[Y,eJ]),td=Y&&!!to,tm=Y?"&broker=".concat(encodeURIComponent(eK||""),"&search=").concat(encodeURIComponent(e$||"")):"",tu=(0,r.useMemo)(()=>{if(!td||!to)return null;let e=eK||e$?eJ||[]:eD||[],t=(0,A.id)(e,to),a={};(eB||[]).forEach(e=>{e.ticker&&(a[e.ticker]={stock_pct:e.stock_pct,bond_pct:e.bond_pct,cash_pct:e.cash_pct,other_pct:e.other_pct,net_exp_ratio:e.net_exp_ratio})});let s=(0,A.iI)(t,a),r=s.reduce((e,t)=>e+(t.currentValue||0),0);return{lots:t,positions:s,totalValue:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(r)}},[td,to,eK,e$,eJ,eD,eB]),{download:th,loading:tx}=(0,g.W)(),[tg,tp]=(0,r.useState)(!1),[tb,tf]=(0,r.useState)(null),tv=!!eu&&null==tt&&!eH,ty=!eu||!tv&&!eP&&!eU&&!eY&&!eH&&(!eB||0===eB.length),tj=!eu||ty,tw=M.FY,tk=eY&&eq>=M.Go.MAX_RETRIES,tN=!!eH&&!eY,tS=(0,r.useRef)(null),{uploadedFiles:tC,isProcessing:t_,parsedTransactions:tT,showUploadModal:tA,showReviewModal:tI,fileInputRef:tL,uploadWarnings:tE,handleFileUpload:tM,handleRemoveFile:tR,handleProcessFiles:tF,handleDrop:tB,handleDragOver:tD,openUploadModal:tO,closeUploadModal:tP,closeReviewModal:tU,handleSaveSuccess:tG,setFileBrokerTag:tH,setFileAccountType:tV,setFileEntryType:tW,setFileHeldSince:tY,setFileSnapshotMode:tq}=(0,z.o)({intakeContext:"investment-tracker",onSaveSuccess:()=>{eG()},onSubscriptionRequired:()=>{em(!0)},bypassEntitlementCheck:!eB||0===eB.length,defaultBrokerTag:eK}),[tK,t$]=(0,r.useState)(null),[tz,tQ]=(0,r.useState)(null),[tJ,tX]=(0,r.useState)("returns"),[tZ,t0]=(0,r.useState)(null),[t1,t2]=(0,r.useState)(!1),[t4,t3]=(0,r.useState)({penny:[],milo:[]}),[t6,t5]=(0,r.useState)(""),[t8,t7]=(0,r.useState)(null),[t9,ae]=(0,r.useState)(!1),at=(0,r.useRef)(null),aa=async()=>{try{t2(!0);let e=await en.get("/api/retirement_input");if(e&&e.summary&&e.summary.data&&e.summary.data.length>0){let t=e.summary.data[0],a=e.summary.columns.reduce((e,a,s)=>(e[a]=t[s],e),{});t0(a)}}catch(e){console.error("Error fetching retirement inputs:",e)}finally{t2(!1)}};(0,r.useEffect)(()=>{let e=!1;return eS(null),e_(""),(async()=>{if(en&&eu)try{var t;let a=()=>en.get("/api/user_settings"),s=null!=(t=await a())?t:await new Promise(e=>setTimeout(e,1500)).then(a);if(!s)throw Error("Could not load the saved benchmark. Refresh before making changes.");
1!e&&s&&eS(Object.keys(s.custom_benchmark||{}).length?s.custom_benchmark:null)}catch(t){h.A.warn("Error fetching custom benchmark:",t),e||e_("Could not load the saved benchmark. Refresh before making changes.")}})(),()=>{e=!0}},[en,eu]);let as=async e=>{if(en)try{let t=await en.post("/api/user_settings",{custom_benchmark:e});if(null==t?void 0:t.success)eS(e),e_("");else throw Error("The benchmark save was not confirmed.")}catch(e){throw console.error("Error saving custom benchmark:",e),e}},ar=async()=>{if(en)try{let e=await en.post("/api/user_settings",{custom_benchmark:{}});if(null==e?void 0:e.success)eS(null),e_("");else throw Error("The benchmark removal was not confirmed.")}catch(e){console.error("Error removing custom benchmark:",e),e_("The benchmark removal was not confirmed. Refresh before retrying.")}},an=r.useCallback(()=>{if("returns"!==tJ)return null;let e=tz?e1.filter(e=>e.date>=tz.startDate&&e.date<=tz.endDate):e1;if(0===e.length)return null;let t=(0,A.K0)(eQ);if(!e4||0===Object.keys(e4).length)return null;let a=(0,A.lK)(e4,t.stock_pct,t.bond_pct);if(0===a.length)return null;let s=new Set(e.map(e=>e.date)),r=new Set(a.map(e=>e.date)),n=[...s].filter(e=>r.has(e));return 0===n.length?null:n.sort()[0]},[tJ,e1,eQ,eB,e4,tz]),al=r.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&"returns"!==tJ)return null;if(tj)return{data:tw.benchmarkReturns,label:"Default Benchmark (preview)",defaultData:tw.benchmarkReturns,defaultLabel:"Default Benchmark (preview)"};let t=(0,A.K0)(eQ);if(!e4||0===Object.keys(e4).length)return null;let a=an();if(!a)return null;let s=(0,A.lK)(e4,t.stock_pct,t.bond_pct),r=100-t.stock_pct,n="Default Benchmark: ".concat(t.stock_pct.toFixed(0),"% ACWI / ").concat(r.toFixed(0),"% IUSB. Based on your current portfolio allocation."),l=s.filter(e=>e.date>=a),o=(0,A.iN)(l);if(eN&&Object.keys(eN).length>0){let e=(0,A.iJ)(e4,eN,M.Il);if(0===e.length)return{data:o,label:n,defaultData:o,defaultLabel:n};let t=Object.entries(eN).filter(e=>
1{let[t,a]=e;return a>0}).sort((e,t)=>{let[a,s]=e,[r,n]=t;return n-s}).map(e=>{let[t,a]=e;return"".concat(a.toFixed(0),"% ").concat(t," (").concat(M.Il[t]||t,")")}).join(" / "),s=e.filter(e=>e.date>=a);return{data:(0,A.iN)(s),label:"Custom Benchmark: ".concat(t),defaultData:o,defaultLabel:n}}return{data:o,label:n,defaultData:o,defaultLabel:n}},[tJ,eQ,eB,e4,an,eN,tj,tw.benchmarkReturns]),ao=r.useCallback(()=>{if(tj)return"balance"===tJ?tw.balanceSeries:tw.returnsSeries;if("balance"===tJ)return e0&&0!==e0.length?tz?e0.filter(e=>e.date>=tz.startDate&&e.date<=tz.endDate):e0:[];{if(!e1||0===e1.length)return[];let e=tz?e1.filter(e=>e.date>=tz.startDate&&e.date<=tz.endDate):e1,t=an();if(t){let a=e.filter(e=>e.date>=t);return(0,A.iN)(a)}return(0,A.iN)(e)}},[tJ,e0,e1,tz,an,tj,tw.balanceSeries,tw.returnsSeries]);(0,r.useEffect)(()=>{if(tj){var e,t;t$(null!=(t=null==(e=tw.balanceSeries[0])?void 0:e.invest_balance)?t:null);return}if(e0&&e0.length>0){let e=new Date().getFullYear(),t="".concat(e,"-01-01"),a=e0.find(e=>e.date>=t);a?t$(a.invest_balance):t$(null)}else t$(null)},[e0]);let ai=()=>{if(!tZ||!tK||isNaN(tK))return{amount:0,explanation:"Annual real return set in retirement plan plus inflation"};let e=tZ.annual_return||M.U1.DEFAULT_ANNUAL_RETURN;return{amount:tK*(e+M.U1.DEFAULT_INFLATION),explanation:"This year's retirement return target ( ".concat((100*e).toFixed(1),"% real return plus 3% inflation )")}},ac=(()=>{if(tj||!(null==e0?void 0:e0.length)||!(null==e1?void 0:e1.length))return null;let e="".concat(new Date().getFullYear(),"-01-01"),t=e0.find(t=>t.date>=e);if(!t||!t.invest_balance||isNaN(t.invest_balance))return null;let a=e1.filter(e=>e.date>t.date);if(0===a.length)return null;let s=a.reduce((e,t)=>e*(1+t.portfolio_return),1)-1;return{amount:t.invest_balance*s,twr:s,startOfYearBalance:t.invest_balance}})(),ad=ai(),am=ac&&ad.amount>0?ac.amount/ad.amount*100:null;(0,r.useEffect)(()=>{(async()=>{var e,t;let{data:a}=await el.auth.getSession();eh((null==(e=a.session)?void 0:e.user)||null),ev(!1),(null==(t=a.session)?void 0:t.user)||eo.replace("/investment-tracker")})();let{data:e}=el.auth.onAuthStateChange((e,t)=>{eh((null==t?void 0:t.user)||null),ev(!1),(null==t?void 0:t.user)||eo.replace("/investment-tracker")});return()=>{e.subscription.unsubscribe()}},[el,eo]),(0,r.useEffect)(()=>{eo.isReady&&"signup"===eo.query.action&&!eu&&eg(!0)},[eo.isReady,eo.query.action,eu]),(0,r.useEffect)(()=>{eu&&en&&aa()},[en,eu]),(0,r.useEffect)(()=>{eu&&!1===eL&&em(!1)},[eL,eu]);let au=async(e,t)=>{if(!eu)throw eg(!0),Error("User not authenticated");if(!en)throw Error("API client not available");let a=await en.post("/api/tracker_chat",{message:e,assistant:"milo",history:t4.milo,...t&&{tracker_state:t}});if(null===a)throw Error("Failed to send message");if(a.open_upload_modal&&!tA){let e=t4.milo.filter(e=>"user"===e.sender).slice(-1)[0];if(e){let t=e.timestamp;at.current&&at.current.getTime()===t.getTime()||(at.current=t,setTimeout(()=>{tO()},300))}}return a.transaction_saved&&eG&&setTimeout(()=>{eG()},1500),a.transactions_deleted&&eG&&setTimeout(()=>{eG()},1500),a},ah=async(e,t)=>{t5(e),ae(!0);let a={text:e,sender:"user",timestamp:new Date,metadata:t?{tracker_state:t}:void 0};t3(e=>({...e,milo:[...e.milo,a]}));try{let t=await au(e);if(t.reply||t.action_buttons){var s;let e={text:t.reply||"",sender:"milo",timestamp:new Date,metadata:t.tracker_state?{tracker_state:t.tracker_state}:void 0,actionButtons:null==(s=t.action_buttons)?void 0:s.map(e=>({text:e.text,onClick:()=>ah(e.message,t.tracker_state)}))};(e.text||e.actionButtons&&e.actionButtons.length>0)&&t3(t=>({...t,milo:[...t.milo,e]}))}}catch(e){console.error("Failed to send message:",e)}finally{ae(!1),t5("")}},ax=()=>
1{if(!eu)return void eb(!0);if(t7("milo"),0===t4.milo.length){let e={text:M.QL.MILO_DEFAULT,sender:"milo",timestamp:new Date,actionButtons:[{text:"Upload Holdings",onClick:()=>ah("I want to upload holdings")},{text:"Add Transactions",onClick:()=>ah("I want to add transactions")},{text:"Review / Modify",onClick:()=>ah("I want to review or modify transactions")}]};t3(t=>({...t,milo:[e]}))}},ag=()=>{eu?tO():eg(!0)},ap=(e,t,a)=>{t&&a?tQ({startDate:t,endDate:a}):tQ(null)},ab=eB.length>0,af=ab||!tk&&!eY&&!tN,av=!tj&&eL,ay=tj?eu?"Add Investments":"Try Premium Free":eL?"Add Investments":"Try Premium Free",aj=()=>eu?ty&&ag?void ag():eL?void(ag&&ag()):void em(!0):void eg(!0),aw=tj?"balance"===tJ?tw.balanceSeries:tw.returnsSeries:ao(),ak=tj?tw.benchmarkReturns:null==(t=al())?void 0:t.data,aN=tj?"Default Benchmark (preview)":null==(a=al())?void 0:a.label,aS=tj?tw.benchmarkReturns:null==(n=al())?void 0:n.defaultData,aC=tj?"Default Benchmark (preview)":null==(o=al())?void 0:o.defaultLabel,a_=tj?tw.positions.map(e=>({...e})):eQ,aT=(0,r.useMemo)(()=>{var e;if(!Y||tj||eP||eV||eH||eK||e$||!(null==eQ?void 0:eQ.length))return null;let t=(0,A.K0)(eQ),a=an(),s=e1||[],r=(0,A.iN)(a?s.filter(e=>e.date>=a):s),n=al(),l=e=>(e||[]).map(e=>({date:e.date,value:e.portfolio_return})),o=r.length>1?(0,b.YV)(l(r),(null==n?void 0:n.data)?l(n.data):void 0):[],i=eQ.reduce((e,t)=>e+(t.totalCost||0),0);return{portfolio_value:Math.round(t.totalPortfolioValue),total_cost_basis:Math.round(i),unrealized_gain:Math.round(t.totalPortfolioValue-i),allocation_pct:{stock:t.stock_pct,bond:t.bond_pct,cash:t.cash_pct,other:t.other_pct},weighted_expense_ratio_pct:Math.round(1e3*t.portfolioExpenseRatio)/1e3,fund_fees_per_year:Math.round(t.totalPortfolioValue*t.portfolioExpenseRatio/100),benchmark:null!=(e=null==n?void 0:n.label)?e:null,performance_window:r.length>1?{start:r[0].date,end:r[r.length-1].date}:null,performance_metrics:o.map(e=>({metric:e.label,portfolio:e.p,benchmark:e.b})),holdings:[...eQ].sort((e,t)=>(t.currentValue||0)-(e.currentValue||0)).slice(0,60).map(e=>{var t,a;return{ticker:e.ticker,quantity:e.quantity,value:Math.round(e.currentValue||0),cost_basis:Math.round(e.totalCost||0),gain:Math.round(e.gainLoss||0),account_type:null!=(t=e.account_type)?t:null,broker:null!=(a=e.broker)?a:null}})}},[Y,tj,eP,eV,eH,eK,e$,eQ,e1,an,al]);(0,p.QW)("investment_performance",aT);let aA=async()=>{tp(!0),tf(null);try{if(!tj&&(eV||eH||eY||eP))throw Error("Refresh price history before downloading this report.");let e=an(),t=e1||[],a=(0,A.iN)(e?t.filter(t=>t.date>=e):t),s=al(!0),r=await (null==en?void 0:en.get("/api/sector_breakdown?".concat(tm))),{sectorBreakdown:n,sectorBenchmarkLabel:l}=(0,f.hh)(r);await th({doc:(0,f.Gc)({clientName:ea,stats:(0,A.K0)(a_),positions:a_,portfolioIndex:a,benchmarkIndex:null==s?void 0:s.data,benchmarkLabel:null==s?void 0:s.label,sectorBreakdown:n,sectorBenchmarkLabel:l}),filename:"Investment Review".concat(ea?" - "+ea:"",".pdf")})}catch(e){tf(e instanceof Error?e.message:"Report generation failed. Please try again.")}finally{tp(!1)}};if(!Y&&ef)return(0,s.jsx)(Q.kt,{});if(!Y&&!eu)return null;let aI=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l(),{children:[(0,s.jsx)("title",{children:"Investment Tracker - Teapot Investments"}),(0,s.jsx)("meta",{name:"description",content:"Track your investment portfolio and analyze performance"}),(0,s.jsx)("meta",{name:"robots",content:"noindex, nofollow"}),(0,s.jsx)("link",{rel:"icon",href:"/logo-tiny.PNG",type:"image/png"})]}),(0,s.jsx)(i(),{id:"investment-tracker-video-schema",type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"VideoObject",name:"Best Family Investment Tracker: Manage All Accounts Without Sharing Logins",description:"Meet Milo Potts, your AI powered investment tracker from Teapot Investments. Manage all family accounts and track household investments across different accounts, brokers, and family members without sharing bank or brokerage logins. Your privacy is our priority with no names, phone numbers, or sales calls required. Just upload screenshots, Excel, or CSV files. Milo organizes everything automatically: tracks all your accounts and family portfolios, reveals asset allocation across all accounts, shows exactly how much you're paying in fund expenses down to the dollar, tracks returns and measures your progress toward retirement goals, and lets you view performance vs custom benchmark. Works securely with screenshots.",thumbnailUrl:"https://img.youtube.com/vi/CC9l1tUF7mE/maxresdefault.jpg",uploadDate:"2024-01-01T00:00:00Z",contentUrl:"https://www.youtube.com/watch?v=CC9l1tUF7mE",embedUrl:"https://www.youtube.com/embed/CC9l1tUF7mE",publisher:{"@type":"Organization",name:"Teapot Investments",url:"https://www.teapotinvestments.com"}})}}),tb&&(0,s.jsx)("p",{role:"alert",className:"mb-4 text-sm text-red-600",children:tb}),Y?(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)(m.ST,{children:[(0,s.jsx)(m.eg,{children:"Investment"})," Tracker"]}),!ea&&(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsx)(B.N,{onClick:ax}),!ty&&(null!=(N=null==eB?void 0:eB.length)?N:0)>0&&(0,s.jsx)(x.l,{onClick:aA,loading:tx||tg})]})]}),ea&&(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 mt-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(m.UH,{children:ea}),es&&(0,s.jsxs)("button",{onClick:es,className:"flex items-center gap-1 text-xs font-medium text-blue-500 hover:text-blue-700 transition-colors",children:[(0,s.jsx)(d.cfS,{size:11}),"See all clients"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsx)(B.N,{onClick:ax}),!ty&&(null!=(S=null==eB?void 0:eB.length)?S:0)>0&&(0,s.jsx)(x.l,{onClick:aA,loading:tx||tg})]})]}),ea&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.yf,{className:"mt-2",children:"See all of your client's household holdings in one place, with live performance, allocation, and fees across every account."}),er&&(0,s.jsx)(u.A,{clientId:er,product:"Investment Tracker",className:"mt-4"}),!tj&&!eP&&!ty&&(null!=(C=null==eB?void 0:eB.length)?C:0)>0&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Total Balance"}),(0,s.jsx)("div",{className:"text-3xl md:text-4xl font-black bg-gradient-to-r from-brandSky to-brandGreen bg-clip-text text-transparent",children:(0,I.ML)(parseFloat(eO.replace(/[$,]/g,""))||0)})]})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("h1",{className:"text-4xl md:text-6xl font-extrabold leading-tight mb-4",children:[(0,s.jsx)("span",{className:"teapot-gradient-text",children:"Investment"})," Tracker"]}),(0,s.jsx)("p",{className:"text-lg text-gray-700 mb-4",children:"See all your household holdings in one place with live performance, allocations, and fees across every account. Track how your investments are doing without linking logins or sharing passwords."}),(0,s.jsx)("div",{className:"mb-8",children:(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-green-100 px-3 py-1 text-sm font-semibold text-green-800 ring-1 ring-inset ring-green-600/20",children:"Based on live market prices"})})]}),eu&&eF&&(0,s.jsx)(ee.A,{onRetry:eR,className:"mb-6"}),!!eu&&ab&&(eV||eH)&&(0,s.jsxs)("div",{role:"status",className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900",children:[(0,s.jsxs)("p",{children:[eV||eH,eY?" Retrying…":""]}),(0,s.jsx)("button",{type:"button",onClick:()=>void eG(),disabled:eP||eY,className:"font-medium text-blue-600 hover:underline disabled:opacity-50",children:"Retry"})]}),(ty||!eu||!ab&&(eY||tN))&&(0,s.jsx)(X.A,{isAuthenticated:!!eu,title:tk||tN?"Investments Could Not Be Loaded":eY?"Retrieving Your Investments":void 0,description:tk||tN?eH||"Please retry loading your investments.":eY?"please wait...":void 0,showProgressBar:eY&&!tk,progress:eY&&!tk?eq/M.Go.MAX_RETRIES*100:0,hideButton:eY,button:tk||tN?(0,s.jsx)("button",{onClick:()=>void eG(),className:"px-6 py-2 bg-brandSky hover:bg-brandSky/90 text-white rounded-md transition-colors duration-200",children:"Retry"}):eu||eY||tN?void 0:(0,s.jsx)(J.A,{onClick:()=>eg(!0),text:"Add Investments"}),onGetStarted:()=>eg(!0),onUploadClick:ag,uploadPanel:!eu||!ty||eY||tN||tk?void 0:(0,s.jsx)(G.A,{uploadedFiles:tC,isProcessing:t_,isLoadingEntitlements:eE,fileInputRef:tL,onFileUpload:tM,onRemoveFile:tR,onProcessFiles:tF,onDrop:tB,onDragOver:tD,showHelpSection:!1,showManualAddSection:!1,hideModalHeader:!0,accent:"blue",requiredInfoAsSentence:!0,onBrokerTagChange:tH,onAccountTypeChange:tV,onEntryTypeChange:tW,onHeldSinceChange:tY,onSnapshotModeChange:tq})}),!Y&&(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8 max-w-4xl mx-auto",children:[(0,s.jsx)("div",{className:"space-y-6",children:tj?(0,s.jsx)(Z.A,{hasAccess:!1,isLoading:!1,showButton:!1,children:(0,s.jsx)("div",{className:"rounded-lg p-0 md:p-6",children:(0,s.jsxs)("div",{className:"w-full bg-themeIvory rounded-2xl p-6 md:p-6 shadow-sm hover:shadow-md transition-all duration-300 ease-in-out flex items-center gap-4 md:gap-6 group border-2 border-gray-100 hover:border-gray-200",children:[(0,s.jsx)("div",{className:"relative w-20 h-20 md:w-24 md:h-24 lg:w-32 lg:h-32 rounded-full bg-themeIvory flex items-center justify-center group-hover:scale-105 transition-transform duration-300 overflow-hidden flex-shrink-0 w-1/3 md:w-auto",children:(0,s.jsx)(v.BJb,{className:"text-brandRuby w-14 h-14"})}),(0,s.jsxs)("div",{className:"w-2/3 md:flex-1 text-left min-w-0",children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-1 group-hover:text-brandGold transition-colors duration-300",children:"Total Balance"}),(0,s.jsxs)("div",{className:"text-2xl sm:text-3xl md:text-3xl font-black text-brandSky tracking-tight overflow-hidden text-ellipsis whitespace-nowrap min-w-0 relative",children:[(0,s.jsx)("span",{className:"text-transparent",children:tw.totalValue}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-200/70 rounded"})]})]})]})})}):(0,s.jsx)("div",{className:"rounded-lg p-0 md:p-6",children:(0,s.jsxs)("div",{className:"w-full bg-themeIvory rounded-2xl p-6 md:p-6 shadow-sm hover:shadow-md transition-all duration-300 ease-in-out flex items-center gap-4 md:gap-6 group border-2 border-gray-100 hover:border-gray-200",children:[(0,s.jsx)("div",{className:"relative w-20 h-20 md:w-24 md:h-24 lg:w-32 lg:h-32 rounded-full bg-themeIvory flex items-center justify-center group-hover:scale-105 transition-transform duration-300 overflow-hidden flex-shrink-0 w-1/3 md:w-auto",children:(0,s.jsx)(v.BJb,{className:"text-brandRuby w-14 h-14"})}),(0,s.jsxs)("div",{className:"w-2/3 md:flex-1 text-left min-w-0",children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-1 group-hover:text-brandGold transition-colors duration-300",children:"Total Balance"}),(0,s.jsx)("div",{className:"text-2xl sm:text-3xl md:text-3xl font-black text-brandSky tracking-tight overflow-hidden text-ellipsis whitespace-nowrap min-w-0",children:eP?(0,s.jsx)(Q.jt,{lines:["w-32"],lineHeight:"h-4",bgColor:"bg-gray-300"}):(()=>{let e=parseFloat(eO.replace(/[$,]/g,""));return(0,I.ML)(e)})()})]})]})})}),(0,s.jsx)(F.l,{assistant:"milo",selectedAssistant:t8,onStartChat:()=>ax()})]}),"milo"===t8&&(0,s.jsx)("div",{className:"mb-8",children:(0,s.jsx)(F.G,{assistant:"milo",conversationHistory:t4,setConversationHistory:t3,selectedAssistant:t8,setSelectedAssistant:t7,inputMessage:t6,setInputMessage:t5,sendMessageToAgent:au,initialMessage:M.QL.MILO_DEFAULT,validationMessages:M.D8.TRACKER_CHAT_VALIDATION,quickHelpButtons:[{text:"How do I take a screenshot?",shortText:"Screenshot?",onClick:()=>t5("How do I take a screenshot?")},{text:"Where can I find tax lots?",shortText:"Tax Lots?",onClick:()=>t5("Where can I find tax lots?")},{text:"I still can't find it",shortText:"I'm Stuck",onClick:()=>t5("I still can't find it")}],onClearHistory:()=>{let e={text:M.QL.MILO_DEFAULT,sender:"milo",timestamp:new Date,actionButtons:[{text:"Upload Holdings",onClick:()=>ah("I want to upload holdings")},{text:"Add transactions",onClick:()=>ah("I want to add transactions")},{text:"Review / Modify",onClick:()=>ah("I want to review or modify transactions")}]};
1t3(t=>({...t,milo:[e]}))},externalLoading:t9})}),af&&(tj||eu&&!ty)&&(()=>{let e=(0,A.K0)(a_);return!tj&&eP?(0,s.jsxs)("div",{className:"mt-4 mb-8 max-w-4xl mx-auto",children:[(0,s.jsx)("h2",{className:"text-xl md:text-2xl font-bold mb-4",children:"Summary"}),(0,s.jsxs)("div",{className:"bg-themeIvory rounded-lg p-6 shadow-sm border border-gray-100",children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("h2",{className:"section-heading-black",children:"Portfolio Allocation"})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,s.jsx)("div",{className:"lg:col-span-2",children:(0,s.jsx)("div",{className:"animate-pulse",children:(0,s.jsx)("div",{className:"h-80 bg-gray-200 rounded"})})}),(0,s.jsxs)("div",{className:"lg:col-span-1 space-y-4",children:[(0,s.jsx)("div",{className:"bg-white rounded-lg p-4 shadow-sm border border-gray-200",children:(0,s.jsxs)("div",{className:"animate-pulse",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-gray-200 rounded-full"}),(0,s.jsx)("div",{className:"h-4 bg-gray-200 rounded w-24"})]}),(0,s.jsx)("div",{className:"h-8 bg-gray-200 rounded w-20 mb-2"}),(0,s.jsx)("div",{className:"h-3 bg-gray-200 rounded w-full"})]})}),(0,s.jsx)("div",{className:"bg-white rounded-lg p-4 shadow-sm border border-gray-200",children:(0,s.jsxs)("div",{className:"animate-pulse",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-gray-200 rounded-full"}),(0,s.jsx)("div",{className:"h-4 bg-gray-200 rounded w-32"})]}),(0,s.jsx)("div",{className:"h-8 bg-gray-200 rounded w-24 mb-2"}),(0,s.jsx)("div",{className:"h-3 bg-gray-200 rounded w-full"})]})}),(0,s.jsx)("div",{className:"bg-white rounded-lg p-4 shadow-sm border border-gray-200",children:(0,s.jsxs)("div",{className:"animate-pulse",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-gray-200 rounded-full"}),(0,s.jsx)("div",{className:"h-4 bg-gray-200 rounded w-28"})]}),(0,s.jsx)("div",{className:"h-8 bg-gray-200 rounded w-20 mb-2"}),(0,s.jsx)("div",{className:"h-3 bg-gray-200 rounded w-full"})]})})]})]})]})]}):0===e.totalPortfolioValue?null:(0,s.jsxs)("div",{className:"mt-4 mb-8 max-w-4xl mx-auto",children:[(0,s.jsx)("h2",{className:"text-xl md:text-2xl font-bold mb-4",children:"Summary"}),(0,s.jsx)(Z.A,{hasAccess:av,isLoading:eE,unverified:eF,onUnlock:aj,buttonText:ay,buttonGradient:"premium",children:(0,s.jsxs)("div",{className:"bg-themeIvory rounded-lg p-6 shadow-sm border border-gray-100",children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("h2",{className:"section-heading-black",children:"Portfolio Allocation"})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,s.jsx)("div",{className:"lg:col-span-2",children:(0,s.jsx)(k.nw,{allocation:e,showTitle:!1,showLegend:!0,legendLayout:"flex",showLabels:!1,showHover:!1,wrapperClassName:"",className:"flex justify-center"})}),(0,s.jsxs)("div",{className:"lg:col-span-1 space-y-4",children:[(0,s.jsxs)("div",{className:"bg-white rounded-lg p-4 shadow-sm border border-gray-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center",children:(0,s.jsx)(d.FrA,{className:"w-4 h-4 text-blue-600"})}),(0,s.jsx)("h4",{className:"font-semibold text-gray-800",children:"Expense Ratio"})]}),(0,s.jsxs)("div",{className:"text-2xl font-bold text-gray-900 relative",children:[(0,s.jsxs)("span",{className:tj?"text-transparent":"",children:[e.portfolioExpenseRatio.toFixed(2),"%"]}),tj&&(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-200/70 rounded"})]}),(0,s.jsxs)("div",{className:"text-xs text-gray-500",children:["You are paying $",Math.round(e.totalPortfolioValue*e.portfolioExpenseRatio/100).toLocaleString()," per year in fund fees"]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg p-4 shadow-sm border border-gray-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-green-100 rounded-full flex items-center justify-center",children:(0,s.jsx)(d.z8N,{className:"w-4 h-4 text-green-600"})}),(0,s.jsx)("h4",{className:"font-semibold text-gray-800",children:"Balance (Start of Year)"})]}),(0,s.jsx)("div",{className:"text-2xl font-bold text-gray-900 relative",children:tj?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-transparent",children:"$42,000"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-200/70 rounded"})]}):null===tK||isNaN(tK)?"--":"$".concat(Math.round(tK).toLocaleStr
1ing())}),(0,s.jsxs)("div",{className:"text-xs text-gray-500",children:[new Date().getFullYear()," Start of Year"]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg p-4 shadow-sm border border-gray-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-amber-100 rounded-full flex items-center justify-center",children:(0,s.jsx)(d._m3,{className:"w-4 h-4 text-amber-600"})}),(0,s.jsx)("h4",{className:"font-semibold text-gray-800",children:"Target Return"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-gray-900 relative",children:tj?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-transparent",children:"$2,100"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-200/70 rounded"})]}):0!==ai().amount?"$".concat(Math.round(ai().amount).toLocaleString()):"--"}),!tj&&ac&&null!==am&&(0,s.jsx)(K,{pct:am,negative:ac.amount<0,onClick:()=>ek(!0),ariaLabel:"View year-to-date return progress"})]}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:ai().explanation})]})]})]}),e.missingTickers&&e.missingTickers.length>0&&(0,s.jsxs)("div",{className:"mt-6 pl-0 lg:pl-8 text-sm text-gray-600",children:[(0,s.jsx)("span",{className:"font-medium",children:"Note:"})," ",M.Pf.ALLOCATION_NOTE," ",e.missingTickers.join(", "),". ",M.Pf.ALLOCATION_FOLLOWUP]})]})})]})})(),Y&&af&&!tj&&eu&&!ty&&(null!=(_=null==eD?void 0:eD.length)?_:0)>0&&(0,s.jsx)(E,{tallies:tc,selected:to,onSelect:e=>ti(t=>t===e?null:e),isLoading:eU}),af&&!tj&&eu&&!ty&&(0,s.jsx)("div",{id:"current-investments",ref:tS,children:(0,s.jsx)(w.A,{positions:td&&tu?tu.positions:eB,lots:td&&tu?tu.lots:eD,totalValue:td&&tu?tu.totalValue:eO,isLoading:eP,title:"Current Investments",columns:[{key:"ticker",label:"Ticker",align:"left"},{key:"quantity",label:"Quantity",align:"right",format:e=>(0,D.S)(e)},{key:"currentPrice",label:"Current Price",align:"right",format:e=>"$".concat((0,D.S)(e))},{key:"currentValue",label:"Current Value",align:"right",format:e=>"$".concat((0,D.S)(e))},{key:"gainLoss",label:"Gain/Loss",align:"right",format:e=>"$".concat((0,D.S)(e))},{key:"net_exp_ratio",label:"Expense Ratio",align:"right",format:e=>e?"".concat(e.toFixed(2),"%"):"--"}],showExpandable:!1,showTotalValue:!0,onPortfolioRefresh:()=>{eG()},selectedBroker:eK,searchQuery:e$,availableBrokers:ez,filteredPositions:td&&tu?tu.positions:eQ,filteredLots:td&&tu?tu.lots:eJ,filteredTotalValue:td&&tu?tu.totalValue:eX,setSelectedBroker:e7,setSearchQuery:e9,clearFilters:te})}),af&&(tj||eu&&!ty)&&(0,s.jsxs)("div",{className:"mt-4 mb-8 max-w-4xl mx-auto",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsx)("h2",{className:"text-xl md:text-2xl font-bold",children:"Investment Performance"})}),!tj&&((null!=(L=null==e3?void 0:e3.length)?L:0)>0||Object.keys(tr.proxies).length>0)&&(0,s.jsxs)("div",{className:"mb-4 space-y-2",children:[(0,s.jsx)(H.A,{lateStarters:e3||[],start:null!=e6?e6:null,extended:Object.entries(tr.proxies).map(e=>{let[t,a]=e;return{ticker:t,proxy:a}}),proxies:tn,onProxyChange:(e,t)=>
1tl(a=>({...a,[e]:t})),onApply:()=>void tr.save({...tr.proxies,...Object.fromEntries(Object.entries(tn).filter(e=>{let[,t]=e;return t.trim()}).map(e=>{let[t,a]=e;return[t,a.trim().toUpperCase()]}))}),onReset:()=>{tl({}),tr.save({})},applying:tr.saving,getHeaders:async()=>{var e;return{Authorization:"Bearer ".concat(null==(e=(await el.auth.getSession()).data.session)?void 0:e.access_token)}}}),tr.error&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-red-600",children:tr.error})]}),tj?(0,s.jsxs)(Z.A,{hasAccess:av,isLoading:eE,unverified:eF,onUnlock:aj,buttonText:ay,buttonGradient:"premium",children:[eC&&(0,s.jsx)("p",{role:"alert",className:"mb-3 text-sm text-amber-700",children:eC}),(0,s.jsx)(k.o6,{data:aw,isLoading:!1,onFrequencyChange:ap,missingTickers:e2,mode:tJ,onModeChange:tX,benchmarkData:ak,benchmarkLabel:aN,defaultBenchmarkData:aS,defaultBenchmarkLabel:aC,hasCustomBenchmark:!1,portfolioLabel:"Portfolio",onAddCustomBenchmark:()=>ej(!0),onEditCustomBenchmark:()=>ej(!0),onRemoveCustomBenchmark:ar})]}):eP&&!ab?(0,s.jsx)("div",{className:"animate-pulse",children:(0,s.jsx)("div",{className:"h-80 bg-gray-200 rounded"})}):(0,s.jsx)(Z.A,{hasAccess:av,isLoading:eE,unverified:eF,onUnlock:aj,buttonText:ay,buttonGradient:"premium",children:(0,s.jsx)(k.o6,{data:aw,isLoading:eP&&!ab,onFrequencyChange:ap,missingTickers:e2,mode:tJ,onModeChange:tX,benchmarkData:ak,benchmarkLabel:aN,defaultBenchmarkData:aS,defaultBenchmarkLabel:aC,hasCustomBenchmark:!!(eN&&Object.keys(eN).length>0),portfolioLabel:eK||e$?"Portfolio (".concat(eK||e$,")"):void 0,onAddCustomBenchmark:()=>ej(!0),onEditCustomBenchmark:()=>ej(!0),onRemoveCustomBenchmark:ar})})]}),af&&!tj&&!ty&&(0,s.jsx)(T,{apiClient:en,enabled:Y||av,filterQuery:tm,refreshKey:String(tt||"")}),(0,s.jsx)(P.A,{isOpen:ed,onClose:()=>em(!1),apiClient:en}),(0,s.jsx)(U.A,{isOpen:tA,onClose:tP,uploadedFiles:tC,isProcessing:t_,isLoadingEntitlements:eE,fileInputRef:tL,onFileUpload:tM,onRemoveFile:tR,onProcessFiles:tF,onDrop:tB,onDragOver:tD,showHelpSection:!1,showManualAddSection:!1,onBrokerTagChange:tH,onAccountTypeChange:tV,onEntryTypeChange:tW,onHeldSinceChange:tY,onSnapshotModeChange:tq}),(0,s.jsx)(W.A,{isOpen:tI,onClose:tU,mode:"review",transactions:tT,onSaveSuccess:tG,uploadWarnings:tE}),(0,s.jsx)($.gK,{isOpen:ex,onClose:()=>eg(!1),assistantName:"Milo",customMessage:"To add or retrieve your investments, sign in or create a free account with just your email."}),(0,s.jsx)($.gK,{isOpen:ep,onClose:()=>eb(!1),assistantName:"Milo"}),(0,s.jsx)($.Kj,{isOpen:ey,onClose:()=>ej(!1),onSave:as,initialBenchmark:eN||void 0}),ac&&(0,s.jsx)(q,{isOpen:ew,onClose:()=>ek(!1),ytdAmount:ac.amount,startOfYearBalance:ac.startOfYearBalance,targetAmount:ad.amount,progressPct:am}),!eu&&(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow p-6 mb-8 mt-8",children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-4",children:"Getting Started with Investment Tracking"}),(0,s.jsx)("p",{className:"text-gray-600 mb-6",children:"Watch this short tutorial to learn how to use our investment tracking tools."}),(0,s.jsx)("div",{className:"relative w-full pb-[56.25%] h-0",children:(0,s.jsx)("iframe",{className:"absolute top-0 left-0 w-full h-full rounded-lg shadow-md",src:"https://www.youtube.com/embed/CC9l1tUF7mE",t
1itle:"Investment Tracking Tutorial",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsxs)("div",{className:"bg-gray-50 border-l-4 border-green-500 p-4 mb-4",children:[(0,s.jsx)("h4",{className:"font-bold text-gray-800 mb-2",children:"Data We Need"}),(0,s.jsx)("p",{className:"text-gray-600 text-sm",children:"Milo only collects tickers, quantities, purchase prices, and transaction dates from the screenshots to do the work. You can block out account numbers for additional peace of mind if you typically do so with other AI tools."})]}),(0,s.jsx)("p",{className:"text-gray-600 mb-4",children:"Tap Get Started to begin tracking your investments!"}),(0,s.jsx)(J.A,{onClick:()=>eg(!0)})]})]})]});return Y?aI:(0,s.jsx)(y.A,{children:aI})};ea.displayName="InvestmentTracker";let es=ea}}]);

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.