| 
						
						
							
								
							
						
						
					 | 
					@ -123,19 +123,6 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      Tooltip | 
					 | 
					 | 
					      Tooltip | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ); | 
					 | 
					 | 
					    ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.calculatorForm.setValue( | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        annualInterestRate: this.annualInterestRate, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        paymentPerPeriod: this.savingsRate, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        principalInvestmentAmount: 0, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        projectedTotalAmount: this.projectedTotalAmount, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        retirementDate: this.retirementDate ?? this.DEFAULT_RETIREMENT_DATE | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        emitEvent: false | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.calculatorForm.valueChanges | 
					 | 
					 | 
					    this.calculatorForm.valueChanges | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      .pipe(takeUntil(this.unsubscribeSubject)) | 
					 | 
					 | 
					      .pipe(takeUntil(this.unsubscribeSubject)) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      .subscribe(() => { | 
					 | 
					 | 
					      .subscribe(() => { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -169,9 +156,22 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public ngOnChanges() { | 
					 | 
					 | 
					  public ngOnChanges() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    if (isNumber(this.fireWealth) && this.fireWealth >= 0) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      this.calculatorForm.setValue( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          annualInterestRate: this.annualInterestRate, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          paymentPerPeriod: this.savingsRate, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          principalInvestmentAmount: 0, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          projectedTotalAmount: this.projectedTotalAmount, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          retirementDate: this.retirementDate ?? this.DEFAULT_RETIREMENT_DATE | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          emitEvent: false | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      this.periodsToRetire = this.getPeriodsToRetire(); | 
					 | 
					 | 
					      this.periodsToRetire = this.getPeriodsToRetire(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (isNumber(this.fireWealth) && this.fireWealth >= 0) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      setTimeout(() => { | 
					 | 
					 | 
					      setTimeout(() => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // Wait for the chartCanvas
 | 
					 | 
					 | 
					        // Wait for the chartCanvas
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        this.calculatorForm.patchValue( | 
					 | 
					 | 
					        this.calculatorForm.patchValue( | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -409,9 +409,9 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (this.projectedTotalAmount) { | 
					 | 
					 | 
					    if (this.projectedTotalAmount) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      const periods = this.fireCalculatorService.calculatePeriodsToRetire({ | 
					 | 
					 | 
					      const periods = this.fireCalculatorService.calculatePeriodsToRetire({ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        P: this.getP(), | 
					 | 
					 | 
					        P: this.getP(), | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        totalAmount: this.projectedTotalAmount, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        PMT: this.getPMT(), | 
					 | 
					 | 
					        PMT: this.getPMT(), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        r: this.getR() | 
					 | 
					 | 
					        r: this.getR(), | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        totalAmount: this.projectedTotalAmount | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }); | 
					 | 
					 | 
					      }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      return periods; | 
					 | 
					 | 
					      return periods; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |