PageSourceSearch

https://app.calypsocopilot.com/static/js/630.992f481d.chunk.js

js calypsocopilot.com collected 2026-10-05 11:30:37 UTC 8,309 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkcalypso=self.webpackChunkcalypso||[]).push([[630],{60630:(e,t,a)=>{a.r(t),a.d(t,{default:()=>x});var n=a(89379),l=a(65043),s=a(34793),i=a(80332),r=a(70579);function o(e){return null==e||""===e?null:Number.isFinite(Number(e))?Number(e):null}function c(e,t){const a=o(e);return null==a?t?"text-white/45":"text-slate-500":a>0?t?"text-emerald-300":"text-emerald-600":a<0?t?"text-rose-300":"text-rose-600":t?"text-white/70":"text-slate-700"}const u=Object.freeze([["1D","1D"],["1W","1W"],["1M","1M"],["YTD","YTD"],["1Y","1Y"],["ALL","All"]]);function d(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(String(e||"")))return null;const t=Date.parse("".concat(e,"T00:00:00.000Z"));return Number.isFinite(t)&&new Date(t).toISOString().slice(0,10)===e?e:null}function m(e){const t=d(null===e||void 0===e?void 0:e.from),a=d(null===e||void 0===e?void 0:e.to),n="number"===typeof(null===e||void 0===e?void 0:e.valuePct)&&Number.isFinite(e.valuePct)?e.valuePct:null;return t&&a&&t<a&&null!=n?{from:t,to:a,valuePct:n}:null}function p(e){let{estimate:t,darkMode:a}=e;return t?(0,r.jsxs)("div",{className:"px-5 py-4","data-testid":"reviewed-midpoint-dietz-estimate",children:[(0,r.jsx)("p",{className:"text-[10px] font-semibold ".concat(a?"text-white/45":"text-slate-600"),children:"Midpoint Dietz estimate"}),"available"===t.status?(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[(0,r.jsxs)("span",{className:"text-lg font-bold tabular-nums ".concat(c(t.valuePct,a)),children:["Cumulative ",(0,i.d1)(t.valuePct)]}),null!=t.annualizedPct&&(0,r.jsxs)("span",{className:"text-[11px] tabular-nums ".concat(c(t.annualizedPct,a)),children:["Annualized ",(0,i.d1)(t.annualizedPct)]}),(0,r.jsxs)("span",{className:a?"text-[10px] text-white/35":"text-[10px] text-slate-500",children:["Reviewed ",t.from," to ",t.to]})]}):(0,r.jsx)("ul",{className:"mt-2 space-y-1.5",children:t.periods.map((e=>(0,r.jsxs)("li",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5 text-[11px]",children:[(0,r.jsxs)("span",{className:a?"text-white/40":"text-slate-500",children:["Reviewed ",e.from," to ",e.to]}),(0,r.jsx)("span",{className:"font-bold tabular-nums ".concat(c(e.valuePct,a)),children:(0,i.d1)(e.valuePct)})]},"".concat(e.from,":").concat(e.to))))}),(0,r.jsxs)("p",{className:"mt-2 text-[10px] leading-4 ".concat(a?"text-white/30":"text-slate-400"),children:["periods_only"===t.status?"Independent reviewed periods use midpoint flow timing; no whole-range estimate is available.":"Reviewed statement estimate uses midpoint flow timing."," Not exact TWR or XIRR. Range controls apply only to exact return lines."]})]}):null}function x(e){let{analytics:t,accounts:a,selectedAccountId:x,reviewedEstimate:h,readAccountValuations:f,buildSeries:b,darkMode:v}=e;const g=(0,l.useMemo)((()=>{const e=[];var n;t.series.length>=2&&e.push({id:"portfolio",label:x?(null===(n=a[0])||void 0===n?void 0:n.name)||"Selected account":"Entire Portfolio",valuations:t.series});return(Array.isArray(a)?a:[]).forEach((a=>{const n=(0,s.fZ)(a),l=f(a);n&&l.length>=2&&!(x&&t.series.length>=2)&&e.push({id:n,label:a.name||a.type||a.institution||"Investment account",valuations:l})})),e.slice(0,8)}),[a,t.series,x,f]),[w,j]=(0,l.useState)("ALL"),y=(0,l.useMemo)((()=>g.map((e=>(0,n.A)((0,n.A)({},e),{},{series:b(e.valuations,w)}))).filter((e=>e.series.length>=2))),[b,g,w]),N=(0,l.useMemo)((()=>{if(!y.length)return null;const e=y.flatMap((e=>e.series.map((e=>(0,n.A)((0,n.A)({},e),{},{timestamp:Date.parse("".concat(e.date,"T00:00:00.000Z"))}))))).filter((e=>Number.isFinite(e.timestamp)&&null!=o(e.value)));if(e.length<2)return null;const t=Math.min(...e.map((e=>e.timestamp))),a=Math.max(...e.map((e=>e.timestamp))),l=e.map((e=>e.value));let s=Math.min(0,...l),i=Math.max(0,...l);s===i&&(s-=1,i+=1);const r=a-t||1,c=i-s;return{minValue:s,maxValue:i,minDate:new Date(t).toISOString().slice(0,10),maxDate:new Date(a).toISOString().slice(0,10),paths:y.map((e=>{var a;return(0,n.A)((0,n.A)({},e),{},{path:e.series.map(((e,a)=>{const n=2+(Date.parse("".concat(e.date,"T00:00:00.000Z"))-t)/r*96,l=42-(e.value-s)/c*38;return"".concat(a?"L":"M"," ").concat(n.toFixed(2)," ").concat(l.toFixed(2))})).join(" "),terminal:null===(a=e.series[e.series.length-1])||void 0===a?void 0:a.value})})),zeroY:42-(0-s)/c*38}}),[y]),P=(0,l.useMemo)((()=>function(e,t){if(!t||(null===e||void 0===e?void 0:e.accountId)!==t)return null;const a=e.midpointDietz;if(!a||!["available","periods_only"].includes(a.status))return null;
1const n=(Array.isArray(a.periods)?a.periods:[]).map(m).filter(Boolean);if("periods_only"===a.status)return n.length?{status:"periods_only",periods:n}:null;const l=d(a.from),s=d(a.to),i="number"===typeof a.valuePct&&Number.isFinite(a.valuePct)?a.valuePct:null;return!l||!s||l>=s||null==i||!Number.isInteger(a.periodCount)||a.periodCount<1?null:{status:"available",from:l,to:s,valuePct:i,annualizedPct:!0===a.cumulativeOnly?null:"number"===typeof a.annualizedPct&&Number.isFinite(a.annualizedPct)?a.annualizedPct:null}}(h,x)),[h,x]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"border-b px-5 py-4 ".concat(v?"border-white/[0.07]":"border-slate-200"),children:[(0,r.jsx)("h2",{className:"text-sm font-bold",children:"Reported account returns"}),(0,r.jsx)("p",{className:"mt-0.5 text-xs ".concat(v?"text-white/38":"text-slate-500"),children:"Cash-flow-adjusted lines from complete dated valuations \xb7 ranges end at the latest complete valuation"}),(0,r.jsx)("div",{className:"mt-3 inline-flex max-w-full overflow-x-auto rounded-lg p-0.5 ".concat(v?"bg-white/[0.04]":"bg-slate-100"),"aria-label":"Reported return range",children:u.map((e=>{let[t,a]=e;return(0,r.jsx)("button",{type:"button","aria-label":"Reported returns: ".concat(a),"aria-pressed":w===t,onClick:()=>j(t),className:"min-h-11 flex-none rounded-md px-2.5 py-1 text-[10px] font-semibold ".concat(w===t?v?"bg-white/[0.1] text-white":"bg-white text-slate-900 shadow-sm":v?"text-white/38":"text-slate-500"),children:a},t)}))})]}),N?(0,r.jsxs)("div",{className:"px-5 py-4",children:[(0,r.jsxs)("svg",{viewBox:"0 0 100 46",preserveAspectRatio:"none",className:"h-44 w-full",role:"img","aria-label":"Cash-flow-adjusted reported returns for the Entire Portfolio and supported accounts",children:[(0,r.jsx)("line",{x1:"2",x2:"98",y1:N.zeroY,y2:N.zeroY,stroke:"currentColor",strokeOpacity:"0.14",vectorEffect:"non-scaling-stroke"}),N.paths.map(((e,t)=>(0,r.jsx)("path",{d:e.path,fill:"none",stroke:["#8b5cf6","#10b981","#f59e0b","#ec4899","#14b8a6","#f97316","#a78bfa","#84cc16"][t],strokeWidth:"portfolio"===e.id?2.4:1.5,strokeOpacity:"portfolio"===e.id?1:.78,vectorEffect:"non-scaling-stroke"},e.id)))]}),(0,r.jsxs)("div",{className:"mt-1 flex justify-between text-[9px] tabular-nums ".concat(v?"text-white/30":"text-slate-400"),children:[(0,r.jsx)("span",{children:N.minDate}),(0,r.jsx)("span",{children:N.maxDate})]}),(0,r.jsx)("ul",{className:"mt-3 grid gap-x-5 gap-y-2 sm:grid-cols-2 lg:grid-cols-3",children:N.paths.map(((e,t)=>(0,r.jsxs)("li",{className:"flex min-w-0 items-center gap-2 text-[10px]",children:[(0,r.jsx)("span",{className:"h-0.5 w-4 flex-none",style:{backgroundColor:["#8b5cf6","#10b981","#f59e0b","#ec4899","#14b8a6","#f97316","#a78bfa","#84cc16"][t]},"aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate font-medium",children:e.label}),(0,r.jsx)("span",{className:"font-bold tabular-nums ".concat(c(e.terminal,v)),children:"1D"===w?(0,i.ED)(e.terminal):(0,i.d1)(e.terminal)})]},"legend-".concat(e.id))))}),y.length<g.length&&(0,r.jsxs)("p",{className:"mt-3 text-[9px] leading-4 ".concat(v?"text-white/30":"text-slate-500"),children:["Only accounts with a real valuation near the ","ALL"===w?"first recorded":w," boundary are shown."]})]}):P?(0,r.jsx)(p,{estimate:P,darkMode:v}):(0,r.jsxs)("p",{className:"px-5 py-7 text-xs leading-5 ".concat(v?"text-white/38":"text-slate-500"),children:["ALL"===w?"Exact TWR/XIRR return lines are unavailable until there are at least two dated valuations with complete external cash-flow coverage.":"Exact ".concat(w," return lines are unavailable because there is no complete valuation near that range boundary.")," Current balances are not treated as returns."]})]})}}}]);
2//# sourceMappingURL=630.992f481d.chunk.js.map

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.