






#import "HellmanPubRangingDetailSuspendedViewController.h"
#import "HeavySortViewController.h"
#import "ProxyBottomPushUnderlineForwardsCell.h"

@interface HellmanPubRangingDetailSuspendedViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *humanKinDismissSheetCallbacksView;

@property (nonatomic, strong) UIView *hallMovieView;

@property (nonatomic, strong) UITableView *nowMercuryView;


@property (nonatomic, assign) BOOL extrasSlopeInterestPlugInsertion;

@property (nonatomic, weak) id scaleBusOptCat;

@property (nonatomic, strong) NSMutableArray *dublinAlcoholArray;

@property (nonatomic, strong) NSMutableArray *hostSignArray;

@property (nonatomic, strong) UIButton *writtenCanButton;
@property (nonatomic, strong) UIButton *largestYardButton;

@end

@implementation HellmanPubRangingDetailSuspendedViewController

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

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

- (void)setExtrasSlopeInterestPlugInsertion:(BOOL)extrasSlopeInterestPlugInsertion {
    
    _extrasSlopeInterestPlugInsertion = extrasSlopeInterestPlugInsertion;
    
    _hostSignArray = extrasSlopeInterestPlugInsertion ? _dublinAlcoholArray : [NSMutableArray arrayWithObject:_scaleBusOptCat];
    
    [self.nowMercuryView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!extrasSlopeInterestPlugInsertion ? SubBondFour.nodeFourteen.allowArmArts : self.hostSignArray.count > 3 ? 3 * SubBondFour.nodeFourteen.allowArmArts  : self.hostSignArray.count * SubBondFour.nodeFourteen.allowArmArts);
    }];
    
    self.nowMercuryView.scrollEnabled = extrasSlopeInterestPlugInsertion;
    
    [self.nowMercuryView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.nowMercuryView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _dublinAlcoholArray = [[SubBondFour handlingPlusMusicianComplexOlympus] mutableCopy];
    
    _scaleBusOptCat = _dublinAlcoholArray.firstObject;
    
    [self koreanRareCalculateProceedVariance];
    
    self.extrasSlopeInterestPlugInsertion = NO;
}

- (void)koreanRareCalculateProceedVariance {
    
    _humanKinDismissSheetCallbacksView = [[UIView alloc] init];
    _humanKinDismissSheetCallbacksView.backgroundColor = UIColor.whiteColor;
    _humanKinDismissSheetCallbacksView.layer.cornerRadius = 2;
    [self.view addSubview:_humanKinDismissSheetCallbacksView];
    [self.view sendSubviewToBack:_humanKinDismissSheetCallbacksView];
    [_humanKinDismissSheetCallbacksView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([SubBondFour carbonCursorsSolveDarkenGroupedStillSize]);
    }];
    
    
    UIView *hallMovieView = [SubBondFour hallMovieView];
    [self.view addSubview:hallMovieView];
    self.hallMovieView = hallMovieView;
    [hallMovieView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(SubBondFour.nodeFourteen.potassiumTop);
        make.height.mas_equalTo(SubBondFour.nodeFourteen.selfOccurBit);
        make.left.equalTo(self.forkChestButton.mas_right);
        make.right.equalTo(self.busExtractButton.mas_left);
    }];
    
    
    _nowMercuryView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    _nowMercuryView.backgroundColor = [UIColor whiteColor];
    _nowMercuryView.layer.masksToBounds = YES;
    _nowMercuryView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _nowMercuryView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _nowMercuryView.layer.borderColor = [SubBondFour routeHeapColor].CGColor;
    _nowMercuryView.layer.borderWidth = 0.6;
    _nowMercuryView.layer.cornerRadius = 2;
    _nowMercuryView.rowHeight = SubBondFour.nodeFourteen.allowArmArts;
    _nowMercuryView.delegate = self;
    _nowMercuryView.dataSource = self;
    [_nowMercuryView registerClass:[ProxyBottomPushUnderlineForwardsCell class] forCellReuseIdentifier:NSStringFromClass(ProxyBottomPushUnderlineForwardsCell.class)];
    [self.view addSubview:_nowMercuryView];
    [self.nowMercuryView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.hallMovieView.mas_bottom).offset(SubBondFour.nodeFourteen.potassiumTop);
        make.left.equalTo(self.humanKinDismissSheetCallbacksView).offset(SubBondFour.nodeFourteen.mustKashmiri);
        make.right.equalTo(self.humanKinDismissSheetCallbacksView).offset(-SubBondFour.nodeFourteen.mustKashmiri);
        make.height.mas_equalTo(SubBondFour.nodeFourteen.allowArmArts);
    }];
    
    
    self.writtenCanButton = [SubBondFour acrossProcessesHindiDepthTower:SubBondFour.injectionBlack.applyLookupReactorSwitchDefaults];
    [self.writtenCanButton addTarget:self action:@selector(footGrowAdditiveSigmaSheetFinishingAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.humanKinDismissSheetCallbacksView addSubview:self.writtenCanButton];
    [self.writtenCanButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.humanKinDismissSheetCallbacksView).offset(-SubBondFour.nodeFourteen.potassiumTop);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.largestYardButton = [SubBondFour certDateSlovakDisablingTalkColor:SubBondFour.injectionBlack.hitAutoFill];
    [self.largestYardButton addTarget:self action:@selector(bikeSquaredRedoColumnSummarySafe:) forControlEvents:UIControlEventTouchUpInside];
    [self.humanKinDismissSheetCallbacksView addSubview:self.largestYardButton];
    [self.largestYardButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.writtenCanButton.mas_top).offset(-SubBondFour.nodeFourteen.feedSeeBasic);
        make.left.right.equalTo(self.nowMercuryView);
        make.height.mas_equalTo(SubBondFour.nodeFourteen.greekAverage);
    }];
}

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ProxyBottomPushUnderlineForwardsCell *dust = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(ProxyBottomPushUnderlineForwardsCell.class) forIndexPath:indexPath];
    NSArray *feetRain = _hostSignArray[indexPath.row];
    
    dust.wakeSortName.text = feetRain[0];
    
    dust.modalTableView.image = [[UIImage positionOwnMeteringSourcesBookName:feetRain[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    dust.jobOtherEarTime.text = [NSString stringWithFormat:@"%@ %@",SubBondFour.injectionBlack.simpleOrangeFunInspiredPagerTime,[self malayalamStyleQuarterMostlyContainerDispenseTime:[feetRain[2] doubleValue]]];
    
    dust.accessoryType = self.extrasSlopeInterestPlugInsertion ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return dust;
}

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


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

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

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id feetRain = _hostSignArray[indexPath.row];
        
        [_hostSignArray removeObject:feetRain];
        
        [_dublinAlcoholArray removeObject:feetRain];
        
        if ([self.taskCharUnify respondsToSelector:@selector(rationalContinuedPubCoalescedNaturalWayName:completion:)]) {
            [self.taskCharUnify rationalContinuedPubCoalescedNaturalWayName:feetRain[0] completion:^(id object) {
                
            }];
        }
        
        if(_dublinAlcoholArray.count > 0){
            
            _hostSignArray = _dublinAlcoholArray;
            _scaleBusOptCat = _hostSignArray.firstObject;
            self.extrasSlopeInterestPlugInsertion = YES;
            
        }
    }
}


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

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

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


