






#import "CelsiusUpperDeltaStepperPromiseViewController.h"
#import "DetachFixViewController.h"
#import "ReceiverSlabAddWrappersWonCell.h"

@interface CelsiusUpperDeltaStepperPromiseViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *periodicBirthTimeElapsedMonitoredView;

@property (nonatomic, strong) UIView *nonceDustView;

@property (nonatomic, strong) UITableView *topWrappedView;


@property (nonatomic, assign) BOOL unboundedDomainSixteenInitiatedExpire;

@property (nonatomic, weak) id winGetIntroSpa;

@property (nonatomic, strong) NSMutableArray *standSawChunkArray;

@property (nonatomic, strong) NSMutableArray *movieFixArray;

@property (nonatomic, strong) UIButton *spokenInfoButton;
@property (nonatomic, strong) UIButton *glucoseBandButton;

@end

@implementation CelsiusUpperDeltaStepperPromiseViewController

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

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

- (void)setUnboundedDomainSixteenInitiatedExpire:(BOOL)unboundedDomainSixteenInitiatedExpire {
    
    _unboundedDomainSixteenInitiatedExpire = unboundedDomainSixteenInitiatedExpire;
    
    _movieFixArray = unboundedDomainSixteenInitiatedExpire ? _standSawChunkArray : [NSMutableArray arrayWithObject:_winGetIntroSpa];
    
    [self.topWrappedView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!unboundedDomainSixteenInitiatedExpire ? MaskTheGray.andRomanPath.artSeedAsset : self.movieFixArray.count > 3 ? 3 * MaskTheGray.andRomanPath.artSeedAsset  : self.movieFixArray.count * MaskTheGray.andRomanPath.artSeedAsset);
    }];
    
    self.topWrappedView.scrollEnabled = unboundedDomainSixteenInitiatedExpire;
    
    [self.topWrappedView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.topWrappedView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _standSawChunkArray = [[MaskTheGray gesturesInitiallyNextAppendedGenerics] mutableCopy];
    
    _winGetIntroSpa = _standSawChunkArray.firstObject;
    
    [self outsideAlarmMostCombinePrototype];
    
    self.unboundedDomainSixteenInitiatedExpire = NO;
}

- (void)outsideAlarmMostCombinePrototype {
    
    _periodicBirthTimeElapsedMonitoredView = [[UIView alloc] init];
    
    _periodicBirthTimeElapsedMonitoredView.backgroundColor = self.personArmDelayedUseNetImageView ? UIColor.clearColor : UIColor.whiteColor;
    _periodicBirthTimeElapsedMonitoredView.layer.cornerRadius = MaskTheGray.andRomanPath.planeDefines;
    _periodicBirthTimeElapsedMonitoredView.layer.masksToBounds = YES;
    [self.view addSubview:_periodicBirthTimeElapsedMonitoredView];
    [self.view sendSubviewToBack:_periodicBirthTimeElapsedMonitoredView];
    
    if (self.personArmDelayedUseNetImageView) {
        [self.view sendSubviewToBack:self.personArmDelayedUseNetImageView];
    }
    [_periodicBirthTimeElapsedMonitoredView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([MaskTheGray destroyUrgentEveryHeadphoneLightenButtonSize]);
    }];
    
    if (self.personArmDelayedUseNetImageView) {
        [self.personArmDelayedUseNetImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.periodicBirthTimeElapsedMonitoredView);
        }];
    }
    
    
    UIView *nonceDustView = [MaskTheGray nonceDustView];
    [self.view addSubview:nonceDustView];
    self.nonceDustView = nonceDustView;
    [nonceDustView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(MaskTheGray.andRomanPath.albumComplex);
        make.height.mas_equalTo(MaskTheGray.andRomanPath.boldWinMusic);
        make.left.equalTo(self.funnelDidButton.mas_right);
        make.right.equalTo(self.herClampedButton.mas_left);
    }];
    
    
    _topWrappedView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    
    _topWrappedView.backgroundColor = [UIColor whiteColor];
    _topWrappedView.layer.masksToBounds = YES;
    _topWrappedView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _topWrappedView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _topWrappedView.layer.borderColor = [MaskTheGray screenNapColor].CGColor;
    _topWrappedView.layer.borderWidth = 0.6;
    _topWrappedView.layer.cornerRadius = MaskTheGray.andRomanPath.planeDefines;
    _topWrappedView.rowHeight = MaskTheGray.andRomanPath.artSeedAsset;
    _topWrappedView.delegate = self;
    _topWrappedView.dataSource = self;
    [_topWrappedView registerClass:[ReceiverSlabAddWrappersWonCell class] forCellReuseIdentifier:NSStringFromClass(ReceiverSlabAddWrappersWonCell.class)];
    [self.view addSubview:_topWrappedView];
    [self.topWrappedView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nonceDustView.mas_bottom).offset(MaskTheGray.andRomanPath.albumComplex);
        make.left.equalTo(self.periodicBirthTimeElapsedMonitoredView).offset(MaskTheGray.andRomanPath.desktopEmail);
        make.right.equalTo(self.periodicBirthTimeElapsedMonitoredView).offset(-MaskTheGray.andRomanPath.desktopEmail);
        make.height.mas_equalTo(MaskTheGray.andRomanPath.artSeedAsset);
    }];
    
    
    self.spokenInfoButton = [MaskTheGray envelopeSeventeenLiteralLaterHave:MaskTheGray.starHealthHome.semicolonAdjustedMidDustBasic];
    [self.spokenInfoButton addTarget:self action:@selector(rotateAssertionOutsideDraftCatalanSockAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.periodicBirthTimeElapsedMonitoredView addSubview:self.spokenInfoButton];
    [self.spokenInfoButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.periodicBirthTimeElapsedMonitoredView).offset(-MaskTheGray.andRomanPath.albumComplex);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.glucoseBandButton = [MaskTheGray commonLibraryGivenHisEitherColor:MaskTheGray.starHealthHome.sameFillArm];
    [self.glucoseBandButton addTarget:self action:@selector(waterResignJustifiedRouteMakeWay:) forControlEvents:UIControlEventTouchUpInside];
    [self.periodicBirthTimeElapsedMonitoredView addSubview:self.glucoseBandButton];
    [self.glucoseBandButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.spokenInfoButton.mas_top).offset(-MaskTheGray.andRomanPath.fullySeeSuch);
        make.left.right.equalTo(self.topWrappedView);
        make.height.mas_equalTo(MaskTheGray.andRomanPath.effectRowRow);
    }];
}

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ReceiverSlabAddWrappersWonCell *tree = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(ReceiverSlabAddWrappersWonCell.class) forIndexPath:indexPath];
    NSArray *binTwist = _movieFixArray[indexPath.row];
    
    tree.pinWaistName.text = binTwist[0];
    
    tree.feedSparseView.image = [[UIImage momentGetMolarPerformerFaceName:binTwist[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    tree.ironReclaimTime.text = [NSString stringWithFormat:@"%@ %@",MaskTheGray.starHealthHome.evaluatedRenameFocalLegacyEligibleTime,[self edgaPriorSliderCompactSupportsSimulatesTime:[binTwist[2] doubleValue]]];
    
    tree.accessoryType = self.unboundedDomainSixteenInitiatedExpire ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return tree;
}

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


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

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

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id binTwist = _movieFixArray[indexPath.row];
        
        [_movieFixArray removeObject:binTwist];
        
        [_standSawChunkArray removeObject:binTwist];
        
        if ([self.paragraphTone respondsToSelector:@selector(waxStreamedRearrangeEnumerateContextsFlowName:completion:)]) {
            [self.paragraphTone waxStreamedRearrangeEnumerateContextsFlowName:binTwist[0] completion:^(id object) {
                
            }];
        }
        
        if(_standSawChunkArray.count > 0){
            
            _movieFixArray = _standSawChunkArray;
            _winGetIntroSpa = _movieFixArray.firstObject;
            self.unboundedDomainSixteenInitiatedExpire = YES;
            
        }
    }
}


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

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

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


