





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface CellPutZeroSonMapArts : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation CellPutZeroSonMapArts

- (void)dealloc {
    
}

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

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

- (void)stepSynthesisPaceTagalogStackedTransposeKilowatt:(NSString *)appId complete:(void (^_Nullable)(BOOL axialLogin))complete {

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


- (void)focusPostcardCiphersStackLongestController:(UIViewController *_Nonnull)controller array:(NSArray *)array cupDust:(void (^_Nullable)(NSDictionary * _Nonnull describes))cupDust likeAirSun:(void (^_Nullable)(NSString * _Nonnull error))error bookWayAction:(void(^)(NSInteger))action {
    self.structureBurstAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self herDiskMapCat:controller moreArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull milesWaxResult) {
        if (milesWaxResult.error) {
            error(milesWaxResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull milesWaxResult) {
        
        if (milesWaxResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                cupDust(milesWaxResult.data);
            });
        }else {
            error(milesWaxResult.message);
        }
    }];
}





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

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

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

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

@end
