






#import "IndigoArmpitCell.h"
#import "PutBelowEye.h"
#import "Masonry.h"
#import "UIImage+DidImage.h"
#import "UIImageView+WebCache.h"
#import "NSString+AskFinger.h"

@interface IndigoArmpitCell()


@property (nonatomic,strong) NSString * anglePenUnder;


@property (nonatomic,strong) UIImageView * whoTapLoseView;


@property (nonatomic,strong) UILabel * returnsTwoLabel;


@property (nonatomic,strong) UILabel * gigabytesLabel;

@property (nonatomic, strong) UIButton * dogPopButton;

@end

@implementation IndigoArmpitCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        
        self.clipsToBounds = YES;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = UIColor.clearColor;
        self.contentView.backgroundColor = UIColor.clearColor;
        
        self.whoTapLoseView = [UIImageView new];
        self.whoTapLoseView.tintColor = [PutBelowEye charAlienColor];
        self.whoTapLoseView.layer.cornerRadius = PutBelowEye.yetRevealHow.allDimension;
        [self.contentView addSubview:self.whoTapLoseView];
        [self.whoTapLoseView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(PutBelowEye.yetRevealHow.modelOwnBus);
            make.centerY.mas_equalTo(self.contentView);
            make.width.height.mas_equalTo(PutBelowEye.yetRevealHow.panInsideBut);
        }];
        
        self.returnsTwoLabel = [UILabel new];
        self.returnsTwoLabel.font = [UIFont boldSystemFontOfSize:PutBelowEye.yetRevealHow.columnEntity];
        self.returnsTwoLabel.textColor = UIColor.darkGrayColor;
        [self.contentView addSubview:self.returnsTwoLabel];
        
        self.gigabytesLabel = [UILabel new];
        self.gigabytesLabel.font = [UIFont boldSystemFontOfSize:PutBelowEye.yetRevealHow.andUnionStep];
        self.gigabytesLabel.textColor = UIColor.darkGrayColor;
        [self.contentView addSubview:self.gigabytesLabel];
        
        [self.returnsTwoLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.whoTapLoseView.mas_right).offset(PutBelowEye.yetRevealHow.shiftFillShe);
            make.centerY.equalTo(self.contentView);
        }];
        
        [self.gigabytesLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.returnsTwoLabel);
            make.top.equalTo(self.returnsTwoLabel.mas_bottom).offset(PutBelowEye.yetRevealHow.nodeFootMix);
        }];
        
        self.dogPopButton = [[UIButton alloc] init];
        _dogPopButton.userInteractionEnabled = NO;
        
        UIImage *image = [[UIImage unsignedTableRenewExcludedSlabName:PutBelowEye.yetRevealHow.waterComponentComposerEyePermanent] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
        [_dogPopButton setBackgroundImage:[UIImage unsignedTableRenewExcludedSlabName:PutBelowEye.yetRevealHow.ovulationYouDialogGenericNode] forState: UIControlStateNormal];
        [_dogPopButton setBackgroundImage:image forState: UIControlStateSelected];
        _dogPopButton.tintColor = [PutBelowEye charAlienColor];
        [self.contentView addSubview:_dogPopButton];
        [_dogPopButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.offset(0);
            make.right.offset(-PutBelowEye.yetRevealHow.shiftFillShe);
            make.size.mas_equalTo(CGSizeMake(PutBelowEye.yetRevealHow.mixEditError, PutBelowEye.yetRevealHow.mixEditError));
        }];
    }
    return self;
}

- (void)setSelected:(BOOL)selected {
    _dogPopButton.selected = selected;
    self.layer.borderWidth = selected ? 1:0;
    self.layer.borderColor = [PutBelowEye charAlienColor].CGColor;
    
    if (selected) {
        self.contentView.backgroundColor = [UIColor colorWithRed:1.0 green:0.98 blue:0.94 alpha:0.95];
    } else {
        self.contentView.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.35];
    }
}

- (void)setFrame:(CGRect)frame {
    frame.origin.x = PutBelowEye.yetRevealHow.modelOwnBus;
    frame.size.width -= PutBelowEye.yetRevealHow.columnEntity;
    frame.origin.y += PutBelowEye.yetRevealHow.modelOwnBus;
    frame.size.height -= PutBelowEye.yetRevealHow.modelOwnBus;
    [super setFrame:frame];
    
    self.layer.cornerRadius = frame.size.height / 2.0;
}

-(void)setAnglePenUnder:(NSString *)anglePenUnder {
    _anglePenUnder = anglePenUnder;
    [self.whoTapLoseView sd_setImageWithURL:[NSURL URLWithString:anglePenUnder] placeholderImage:nil];
}

- (void)setHybridGasp:(CountSurfaceSuperiorsTagDividerPossible *)hybridGasp {
    _hybridGasp= hybridGasp;
    self.anglePenUnder = hybridGasp.cloudWide;
    self.returnsTwoLabel.text = hybridGasp.sensorTab;
    NSString *note = hybridGasp.sceneSnow?:@"";
    if (note.theIndexBlob) {
        self.gigabytesLabel.hidden = YES;
        [self.returnsTwoLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.whoTapLoseView.mas_right).offset(PutBelowEye.yetRevealHow.shiftFillShe);
            make.centerY.equalTo(self.contentView);
        }];
    }else {
        self.gigabytesLabel.hidden = NO;
        NSRange runOld = [note rangeOfString:PutBelowEye.yetRevealHow.headerDarkerForbiddenHectaresAwakePurpose];
        NSRange italic = [note rangeOfString:PutBelowEye.yetRevealHow.farSampleSmoothStepBitCondition];
        
        if (runOld.length == 0 && italic.length == 0) {
            self.gigabytesLabel.text = note;
            self.gigabytesLabel.font = [UIFont systemFontOfSize:PutBelowEye.yetRevealHow.andUnionStep];
            self.gigabytesLabel.textColor = UIColor.lightGrayColor;
        }else {
            NSRange funTrait = NSMakeRange(runOld.location+runOld.length, italic.location-(runOld.location+runOld.length));
            NSString *plural = [note substringWithRange:funTrait];
            NSString *dayCity = [note stringByReplacingOccurrencesOfString:PutBelowEye.yetRevealHow.headerDarkerForbiddenHectaresAwakePurpose withString:@""];
            dayCity = [dayCity stringByReplacingOccurrencesOfString:PutBelowEye.yetRevealHow.farSampleSmoothStepBitCondition withString:@""];
            
            funTrait = [dayCity rangeOfString:plural];
            NSMutableAttributedString *boxDownloads = [[NSMutableAttributedString alloc] initWithString:dayCity];
            [boxDownloads addAttribute:NSForegroundColorAttributeName value:[UIColor lightGrayColor] range:NSMakeRange(0, dayCity.length)];
            [boxDownloads addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0, dayCity.length)];
            [boxDownloads addAttribute:NSForegroundColorAttributeName value:[PutBelowEye charAlienColor] range:funTrait];
            [boxDownloads addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:14] range:funTrait];
            
            self.gigabytesLabel.attributedText = boxDownloads;
        }
        
        [self.returnsTwoLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.whoTapLoseView.mas_right).offset(PutBelowEye.yetRevealHow.shiftFillShe);
            make.top.equalTo(self.whoTapLoseView).offset(PutBelowEye.yetRevealHow.panHundreds);
        }];
    }
}

@end
