





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface ItsSilencePunjabiNearbyCompareLonger : NSObject<CLShanYanSDKManagerDelegate>

@property (nonatomic, copy) void(^telephonyCycleAction)(NSInteger);

@end

@implementation ItsSilencePunjabiNearbyCompareLonger

- (void)dealloc {
    
}

+ (instancetype)shared {
    static id shared = nil;
    static dispatch_once_t blueToken;
    dispatch_once(&blueToken, ^{
        shared = [[super allocWithZone:NULL] init];
    });
    return shared;
}

+ (NSString *)recoveredIll {
    return [CLShanYanSDKManager clShanYanSDKVersion];
}

- (void)detailsOrderInnerAmbiguityStakeSeparatorCritical:(NSString *)appId complete:(void (^_Nullable)(BOOL pieceLogin))complete {

    [CLShanYanSDKManager setCLShanYanSDKManagerDelegate:self];
    
    [CLShanYanSDKManager setPreGetPhonenumberUseCacheIfNoCellularNetwork:NO];
    
    [CLShanYanSDKManager initWithAppId:appId complete:^(CLCompleteResult * _Nonnull registerResult) {
        __block BOOL stepItsHisBeenLogin = !registerResult.error;
        
        if (stepItsHisBeenLogin) {
            
            [CLShanYanSDKManager preGetPhonenumber:^(CLCompleteResult * _Nonnull registerResult) {
                dispatch_sync(dispatch_get_main_queue(), ^{
                    complete(registerResult.error == nil);
                });
            }];
            
        } else {
            dispatch_sync(dispatch_get_main_queue(), ^{
                complete(NO);
            });
        }
    }];
}


- (void)callbacksAnimatedVortexPickUseController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull poloStart))success thinBasque:(void (^_Nullable)(NSString * _Nonnull error))error minimumAction:(void(^)(NSInteger))action {
    self.telephonyCycleAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self ourDayAreThat:controller partArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull registerResult) {
        if (registerResult.error) {
            error(registerResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull registerResult) {
        
        if (registerResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                success(registerResult.data);
            });
        }else {
            error(registerResult.message);
        }
    }];
}





- (CLUIConfigure *)ourDayAreThat:(UIViewController *)viewController partArray:(NSArray *)array {
    CLUIConfigure *bendStaySub = [[CLUIConfigure alloc] init];
    
    bendStaySub.viewController = viewController;
    
    
    bendStaySub.clNavigationBarHidden = @(YES);
    
    //logo
    bendStaySub.clLogoHiden = @(YES);
    
    
    bendStaySub.clPhoneNumberFont = [UIFont boldSystemFontOfSize:26];
    bendStaySub.clPhoneNumberColor = UIColor.darkGrayColor;
    bendStaySub.clPhoneNumberTextAlignment = @(NSTextAlignmentCenter);
    
    
    bendStaySub.clSloganTextFont = [UIFont systemFontOfSize:14];
    bendStaySub.clSloganTextColor = UIColor.darkGrayColor;
    bendStaySub.clSlogaTextAlignment = @(NSTextAlignmentCenter);
    
    
    bendStaySub.clLoginBtnText = array[4];
    bendStaySub.clLoginBtnTextFont = [UIFont systemFontOfSize:18];
    bendStaySub.clLoginBtnTextColor = UIColor.whiteColor;
    bendStaySub.clLoginBtnBgColor = array[0];
    bendStaySub.clLoginBtnCornerRadius = @(2);
    
    
    bendStaySub.clCheckBoxSize = [NSValue valueWithCGSize:CGSizeMake(0, 0)];
    bendStaySub.clCheckBoxValue = @(YES);
    
    
    bendStaySub.clAppPrivacyNormalDesTextFirst = array[5];
    bendStaySub.clAppPrivacyFirst = @[array[6], array[1]];
    bendStaySub.clAppPrivacyNormalDesTextSecond = array[7];
    bendStaySub.clAppPrivacyNormalDesTextLast = @"";
    bendStaySub.clAppPrivacyTextFont = [UIFont systemFontOfSize:12];
    bendStaySub.clAppPrivacyTextAlignment = @(NSTextAlignmentLeft);
    bendStaySub.clAppPrivacyWebNavigationBarTintColor = UIColor.whiteColor;
    bendStaySub.clAppPrivacyPunctuationMarks = @(YES);
    bendStaySub.clAppPrivacyColor = @[UIColor.darkGrayColor,array[0]];;
    bendStaySub.clAuthTypeUseWindow = @(YES);
    bendStaySub.clPrivacyShowUnderline = @(YES);
    bendStaySub.clAppPrivacyLineSpacing = @(2.5);
    bendStaySub.clAuthWindowModalTransitionStyle = @(UIModalTransitionStyleCrossDissolve);
    
    bendStaySub.clAppPrivacyWebBackBtnImage = array[2];
    
    
    bendStaySub.clLoadingSize = [NSValue valueWithCGSize:CGSizeMake(90, 90)];
    bendStaySub.clLoadingCornerRadius = @(2);
    bendStaySub.clLoadingIndicatorStyle = @(UIActivityIndicatorViewStyleLarge);
    bendStaySub.clLoadingTintColor = UIColor.blackColor;
    bendStaySub.clLoadingBackgroundColor = UIColor.clearColor;
    
    
    CLOrientationLayOut *behaviorMinimumFloatOwnLook = [[CLOrientationLayOut alloc] init];
    bendStaySub.clOrientationLayOutPortrait = behaviorMinimumFloatOwnLook;
    
    
    CGFloat y = (([UIScreen mainScreen].bounds.size.height - [array[3] CGSizeValue].height) * 0.5) + 35;
    CGFloat height = 30;
    behaviorMinimumFloatOwnLook.clLayoutPhoneTop = @(y);
    behaviorMinimumFloatOwnLook.clLayoutPhoneHeight = @(height);
    behaviorMinimumFloatOwnLook.clLayoutPhoneCenterX = @(0);
    
    
    y += (height + 20);
    height = 17;
    behaviorMinimumFloatOwnLook.clLayoutSloganTop = @(y);
    behaviorMinimumFloatOwnLook.clLayoutSloganCenterX = @(0);
    behaviorMinimumFloatOwnLook.clLayoutSloganHeight = @(height);

    
    y += (height + 20);
    height = 50;
    behaviorMinimumFloatOwnLook.clLayoutLoginBtnTop = @(y);
    behaviorMinimumFloatOwnLook.clLayoutLoginBtnWidth = @([array[3] CGSizeValue].width - 40);
    behaviorMinimumFloatOwnLook.clLayoutLoginBtnCenterX = @(0);
    behaviorMinimumFloatOwnLook.clLayoutLoginBtnHeight = @(height);

    
    y += (height + 15);
    behaviorMinimumFloatOwnLook.clLayoutAppPrivacyTop = @(y);
    behaviorMinimumFloatOwnLook.clLayoutAppPrivacyCenterX = @(0);
    behaviorMinimumFloatOwnLook.clLayoutAppPrivacyWidth = @([array[3] CGSizeValue].width - 40);
    
    
    bendStaySub.customAreaView = ^(UIView * _Nonnull customAreaView) {
        
        customAreaView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0];
        
        UIView *elderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [array[3] CGSizeValue].width, [array[3] CGSizeValue].height)];
        elderView.backgroundColor = UIColor.whiteColor;
        elderView.layer.cornerRadius = 2.0;
        [customAreaView addSubview:elderView];
        elderView.center = customAreaView.center;
        
        
        UIButton *close = [UIButton buttonWithType:UIButtonTypeCustom];
        [close addTarget:self action:@selector(decreaseGlucoseBufferSuccessSquaresVelocityHandler:) forControlEvents:(UIControlEventTouchUpInside)];
        [close setBackgroundImage:array[2] forState:UIControlStateNormal];
        [elderView addSubview:close];
        close.frame = CGRectMake(8, 8, 20, 20);
    };
    
    return bendStaySub;
}

- (void)decreaseGlucoseBufferSuccessSquaresVelocityHandler:(id)sender {
    [CLShanYanSDKManager finishAuthControllerCompletion:nil];
    self.telephonyCycleAction(0);
}

@end
