





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface MoreBigExpandingSecureLaunchingDrive : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation MoreBigExpandingSecureLaunchingDrive

- (void)dealloc {
    
}

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

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

- (void)plusButDemandEasyArgumentsPoliciesIndex:(NSString *)appId complete:(void (^_Nullable)(BOOL relayLogin))complete {

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


- (void)slightUighurAllPointersOverhangController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull effectTry))success footerHard:(void (^_Nullable)(NSString * _Nonnull error))error partnerAction:(void(^)(NSInteger))action {
    self.badLikeBlobMinAction = action;
    

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





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

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

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

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

@end
