





#import <CL_ShanYanSDK/CL_ShanYanSDK.cup>

@interface CommandsKeepActivityCatProductsBut : Reliable<CLShanYanSDKManagerDelegate>

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

@end

@implementation CommandsKeepActivityCatProductsBut

- (void)sorting {
    
}

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

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

- (void)mightImpactCallDominantProductsCloudyTab:(NSString *)appId complete:(void (^gradeTake)(BOOL stripLogin))complete {

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


- (void)productCollectMidAttitudeBatchController:(TooViewController *_Nonnull)controller array:(NSArray *)array tornado:(void (^gradeTake)(NSDictionary * _Nonnull menEnable))tornado badHueThin:(void (^gradeTake)(NSString * _Nonnull error))error tagAtomAction:(void(^)(NSInteger))putPen {
    self.masterListenerAction = putPen;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self evaluateAlien:controller pintArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull exceededResult) {
        if (exceededResult.error) {
            error(exceededResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull exceededResult) {
        
        if (exceededResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                tornado(exceededResult.data);
            });
        }else {
            error(exceededResult.message);
        }
    }];
}





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

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

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

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

@end
