






#import "KeysWhiteTapOffsetZipViewController.h"
#import "RouterCupViewController.h"
#import "PressObservingShareFailFourCell.h"

@interface KeysWhiteTapOffsetZipViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *sixArmourDeclinePromisedMidView;

@property (nonatomic, strong) UIView *searchMaxView;

@property (nonatomic, strong) UITableView *timeReportView;


@property (nonatomic, assign) BOOL documentsJumpDrivenShapeFlush;

@property (nonatomic, weak) id mathLostKitDog;

@property (nonatomic, strong) NSMutableArray *glyphBoldfaceArray;

@property (nonatomic, strong) NSMutableArray *sobInsetArray;

@property (nonatomic, strong) UIButton *spineMergeButton;
@property (nonatomic, strong) UIButton *albumCursorButton;

@end

@implementation KeysWhiteTapOffsetZipViewController

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

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

- (void)setDocumentsJumpDrivenShapeFlush:(BOOL)documentsJumpDrivenShapeFlush {
    
    _documentsJumpDrivenShapeFlush = documentsJumpDrivenShapeFlush;
    
    _sobInsetArray = documentsJumpDrivenShapeFlush ? _glyphBoldfaceArray : [NSMutableArray arrayWithObject:_mathLostKitDog];
    
    [self.timeReportView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!documentsJumpDrivenShapeFlush ? PartialBest.mouseEarlier.drivenEffect : self.sobInsetArray.count > 3 ? 3 * PartialBest.mouseEarlier.drivenEffect  : self.sobInsetArray.count * PartialBest.mouseEarlier.drivenEffect);
    }];
    
    self.timeReportView.scrollEnabled = documentsJumpDrivenShapeFlush;
    
    [self.timeReportView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.timeReportView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _glyphBoldfaceArray = [[PartialBest sonHertzEvictBlurPromise] mutableCopy];
    
    _mathLostKitDog = _glyphBoldfaceArray.firstObject;
    
    [self quickBackwardsDanceFunkIntegrity];
    
    self.documentsJumpDrivenShapeFlush = NO;
}

- (void)quickBackwardsDanceFunkIntegrity {
    
    _sixArmourDeclinePromisedMidView = [[UIView alloc] init];
    
    _sixArmourDeclinePromisedMidView.backgroundColor = self.inferModifiersUnwindEncryptListImageView ? UIColor.clearColor : UIColor.whiteColor;
    _sixArmourDeclinePromisedMidView.layer.cornerRadius = PartialBest.mouseEarlier.barSceneEasy;
    _sixArmourDeclinePromisedMidView.layer.masksToBounds = YES;
    [self.view addSubview:_sixArmourDeclinePromisedMidView];
    [self.view sendSubviewToBack:_sixArmourDeclinePromisedMidView];
    
    if (self.inferModifiersUnwindEncryptListImageView) {
        [self.view sendSubviewToBack:self.inferModifiersUnwindEncryptListImageView];
    }
    [_sixArmourDeclinePromisedMidView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([PartialBest sayHangExecSelectingPencilWaxSize]);
    }];
    
    if (self.inferModifiersUnwindEncryptListImageView) {
        [self.inferModifiersUnwindEncryptListImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.sixArmourDeclinePromisedMidView);
        }];
    }
    
    
    UIView *searchMaxView = [PartialBest searchMaxView];
    [self.view addSubview:searchMaxView];
    self.searchMaxView = searchMaxView;
    [searchMaxView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(PartialBest.mouseEarlier.nameBrushDry);
        make.height.mas_equalTo(PartialBest.mouseEarlier.butTargetEye);
        make.left.equalTo(self.nearHumanButton.mas_right);
        make.right.equalTo(self.declineRawButton.mas_left);
    }];
    
    
    _timeReportView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    
    _timeReportView.backgroundColor = [UIColor whiteColor];
    _timeReportView.layer.masksToBounds = YES;
    _timeReportView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _timeReportView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _timeReportView.layer.borderColor = [PartialBest turnOtherColor].CGColor;
    _timeReportView.layer.borderWidth = 0.6;
    _timeReportView.layer.cornerRadius = PartialBest.mouseEarlier.barSceneEasy;
    _timeReportView.rowHeight = PartialBest.mouseEarlier.drivenEffect;
    _timeReportView.delegate = self;
    _timeReportView.dataSource = self;
    [_timeReportView registerClass:[PressObservingShareFailFourCell class] forCellReuseIdentifier:NSStringFromClass(PressObservingShareFailFourCell.class)];
    [self.view addSubview:_timeReportView];
    [self.timeReportView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.searchMaxView.mas_bottom).offset(PartialBest.mouseEarlier.nameBrushDry);
        make.left.equalTo(self.sixArmourDeclinePromisedMidView).offset(PartialBest.mouseEarlier.sameChinaHue);
        make.right.equalTo(self.sixArmourDeclinePromisedMidView).offset(-PartialBest.mouseEarlier.sameChinaHue);
        make.height.mas_equalTo(PartialBest.mouseEarlier.drivenEffect);
    }];
    
    
    self.spineMergeButton = [PartialBest externSortRevokedWakeOverride:PartialBest.itsOneFlowEasy.raceConcertThumbnailThatFocused];
    [self.spineMergeButton addTarget:self action:@selector(provinceLiterModernFallbackExistMiterAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.sixArmourDeclinePromisedMidView addSubview:self.spineMergeButton];
    [self.spineMergeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.sixArmourDeclinePromisedMidView).offset(-PartialBest.mouseEarlier.nameBrushDry);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.albumCursorButton = [PartialBest textualEllipsisBankStopMonthColor:PartialBest.itsOneFlowEasy.phaseEffort];
    [self.albumCursorButton addTarget:self action:@selector(rootCombinedExhaustedZeroResourcePut:) forControlEvents:UIControlEventTouchUpInside];
    [self.sixArmourDeclinePromisedMidView addSubview:self.albumCursorButton];
    [self.albumCursorButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.spineMergeButton.mas_top).offset(-PartialBest.mouseEarlier.notWayWindow);
        make.left.right.equalTo(self.timeReportView);
        make.height.mas_equalTo(PartialBest.mouseEarlier.waxElderLess);
    }];
}

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    PressObservingShareFailFourCell *pack = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(PressObservingShareFailFourCell.class) forIndexPath:indexPath];
    NSArray *hueOuter = _sobInsetArray[indexPath.row];
    
    pack.dateDenyName.text = hueOuter[0];
    
    pack.skipUnsafeView.image = [[UIImage reverseOptionCervicalSinhaleseSpecifiedName:hueOuter[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    pack.unlockGreekTime.text = [NSString stringWithFormat:@"%@ %@",PartialBest.itsOneFlowEasy.disparityBinaryCollationSnowInverseTime,[self contentDigitMegabytesInterestVisualQualityTime:[hueOuter[2] doubleValue]]];
    
    pack.accessoryType = self.documentsJumpDrivenShapeFlush ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return pack;
}

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


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

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

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id hueOuter = _sobInsetArray[indexPath.row];
        
        [_sobInsetArray removeObject:hueOuter];
        
        [_glyphBoldfaceArray removeObject:hueOuter];
        
        if ([self.blueOffWaxSee respondsToSelector:@selector(shareDirectorOrnamentCoverDogSunName:completion:)]) {
            [self.blueOffWaxSee shareDirectorOrnamentCoverDogSunName:hueOuter[0] completion:^(id object) {
                
            }];
        }
        
        if(_glyphBoldfaceArray.count > 0){
            
            _sobInsetArray = _glyphBoldfaceArray;
            _mathLostKitDog = _sobInsetArray.firstObject;
            self.documentsJumpDrivenShapeFlush = YES;
            
        }
    }
}


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

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

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


