//
//  VFYIDSelfieGuideWrapper.m
//  Verif-y
//
//  Created by MTN on 12/09/20.
//

#import "VFYIDSelfieGuideWrapper.h"
#import "VFYVerifyApp.h"
#import "VFYCameraWrapper.h"
#import "VFYSelfieFinalPreviewWrapper.h"
#import "VFYConstant.h"
#import "VFYButton.h"
#import <MobileCoreServices/MobileCoreServices.h>
#import "ResultModelSelfie.h"

@interface VFYIDSelfieGuideWrapper ()

@property (weak, nonatomic) IBOutlet UILabel *LbTkSelfie;
@property (weak, nonatomic) IBOutlet UILabel *LbVFYId;
@property (weak, nonatomic) IBOutlet VFYButton *LbBtUpload;
@property (weak, nonatomic) IBOutlet VFYButton *LbBtCamera;
@property (weak, nonatomic) IBOutlet UIView *LoaderView;
@property (weak, nonatomic) IBOutlet UILabel *LbLogoPow;
@property (weak, nonatomic) IBOutlet UILabel *LbLogoBy;
@property (weak, nonatomic) IBOutlet UIScrollView *BodyScrollView;
@property (nonatomic, retain) VFYVerifyApp *sharedInstance;
@property (nonatomic) NSString* Source;
@property (nonatomic) NSString* Target;
@property (nonatomic) CFTimeInterval audit_event_Duration;
@property (nonatomic, strong) NSBundle *bundlePath;

@end

@implementation VFYIDSelfieGuideWrapper

@synthesize selectedOption;
@synthesize callDirectlyFlag;
@synthesize selfieGuide;
@synthesize idSuccess;
@synthesize selfieFaceImage;
@synthesize audit_event_Duration;

- (void)viewDidLoad {
    [super viewDidLoad];
    if (@available(iOS 13.0, *)) {
         self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    }
    self.bundlePath = [NSBundle bundleForClass:[VFYVerifyApp class]];
    
    //make the loader view background clear color to be fully transparent
    self.LoaderView.backgroundColor = [UIColor clearColor];
    self.sharedInstance = [VFYVerifyApp sharedInstance];
    //[self.view setBackgroundColor:[Utilities colorFromColorString:self.sharedInstance.bodyColor]];
    [self.BodyScrollView setBackgroundColor:[Utilities colorFromColorString:self.sharedInstance.bodyColor]];
    [self setBrandingColor];
    [self setLocalizationText];
    audit_event_Duration = CACurrentMediaTime();
    if(callDirectlyFlag == Directly){
        [self setCloseButton];
        idSuccess = [[ResultModelSelfie alloc] init];
        if([selfieFaceImage length]>0){
            [idSuccess setValue:selfieFaceImage forKey:@"faceImage"];
        }
        /** observer is use to receive values from Nth child to current view */
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(idSuccessCallFromNthChild:) name:VFY_OBSERVER_IDSUCCESS object:nil];
    }
}

/** Receive method use to handle call from nth child */
- (void) idSuccessCallFromNthChild:(NSNotification *)notify {
    NSLog(@"dataReceived :%@", notify.object);
    ResultModelSelfie *vfySuccess = (ResultModelSelfie*)notify.object;
    [selfieGuide callClose:SelfieGuideWrapperComplete PassValue:vfySuccess];
}

/**
  Add localization text on labels
*/
- (void) setLocalizationText {
    self.LbTkSelfie.text = NSLocalizedStringWithDefaultValue(@"mb_selfie_userguidance_title", [self.sharedInstance language], [self.sharedInstance languageBundlePath], @"Take a Selfie", nil);
    //self.LbVFYId.text = NSLocalizedStringWithDefaultValue(@"mb_selfie_userguidance_subtitle", [self.sharedInstance language], [self.sharedInstance languageBundlePath], @"This will be used to verify your ID", nil);
    [self.LbTkSelfie setTextColor:[Utilities colorFromColorString:self.sharedInstance.bodyTitleColor]];
}

/**
  Add color to branding and corner button
*/
- (void) setBrandingColor
{
    [self.LbLogoPow setTextColor:[Utilities colorFromColorString:VFY_LOGO_POWER]];
    [self.LbLogoBy setTextColor:[Utilities colorFromColorString:VFY_LOGO_BY]];
    /* Set rounded button*/
    //self.LbBtCamera.layer.cornerRadius = 5; self.LbBtCamera.clipsToBounds = true; self.LbBtUpload.layer.cornerRadius = 5; self.LbBtUpload.clipsToBounds = true;
    /* Set button style */
    [self.LbBtCamera animateOnPress:FALSE borderColor:[Utilities colorFromColorString:[self.sharedInstance buttonBorderColor]] backGroundColor:[Utilities colorFromColorString:[self.sharedInstance buttonBackgroundColor]] textColor:[Utilities colorFromColorString:[self.sharedInstance buttonTextColor]]];
    [self.LbBtUpload animateOnPress:FALSE borderColor:[Utilities colorFromColorString:[self.sharedInstance buttonBorderColor]] backGroundColor:[Utilities colorFromColorString:[self.sharedInstance buttonBackgroundColor]] textColor:[Utilities colorFromColorString:[self.sharedInstance buttonTextColor]]];
    [self CustomTitle];
}

/**
  Add Header title test or image
*/
-(void) CustomTitle
{
    if([self.sharedInstance.headerTitleImage length]>0){
       [Utilities customTitleImage:self.navigationItem Logo:self.sharedInstance.headerTitleImage];
    } else if([self.sharedInstance.headerTitleText length]){
        [Utilities customTitleText:self.navigationItem TitleText:self.sharedInstance.headerTitleText FontColor:self.sharedInstance.headerTextColor];
    }
}

