






#import "InfoMercuryDecrementProcessorDemandViewController.h"
#import "StepRenewViewController.h"
#import "DecideSuffixCardRestingInvertCell.h"

@interface InfoMercuryDecrementProcessorDemandViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *axesListLexicalPopSubmitView;

@property (nonatomic, strong) UIView *somaliSonView;

@property (nonatomic, strong) UITableView *axialPhoneView;


@property (nonatomic, assign) BOOL strategyResponderChunkIntervalFetch;

@property (nonatomic, weak) id sheIcyOldClaim;

@property (nonatomic, strong) NSMutableArray *matchTempPairArray;

@property (nonatomic, strong) NSMutableArray *downArtsArray;

@property (nonatomic, strong) UIButton *tryNibblesButton;
@property (nonatomic, strong) UIButton *penTenBeginButton;

@end

@implementation InfoMercuryDecrementProcessorDemandViewController

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    if (_downArtsArray.count > 0 && self.strategyResponderChunkIntervalFetch) {
        self.strategyResponderChunkIntervalFetch = NO;
    }
}

- (void)viewWillAppear:(BOOL)animated {
    
    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        CGFloat bottom = FeedSunTied.rootIntegral.encryptEmail;
        make.centerX.equalTo(self.view.superview);
        make.centerY.equalTo(self.view.superview).offset(+bottom/2);
        make.height.mas_equalTo([FeedSunTied coercionAnnotatedTailFadeEqualAskSize].height+bottom);
        make.width.mas_equalTo([FeedSunTied coercionAnnotatedTailFadeEqualAskSize].width);
    }];
}

- (void)setStrategyResponderChunkIntervalFetch:(BOOL)strategyResponderChunkIntervalFetch {
    
    _strategyResponderChunkIntervalFetch = strategyResponderChunkIntervalFetch;
    
    _downArtsArray = strategyResponderChunkIntervalFetch ? _matchTempPairArray : [NSMutableArray arrayWithObject:_sheIcyOldClaim];
    
    [self.axialPhoneView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!strategyResponderChunkIntervalFetch ? FeedSunTied.rootIntegral.portalHitPut : self.downArtsArray.count > 3 ? 3 * FeedSunTied.rootIntegral.portalHitPut  : self.downArtsArray.count * FeedSunTied.rootIntegral.portalHitPut);
    }];
    
    self.axialPhoneView.scrollEnabled = strategyResponderChunkIntervalFetch;
    
    [self.axialPhoneView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.axialPhoneView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _matchTempPairArray = [[FeedSunTied infinityTryTokenHandshakeGregorian] mutableCopy];
    
    _sheIcyOldClaim = _matchTempPairArray.firstObject;
    
    [self leaveSeparatedCostMandatorySon];
    
    self.strategyResponderChunkIntervalFetch = NO;
}

- (void)leaveSeparatedCostMandatorySon {
    
    _axesListLexicalPopSubmitView = [[UIView alloc] init];
    _axesListLexicalPopSubmitView.backgroundColor = UIColor.whiteColor;
    _axesListLexicalPopSubmitView.layer.cornerRadius = 2;
    [self.view addSubview:_axesListLexicalPopSubmitView];
    [self.view sendSubviewToBack:_axesListLexicalPopSubmitView];
    [_axesListLexicalPopSubmitView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([FeedSunTied coercionAnnotatedTailFadeEqualAskSize]);
    }];
    
    
    UIView *somaliSonView = [FeedSunTied somaliSonView];
    [self.view addSubview:somaliSonView];
    self.somaliSonView = somaliSonView;
    [somaliSonView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(FeedSunTied.rootIntegral.lateSmallAir);
        make.height.mas_equalTo(FeedSunTied.rootIntegral.hasHockeyWax);
        make.left.equalTo(self.redoHertzButton.mas_right);
        make.right.equalTo(self.nowEquallyButton.mas_left);
    }];
    
    
    _axialPhoneView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    _axialPhoneView.backgroundColor = [UIColor whiteColor];
    _axialPhoneView.layer.masksToBounds = YES;
    _axialPhoneView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _axialPhoneView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _axialPhoneView.layer.borderColor = [FeedSunTied activeBigColor].CGColor;
    _axialPhoneView.layer.borderWidth = 0.6;
    _axialPhoneView.layer.cornerRadius = 2;
    _axialPhoneView.rowHeight = FeedSunTied.rootIntegral.portalHitPut;
    _axialPhoneView.delegate = self;
    _axialPhoneView.dataSource = self;
    [_axialPhoneView registerClass:[DecideSuffixCardRestingInvertCell class] forCellReuseIdentifier:NSStringFromClass(DecideSuffixCardRestingInvertCell.class)];
    [self.view addSubview:_axialPhoneView];
    [self.axialPhoneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.somaliSonView.mas_bottom).offset(FeedSunTied.rootIntegral.lateSmallAir);
        make.left.equalTo(self.axesListLexicalPopSubmitView).offset(FeedSunTied.rootIntegral.causeLongYou);
        make.right.equalTo(self.axesListLexicalPopSubmitView).offset(-FeedSunTied.rootIntegral.causeLongYou);
        make.height.mas_equalTo(FeedSunTied.rootIntegral.portalHitPut);
    }];
    
    
    self.tryNibblesButton = [FeedSunTied promptNorthLookCapsCascade:FeedSunTied.switchEnvelope.assetKinControlUnknownAlong];
    [self.tryNibblesButton addTarget:self action:@selector(processLongBasalSecondaryCompanyTenAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.axesListLexicalPopSubmitView addSubview:self.tryNibblesButton];
    [self.tryNibblesButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.axesListLexicalPopSubmitView).offset(-FeedSunTied.rootIntegral.lateSmallAir);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.penTenBeginButton = [FeedSunTied edgeSlideMidDeciliterIndentColor:FeedSunTied.switchEnvelope.shrinkDutch];
    [self.penTenBeginButton addTarget:self action:@selector(standBayerGatherRedDecreaseMiter:) forControlEvents:UIControlEventTouchUpInside];
    [self.axesListLexicalPopSubmitView addSubview:self.penTenBeginButton];
    [self.penTenBeginButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.tryNibblesButton.mas_top).offset(-FeedSunTied.rootIntegral.howSixAppend);
        make.left.right.equalTo(self.axialPhoneView);
        make.height.mas_equalTo(FeedSunTied.rootIntegral.strictlyRank);
    }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _downArtsArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    DecideSuffixCardRestingInvertCell *flag = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(DecideSuffixCardRestingInvertCell.class) forIndexPath:indexPath];
    NSArray *sessions = _downArtsArray[indexPath.row];
    
    flag.footnoteName.text = sessions[0];
    
    flag.mixBeenSinView.image = [[UIImage upsideJouleAssistantTraverseShakeName:sessions[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    flag.blurBadMoreTime.text = [NSString stringWithFormat:@"%@ %@",FeedSunTied.switchEnvelope.ouncesCellBadgeThreeTabTime,[self segmentsExcludedGrandauntLateSomaliPunjabiTime:[sessions[2] doubleValue]]];
    
    flag.accessoryType = self.strategyResponderChunkIntervalFetch ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return flag;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    _sheIcyOldClaim = _downArtsArray[indexPath.row];
    self.strategyResponderChunkIntervalFetch = !self.strategyResponderChunkIntervalFetch;
}


- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return self.strategyResponderChunkIntervalFetch;
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellEditingStyleDelete;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id sessions = _downArtsArray[indexPath.row];
        
        [_downArtsArray removeObject:sessions];
        
        [_matchTempPairArray removeObject:sessions];
        
        if ([self.subIcyWaxFree respondsToSelector:@selector(dailyMeteringSuggestedLoopScannerSoundName:completion:)]) {
            [self.subIcyWaxFree dailyMeteringSuggestedLoopScannerSoundName:sessions[0] completion:^(id object) {
                
            }];
        }
        
        if(_matchTempPairArray.count > 0){
            
            _downArtsArray = _matchTempPairArray;
            _sheIcyOldClaim = _downArtsArray.firstObject;
            self.strategyResponderChunkIntervalFetch = YES;
            
        }
    }
}


- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
    return @"Delete";
}

- (void)enablingShelfFlagDisablesFar:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super enablingShelfFlagDisablesFar:touches withEvent:event];
    self.strategyResponderChunkIntervalFetch = NO;
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
    self.strategyResponderChunkIntervalFetch = NO;
}


- (void)processLongBasalSecondaryCompanyTenAction:(UIButton *)sender {
    StepRenewViewController *liftMinSaySin = [StepRenewViewController new];
    liftMinSaySin.subIcyWaxFree = self.subIcyWaxFree;
    [self.navigationController pushViewController:liftMinSaySin animated:NO];
}

- (void)standBayerGatherRedDecreaseMiter:(UIButton *)sender {
    if ([self.subIcyWaxFree respondsToSelector:@selector(fireIcyPeakCaretStoreAccessingExecutingName:completion:)]) {
        [CutSubjectView suchAlignRoomWindow];
        [self.subIcyWaxFree fireIcyPeakCaretStoreAccessingExecutingName:self.sheIcyOldClaim[0] completion:^(id object) {
            [CutSubjectView blueMenuThirteenVariablesOddWindow];
        }];
    }
}


- (NSString *)segmentsExcludedGrandauntLateSomaliPunjabiTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double displaysTime = now - beTime;
    NSString * ascentBrand;
    
    NSDate * sheDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * say = [[NSDateFormatter alloc] init];
    [say setDateFormat:@"HH:mm"];
    NSString * optical = [say stringFromDate:sheDate];
    
    [say setDateFormat:@"dd"];
    NSString * panFar = [say stringFromDate:[NSDate date]];
    NSString * hellman = [say stringFromDate:sheDate];
    
    if (displaysTime < 60) {
        ascentBrand = FeedSunTied.switchEnvelope.bigAtomPower;
    }else if (displaysTime < 60 * 60) {
        ascentBrand = [NSString stringWithFormat:@"%ld%@",(long)displaysTime / 60, FeedSunTied.switchEnvelope.startedSundanesePedometerVectorWon];
    }else if(displaysTime < 24 * 60 * 60 && [panFar integerValue] == [hellman integerValue]){
        ascentBrand = [NSString stringWithFormat:@"%@ %@",FeedSunTied.switchEnvelope.subCitySum,optical];
    }else if(displaysTime < 24 * 60 * 60 * 2 && [panFar integerValue] != [hellman integerValue]){
        if ([panFar integerValue] - [hellman integerValue] == 1 || ([hellman integerValue] - [panFar integerValue] > 10 && [panFar integerValue] == 1)) {
            ascentBrand = [NSString stringWithFormat:@"%@ %@",FeedSunTied.switchEnvelope.hueAddExistFun,optical];
        }else{
            [say setDateFormat:@"MM-dd HH:mm"];
            ascentBrand = [say stringFromDate:sheDate];
        }
    }else if(displaysTime < 24 * 60 * 60 * 365){
        [say setDateFormat:@"MM-dd HH:mm"];
        ascentBrand = [say stringFromDate:sheDate];
    }else{
        [say setDateFormat:@"yyyy-MM-dd HH:mm"];
        ascentBrand = [say stringFromDate:sheDate];
    }
    return ascentBrand;
}

@end
