






#import "RareSlashLoopsViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+FunDecode.h"
#import "NSString+HairNoneIts.h"

@interface RareSlashLoopsViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *bankBoxDrawEarControl;
@property (nonatomic, strong) UIView * restoredSubstringDarwinMetricsIntents;
@property (nonatomic, strong) UIView * surgeInsideInviteCallDigit;

@property (nonatomic, strong) UIScrollView * handlerPlusView;

@end

@implementation RareSlashLoopsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.subLoadSumButton.hidden = YES;
    self.canCreamyButton.hidden = YES;
    
    UISegmentedControl *wonKeysView = [[UISegmentedControl alloc] initWithItems:@[MenuCluster.hallFloorExist.napIconExpansionCalendarExportedBridge,MenuCluster.hallFloorExist.bestDrivenCallDividePrivacyMin]];
    wonKeysView.layer.masksToBounds = YES; 
    wonKeysView.layer.cornerRadius = 2;    
    [wonKeysView setTitleTextAttributes:@{NSForegroundColorAttributeName:[MenuCluster asleepYetColor]} forState:UIControlStateSelected];
    [wonKeysView setTitleTextAttributes:@{NSForegroundColorAttributeName:[MenuCluster asleepYetColor]} forState:UIControlStateNormal];
    [self.view addSubview:wonKeysView];
    [wonKeysView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(MenuCluster.thirteenHand.boostSender);
    }];
    [wonKeysView addTarget:self action:@selector(yardIcelandic:) forControlEvents:UIControlEventValueChanged];
    self.bankBoxDrawEarControl = wonKeysView;
    
    _handlerPlusView = [[UIScrollView alloc]init];
    _handlerPlusView.pagingEnabled = YES;
    _handlerPlusView.delegate = self;
    [self.view addSubview:_handlerPlusView];
    [_handlerPlusView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(MenuCluster.thirteenHand.wayGroupWait);
        make.right.equalTo(self.view).offset(-MenuCluster.thirteenHand.wayGroupWait);
        make.top.equalTo(self.view).offset(MenuCluster.thirteenHand.eggPanQuotes);
        make.bottom.equalTo(self.view).offset(-MenuCluster.thirteenHand.waxSuchRotor);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.handlerPlusView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.handlerPlusView);
        make.height.equalTo(_handlerPlusView);
    }];
    
    UIView * fillerSubTen = [self illLexicalView:[MenuCluster disablesSnowDeclinedExportedStorage]];
    [containerView addSubview:fillerSubTen];
    [fillerSubTen mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.handlerPlusView);
    }];
    self.restoredSubstringDarwinMetricsIntents = fillerSubTen;
    
    UIView * farOxygenAdd = [self illLexicalView:[MenuCluster lettishExpectSecurelyCubeArcade]];
    [containerView addSubview:farOxygenAdd];
    [farOxygenAdd mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(fillerSubTen.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.handlerPlusView);
    }];
    self.surgeInsideInviteCallDigit = farOxygenAdd;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(farOxygenAdd.mas_right);
    }];
    
    if (![self.mailBigPack boolValue]) {
        UIButton *workingButton = [MenuCluster systolicFlagSwitchSlovakDenyColor:MenuCluster.hallFloorExist.closeHisHand];
        [workingButton setBackgroundImage:[UIImage usePastFoodFaxColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [workingButton addTarget:self action:@selector(attachedOperatorForbiddenPrepGainNineteen:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:workingButton];
        [workingButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-MenuCluster.thirteenHand.bodyPintEar);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(MenuCluster.thirteenHand.correctedOne);
        }];
    }
    
    UIButton *expiresButton =  [MenuCluster systolicFlagSwitchSlovakDenyColor:MenuCluster.hallFloorExist.labeledAre];
    [expiresButton addTarget:self action:@selector(heapElapsedFilterPopArgumentLongest:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:expiresButton];
    [expiresButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-MenuCluster.thirteenHand.bodyPintEar);
        make.centerX.equalTo(self.view).multipliedBy(![self.mailBigPack boolValue]?1.35:1);
        make.height.mas_equalTo(MenuCluster.thirteenHand.correctedOne);
    }];
    
    wonKeysView.selectedSegmentIndex = 0;
    [self yardIcelandic:wonKeysView];
}

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
    [self.bankBoxDrawEarControl setSelectedSegmentIndex:scrollView.contentOffset.x/self.view.frame.size.width ==0?0:1];
    [self badLayerReduceUnlockedScreenText:scrollView.contentOffset.x/self.view.frame.size.width ==0?0:1];
}

- (void)yardIcelandic:(UISegmentedControl *)sender {
    [self badLayerReduceUnlockedScreenText:sender.selectedSegmentIndex == 0?0:1];
    [self.handlerPlusView setContentOffset:CGPointMake(sender.selectedSegmentIndex == 0?0:self.handlerPlusView.frame.size.width, 0) animated:YES];
}

- (void)badLayerReduceUnlockedScreenText:(NSInteger)type {
    NSString *warpBrowse = nil;
    UIView *contentView = nil;
    warpBrowse = type == 0 ? [MenuCluster disablesSnowDeclinedExportedStorage]:[MenuCluster lettishExpectSecurelyCubeArcade];
    contentView = type == 0 ? self.restoredSubstringDarwinMetricsIntents:self.surgeInsideInviteCallDigit;
    
    if (warpBrowse.easyTopIndex) {
        return;
    }
    
    if ([[warpBrowse pathExtension] containsString:MenuCluster.thirteenHand.funElderGrandsonExclusiveLittle]) {
        UITextView *allView = (UITextView *)contentView;
        if (allView.text.length > 0) {
            return;
        }

        
        [PopTipHomeView logoTooLowTwoView:contentView];

        
        NSURL *url = [NSURL URLWithString:warpBrowse];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [PopTipHomeView slideExtrinsicPhotosDisorderTokenView:contentView];
                
                if (error || data.length == 0) {
                    
                    allView.text = MenuCluster.hallFloorExist.entropyTakeChinaDirectionContactsSubset;
                    return;
                }
                
                
                NSString *beganFootnote = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                allView.text = beganFootnote ?: MenuCluster.hallFloorExist.ratioThatIndexedRatioGrowRetriedTwo;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *shrink = (WKWebView *)contentView;
        if (!shrink.isLoading && shrink.estimatedProgress == 1) {
            [PopTipHomeView slideExtrinsicPhotosDisorderTokenView:contentView];
            return;
        }
        [PopTipHomeView logoTooLowTwoView:contentView];
        NSString *strideMen =  [warpBrowse.portraitLazyRestartTaskCallbacksHomepage stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:strideMen];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [shrink loadRequest:request];
    }
}

- (void)attachedOperatorForbiddenPrepGainNineteen:(id)sender {
    [self yearsProducedRenamingLeakyExportedAction:nil];
    if (self.engineBookmarkArchiveChapterBurst) {
        self.engineBookmarkArchiveChapterBurst(NO);
    }
}

- (void)heapElapsedFilterPopArgumentLongest:(id)sender {
    [self yearsProducedRenamingLeakyExportedAction:nil];
    if (self.engineBookmarkArchiveChapterBurst) {
        self.engineBookmarkArchiveChapterBurst(YES);
    }
}

- (UIView *)illLexicalView:(NSString *)string {
    UIView *safeHexMenu = nil;
    if ([[string pathExtension] containsString:MenuCluster.thirteenHand.funElderGrandsonExclusiveLittle]) {
        UITextView * artPause = [UITextView new];
        artPause.editable = NO;
        artPause.backgroundColor = UIColor.whiteColor;
        artPause.textColor = UIColor.grayColor;
        safeHexMenu = artPause;
    }else {
        WKWebView *finnishLive = [[WKWebView alloc] initWithFrame:CGRectZero];
        finnishLive.backgroundColor = UIColor.clearColor;
        finnishLive.scrollView.backgroundColor = UIColor.lightGrayColor;
        finnishLive.opaque = YES;
        finnishLive.scrollView.bounces =NO;
        finnishLive.scrollView.showsVerticalScrollIndicator = NO;
        finnishLive.scrollView.showsHorizontalScrollIndicator = NO;
        finnishLive.navigationDelegate = self;
        safeHexMenu = finnishLive;
    }
    return safeHexMenu;
}

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    [PopTipHomeView slideExtrinsicPhotosDisorderTokenView:webView];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    UIEdgeInsets funSumIdle = [[PotentialManager shared] tapHalfOrderWindow].safeAreaInsets;
    funSumIdle.top    += 10;
    funSumIdle.left   += 10;
    funSumIdle.bottom += 10;
    funSumIdle.right  += 10;

    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(funSumIdle);
    }];
}

@end
