| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -4,6 +4,7 @@ import { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} from '@ghostfolio/common/chart-helper'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { primaryColorRgb } from '@ghostfolio/common/config'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { getLocale } from '@ghostfolio/common/helper'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { FireWealth } from '@ghostfolio/common/interfaces'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { ColorScheme } from '@ghostfolio/common/types'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { CommonModule } from '@angular/common'; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -79,7 +80,7 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  @Input() colorScheme: ColorScheme; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  @Input() currency: string; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  @Input() deviceType: string; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  @Input() fireWealth: number; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  @Input() fireWealth: FireWealth; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  @Input() hasPermissionToUpdateUserSettings: boolean; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  @Input() locale = getLocale(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  @Input() projectedTotalAmount: number; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -156,12 +157,15 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  public ngOnChanges() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    if (isNumber(this.fireWealth) && this.fireWealth >= 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    if ( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      isNumber(this.fireWealth.today.valueInBaseCurrency) && | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      this.fireWealth.today.valueInBaseCurrency >= 0 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    ) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      this.calculatorForm.setValue( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          annualInterestRate: this.annualInterestRate ?? 5, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          paymentPerPeriod: this.savingsRate ?? 0, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          principalInvestmentAmount: this.fireWealth, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          principalInvestmentAmount: this.fireWealth.today.valueInBaseCurrency, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          projectedTotalAmount: this.projectedTotalAmount ?? 0, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          retirementDate: this.retirementDate ?? this.DEFAULT_RETIREMENT_DATE | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }, | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -393,9 +397,11 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          r | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      datasetDeposit.data.push(this.fireWealth); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      datasetDeposit.data.push(this.fireWealth.today.valueInBaseCurrency); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      datasetInterest.data.push(interest.toNumber()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      datasetSavings.data.push(principal.minus(this.fireWealth).toNumber()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      datasetSavings.data.push( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        principal.minus(this.fireWealth.today.valueInBaseCurrency) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      ); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    return { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -405,7 +411,7 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  private getP() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    return this.fireWealth || 0; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    return this.fireWealth.today.valueInBaseCurrency || 0; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  private getPeriodsToRetire(): number { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |