






#import "FitCloseSinPenViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+Universal.h"
#import "NSString+CountedSlab.h"

@interface FitCloseSinPenViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *rightCapCupTryControl;
@property (nonatomic, strong) UIView * widthJabberNorthBedProcessed;
@property (nonatomic, strong) UIView * nordicPreviewsVisitSlidingEmbedded;

@property (nonatomic, strong) UIScrollView * figureLeaseView;

@end

@implementation FitCloseSinPenViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.poloDecodeButton.hidden = YES;
    self.partDraftButton.hidden = YES;
    
    UISegmentedControl *andSockView = [[UISegmentedControl alloc] initWithItems:@[AppleNotify.labelBrownCurl.civilPowerSparseRecordAdobeTeeth,AppleNotify.labelBrownCurl.refinedMixSkinShortcutEncryptZoom]];
    andSockView.layer.masksToBounds = YES; 
    andSockView.layer.cornerRadius = 2;    
    [andSockView setTitleTextAttributes:@{NSForegroundColorAttributeName:[AppleNotify hourlyWaxColor]} forState:UIControlStateSelected];
    [andSockView setTitleTextAttributes:@{NSForegroundColorAttributeName:[AppleNotify hourlyWaxColor]} forState:UIControlStateNormal];
    [self.view addSubview:andSockView];
    [andSockView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(AppleNotify.emailBestRaw.evaluateAnd);
    }];
    [andSockView addTarget:self action:@selector(ownCubeWasOwn:) forControlEvents:UIControlEventValueChanged];
    self.rightCapCupTryControl = andSockView;
    
    _figureLeaseView = [[UIScrollView alloc]init];
    _figureLeaseView.pagingEnabled = YES;
    _figureLeaseView.delegate = self;
    [self.view addSubview:_figureLeaseView];
    [_figureLeaseView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(AppleNotify.emailBestRaw.yetPinkPrime);
        make.right.equalTo(self.view).offset(-AppleNotify.emailBestRaw.yetPinkPrime);
        make.top.equalTo(self.view).offset(AppleNotify.emailBestRaw.artsMetadata);
        make.bottom.equalTo(self.view).offset(-AppleNotify.emailBestRaw.pinchLoudAir);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.figureLeaseView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.figureLeaseView);
        make.height.equalTo(_figureLeaseView);
    }];
    
    UIView * adjustWhoFor = [self danishBoldView:[AppleNotify prologHalfEnablingDiphthongYou]];
    [containerView addSubview:adjustWhoFor];
    [adjustWhoFor mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.figureLeaseView);
    }];
    self.widthJabberNorthBedProcessed = adjustWhoFor;
    
    UIView * blobMatchRow = [self danishBoldView:[AppleNotify evictSomaliPlusLossyWith]];
    [containerView addSubview:blobMatchRow];
    [blobMatchRow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(adjustWhoFor.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.figureLeaseView);
    }];
    self.nordicPreviewsVisitSlidingEmbedded = blobMatchRow;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(blobMatchRow.mas_right);
    }];
    
    if (![self.problemBars boolValue]) {
        UIButton *moveTagButton = [AppleNotify smallerForTryDidThirdColor:AppleNotify.labelBrownCurl.redRawHybrid];
        [moveTagButton setBackgroundImage:[UIImage allEarUnitLiftColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [moveTagButton addTarget:self action:@selector(likeGlucoseYouIcyAppendLetter:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:moveTagButton];
        [moveTagButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-AppleNotify.emailBestRaw.angleRemove);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(AppleNotify.emailBestRaw.tipJoinClean);
        }];
    }
    
    UIButton *armZeroButton =  [AppleNotify smallerForTryDidThirdColor:AppleNotify.labelBrownCurl.revertFilm];
    [armZeroButton addTarget:self action:@selector(portWetStereoOffEffortVelocity:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:armZeroButton];
    [armZeroButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-AppleNotify.emailBestRaw.angleRemove);
        make.centerX.equalTo(self.view).multipliedBy(![self.problemBars boolValue]?1.35:1);
        make.height.mas_equalTo(AppleNotify.emailBestRaw.tipJoinClean);
    }];
    
    andSockView.selectedSegmentIndex = 0;
    [self ownCubeWasOwn:andSockView];
}

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

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

- (void)fourteenUpdatingNotifiesPressureClimbedText:(NSInteger)type {
    NSString *sameSlider = nil;
    UIView *contentView = nil;
    sameSlider = type == 0 ? [AppleNotify prologHalfEnablingDiphthongYou]:[AppleNotify evictSomaliPlusLossyWith];
    contentView = type == 0 ? self.widthJabberNorthBedProcessed:self.nordicPreviewsVisitSlidingEmbedded;
    
    if (sameSlider.saySpringSon) {
        return;
    }
    
    if ([[sameSlider pathExtension] containsString:AppleNotify.emailBestRaw.chapterJobLearnRetrieveFemale]) {
        UITextView *sayView = (UITextView *)contentView;
        if (sayView.text.length > 0) {
            return;
        }

        
        [MealHealthView midOwnBinUnitView:contentView];

        
        NSURL *url = [NSURL URLWithString:sameSlider];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [MealHealthView hexReferentFrictionPortionVitaminView:contentView];
                
                if (error || data.length == 0) {
                    
                    sayView.text = AppleNotify.labelBrownCurl.airObserversExtrinsicBalanceKinSay;
                    return;
                }
                
                
                NSString *projectsEvent = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                sayView.text = projectsEvent ?: AppleNotify.labelBrownCurl.minAnswerEjectLexicalSawDuplicateSex;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *keySum = (WKWebView *)contentView;
        if (!keySum.isLoading && keySum.estimatedProgress == 1) {
            [MealHealthView hexReferentFrictionPortionVitaminView:contentView];
            return;
        }
        [MealHealthView midOwnBinUnitView:contentView];
        NSString *commonTwo =  [sameSlider.pointTopArchivedPreviousRetainedRows stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:commonTwo];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [keySum loadRequest:request];
    }
}

- (void)likeGlucoseYouIcyAppendLetter:(id)sender {
    [self starSpecifyDisposeDashClipAction:nil];
    if (self.twistStepperCustodianChangingArabic) {
        self.twistStepperCustodianChangingArabic(NO);
    }
}

- (void)portWetStereoOffEffortVelocity:(id)sender {
    [self starSpecifyDisposeDashClipAction:nil];
    if (self.twistStepperCustodianChangingArabic) {
        self.twistStepperCustodianChangingArabic(YES);
    }
}

- (UIView *)danishBoldView:(NSString *)string {
    UIView *tapsCutRule = nil;
    if ([[string pathExtension] containsString:AppleNotify.emailBestRaw.chapterJobLearnRetrieveFemale]) {
        UITextView * rareSock = [UITextView new];
        rareSock.editable = NO;
        rareSock.backgroundColor = UIColor.whiteColor;
        rareSock.textColor = UIColor.grayColor;
        tapsCutRule = rareSock;
    }else {
        WKWebView *thickBefore = [[WKWebView alloc] initWithFrame:CGRectZero];
        thickBefore.backgroundColor = UIColor.clearColor;
        thickBefore.scrollView.backgroundColor = UIColor.lightGrayColor;
        thickBefore.opaque = YES;
        thickBefore.scrollView.bounces =NO;
        thickBefore.scrollView.showsVerticalScrollIndicator = NO;
        thickBefore.scrollView.showsHorizontalScrollIndicator = NO;
        thickBefore.navigationDelegate = self;
        tapsCutRule = thickBefore;
    }
    return tapsCutRule;
}

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

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

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

@end
