| 
						
						
							
								
							
						
						
					 | 
					@ -19,13 +19,13 @@ import { takeUntil } from 'rxjs/operators'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					@Component({ | 
					 | 
					 | 
					@Component({ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  imports: [ | 
					 | 
					 | 
					  imports: [ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    CommonModule, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    FormsModule, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    GfFireCalculatorComponent, | 
					 | 
					 | 
					    GfFireCalculatorComponent, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    GfPremiumIndicatorComponent, | 
					 | 
					 | 
					    GfPremiumIndicatorComponent, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    GfValueComponent, | 
					 | 
					 | 
					    GfValueComponent, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    NgStyle, | 
					 | 
					 | 
					    NgStyle, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    NgxSkeletonLoaderModule, | 
					 | 
					 | 
					    NgxSkeletonLoaderModule, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    CommonModule, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    FormsModule, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ReactiveFormsModule | 
					 | 
					 | 
					    ReactiveFormsModule | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  ], | 
					 | 
					 | 
					  ], | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  selector: 'gf-fire-page', | 
					 | 
					 | 
					  selector: 'gf-fire-page', | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -38,7 +38,7 @@ export class GfFirePageComponent implements OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public hasImpersonationId: boolean; | 
					 | 
					 | 
					  public hasImpersonationId: boolean; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public hasPermissionToUpdateUserSettings: boolean; | 
					 | 
					 | 
					  public hasPermissionToUpdateUserSettings: boolean; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public isLoading = false; | 
					 | 
					 | 
					  public isLoading = false; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  public safeWithdrawalRateControl = new FormControl(0.025); | 
					 | 
					 | 
					  public safeWithdrawalRateControl = new FormControl<number>(undefined); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					  public safeWithdrawalRateOptions = [0.025, 0.03, 0.035, 0.04, 0.045]; | 
					 | 
					 | 
					  public safeWithdrawalRateOptions = [0.025, 0.03, 0.035, 0.04, 0.045]; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public user: User; | 
					 | 
					 | 
					  public user: User; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public withdrawalRatePerMonth: Big; | 
					 | 
					 | 
					  public withdrawalRatePerMonth: Big; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -58,8 +58,6 @@ export class GfFirePageComponent implements OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.isLoading = true; | 
					 | 
					 | 
					    this.isLoading = true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.deviceType = this.deviceService.getDeviceInfo().deviceType; | 
					 | 
					 | 
					    this.deviceType = this.deviceService.getDeviceInfo().deviceType; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.safeWithdrawalRateControl = new FormControl(0.025); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.dataService | 
					 | 
					 | 
					    this.dataService | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      .fetchPortfolioDetails() | 
					 | 
					 | 
					      .fetchPortfolioDetails() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      .pipe(takeUntil(this.unsubscribeSubject)) | 
					 | 
					 | 
					      .pipe(takeUntil(this.unsubscribeSubject)) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -99,21 +97,6 @@ export class GfFirePageComponent implements OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (state?.user) { | 
					 | 
					 | 
					        if (state?.user) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.user = state.user; | 
					 | 
					 | 
					          this.user = state.user; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          const isWithdrawalRateDisabled = | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.user?.subscription?.type === 'Basic' || | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.hasImpersonationId; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.safeWithdrawalRateControl.setValue( | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.user.settings.safeWithdrawalRate, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            { emitEvent: false } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          ); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          if (isWithdrawalRateDisabled) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.safeWithdrawalRateControl.disable({ emitEvent: false }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          } else { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.safeWithdrawalRateControl.enable({ emitEvent: false }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.hasPermissionToUpdateUserSettings = | 
					 | 
					 | 
					          this.hasPermissionToUpdateUserSettings = | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.user.subscription?.type === 'Basic' | 
					 | 
					 | 
					            this.user.subscription?.type === 'Basic' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              ? false | 
					 | 
					 | 
					              ? false | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -122,6 +105,11 @@ export class GfFirePageComponent implements OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                  permissions.updateUserSettings | 
					 | 
					 | 
					                  permissions.updateUserSettings | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                ); | 
					 | 
					 | 
					                ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          this.safeWithdrawalRateControl.setValue( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.user.settings.safeWithdrawalRate, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            { emitEvent: false } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.calculateWithdrawalRates(); | 
					 | 
					 | 
					          this.calculateWithdrawalRates(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.changeDetectorRef.markForCheck(); | 
					 | 
					 | 
					          this.changeDetectorRef.markForCheck(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -233,9 +221,8 @@ export class GfFirePageComponent implements OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  private calculateWithdrawalRates() { | 
					 | 
					 | 
					  private calculateWithdrawalRates() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (this.fireWealth && this.user?.settings?.safeWithdrawalRate) { | 
					 | 
					 | 
					    if (this.fireWealth && this.user?.settings?.safeWithdrawalRate) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      this.withdrawalRatePerYear = new Big( | 
					 | 
					 | 
					      this.withdrawalRatePerYear = new Big( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        this.fireWealth.today.valueInBaseCurrency * | 
					 | 
					 | 
					        this.fireWealth.today.valueInBaseCurrency | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					          this.user.settings.safeWithdrawalRate | 
					 | 
					 | 
					      ).mul(this.user.settings.safeWithdrawalRate); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					      ); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      this.withdrawalRatePerMonth = this.withdrawalRatePerYear.div(12); | 
					 | 
					 | 
					      this.withdrawalRatePerMonth = this.withdrawalRatePerYear.div(12); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |