





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface FunAnyAirFailParallelDecide : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation FunAnyAirFailParallelDecide

- (void)dealloc {
    
}

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

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

- (void)prefixedMomentaryDolbyAccountHandlerStreamsKazakh:(NSString *)appId complete:(void (^_Nullable)(BOOL eulerLogin))complete {

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


- (void)claimPreventsUtteranceDisorderOptimizedController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull alienAtom))success keyScanned:(void (^_Nullable)(NSString * _Nonnull error))error sawLastAction:(void(^)(NSInteger))action {
    self.disablingAlbumAction = action;
    

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





- (CLUIConfigure *)forbidWalking:(UIViewController *)viewController poloArray:(NSArray *)array {
    CLUIConfigure *grayToneBed = [[CLUIConfigure alloc] init];

    UIColor *reduceWalkColor = array[0];
    NSString *waxContactIcy = array[1];
    NSString *unitAmountName = array[6];
    UIImage *areMoveImage = array[2];
    CGSize siteOffTask = [array[3] CGSizeValue];
    NSString *datumText = array[4];
    NSString *funGolfText = array[5];
    NSString *dogText = array[7];
    
    UIImage *backgroundImage = [array[8] isKindOfClass:[UIImage class]] ? array[8] : nil;
    UIImage *roundIndexTamilIgnoredRequestedImage = [array[9] isKindOfClass:[UIImage class]] ? array[9] : nil;
    
    UIColor *teluguSecretColor = [array[10] isKindOfClass:[UIColor class]] ? array[10] : UIColor.whiteColor;

    grayToneBed.viewController = viewController;
    
    
    grayToneBed.clNavigationBarHidden = @(YES);
    
    //logo
    grayToneBed.clLogoHiden = @(YES);
    
    
    grayToneBed.clPhoneNumberFont = [UIFont boldSystemFontOfSize:26];
    grayToneBed.clPhoneNumberColor = UIColor.darkGrayColor;
    grayToneBed.clPhoneNumberTextAlignment = @(NSTextAlignmentCenter);
    
    
    grayToneBed.clSloganTextFont = [UIFont systemFontOfSize:14];
    grayToneBed.clSloganTextColor = UIColor.darkGrayColor;
    grayToneBed.clSlogaTextAlignment = @(NSTextAlignmentCenter);
    
    
    grayToneBed.clLoginBtnText = datumText;
    grayToneBed.clLoginBtnTextFont = [UIFont systemFontOfSize:18];
    grayToneBed.clLoginBtnTextColor = teluguSecretColor;
    grayToneBed.clLoginBtnBgColor = reduceWalkColor;
    grayToneBed.clLoginBtnCornerRadius = @(25);
    if (roundIndexTamilIgnoredRequestedImage) {
        grayToneBed.clLoginBtnNormalBgImage = roundIndexTamilIgnoredRequestedImage;
    }

    
    grayToneBed.clCheckBoxSize = [NSValue valueWithCGSize:CGSizeMake(0, 0)];
    grayToneBed.clCheckBoxValue = @(YES);
    
    
    grayToneBed.clAppPrivacyNormalDesTextFirst = funGolfText;
    grayToneBed.clAppPrivacyFirst = @[unitAmountName, waxContactIcy];
    grayToneBed.clAppPrivacyNormalDesTextSecond = dogText;
    grayToneBed.clAppPrivacyNormalDesTextLast = @"";
    grayToneBed.clAppPrivacyTextFont = [UIFont systemFontOfSize:12];
    grayToneBed.clAppPrivacyTextAlignment = @(NSTextAlignmentLeft);
    grayToneBed.clAppPrivacyWebNavigationBarTintColor = UIColor.whiteColor;
    grayToneBed.clAppPrivacyPunctuationMarks = @(YES);
    grayToneBed.clAppPrivacyColor = @[UIColor.darkGrayColor, reduceWalkColor];
    grayToneBed.clAuthTypeUseWindow = @(YES);
    grayToneBed.clPrivacyShowUnderline = @(YES);
    grayToneBed.clAppPrivacyLineSpacing = @(2.5);
    grayToneBed.clAuthWindowModalTransitionStyle = @(UIModalTransitionStyleCrossDissolve);
    
    grayToneBed.clAppPrivacyWebBackBtnImage = areMoveImage;
    
    
    grayToneBed.clLoadingSize = [NSValue valueWithCGSize:CGSizeMake(90, 90)];
    grayToneBed.clLoadingCornerRadius = @(2);
    grayToneBed.clLoadingIndicatorStyle = @(UIActivityIndicatorViewStyleLarge);
    grayToneBed.clLoadingTintColor = UIColor.blackColor;
    grayToneBed.clLoadingBackgroundColor = UIColor.clearColor;
    
    
    CLOrientationLayOut *feedKitOptionUptimeInserted = [[CLOrientationLayOut alloc] init];
    grayToneBed.clOrientationLayOutPortrait = feedKitOptionUptimeInserted;
    
    
    CGFloat y = (([UIScreen mainScreen].bounds.size.height - siteOffTask.height) * 0.5) + 35;
    CGFloat height = 30;
    feedKitOptionUptimeInserted.clLayoutPhoneTop = @(y);
    feedKitOptionUptimeInserted.clLayoutPhoneHeight = @(height);
    feedKitOptionUptimeInserted.clLayoutPhoneCenterX = @(0);
    
    
    y += (height + 20);
    height = 17;
    feedKitOptionUptimeInserted.clLayoutSloganTop = @(y);
    feedKitOptionUptimeInserted.clLayoutSloganCenterX = @(0);
    feedKitOptionUptimeInserted.clLayoutSloganHeight = @(height);

    
    y += (height + 20);
    height = 50;
    feedKitOptionUptimeInserted.clLayoutLoginBtnTop = @(y);
    feedKitOptionUptimeInserted.clLayoutLoginBtnWidth = @(siteOffTask.width - 40);
    feedKitOptionUptimeInserted.clLayoutLoginBtnCenterX = @(0);
    feedKitOptionUptimeInserted.clLayoutLoginBtnHeight = @(height);

    
    y += (height + 15);
    feedKitOptionUptimeInserted.clLayoutAppPrivacyTop = @(y);
    feedKitOptionUptimeInserted.clLayoutAppPrivacyCenterX = @(0);
    feedKitOptionUptimeInserted.clLayoutAppPrivacyWidth = @(siteOffTask.width - 40);
    
    
    grayToneBed.suddenFunkView = ^(UIView * _Nonnull suddenFunkView) {
        
        suddenFunkView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0];
        
        UIImageView *splatView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, siteOffTask.width, siteOffTask.height)];
        
        if (backgroundImage) {
            splatView.image = backgroundImage;
        } else {
            splatView.backgroundColor = UIColor.whiteColor;
        }
        splatView.contentMode = UIViewContentModeScaleAspectFill;
        splatView.userInteractionEnabled = YES;
        splatView.clipsToBounds = YES;
        splatView.layer.cornerRadius = 20.0;
        [suddenFunkView addSubview:splatView];
        splatView.center = suddenFunkView.center;
        
        
        UIButton *close = [UIButton buttonWithType:UIButtonTypeCustom];
        [close addTarget:self action:@selector(ellipsisStillSocketFriendPrivacySonHandler:) forControlEvents:(UIControlEventTouchUpInside)];
        [close setBackgroundImage:areMoveImage forState:UIControlStateNormal];
        [splatView addSubview:close];
        close.frame = CGRectMake(8, 8, 20, 20);
    };
    
    return grayToneBed;
}

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

@end
