





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface SignIntentsSafariMountedAppleDecompose : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation SignIntentsSafariMountedAppleDecompose

- (void)dealloc {
    
}

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

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

- (void)typeProjectBitsTodayPersistColumnIndexing:(NSString *)appId complete:(void (^_Nullable)(BOOL pointLogin))complete {

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


- (void)barResonantTransferCursorRuleController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull foundRain))success pintCircle:(void (^_Nullable)(NSString * _Nonnull error))error busLastAction:(void(^)(NSInteger))action {
    self.scrollingSolidAction = action;
    

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





- (CLUIConfigure *)tenFarMaySnow:(UIViewController *)viewController foodArray:(NSArray *)array {
    CLUIConfigure *blobDetects = [[CLUIConfigure alloc] init];

    UIColor *decryptWinColor = array[0];
    NSString *youSeeFormCup = array[1];
    NSString *usePartPanName = array[6];
    UIImage *mainMidImage = array[2];
    CGSize switchPatch = [array[3] CGSizeValue];
    NSString *routeText = array[4];
    NSString *pageSeeText = array[5];
    NSString *tapText = array[7];
    
    UIImage *backgroundImage = [array[8] isKindOfClass:[UIImage class]] ? array[8] : nil;
    UIImage *fractionSlideTopIrishJumpImage = [array[9] isKindOfClass:[UIImage class]] ? array[9] : nil;
    
    UIColor *suchTrySolveColor = [array[10] isKindOfClass:[UIColor class]] ? array[10] : UIColor.whiteColor;

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

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

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

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

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

@end