- (void)rotateAssertionOutsideDraftCatalanSockAction:(UIButton *)sender {
    DetachFixViewController *midStoneAngle = [DetachFixViewController new];
    midStoneAngle.paragraphTone = self.paragraphTone;
    [self.navigationController pushViewController:midStoneAngle animated:NO];
}

- (void)waterResignJustifiedRouteMakeWay:(UIButton *)sender {
    if ([self.paragraphTone respondsToSelector:@selector(cornerSelectingPortalNeedBalancedAmbienceDownloadsName:completion:)]) {
        [EchoEggBitView utilitiesSaltWindow];
        [self.paragraphTone cornerSelectingPortalNeedBalancedAmbienceDownloadsName:self.winGetIntroSpa[0] completion:^(id object) {
            [EchoEggBitView menuIrishSevenEachOrdinalWindow];
        }];
    }
}


- (NSString *)edgaPriorSliderCompactSupportsSimulatesTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double waistDayTime = now - beTime;
    NSString * romanianSum;
    
    NSDate * dryDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * bag = [[NSDateFormatter alloc] init];
    [bag setDateFormat:@"HH:mm"];
    NSString * funBack = [bag stringFromDate:dryDate];
    
    [bag setDateFormat:@"dd"];
    NSString * runFun = [bag stringFromDate:[NSDate date]];
    NSString * areaOut = [bag stringFromDate:dryDate];
    
    if (waistDayTime < 60) {
        romanianSum = MaskTheGray.starHealthHome.clickIgnores;
    }else if (waistDayTime < 60 * 60) {
        romanianSum = [NSString stringWithFormat:@"%ld%@",(long)waistDayTime / 60, MaskTheGray.starHealthHome.callbacksBedCameraMinimizePayments];
    }else if(waistDayTime < 24 * 60 * 60 && [runFun integerValue] == [areaOut integerValue]){
        romanianSum = [NSString stringWithFormat:@"%@ %@",MaskTheGray.starHealthHome.heartMouth,funBack];
    }else if(waistDayTime < 24 * 60 * 60 * 2 && [runFun integerValue] != [areaOut integerValue]){
        if ([runFun integerValue] - [areaOut integerValue] == 1 || ([areaOut integerValue] - [runFun integerValue] > 10 && [runFun integerValue] == 1)) {
            romanianSum = [NSString stringWithFormat:@"%@ %@",MaskTheGray.starHealthHome.recoverySpouse,funBack];
        }else{
            [bag setDateFormat:@"MM-dd HH:mm"];
            romanianSum = [bag stringFromDate:dryDate];
        }
    }else if(waistDayTime < 24 * 60 * 60 * 365){
        [bag setDateFormat:@"MM-dd HH:mm"];
        romanianSum = [bag stringFromDate:dryDate];
    }else{
        [bag setDateFormat:@"yyyy-MM-dd HH:mm"];
        romanianSum = [bag stringFromDate:dryDate];
    }
    return romanianSum;
}

@end
