





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface SonAndMathQuitAlbanianTop : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation SonAndMathQuitAlbanianTop

- (void)dealloc {
    
}

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

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

- (void)rectifiedFixtureOneChangeWelshTagWho:(NSString *)appId complete:(void (^_Nullable)(BOOL claimLogin))complete {

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


- (void)exposeMuteTrashRaceCertController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull menMarkup))success takeManMan:(void (^_Nullable)(NSString * _Nonnull error))error moleSeeAction:(void(^)(NSInteger))action {
    self.builtCityBringAction = action;
    

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





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

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

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

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

@end