- (IBAction)BtnUpload:(id)sender {
   selectedOption = Upload;
   UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
   imagePicker.delegate = self;
   imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
   [self presentViewController:imagePicker animated:YES completion:nil];
}

- (IBAction)BtnCamera:(id)sender {
   /*selectedOption = Camera;
   UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
   imagePicker.delegate = self;
   imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
   [self presentViewController:imagePicker animated:YES completion:nil];*/
   UIStoryboard *storyboard = [UIStoryboard storyboardWithName:VFY_MAIN_STORYBOARD bundle:self.bundlePath];
   VFYCameraWrapper *newView = [storyboard instantiateViewControllerWithIdentifier:VFY_CAMERA_STORYBOARD];
   newView.selectedView = SelfieCase;
   newView.idSuccess = idSuccess;
   newView.audit_event_Duration = audit_event_Duration;
   [self.navigationController pushViewController:newView animated:YES];
}

- (void) openImagePreviewController:(UIImage *) image {
    if(selectedOption == Camera){
        [self compareImage:image];
    } else if(selectedOption == Upload) {
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:VFY_MAIN_STORYBOARD bundle:self.bundlePath];
        VFYSelfieFinalPreviewWrapper *newView = [storyboard instantiateViewControllerWithIdentifier:VFY_SELFIE_PREVIEW_STORYBOARD];
        newView.selectedOption = Upload;
        newView.passImage = image;
        newView.idSuccess = idSuccess;
        newView.audit_event_Duration = audit_event_Duration;
        [self.navigationController pushViewController:newView animated:YES];
    } else {
        NSLog(@"No option from selfieguide");
    }
}

-(void)compareImage:(UIImage *) image {
    if(image == nil){
      return;
    }
    self.Source=nil;
    self.Target=nil;
    self.LoaderView.hidden = false;
    [self.view bringSubviewToFront:self.LoaderView];
    NSData *compressData = [Utilities compressForUpload:image];
    UIImage  *compressedImg = [UIImage imageWithData:compressData];
    NSString *base64Str = [Utilities encodeToBase64String:compressedImg];
    NSLog(@"base-2 lenght %lu",[base64Str length]);
    if([base64Str length]==0)
    {
       dispatch_async(dispatch_get_main_queue(), ^{
            self.LoaderView.hidden = true;
       });
       return;
    }
    self.Source = base64Str;
    self.Target = base64Str;

    NSURLSessionConfiguration *defaultSessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
    NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration:defaultSessionConfiguration];
    NSURL *url = [NSURL URLWithString:VFY_IMAGE_COMPARE_API];
    NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url];
    NSString *baseString = [NSString stringWithFormat:@"%@%@",VFY_IMAGE_COMPARE_AUTHORIZATION,[Utilities encodeStringTo64:VFY_IMAGE_COMPARE_CREDENTIAL]];
    NSDictionary *tmp = [[NSDictionary alloc] initWithObjectsAndKeys:self.Target, VFY_IMAGE_TARGET, self.Source, VFY_IMAGE_SOURCE,nil];
    NSError *error;
    NSData *postData = [NSJSONSerialization dataWithJSONObject:tmp options:0 error:&error];
    [urlRequest setValue:VFY_HEADER_CONTENT_VALUE forHTTPHeaderField:VFY_HEADER_CONTENT_KEY];
    [urlRequest setValue:baseString forHTTPHeaderField:VFY_HEADER_AUTH_KEY];
    [urlRequest setHTTPMethod:VFY_METHOD];
    [urlRequest setHTTPBody:postData];

    NSURLSessionDataTask *dataTask = [defaultSession dataTaskWithRequest:urlRequest completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
        
        NSString *base64Decoded = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        if([base64Decoded length]>0){
            if([base64Decoded isEqualToString:VFY_RESPONSE_TRUE]){
                NSLog(@"Successful match!");
            } else if ([base64Decoded isEqualToString:VFY_RESPONSE_FALSE]){
                NSLog(@"Unsuccessful match, please try again...");
            } else if([base64Decoded isEqualToString:VFY_RESPONSE_FAILED]){
                NSLog(@"Error occurred, please try again...");
            }
        } else {
            NSLog(@"Null response from image compare API");
        }
        dispatch_async(dispatch_get_main_queue(), ^{
            self.LoaderView.hidden = true;
        });
    }];
    // Fire the request
    [dataTask resume];
}

/**
  Add close button in navigation
*/
- (void) setCloseButton {
    
    UIBarButtonItem *flipButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self action:@selector(BtClose:)];
    self.navigationItem.leftBarButtonItem = flipButton;
}

/**
  Close button action
*/
-(IBAction) BtClose:(id)sender {
    //[self dismissViewControllerAnimated:YES completion:nil];
    if(callDirectlyFlag == Directly){
      [selfieGuide callClose:SelfieGuideWrapperClose];
    } else {
      [self dismissViewControllerAnimated:YES completion:nil];
    }
}

#pragma mark UIImagePickerControllerDelegate
 
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    [self dismissViewControllerAnimated:YES completion:nil];
    NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType];
    if (CFStringCompare((CFStringRef) mediaType, kUTTypeImage, 0) == kCFCompareEqualTo) {
        UIImage* picture = nil;//[info objectForKey:UIImagePickerControllerEditedImage];
        if (!picture){
            picture = [info objectForKey:UIImagePickerControllerOriginalImage];
            [self openImagePreviewController:picture];
        }
    }
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void) setSource
{
    NSString *temp = @"/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJC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