- (void)footGrowAdditiveSigmaSheetFinishingAction:(UIButton *)sender {
    HeavySortViewController *unionShakeSee = [HeavySortViewController new];
    unionShakeSee.taskCharUnify = self.taskCharUnify;
    [self.navigationController pushViewController:unionShakeSee animated:NO];
}

- (void)bikeSquaredRedoColumnSummarySafe:(UIButton *)sender {
    if ([self.taskCharUnify respondsToSelector:@selector(preservesDiscardedScanCostWidthThemeEvictName:completion:)]) {
        [FitCalorieView waistEraThreeWindow];
        [self.taskCharUnify preservesDiscardedScanCostWidthThemeEvictName:self.scaleBusOptCat[0] completion:^(id object) {
            [FitCalorieView invertedListenMinOurOverdueWindow];
        }];
    }
}


- (NSString *)malayalamStyleQuarterMostlyContainerDispenseTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double boostTryTime = now - beTime;
    NSString * abovePrefer;
    
    NSDate * tryDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * icy = [[NSDateFormatter alloc] init];
    [icy setDateFormat:@"HH:mm"];
    NSString * pinRace = [icy stringFromDate:tryDate];
    
    [icy setDateFormat:@"dd"];
    NSString * driven = [icy stringFromDate:[NSDate date]];
    NSString * busRope = [icy stringFromDate:tryDate];
    
    if (boostTryTime < 60) {
        abovePrefer = SubBondFour.injectionBlack.placeLazyAdd;
    }else if (boostTryTime < 60 * 60) {
        abovePrefer = [NSString stringWithFormat:@"%ld%@",(long)boostTryTime / 60, SubBondFour.injectionBlack.dingbatsSunTopPlusBlack];
    }else if(boostTryTime < 24 * 60 * 60 && [driven integerValue] == [busRope integerValue]){
        abovePrefer = [NSString stringWithFormat:@"%@ %@",SubBondFour.injectionBlack.strokedAdd,pinRace];
    }else if(boostTryTime < 24 * 60 * 60 * 2 && [driven integerValue] != [busRope integerValue]){
        if ([driven integerValue] - [busRope integerValue] == 1 || ([busRope integerValue] - [driven integerValue] > 10 && [driven integerValue] == 1)) {
            abovePrefer = [NSString stringWithFormat:@"%@ %@",SubBondFour.injectionBlack.kitRedGainPost,pinRace];
        }else{
            [icy setDateFormat:@"MM-dd HH:mm"];
            abovePrefer = [icy stringFromDate:tryDate];
        }
    }else if(boostTryTime < 24 * 60 * 60 * 365){
        [icy setDateFormat:@"MM-dd HH:mm"];
        abovePrefer = [icy stringFromDate:tryDate];
    }else{
        [icy setDateFormat:@"yyyy-MM-dd HH:mm"];
        abovePrefer = [icy stringFromDate:tryDate];
    }
    return abovePrefer;
}

@end
