PageSourceSearch

https://fiyr.app/js/4141.987e3799.js

js fiyr.app collected 2026-10-09 04:27:19 UTC 39,843 bytes, 1 lines download raw bytes

1"use strict";(self["webpackChunkfinance_app"]=self["webpackChunkfinance_app"]||[]).push([[4141],{6525:function(t,e,s){s.d(e,{A:function(){return S}});var a=s(1529),n=s(8642),i=s(9868);const r=["viewBox","aria-label"],o=["d"],l=["d"],h=["d"],c=["x1","x2","y2"],u=["cx","cy","r"],p=["cx","cy","r"],d={class:"burn-spark-foot"},m={class:"burn-spark-caption"},y={class:"burn-spark-readout-value"},v={class:"burn-spark-readout-part"},g={class:"burn-spark-readout-part"},f={class:"burn-spark-readout-date"},k=["title"];function x(t,e,s,x,w,D){return D.hasPlot?((0,a.uX)(),(0,a.CE)("div",{key:0,ref:"root",class:"burn-spark",onPointermove:e[1]||(e[1]=(...t)=>D.onMove&&D.onMove(...t)),onPointerleave:e[2]||(e[2]=(...t)=>D.onLeave&&D.onLeave(...t)),onPointerdown:e[3]||(e[3]=(0,n.D$)(()=>{},["stop"])),onClick:e[4]||(e[4]=(0,n.D$)(()=>{},["stop"]))},[((0,a.uX)(),(0,a.CE)("svg",{class:"burn-spark-svg",viewBox:`0 0 ${s.width} ${s.height}`,preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":D.ariaLabel},[w.splitMode?((0,a.uX)(!0),(0,a.CE)(a.FK,{key:1},(0,a.pI)(D.splitPaths,t=>((0,a.uX)(),(0,a.CE)("path",{key:t.key,class:(0,i.C4)(["burn-spark-line",`is-${t.key}`]),d:t.d,"vector-effect":"non-scaling-stroke"},null,10,h))),128)):((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("path",{class:"burn-spark-area",d:D.areaPath},null,8,o),(0,a.Lk)("path",{class:"burn-spark-line",d:D.linePath,"vector-effect":"non-scaling-stroke"},null,8,l)],64)),w.hover?((0,a.uX)(),(0,a.CE)("line",{key:2,class:"burn-spark-crosshair",x1:w.hover.x,y1:0,x2:w.hover.x,y2:s.height,"vector-effect":"non-scaling-stroke"},null,8,c)):(0,a.Q3)("",!0),w.splitMode?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)("circle",{key:3,class:"burn-spark-dot",cx:D.lastPoint.x,cy:D.lastPoint.y,r:D.dotRadius},null,8,u)),w.hover&&!w.splitMode?((0,a.uX)(),(0,a.CE)("circle",{key:4,class:"burn-spark-hoverdot",cx:w.hover.x,cy:w.hover.y,r:D.dotRadius},null,8,p)):(0,a.Q3)("",!0)],8,r)),(0,a.Lk)("div",d,[(0,a.Lk)("div",m,[w.hover?((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("span",y,"$"+(0,i.v_)(w.hover.value.toLocaleString())+"/day",1),w.splitMode?((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[e[7]||(e[7]=(0,a.Lk)("span",{class:"burn-spark-swatch is-recurring"},null,-1)),(0,a.Lk)("span",v,[e[5]||(e[5]=(0,a.Lk)("span",{class:"burn-spark-readout-label"},"Recurring",-1)),(0,a.eW)(" $"+(0,i.v_)(w.hover.recurring.toLocaleString()),1)]),e[8]||(e[8]=(0,a.Lk)("span",{class:"burn-spark-swatch is-everyday"},null,-1)),(0,a.Lk)("span",g,[e[6]||(e[6]=(0,a.Lk)("span",{class:"burn-spark-readout-label"},"Everyday",-1)),(0,a.eW)(" $"+(0,i.v_)(w.hover.everyday.toLocaleString()),1)])],64)):(0,a.Q3)("",!0),(0,a.Lk)("span",f,(0,i.v_)(w.hover.label),1)],64)):w.splitMode?((0,a.uX)(),(0,a.CE)(a.FK,{key:1},[e[9]||(e[9]=(0,a.Lk)("span",{class:"burn-spark-swatch is-recurring"},null,-1)),e[10]||(e[10]=(0,a.Lk)("span",{class:"burn-spark-readout-part"},"Recurring",-1)),e[11]||(e[11]=(0,a.Lk)("span",{class:"burn-spark-swatch is-everyday"},null,-1)),e[12]||(e[12]=(0,a.Lk)("span",{class:"burn-spark-readout-part"},"Everyday",-1))],64)):((0,a.uX)(),(0,a.CE)(a.FK,{key:2},[(0,a.eW)((0,i.v_)(D.caption),1)],64))]),D.canSplit?((0,a.uX)(),(0,a.CE)("button",{key:0,class:"burn-spark-mode",title:w.splitMode?"Show the total":"Break out recurring vs everyday",onClick:e[0]||(e[0]=(0,n.D$)(t=>w.splitMode=!w.splitMode,["stop"]))},(0,i.v_)(w.splitMode?"Total":"Breakdown"),9,k)):(0,a.Q3)("",!0)])],544)):(0,a.Q3)("",!0)}var w={name:"BurnSparkline",data(){return{hover:null,splitMode:!1}},props:{points:{type:Array,default:()=>[]},splitPoints:{type:Array,default:()=>[]},width:{type:Number,default:260},height:{type:Number,default:34},windowLabel:{type:String,default:"90-day trend"},spanLabel:{type:String,default:"12 months"}},computed:{hasPlot(){return this.series.length>=2},series(){return(this.points||[]).filter(t=>t&&"number"===typeof t.value&&isFinite(t.value))},dotRadius(){return 2.5},canSplit(){return this.splitSeries.length>=2},splitSeries(){return(this.splitPoints||[]).filter(t=>t&&"number"===typeof t.recurring&&"number"===typeof t.everyday)},scale(){const t=this.dotRadius+1;if(this.splitMode&&this.canSplit){const e=this.splitSeries.flatMap(t=>
1[t.recurring,t.everyday]);return{min:0,max:Math.max(...e,1),pad:t,usableH:this.height-2*t}}const e=this.series.map(t=>t.value),s=Math.min(...e),a=Math.max(...e);return{min:s,max:a,pad:t,usableH:this.height-2*t}},stepX(){const t=this.splitMode&&this.canSplit?this.splitSeries.length:this.series.length;return t>1?this.width/(t-1):0},coords(){return this.series.map((t,e)=>({x:e*this.stepX,y:this.yFor(t.value)}))},splitPaths(){return this.splitMode&&this.canSplit?[{key:"recurring",accessor:t=>t.recurring},{key:"everyday",accessor:t=>t.everyday}].map(({key:t,accessor:e})=>({key:t,d:this.curve(this.splitSeries.map((t,s)=>({x:s*this.stepX,y:this.yFor(e(t))})))})):[]},linePath(){return this.curve(this.coords)},areaPath(){if(!this.coords.length)return"";const t=this.coords[this.coords.length-1];return`${this.linePath} L${t.x.toFixed(2)} ${this.height} L0 ${this.height} Z`},lastPoint(){return this.coords[this.coords.length-1]||{x:0,y:0}},caption(){return`${this.windowLabel} · ${this.spanLabel}`},ariaLabel(){const t=this.series.map(t=>t.value),e=t[0],s=t[t.length-1],a=s>e?"up":s<e?"down":"flat";return`${this.windowLabel} over ${this.spanLabel}: ${a}, from $${e} to $${s} per day`}},methods:{curve(t){if(!t||t.length<2)return t&&t.length?`M${t[0].x.toFixed(2)} ${t[0].y.toFixed(2)}`:"";const e=t.length,s=[],a=[],n=[];for(let o=0;o<e-1;o++)s.push(t[o+1].x-t[o].x),a.push(t[o+1].y-t[o].y),n.push(s[o]?a[o]/s[o]:0);const i=[n[0]];for(let o=1;o<e-1;o++)if(n[o-1]*n[o]<=0)i.push(0);else{const t=2*s[o]+s[o-1],e=s[o]+2*s[o-1];i.push((t+e)/(t/n[o-1]+e/n[o]))}i.push(n[e-2]);let r=`M${t[0].x.toFixed(2)} ${t[0].y.toFixed(2)}`;for(let o=0;o<e-1;o++){const e=t[o].x+s[o]/3,a=t[o].y+i[o]*s[o]/3,n=t[o+1].x-s[o]/3,l=t[o+1].y-i[o+1]*s[o]/3;r+=` C${e.toFixed(2)} ${a.toFixed(2)} ${n.toFixed(2)} ${l.toFixed(2)} ${t[o+1].x.toFixed(2)} ${t[o+1].y.toFixed(2)}`}return r},yFor(t){const{min:e,max:s,pad:a,usableH:n}=this.scale,i=s-e;return 0===i?a+n/2:a+n*(1-(t-e)/i)},onMove(t){const e=this.$refs.root?.getBoundingClientRect();if(!e||!e.width)return;const s=this.splitMode&&this.canSplit,a=s?this.splitSeries:this.series;if(!a.length)return;const n=Math.min(1,Math.max(0,(t.clientX-e.left)/e.width)),i=Math.round(n*(a.length-1)),r=a[i];r&&(this.hover={x:i*this.stepX,y:this.yFor(r.value),value:r.value,recurring:r.recurring||0,everyday:r.everyday||0,label:this.formatDate(r.date)})},onLeave(){this.hover=null},formatDate(t){const[e,s]=String(t).split("-").map(Number);if(!e||!s)return t;const a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return`${a[s-1]} ${e}`}}},D=s(4814);const L=(0,D.A)(w,[["render",x],["__scopeId","data-v-0fe6fe4a"]]);var S=L},1561:function(t,e,s){s.d(e,{A:function(){return xt}});var a=s(1529),n=s(9868),i=s(8642);const r={class:"slc-card"},o={key:0,class:"slc-body"},l=["viewBox"],h=["id"],c=["x","width","height"],u=["id"],p=["x","width","height"],d=["x1","x2","y1","y2"],m=["x","y"],y=["x","y"],v=["x","y","width","height","rx","ry"],g=["x1","x2","y1","y2"],f=["x","y"],k=["clip-path"],x=["d"],w=["cx","cy"],D=["d"],L=["d"],S=["d"],b=["d"],P=["clip-path"],C=["d"],j=["cx","cy"],T=["d"],M=["x1","y1","x2","y2"],E=["cx","cy","r"],$=["x1","x2","y1","y2"],A=["x","y","width","height","onMouseenter","onTouchstartPassive"],F={class:"slc-tt-date"},_={class:"slc-tt-headline"},X={key:0,class:"slc-tt-row muted"},I={class:"slc-tt-label"},W={class:"slc-tt-val"},B={key:1,class:"slc-tt-row income"},Q={class:"slc-tt-val"},R={key:0,class:"slc-tt-row spend"},O={class:"slc-tt-val"},V={key:1,class:"slc-tt-row income"},K={class:"slc-tt-val"},H={class:"slc-tt-label"},Y={class:"slc-tt-val"},z={class:"slc-tt-val"},G={class:"slc-tt-val"},N={key:4,class:"slc-tt-row muted"},U={class:"slc-tt-label"},q={class:"slc-tt-val"},J={class:"slc-tt-val"},Z={key:1,class:"slc-no-data"},tt={key:2,class:"slc-compact-bar"},et={class:"slc-compact-label"},st=["aria-expanded"],at={class:"slc-toggle"},nt={class:"slc-toggle"},it=["value"],rt={key:1,class:"slc-menu-extra"};function ot(t,e,s,ot,lt,ht){return(0,a.uX)(),(0,a.CE)("div",r,[ht.hasData?((0,a.uX)(),(0,a.CE)("div",o,[((0,a.uX)(),(0,a.CE)("svg",{ref:"svg",viewBox:`0 0 ${lt.W} ${lt.H}`,preserveAspectRatio:"xMidYMid meet",class:"slc-svg",onMouseleave:e[0]||(e[0]=t=>lt.hover=null),onTouchstartPassive:e[1]||(e[1]=(...t)=>ht.onTouchStart&&ht.onTouchStart(...t)),onTouchmove:e[2]||(e[2]=(...t)=>ht.onTouchMove&&ht.onTouchMove(...t)),onTouchend:e[3]||(e[3]=t=>lt.hover=null)},[(0,a.Lk)("defs",null,[e[10]||(e[10]=(0,a.Fv)('<linearGradient id="slcAreaGrad" x1="0" y1="0" x2="0" y2="1" data-v-27f8e60c><stop offset="0%" stop-color="#3A9AB5" stop-opacity="0.32" data-v-27f8e60c></stop><stop offset="100%" stop-color="#3A9AB5" stop-opacity="0" data-v-27f8e60c></stop></linearGradient><linearGradient id="slcIncomeGrad" x1="0" y1="0" x2="0" y2="1" data-v-27f8e60c><stop offset="0%" stop-color="#0d9668" stop-opacity="0.2" data-v-27f8e60c></stop><stop offset="100%" stop-color="#0d9668" stop-opacity="0" data-v-27f8e60c></stop></linearGradient>',2)),(0,a.Lk)("clipPath",{id:ht.projClipId},[(0,a.Lk)("rect",{x:ht.projClip.x,y:"0",width:ht.projClip.w,height:lt.H,style:(0,n.Tr)(ht.projClipStyle)},null,12,c)],8,h),(0,a.Lk)("clipPath",{id:ht.spendClipId},[(0,a.Lk)("rect",{x:ht.spendClip.x,y:"0",width:ht.spendClip.w,height:lt.H,style:(0,n.Tr)(ht.spendClipStyle)},null,12,p)],8,u)]),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(ht.yTicks,(t,e)=>((0,a.uX)(),(0,a.CE)("line",{key:"g"+e,x1:lt.pad.l,x2:lt.W-lt.pad.r,y1:ht.yScale(t),y2:ht.yScale(t),class:"slc-grid"},null,8,d))),128)),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(ht.yTicks,(t,e)=>((0,a.uX)(),(0,a.CE)("text",{key:"yl"+e,x:lt.pad.l-8,y:ht.yScale(t)+4,class:"slc-y-label"},(0,n.v_)(ht.fmtShort(t)),9,m))),128)),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(ht.xLabelsFiltered,(t,e)=>((0,a.uX)(),(0,a.CE)("text",{key:"xl"+e,x:ht.xScale(t.idx),y:lt.H-lt.pad.b+20,class:"slc-x-label"},(0,n.v_)(t.text),9,y))),128)),"bar"===lt.chartType?((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(ht.chartAmounts,(t,e)=>((0,a.uX)(),(0,a.CE)("rect",{key:"bar"+e,x:ht.xScale(e)-ht.barW/2,y:Math.min(ht.yScale(t||0),ht.yScale(0)),width:ht.barW,height:Math.abs(ht.yScale(t||0)-ht.yScale(0)),rx:Math.min(6,ht.barW/2),ry:Math.min(6,ht.barW/2),class:(0,n.C4)(["slc-bar",{"slc-bar-hover":lt.hover===e}])},null,10,v))),128)),0!==ht.average?((0,a.uX)(),(0,a.CE)("line",{key:0,x1:lt.pad.l,x2:lt.W-lt.pad.r,y1:ht.yScale(ht.average),y2:ht.yScale(ht.average),class:"slc-avg-line"},null,8,g)):(0,a.Q3)("",!0),0!==ht.average?((0,a.uX)(),(0,a.CE)("text",{key:1,x:lt.W-lt.pad.r,y:ht.yScale(ht.average)-6,class:"slc-avg-label"}," Avg: "+(0,n.v_)(ht.fmtCurrency(ht.average)),9,f)):(0,a.Q3)("",!0)],64)):(0,a.Q3)("",!0),"line"===lt.chartType?((0,a.uX)(),(0,a.CE)(a.FK,{key:1},[ht.projectedIncomePath?((0,a.uX)(),(0,a.CE)("g",{key:0,"clip-path":`url(#${ht.projClipId})`},[(0,a.Lk)("path",{ref:"projPath",d:ht.projectedIncomePath,fill:"none",stroke:"#10d9a0","stroke-width":"0.9","stroke-linecap":"round","stroke-linejoin":"round",opacity:"0.3"},null,8,x),ht.projectedIncomeEnd?((0,a.uX)(),(0,a.CE)("circle",{key:0,cx:ht.projectedIncomeEnd[0],cy:ht.projectedIncomeEnd[1],r:"2",fill:"#10d9a0",opacity:"0.4"},null,8,w)):(0,a.Q3)("",!0)],8,k)):(0,a.Q3)("",!0),lt.showIncome&&ht.incomeLinePath?((0,a.uX)(),(0,a.CE)("path",{key:1,ref:"incomePath",d:ht.incomeLinePath,fill:"none",stroke:"#10d9a0","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",style:(0,n.Tr)(ht.incomeLineStyle)}
1,null,12,D)):(0,a.Q3)("",!0),lt.showComparison&&ht.comparisonLinePath?((0,a.uX)(),(0,a.CE)("path",{key:2,d:ht.comparisonLinePath,fill:"none",stroke:"#6b7280","stroke-width":"1","stroke-dasharray":"3 8",opacity:"0.45","stroke-linecap":"round"},null,8,L)):(0,a.Q3)("",!0),ht.areaPath?(0,a.bo)(((0,a.uX)(),(0,a.CE)("path",{key:3,d:ht.areaPath,fill:"url(#slcAreaGrad)",class:"slc-area",style:(0,n.Tr)(lt.drawn?{opacity:1}:{opacity:0})},null,12,S)),[[i.aG,lt.showMainLine]]):(0,a.Q3)("",!0),(0,a.bo)((0,a.Lk)("path",{ref:"mainPath",d:ht.linePath,fill:"none",stroke:"#3A9AB5","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",class:"slc-main-line",style:(0,n.Tr)(ht.mainLineStyle)},null,12,b),[[i.aG,lt.showMainLine]]),ht.projectedSpendPath?(0,a.bo)(((0,a.uX)(),(0,a.CE)("g",{key:4,"clip-path":`url(#${ht.spendClipId})`},[(0,a.Lk)("path",{ref:"spendProjPath",d:ht.projectedSpendPath,fill:"none",stroke:"#3A9AB5","stroke-width":"0.9","stroke-linecap":"round","stroke-linejoin":"round",opacity:"0.3"},null,8,C),ht.projectedSpendEnd?((0,a.uX)(),(0,a.CE)("circle",{key:0,cx:ht.projectedSpendEnd[0],cy:ht.projectedSpendEnd[1],r:"2",fill:"#3A9AB5",opacity:"0.4"},null,8,j)):(0,a.Q3)("",!0)],8,P)),[[i.aG,lt.showMainLine]]):(0,a.Q3)("",!0),(0,a.bo)((0,a.Lk)("path",{d:ht.maPath,fill:"none",class:"slc-ma-line","stroke-width":"1.5","stroke-dasharray":"6 4"},null,8,T),[[i.aG,lt.showMA]]),ht.trendPoints.length>=2&&lt.showTrend?((0,a.uX)(),(0,a.CE)("line",{key:5,x1:ht.trendPoints[0][0],y1:ht.trendPoints[0][1],x2:ht.trendPoints[ht.trendPoints.length-1][0],y2:ht.trendPoints[ht.trendPoints.length-1][1],class:"slc-trend-line","stroke-width":"1.5","stroke-dasharray":"5 5"},null,8,M)):(0,a.Q3)("",!0),"daily"===lt.dataType?((0,a.uX)(!0),(0,a.CE)(a.FK,{key:6},(0,a.pI)(ht.chartAmounts,(t,e)=>(0,a.bo)(((0,a.uX)(),(0,a.CE)("circle",{key:"dot"+e,cx:ht.xScale(e),cy:ht.yScale(t||0),r:lt.hover===e?5:3,class:(0,n.C4)(["slc-dot",{"slc-dot-hover":lt.hover===e}])},null,10,E)),[[i.aG,lt.showMainLine&&null!==t]])),128)):(0,a.Q3)("",!0)],64)):(0,a.Q3)("",!0),null!==lt.hover?((0,a.uX)(),(0,a.CE)("line",{key:2,x1:ht.xScale(lt.hover),x2:ht.xScale(lt.hover),y1:lt.pad.t,y2:lt.H-lt.pad.b,class:"slc-hover-line"},null,8,$)):(0,a.Q3)("",!0),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(ht.chartAmounts,(t,e)=>((0,a.uX)(),(0,a.CE)("rect",{key:"hit"+e,x:ht.xScale(e)-ht.hitW/2,y:lt.pad.t,width:ht.hitW,height:lt.H-lt.pad.t-lt.pad.b,fill:"transparent",onMouseenter:t=>lt.hover=e,onTouchstartPassive:t=>lt.hover=e},null,40,A))),128))],40,l)),null!==lt.hover&&ht.tooltipData?((0,a.uX)(),(0,a.CE)("div",{key:0,ref:"tip",class:"slc-tooltip chart-tip-glass",style:(0,n.Tr)(ht.tooltipPosition)},[(0,a.Lk)("div",F,(0,n.v_)(ht.tooltipData.label),1),null!==ht.tooltipData.value?((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("div",_,(0,n.v_)(ht.fmtCurrency(ht.tooltipData.value)),1),null!==ht.tooltipData.compValue?((0,a.uX)(),(0,a.CE)("div",X,[(0,a.Lk)("span",I,(0,n.v_)(ht.comparisonLabel),1),(0,a.Lk)("span",W,(0,n.v_)(ht.fmtCurrency(ht.tooltipData.compValue)),1)])):(0,a.Q3)("",!0),null!==ht.tooltipData.incomeValue?((0,a.uX)(),(0,a.CE)("div",B,[e[11]||(e[11]=(0,a.Lk)("span",{class:"slc-tt-label"},"Income",-1)),(0,a.Lk)("span",Q,(0,n.v_)(ht.fmtCurrency(ht.tooltipData.incomeValue)),1)])):(0,a.Q3)("",!0)],64)):((0,a.uX)(),(0,a.CE)(a.FK,{key:1},[null!==ht.tooltipData.projectedSpendValue?((0,a.uX)(),(0,a.CE)("div",R,[e[12]||(e[12]=(0,a.Lk)("span",{class:"slc-tt-label"},"Projected spend",-1)),(0,a.Lk)("span",O,(0,n.v_)(ht.fmtCurrency(ht.tooltipData.projectedSpendValue)),1)])):(0,a.Q3)("",!0),null!==ht.tooltipData.projectedIncomeValue?((0,a.uX)(),(0,a.CE)("div",V,[e[13]||(e[13]=(0,a.Lk)("span",{class:"slc-tt-label"},"Projected income",-1)),(0,a.Lk)("span",K,(0,n.v_)(ht.fmtCurrency(ht.tooltipData.projectedIncomeValue)),1)])):(0,a.Q3)("",!0),ht.recurringToday.length?((0,a.uX)(),(0,a.CE)(a.FK,{key:2},[e[14]||(e[14]=(0,a.Lk)("div",{class:"slc-tt-section"},"Recurring",-1)),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(ht.recurringToday,(t,e)=>((0,a.uX)(),(0,a.CE)("div",{key:"rec"+e,class:(0,n.C4)(["slc-tt-row","item",t.income?"income":"spend"])},[(0,a.Lk)("span",H,(0,n.v_)(t.name),1),(0,a.Lk)("span",Y,(0,n.v_)(t.income?"+":"−")+(0,n.v_)(ht.fmtCurrency(t.amount)),1)],2))),128))],64)):(0,a.Q3)("",!0),null!==ht.tooltipData.projectedCashFlow?((0,a.uX)(),(0,a.CE)(a.FK,{key:3},[e[17]||(e[17]=(0,a.Lk)("div",{class:"slc-tt-sep"},null,-1)),(0,a.Lk)("div",{class:(0,n.C4)(["slc-tt-row",ht.tooltipData.projectedCashFlow>=0?"pos":"neg"])},[e[15]||(e[15]=(0,a.Lk)("span",{class:"slc-tt-label"},"Net",-1)),(0,a.Lk)("span",z,(0,n.v_)(ht.tooltipData.projectedCashFlow<0?"−":"+")+(0,n.v_)(ht.fmtCurrency(Math.abs(ht.tooltipData.projectedCashFlow))),1)],2),null!==ht.tooltipData.projectedSavingsRate?((0,a.uX)(),(0,a.CE)("div",{key:0,class:(0,n.C4)(["slc-tt-row",ht.tooltipData.projectedSavingsRate>=0?"pos":"neg"])},[e[16]||(e[16]=(0,a.Lk)("span",{class:"slc-tt-label"},"Savings rate",-1)),(0,a.Lk)("span",G,(0,n.v_)(ht.tooltipData.projectedSavingsRate<0?"−":"+")+(0,n.v_)(Math.abs(ht.tooltipData.projectedSavingsRate).toFixed(1))+"%",1)],2)):(0,a.Q3)("",!0)],64)):(0,a.Q3)("",!0),ht.tooltipData.upcoming?((0,a.uX)(),(0,a.CE)("div",N,[(0,a.Lk)("span",U,"Next · "+(0,n.v_)(ht.tooltipData.upcoming.label),1),(0,a.Lk)("span",q,"+"+(0,n.v_)(ht.fmtCurrency(ht.tooltipData.upcoming.amount)),1)])):(0,a.Q3)("",!0)],64)),null!==ht.tooltipData.pctChange?((0,a.uX)(),(0,a.CE)("div",{key:2,class:(0,n.C4)(["slc-tt-row",ht.tooltipData.pctChange>=0?"neg":"pos"])},[e[18]||(e[18]=(0,a.Lk)("span",{class:"slc-tt-label"},"vs prior",-1)),(0,a.Lk)("span",J,(0,n.v_)(ht.tooltipData.pctChange>=0?"+":"")+(0,n.v_)(ht.tooltipData.pctChange.toFixed(1))+"%",1)],2)):(0,a.Q3)("",!0)],4)):(0,a.Q3)("",!0)])):((0,a.uX)(),(0,a.CE)("div",Z,[...e[19]||(e[19]=[(0,a.Lk)("p",null,"No transactions for this period",-1)])])),s.compactControls?((0,a.uX)(),(0,a.CE)("div",tt,[(0,a.Lk)("div",et,[(0,a.RG)(t.$slots,"menu-label",{},void 0,!0)]),(0,a.Lk)("button",{class:(0,n.C4)(["slc-menu-btn",{on:lt.menuOpen}]),onClick:e[4]||(e[4]=t=>lt.menuOpen=!lt.menuOpen),"aria-expanded":lt.menuOpen?"true":"false","aria-label":"Chart options"},"⋯",10,st)])):(0,a.Q3)("",!0),s.compactControls?(0,a.RG)(t.$slots,"menu-below",{key:3},void 0,!0):(0,a.Q3)("",!0),!s.compactControls||lt.menuOpen?((0,a.uX)(),(0,a.CE)("div",{key:4,class:(0,n.C4)(["slc-header",{"slc-header--menu":s.compactControls}])},[(0,a.Lk)("div",at,[(0,a.Lk)("button",{class:(0,n.C4)(["slc-btn",{active:"line"===lt.chartType}]),onClick:e[5]||(e[5]=t=>lt.chartType="line")},"Line",2),(0,a.Lk)("button",{class:(0,n.C4)(["slc-btn",{active:"bar"===lt.chartType}]),onClick:e[6]||(e[6]=t=>lt.chartType="bar")},"Bar",2)]),(0,a.Lk)("div",nt,[(0,a.Lk)("button",{class:(0,n.C4)(["slc-btn",{active:"daily"===lt.dataType}]),onClick:e[7]||(e[7]=t=>lt.dataType="daily")},"Daily",2),(0,a.Lk)("button",{class:(0,n.C4)(["slc-btn",{active:"cumulative"===lt.dataType}]),onClick:e[8]||(e[8]=t=>lt.dataType="cumulative")},"Cumulative",2)]),ht.isMonthView?(0,a.bo)(((0,a.uX)(),(0,a.CE)("select",{key:0,"onUpdate:modelValue":e[9]||(e[9]=t=>
1lt.selectedComparison=t),class:"slc-compare-select","aria-label":"Compare with"},[e[20]||(e[20]=(0,a.Lk)("option",{value:"12-month-avg"},"12 Month Average",-1)),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(ht.previousMonths,t=>((0,a.uX)(),(0,a.CE)("option",{key:t.value,value:t.value},(0,n.v_)(t.label),9,it))),128))],512)),[[i.u1,lt.selectedComparison]]):(0,a.Q3)("",!0),s.compactControls?((0,a.uX)(),(0,a.CE)("div",rt,[(0,a.RG)(t.$slots,"menu",{},void 0,!0)])):(0,a.Q3)("",!0)],2)):(0,a.Q3)("",!0)])}function lt({allDates:t=[],todayStr:e="",actual:s=[],expected:a=[]}={}){const n=[];if(t.forEach((t,s)=>{t>e&&n.push(s)}),!n.length)return[];let i=-1;for(let u=0;u<s.length;u++)null!==s[u]&&void 0!==s[u]&&(i=u);const r=-1===i?Math.max(0,n[0]-1):i,o=-1===i?0:s[i],l={};if(a.forEach(t=>{t&&t.date&&(l[t.date]=(l[t.date]||0)+(Number(t.amount)||0))}),-1===i&&!n.some(e=>l[t[e]]))return[];const h=[{idx:r,value:o}];let c=o;return n.forEach(e=>{c+=l[t[e]]||0,h.push({idx:e,value:c})}),h}const ht=600,ct=1600,ut=2400,pt=1800,dt=350,mt=2e3;function yt(t,e,s,a){if(!t)return{main:a,proj:e?a:0};if(!e)return{main:a,proj:0};const n=Math.round(s*(t/(t+e)));return{main:n,proj:s-n}}let vt=0;var gt={name:"SpendingLineChartSVG",props:{data:{type:Array,required:!0},dateOption:{type:String,required:!0},incomeData:{type:Array,default:()=>[]},expectedIncome:{type:Array,default:()=>[]},expectedSpend:{type:Array,default:()=>[]},dailyBurn:{type:Number,default:0},asOf:{type:String,default:""},compactControls:{type:Boolean,default:!1}},data(){return{menuOpen:!1,chartType:"line",dataType:"cumulative",selectedComparison:"12-month-avg",hover:null,drawn:!1,pathLen:0,incomePathLen:0,incomeDrawn:!1,projPathLen:0,projDrawn:!1,spendProjPathLen:0,spendProjDrawn:!1,hasAnimatedOnce:!1,tipWidth:0,tipHostWidth:0,resizeTick:0,clipUid:++vt,showMainLine:!0,showComparison:!0,showIncome:!0,showMA:!1,showTrend:!1,W:760,H:window.innerWidth<=768?420:340,pad:{t:32,r:20,b:40,l:58}}},computed:{today(){if(this.asOf)return this.parseDate(this.asOf);const t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate())},todayStr(){const t=this.today;return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`},dateRange(){const t=this.today,e=t.getFullYear(),s=t.getMonth(),a=t.getDate();let n,i=t;switch(this.dateOption){case"week":n=new Date(e,s,a-7);break;case"lastmonth":n=new Date(e,s-1,1),i=new Date(e,s,0);break;
1case"1year":n=new Date(e-1,s,a);break;case"2year":n=new Date(e-2,s,a);break;case"month":n=new Date(e,s,1);break;case"forward-2mo":n=new Date(e,s,1),i=new Date(e,s+2,0);break;case"30":n=new Date(e,s,a-30);break;case"60":n=new Date(e,s,a-60);break;case"90":n=new Date(e,s,a-90);break;case"180":n=new Date(e,s,a-180);break;case"year":n=new Date(e,0,1);break;case"all":n=new Date(1970,0,1);break;default:if(this.dateOption?.startsWith("month-")){const t=this.dateOption.split("-"),e=parseInt(t[1]),s=parseInt(t[2])-1;n=new Date(e,s,1),i=new Date(e,s+1,0)}else n=new Date(e,s,a-30)}return{start:n,end:i}},filteredData(){const{start:t,end:e}=this.dateRange;return this.data.filter(s=>{const a=this.parseDate(s.date);return a>=t&&a<=e})},filteredIncomeData(){if(!this.incomeData?.length)return[];const{start:t,end:e}=this.dateRange;return this.incomeData.filter(s=>{const a=this.parseDate(s.date);return a>=t&&a<=e})},hasData(){return this.chartLabels.length>0},hasIncome(){return this.filteredIncomeData.length>0},isMonthView(){return"month"===this.dateOption||this.dateOption?.startsWith("month-")},referenceDate(){if(this.dateOption?.startsWith("month-")){const t=this.dateOption.split("-");return new Date(parseInt(t[1]),parseInt(t[2])-1,1)}const t=this.today;return new Date(t.getFullYear(),t.getMonth(),1)},previousMonths(){const t=this.referenceDate,e=[];for(let s=1;s<=12;s++){const a=new Date(t.getFullYear(),t.getMonth()-s,1);e.push({value:s,label:a.toLocaleString("default",{month:"long",year:"numeric"})})}return e},comparisonLabel(){if("12-month-avg"===this.selectedComparison)return"12 Mo Avg";const t=this.referenceDate,e=new Date(t.getFullYear(),t.getMonth()-parseInt(this.selectedComparison),1);return e.toLocaleString("default",{month:"short",year:"numeric"})},dailyTotals(){const t={};return this.filteredData.forEach(e=>{const s=e.date.substring(0,10);t[s]=(t[s]||0)+e.amount}),t},incomeDailyTotals(){const t={};return this.filteredIncomeData.forEach(e=>{const s=e.date.substring(0,10);t[s]=(t[s]||0)+e.amount}),t},allDates(){const t=Object.keys(this.dailyTotals);if(!t.length)return[];const{start:e,end:s}=this.dateRange,a=this.isMonthView,n=a?new Date(s.getFullYear(),s.getMonth()+1,0):s,i="all"===this.dateOption?this.parseDate(t.sort()[0]):e;return this.getDatesBetween(i,n)},chartLabels(){return this.allDates},chartAmounts(){const t=this.todayStr;let e=this.allDates.map(e=>e>t?null:this.dailyTotals[e]||0);if("cumulative"===this.dataType){let t=0;e=e.map(e=>null===e?null:(t+=e,t))}return e},incomeAmounts(){if(!this.hasIncome)return[];const t=this.todayStr;let e=this.allDates.map(e=>e>t?null:this.incomeDailyTotals[e]||0);if("cumulative"===this.dataType){let t=0;e=e.map(e=>null===e?null:(t+=e,t))}return e},projectedIncomeSeries(){return"cumulative"===this.dataType&&this.showIncome?lt({allDates:this.allDates,todayStr:this.todayStr,actual:this.incomeAmounts,expected:this.expectedIncome||[]}):[]},projectedSpendSeries(){if("cumulative"!==this.dataType||!this.showMainLine)return[];const t=this.todayStr,e=[];if(this.allDates.forEach((s,a)=>{s>t&&e.push(a)}),!e.length)return[];const s=this.chartAmounts;let a=-1;for(let c=0;c<s.length;c++)null!==s[c]&&(a=c);const n=-1===a?0:a,i=-1===a?0:s[a],r={};(this.expectedSpend||[]).forEach(t=>{t&&t.date&&(r[t.date]=(r[t.date]||0)+(Number(t.amount)||0))});const o=Math.max(0,Number(this.dailyBurn)||0),l=[{idx:n,value:i}];let h=i;return e.forEach(t=>{h+=o+(r[this.allDates[t]]||0),l.push({idx:t,value:h})}),l},projectedSpendPoints(){return this.projectedSpendSeries.map(t=>[this.xScale(t.idx),this.yScale(t.value)])},projectedSpendPath(){const t=this.projectedSpendPoints;return t.length>=2?this.bezier(t):""},projectedSpendEnd(){const t=this.projectedSpendPoints;return t.length>=2?t[t.length-1]:null},projectedSpendByIdx(){const t={};return this.projectedSpendSeries.forEach(e=>{t[e.idx]=e.value}),t},expectedSpendByDate(){const t={};return(this.expectedSpend||[]).forEach(e=>{e&&e.date&&(t[e.date]||(t[e.date]={amount:0,sources:[]}),t[e.date].amount+=Number(e.amount)||0,e.sources&&t[e.date].sources.push(...e.sources))}),t},projectedIncomePoints(){return this.projectedIncomeSeries.map(t=>[this.xScale(t.idx),this.yScale(t.value)])},projectedIncomePath(){const t=this.projectedIncomePoints;return t.length>=2?this.bezier(t):""},projectedIncomeEnd(){const t=this.projectedIncomePoints;return t.length>=2?t[t.length-1]:null},projectedIncomeByIdx(){const t={};
1return this.projectedIncomeSeries.forEach(e=>{t[e.idx]=e.value}),t},expectedByDate(){const t={};return(this.expectedIncome||[]).forEach(e=>{e&&e.date&&(t[e.date]||(t[e.date]={amount:0,sources:[]}),t[e.date].amount+=Number(e.amount)||0,e.sources&&t[e.date].sources.push(...e.sources))}),t},expectedSorted(){return(this.expectedIncome||[]).filter(t=>t&&t.date).slice().sort((t,e)=>t.date<e.date?-1:t.date>e.date?1:0)},comparisonAmounts(){if(!this.isMonthView)return[];const t=this.referenceDate,e=this.chartLabels.length;if("12-month-avg"===this.selectedComparison){const s=[];for(let e=1;e<=12;e++){const a=new Date(t.getFullYear(),t.getMonth()-e,1),n=new Date(t.getFullYear(),t.getMonth()-e+1,0),i=this.getDatesBetween(a,n),r={};this.data.forEach(t=>{const e=this.parseDate(t.date);if(e>=a&&e<=n){const e=t.date.substring(0,10);r[e]=(r[e]||0)+t.amount}}),s.push(i.map(t=>r[t]||0))}let a=[];for(let t=0;t<e;t++){let e=0,n=0;s.forEach(s=>{t<s.length&&(e+=s[t],n++)}),a.push(n>0?e/n:0)}if("cumulative"===this.dataType){let t=0;a=a.map(e=>(t+=e,t))}return a}const s=parseInt(this.selectedComparison),a=new Date(t.getFullYear(),t.getMonth()-s,1),n=new Date(t.getFullYear(),t.getMonth()-s+1,0),i=this.getDatesBetween(a,n),r={};this.data.forEach(t=>{const e=this.parseDate(t.date);if(e>=a&&e<=n){const e=t.date.substring(0,10);r[e]=(r[e]||0)+t.amount}});let o=i.map(t=>r[t]||0);if("cumulative"===this.dataType){let t=0;o=o.map(e=>(t+=e,t))}return o},isLongRange(){if(!this.allDates.length)return!1;const t=new Date(this.allDates[0]),e=new Date(this.allDates[this.allDates.length-1]);return e-t>7776e6},formattedLabels(){const t=this.isLongRange;return this.allDates.map(e=>{const s=new Date(e+"T00:00:00");return t?s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"2-digit"}):s.toLocaleDateString("en-US",{month:"short",day:"numeric"})})},tooltipLabels(){return this.allDates.map(t=>{const e=new Date(t+"T00:00:00");return e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})},allValues(){const t=this.chartAmounts.filter(t=>null!==t);return this.showComparison&&t.push(...this.comparisonAmounts),this.showIncome&&t.push(...this.incomeAmounts.filter(t=>null!==t)),t.push(...this.projectedIncomeSeries.map(t=>t.value)),t.push(...this.projectedSpendSeries.map(t=>t.value)),this.showMA&&t.push(...this.maData),this.showTrend&&t.push(...this.trendData),t},yMin(){if(!this.allValues.length)return 0;const t=Math.min(...this.allValues);return t>=0?0:t-.1*Math.abs(t)},yMax(){if(!this.allValues.length)return 10;const t=Math.max(...this.allValues);return t<=0?10:t+.1*t},yTicks(){const t=5,e=this.yMax-this.yMin,s=e/t;return Array.from({length:t+1},(t,e)=>this.yMin+s*e)},plotW(){return this.W-this.pad.l-this.pad.r},plotH(){return this.H-this.pad.t-this.pad.b},barW(){const t=this.chartAmounts.length;return t<=1?40:Math.max(4,Math.min(40,this.plotW/t*.6))},hitW(){const t=this.chartAmounts.length;return t<=1?this.plotW:this.plotW/t},xLabelsFiltered(){const t=this.formattedLabels,e=t.length;if(!e)return[];const s=8,a=Math.max(1,Math.ceil(e/s)),n=[];for(let i=0;i<e;i+=a)n.push({idx:i,text:t[i]});return n},trendData(){const t=this.chartAmounts.map(t=>t??0),e=t.map((t,e)=>({x:e,y:t})).filter(t=>null!==t.y),s=e.length;if(s<2)return t.map(()=>0);const a=e.reduce((t,e)=>t+e.x,0),n=e.reduce((t,e)=>t+e.y,0),i=e.reduce((t,e)=>t+e.x*e.y,0),r=e.reduce((t,e)=>t+e.x*e.x,0),o=(s*i-a*n)/(s*r-a*a),l=(n-o*a)/s;return t.map((t,e)=>o*e+l)},maData(){const t=this.chartAmounts.map(t=>t??0);return t.map((e,s)=>{const a=Math.max(0,s-6),n=t.slice(a,s+1).filter(t=>null!==t);return n.length?n.reduce((t,e)=>t+e,0)/n.length:0})},average(){const t=this.chartAmounts.filter(t=>null!==t&&0!==t);return t.length?t.reduce((t,e)=>t+e,0)/t.length:0},linePoints(){return this.chartAmounts.map((t,e)=>null!==t?[this.xScale(e),this.yScale(t)]:null).filter(Boolean)},linePath(){return this.bezier(this.linePoints)},areaPath(){if(this.linePoints.length<2)return"";const t=this.linePoints[0],e=this.linePoints[this.linePoints.length-1],s=this.yScale(Math.max(0,this.yMin));return this.linePath+` L ${e[0].toFixed(1)} ${s.toFixed(1)} L ${t[0].toFixed(1)} ${s.toFixed(1)} Z`},incomeLinePoints(){return this.incomeAmounts.map((t,e)=>
1null!==t?[this.xScale(e),this.yScale(t)]:null).filter(Boolean)},incomeLinePath(){return this.bezier(this.incomeLinePoints)},incomeAreaPath(){if(this.incomeLinePoints.length<2)return"";const t=this.incomeLinePoints[0],e=this.incomeLinePoints[this.incomeLinePoints.length-1],s=this.yScale(Math.max(0,this.yMin));return this.incomeLinePath+` L ${e[0].toFixed(1)} ${s.toFixed(1)} L ${t[0].toFixed(1)} ${s.toFixed(1)} Z`},comparisonLinePoints(){return this.comparisonAmounts.map((t,e)=>[this.xScale(e),this.yScale(t)])},comparisonLinePath(){return this.bezier(this.comparisonLinePoints)},maPoints(){return this.maData.map((t,e)=>[this.xScale(e),this.yScale(t)])},maPath(){return this.bezier(this.maPoints)},trendPoints(){return this.trendData.map((t,e)=>[this.xScale(e),this.yScale(t)])},mainLineStyle(){return this.drawn&&this.pathLen?{strokeDasharray:this.pathLen,strokeDashoffset:0,transition:`stroke-dashoffset ${this.spendSplit.main}ms linear`}:{strokeDasharray:this.pathLen||2e3,strokeDashoffset:this.pathLen||2e3}},projClipId(){return`slcProjClip${this.clipUid}`},projClip(){const t=this.projectedIncomePoints,e=t.length?t[0][0]:0;
1return{x:e,w:Math.max(1,this.W-e)}},drawSplit(){return yt(this.incomePathLen,this.projPathLen,ut,ct)},spendSplit(){return yt(this.pathLen,this.spendProjPathLen,ut,pt)},spendClipId(){return`slcSpendClip${this.clipUid}`},spendClip(){const t=this.projectedSpendPoints,e=t.length?t[0][0]:0;return{x:e,w:Math.max(1,this.W-e)}},spendClipStyle(){return this.spendProjDrawn?{transform:"translateX(0px)",transition:`transform ${this.spendSplit.proj}ms linear`}:{transform:`translateX(${-this.spendClip.w}px)`}},projClipStyle(){return this.projDrawn?{transform:"translateX(0px)",transition:`transform ${this.drawSplit.proj}ms linear`}:{transform:`translateX(${-this.projClip.w}px)`}},incomeLineStyle(){return this.incomeDrawn&&this.incomePathLen?{strokeDasharray:this.incomePathLen,strokeDashoffset:0,transition:`stroke-dashoffset ${this.drawSplit.main}ms linear`}:{strokeDasharray:this.incomePathLen||2e3,strokeDashoffset:this.incomePathLen||2e3}},tooltipData(){if(null===this.hover||this.hover>=this.chartAmounts.length)return null;const t=this.hover,e=this.chartAmounts[t],s=this.projectedIncomeByIdx[t]??null;if(null===e&&null===s&&null===o)return null;const a=this.tooltipLabels[t];let n=null;null!==e&&this.isMonthView&&void 0!==this.comparisonAmounts[t]&&0!==this.comparisonAmounts[t]&&(n=(e-this.comparisonAmounts[t])/Math.abs(this.comparisonAmounts[t])*100);const i=null!==e&&this.isMonthView&&void 0!==this.comparisonAmounts[t]?this.comparisonAmounts[t]:null,r=this.hasIncome&&void 0!==this.incomeAmounts[t]&&null!==this.incomeAmounts[t]?this.incomeAmounts[t]:null,o=this.projectedSpendByIdx[t]??null;let l=[];null!==o&&(l=this.expectedSpendByDate[this.allDates[t]]?.sources||[]);let h=[],c=null;if(null!==s){const e=this.allDates[t];h=this.expectedByDate[e]?.sources||[];const s=this.expectedSorted.find(t=>t.date>e);s&&(c={amount:s.amount,label:this.shortDate(s.date),name:1===s.sources?.length?s.sources[0].name:`${s.sources?.length||0} deposits`})}let u=null,p=null;return null!==s&&null!==o&&(u=s-o,s>0&&(p=u/s*100)),{value:e,label:a,pctChange:n,compValue:i,incomeValue:r,projectedIncomeValue:s,expectedToday:h,upcoming:c,projectedSpendValue:o,billsToday:l,projectedCashFlow:u,projectedSavingsRate:p}},recurringToday(){const t=this.tooltipData;if(!t)return[];const e=(t.billsToday||[]).map(t=>({name:t.name,amount:t.amount,income:!1})),s=(t.expectedToday||[]).map(t=>({name:t.name,amount:t.amount,income:!0}));return[...e,...s].sort((t,e)=>e.amount-t.amount)},tooltipPosition(){if(null===this.hover)return{};const t=this.$refs.svg;if(!t)return{};const e=t.getBoundingClientRect(),s=e.width/this.W,a=this.xScale(this.hover)*s,n=e.width;this.resizeTick;const i=14,r=10,o=this.tipWidth||160,l=this.tipHostWidth||n;let h=a+i;if(h+o>l-r){const t=a-i-o;h=t>=r?t:Math.max(r,l-o-r)}h=Math.max(r,Math.min(h,l-o-r));const c=this.pad.t*(e.height/this.H);return{position:"absolute",left:h+"px",top:Math.max(0,c)+"px"}}},methods:{xScale(t){const e=this.chartAmounts.length;return e<=1?this.pad.l+this.plotW/2:this.pad.l+t/(e-1)*this.plotW},yScale(t){const e=this.yMax-this.yMin;return 0===e?this.pad.t+this.plotH/2:this.pad.t+this.plotH-(t-this.yMin)/e*this.plotH},bezier(t){if(t.length<2)return"";let e=`M ${t[0][0].toFixed(1)} ${t[0][1].toFixed(1)}`;for(let s=1;s<t.length;s++){const[a,n]=t[s-1],[i,r]=t[s],o=(a+i)/2;e+=` C ${o.toFixed(1)} ${n.toFixed(1)}, ${o.toFixed(1)} ${r.toFixed(1)}, ${i.toFixed(1)} ${r.toFixed(1)}`}return e},parseDate(t){const e=t.substring(0,10),[s,a,n]=e.split("-").map(Number);return new Date(s,a-1,n)},getDatesBetween(t,e){const s=[];let a=new Date(t);a.setHours(0,0,0,0);const n=new Date(e);n.setHours(0,0,0,0);while(a<=n){const t=a.getFullYear(),e=String(a.getMonth()+1).padStart(2,"0"),n=String(a.getDate()).padStart(2,"0");s.push(`${t}-${e}-${n}`),a.setDate(a.getDate()+1)}return s},fmtCurrency(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(Math.abs(t))},shortDate(t){return new Date(t+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric"})},fmtShort(t){const e=Math.abs(t);return e>=1e6?"$"+(e/1e6).toFixed(1)+"M":e>=1e3?"$"+(e/1e3).toFixed(e>=1e4?0:1)+"K":"$"+Math.round(e)}
1,scheduleDraw(){this._pendingSince||(this._pendingSince=Date.now()),clearTimeout(this._settleTimer),this.hasAnimatedOnce||(this.drawn=!1,this.pathLen=0);const t=Date.now()-this._pendingSince>=mt?0:dt;this._settleTimer=setTimeout(()=>{this._pendingSince=0,this.hasData&&"line"===this.chartType?this.hasAnimatedOnce?this.refreshLengths():this.measurePath():this.drawn=!0},t)},replayDraw(){clearTimeout(this._settleTimer),this._pendingSince=0,this.$nextTick(()=>{this.hasData&&"line"===this.chartType?this.measurePath():this.drawn=!0})},refreshLengths(){this.$nextTick(()=>{this.measureAllLengths();const t=performance.now();this._spendEndsAt<=t&&(this.drawn=!0),this._incomeEndsAt<=t&&(this.incomeDrawn=!0),this.syncProjection("spend"),this.syncProjection("income")})},syncProjection(t){const e="income"===t,s=e?"projDrawn":"spendProjDrawn",a=e?"_projTimer":"_spendProjTimer",n=e?this.projPathLen:this.spendProjPathLen,i=e?this._incomeEndsAt:this._spendEndsAt;clearTimeout(this[a]);const r=i-performance.now();if(n&&r!==1/0)return r>0?(this[s]=!1,void(this[a]=setTimeout(()=>{this[s]=!0},r))):void(this[s]=!0);this[s]=!1},measureAllLengths(){const t=this.$refs.mainPath;this.pathLen=t?t.getTotalLength():0;const e=this.$refs.incomePath;this.incomePathLen=e?e.getTotalLength():0;const s=this.$refs.projPath;this.projPathLen=s?s.getTotalLength():0;const a=this.$refs.spendProjPath;this.spendProjPathLen=a?a.getTotalLength():0},measurePath(){this.hasAnimatedOnce=!0,this.drawn=!1,this.pathLen=0,this.incomeDrawn=!1,this.incomePathLen=0,this.projDrawn=!1,this.projPathLen=0,this.spendProjDrawn=!1,this.spendProjPathLen=0,clearTimeout(this._projTimer),clearTimeout(this._spendProjTimer),clearTimeout(this._incomeStartTimer),this._spendEndsAt=1/0,this._incomeEndsAt=1/0,this.$nextTick(()=>{this.measureAllLengths(),requestAnimationFrame(()=>{this.pathLen?(this.drawn=!0,this._spendEndsAt=performance.now()+this.spendSplit.main):this._spendEndsAt=0,this.syncProjection("spend")}),this._incomeStartTimer=setTimeout(()=>{requestAnimationFrame(()=>{this.incomePathLen?(this.incomeDrawn=!0,this._incomeEndsAt=performance.now()+this.drawSplit.main):this._incomeEndsAt=0,this.syncProjection("income")})},ht)})},measureProjection(){const t=this.$refs.projPath;this.projPathLen=t&&this.projectedIncomePath?t.getTotalLength():0,this.syncProjection("income")},measureSpendProjection(){const t=this.$refs.spendProjPath;this.spendProjPathLen=t&&this.projectedSpendPath?t.getTotalLength():0,this.syncProjection("spend")},onTouchStart(t){this._lastTouch={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}},onTouchMove(t){if(this._lastTouch){const e=Math.abs(t.touches[0].clientX-this._lastTouch.clientX),s=Math.abs(t.touches[0].clientY-this._lastTouch.clientY);e>s&&t.preventDefault(),this._lastTouch={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}}const e=this.$refs.svg;if(!e)return;const s=e.getBoundingClientRect(),a=(t.touches[0].clientX-s.left)*(this.W/s.width);let n=0,i=1/0;for(let r=0;r<this.chartAmounts.length;r++){const t=Math.abs(this.xScale(r)-a);t<i&&(i=t,n=r)}this.hover=n}},beforeUnmount(){clearTimeout(this._projTimer),clearTimeout(this._spendProjTimer),clearTimeout(this._settleTimer),clearTimeout(this._incomeStartTimer),this._onResize&&window.removeEventListener("resize",this._onResize)},mounted(){this._lastTouch=null,this._projTimer=null,this._spendProjTimer=null,this._settleTimer=null,this._incomeStartTimer=null,this._spendEndsAt=0,this._incomeEndsAt=0,this._pendingSince=0,this._onResize=()=>{this.resizeTick++},window.addEventListener("resize",this._onResize),this.$nextTick(()=>{this.hasData&&"line"===this.chartType?this.measurePath():this.drawn=!0})},watch:{tooltipData(){this.$nextTick(()=>{const t=this.$refs.tip;t&&(this.tipWidth=t.getBoundingClientRect().width)})},data(){this.scheduleDraw()},incomeData(){this.scheduleDraw()},expectedIncome(){this.scheduleDraw()},expectedSpend(){this.scheduleDraw()},dailyBurn(){this.scheduleDraw()},dateOption(){this.replayDraw()},dataType(){this.replayDraw()},selectedComparison(){this.replayDraw()},chartType(t){"line"===t?this.replayDraw():(clearTimeout(this._settleTimer),this.drawn=!0)},projectedSpendPath(t){if(!t)return this.spendProjDrawn=!1,this.spendProjPathLen=0,void clearTimeout(this._spendProjTimer);this.hasAnimatedOnce&&this.$nextTick(()=>this.measureSpendProjection())},projectedIncomePath(t){if(!t)return this.projDrawn=!1,this.projPathLen=0,void clearTimeout(this._projTimer);this.hasAnimatedOnce&&this.$nextTick(()=>this.measureProjection())}}},ft=s(4814);const kt=(0,ft.A)(gt,[["render",ot],["__scopeId","data-v-27f8e60c"]]);var xt=kt}}]);

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.