- (void)provinceLiterModernFallbackExistMiterAction:(UIButton *)sender {
    RouterCupViewController *catSubYetCube = [RouterCupViewController new];
    catSubYetCube.blueOffWaxSee = self.blueOffWaxSee;
    [self.navigationController pushViewController:catSubYetCube animated:NO];
}

- (void)rootCombinedExhaustedZeroResourcePut:(UIButton *)sender {
    if ([self.blueOffWaxSee respondsToSelector:@selector(mouseAccessedGeneratorLawManAdoptJobName:completion:)]) {
        [LinkArmBadView computerSmallWindow];
        [self.blueOffWaxSee mouseAccessedGeneratorLawManAdoptJobName:self.mathLostKitDog[0] completion:^(id object) {
            [LinkArmBadView oneStrictMonitoredFinishedDryWindow];
        }];
    }
}


- (NSString *)contentDigitMegabytesInterestVisualQualityTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double iconSafeTime = now - beTime;
    NSString * icyNetBevel;
    
    NSDate * penDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * who = [[NSDateFormatter alloc] init];
    [who setDateFormat:@"HH:mm"];
    NSString * general = [who stringFromDate:penDate];
    
    [who setDateFormat:@"dd"];
    NSString * kinKit = [who stringFromDate:[NSDate date]];
    NSString * capsMid = [who stringFromDate:penDate];
    
    if (iconSafeTime < 60) {
        icyNetBevel = PartialBest.itsOneFlowEasy.managerSpell;
    }else if (iconSafeTime < 60 * 60) {
        icyNetBevel = [NSString stringWithFormat:@"%ld%@",(long)iconSafeTime / 60, PartialBest.itsOneFlowEasy.volumeLoudNominallyTowerBevel];
    }else if(iconSafeTime < 24 * 60 * 60 && [kinKit integerValue] == [capsMid integerValue]){
        icyNetBevel = [NSString stringWithFormat:@"%@ %@",PartialBest.itsOneFlowEasy.reloadEnds,general];
    }else if(iconSafeTime < 24 * 60 * 60 * 2 && [kinKit integerValue] != [capsMid integerValue]){
        if ([kinKit integerValue] - [capsMid integerValue] == 1 || ([capsMid integerValue] - [kinKit integerValue] > 10 && [kinKit integerValue] == 1)) {
            icyNetBevel = [NSString stringWithFormat:@"%@ %@",PartialBest.itsOneFlowEasy.decisionOpaque,general];
        }else{
            [who setDateFormat:@"MM-dd HH:mm"];
            icyNetBevel = [who stringFromDate:penDate];
        }
    }else if(iconSafeTime < 24 * 60 * 60 * 365){
        [who setDateFormat:@"MM-dd HH:mm"];
        icyNetBevel = [who stringFromDate:penDate];
    }else{
        [who setDateFormat:@"yyyy-MM-dd HH:mm"];
        icyNetBevel = [who stringFromDate:penDate];
    }
    return icyNetBevel;
}

@end
