//
//  VFYVerifyApp.m
//  Verif-y
//
//  Created by Ashok Goil on 10/09/20.
//

#import "VFYVerifyApp.h"
#import "VFYConstant.h"
#import <MicroBlink/MicroBlink.h>

@implementation VFYVerifyApp

@synthesize language;
@synthesize resourcesBundle;
@synthesize customLocalizationFileName;
@synthesize languageBundlePath;
@synthesize scanType;
@synthesize suggestionValidation;
@synthesize requestId;
@synthesize previousEventId;
@synthesize reviewPage;

+ (id)sharedInstance {
    static VFYVerifyApp *sharedVFYInstance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedVFYInstance = [[self alloc] init];
    });
    return sharedVFYInstance;
}

- (id)init {
  if (self = [super init]) {
      //someProperty = [[NSString alloc] initWithString:@"Default Property Value"];
      
      self.geoLanguage = false;
      self.suggestionValidation = false;
      self.reviewPage = false;
      //self.language = [[MBMicroblinkApp instance] language];
      //self.idSuccess = [[VFYIDSuccess alloc] init];
      self.language = nil;
      self.languageBundlePath = [[MBMicroblinkApp instance] resourcesBundle];
      //self.failedResponse = [NSMutableDictionary dictionary];
      //Default value of all the custom setting variable
      //self.requestId = [self getRandomNumber]; //uncomment to set random number
      self.requestId = 0;
      self.previousEventId = 0;
      self.scanType = @"";
      self.headerColor = @"#FFF";
      self.headerTextColor = @"#000";
      self.bodyColor = @"#f5f5f5";
      //self.bodyColor = @"#C0C0C0";
      self.bodyTextColor = @"#345EAA";
      self.bodyTitleColor = @"#345EAA";
      self.buttonBorderColor = @"#345EAA";
      self.buttonBackgroundColor = @"#FFF";
      self.buttonTextColor = @"#345EAA";
      self.accountOwnerFirstName = @"";
      self.accountOwnerLastName = @"";
      self.cardOwnerFirstName = @"";
      self.cardOwnerLastName = @"";
      self.minimumAgeLimit = @"18";
      //self.headerTitleText = @"";
      self.headerTitleText = @"Verif-y";
      //self.headerTitleImage = @"";
      self.faceImage = @""; //use as first parameter image for selfie compare
      self.headerTitleImage = @"iVBORw0KGgoAAAANSUhEUgAAAZAAAACHCAMAAAAPxf9pAA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u8wV5RhSZZPWPid8he0FkgL4chwD7aZC9+j0OJHQWyKYyAKdyMOaPjktjtJJBs9RBgj91uxe+SsJaDQPYjwJb018vx23RObjeQlzv/3SfBemG9UtIT4vfJ+dpmIEf/7ldM/WnhQtK0B79RaIG9QLJNRICIW8/5TQHuJZnJBBIUEF6WRReTCUCkPpFGKekCv1Xm5DYCGfx3v+f2T7ny/E3jFi1btmgkSeLV+M1iZYwYSI2pCADo8Jw5MyTwm4V2RwqkQNCB0B5ri3yV8NvF3RwhkL/8jXh/Tnz5k9vwQJd0XCC0qyHoQOiUpMX9ELwwPt8vAkmfEIGvmkuLMtnhjVjvfwgkKOgM83QnmZMbHhHzdYEUCDpCU9YeUpVvb0J4JskDPpBUQUEnqRO/ob0WyRdMhpdy92IDOR0UdCImH8jUqt/0gtOvbTt5Pjc8Rh07BfJy+1//htv/mDnVokDSJ0HAN+JZHksgvYMJlr92v/ohkGrBionPYs5XAynwCAGfhbdSIHnvIuC7FLW+BBLckvprVO71LZBTQQPyd8hQ8HMgL68HefwtHpeWL17eCBrCv0fdHB93xkTg71HxadCg/12C+hH4j30C8A8yal9nfW0AAAAASUVORK5CYII=";
  }
  return self;
}

- (void) setDefaultValues {
    self.geoLanguage = false;
    self.suggestionValidation = false;
    self.reviewPage = false;
    self.language = nil;
    self.scanType = @"";
    self.requestId = @"";
    self.accountOwnerFirstName = @"";
    self.accountOwnerLastName = @"";
    self.cardOwnerFirstName = @"";
    self.cardOwnerLastName = @"";
    self.faceImage = @""; //use as first parameter image for selfie compare
    self.minimumAgeLimit = @"18";
    //self.requestId = [self getRandomNumber]; // uncomment to set random number
    self.requestId = 0;
    self.previousEventId = 0;
}

- (NSString*) getRandomNumber {
    //int randomNumber = arc4random_uniform(8999) + 1000 //for 4 digit random number
    int randomNumber = arc4random_uniform(8999999) + 1000000; //for 7 digit random number
    NSString *randomString = [NSString stringWithFormat:@"%d",randomNumber];
    return randomString;
}

@end
