






#import "SolidEntriesCell.h"
#import "BadMeanSame.h"
#import "Masonry.h"
#import "UIImage+EraImage.h"
#import "UIImageView+WebCache.h"
#import "NSString+TowerNeed.h"

@interface SolidEntriesCell()


@property (nonatomic,strong) NSString * occlusionLeft;


@property (nonatomic,strong) UIImageView * sawWetTintView;


@property (nonatomic,strong) UILabel * unboundBusLabel;


@property (nonatomic,strong) UILabel * rawSenderLabel;

@property (nonatomic, strong) UIButton * hitHexButton;

@end

@implementation SolidEntriesCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        
        self.clipsToBounds = YES;
        self.layer.cornerRadius = BadMeanSame.clockwiseSun.formatAgent;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.sawWetTintView = [UIImageView new];
        self.sawWetTintView.tintColor = [BadMeanSame currentlyColor];
        self.sawWetTintView.layer.cornerRadius = BadMeanSame.clockwiseSun.starThirdHue;
        [self.contentView addSubview:self.sawWetTintView];
        [self.sawWetTintView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(BadMeanSame.clockwiseSun.forkSinSent);
            make.centerY.mas_equalTo(self.contentView);
            make.width.height.mas_equalTo(BadMeanSame.clockwiseSun.twoPartTeeth);
        }];
        
        self.unboundBusLabel = [UILabel new];
        self.unboundBusLabel.font = [UIFont boldSystemFontOfSize:BadMeanSame.clockwiseSun.perfusionTab];
        self.unboundBusLabel.textColor = UIColor.darkGrayColor;
        [self.contentView addSubview:self.unboundBusLabel];
        
        self.rawSenderLabel = [UILabel new];
        self.rawSenderLabel.font = [UIFont boldSystemFontOfSize:BadMeanSame.clockwiseSun.sayEndsCycle];
        self.rawSenderLabel.textColor = UIColor.darkGrayColor;
        [self.contentView addSubview:self.rawSenderLabel];
        
        [self.unboundBusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.sawWetTintView.mas_right).offset(BadMeanSame.clockwiseSun.queueSunBars);
            make.centerY.equalTo(self.contentView);
        }];
        
        [self.rawSenderLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.unboundBusLabel);
            make.top.equalTo(self.unboundBusLabel.mas_bottom).offset(BadMeanSame.clockwiseSun.dragDefines);
        }];
        
        self.hitHexButton = [[UIButton alloc] init];
        _hitHexButton.userInteractionEnabled = NO;
        
        UIImage *image = [[UIImage mediumBackwardsReceiveDeliveryVersionsName:BadMeanSame.clockwiseSun.angleRandomShiftIllegalUnderline] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
        [_hitHexButton setBackgroundImage:[UIImage mediumBackwardsReceiveDeliveryVersionsName:BadMeanSame.clockwiseSun.rangeAttachDisposeNotMicro] forState: UIControlStateNormal];
        [_hitHexButton setBackgroundImage:image forState: UIControlStateSelected];
        _hitHexButton.tintColor = [BadMeanSame currentlyColor];
        [self.contentView addSubview:_hitHexButton];
        [_hitHexButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.offset(0);
            make.right.offset(-BadMeanSame.clockwiseSun.queueSunBars);
            make.size.mas_equalTo(CGSizeMake(BadMeanSame.clockwiseSun.depthRemoval, BadMeanSame.clockwiseSun.depthRemoval));
        }];
    }
    return self;
}

- (void)setSelected:(BOOL)selected {
    _hitHexButton.selected = selected;
    self.layer.borderWidth = selected ? 1:0;
    self.layer.borderColor = [BadMeanSame currentlyColor].CGColor;
}

- (void)setFrame:(CGRect)frame {
    frame.origin.x = BadMeanSame.clockwiseSun.forkSinSent;
    frame.size.width -= BadMeanSame.clockwiseSun.perfusionTab;
    frame.origin.y += BadMeanSame.clockwiseSun.forkSinSent;
    frame.size.height -= BadMeanSame.clockwiseSun.forkSinSent;
    [super setFrame:frame];
}

-(void)setOcclusionLeft:(NSString *)occlusionLeft {
    _occlusionLeft = occlusionLeft;
    [self.sawWetTintView sd_setImageWithURL:[NSURL URLWithString:occlusionLeft] placeholderImage:nil];
}

- (void)setDesiredAre:(MayRoundHybridLetterClimbingBlue *)desiredAre {
    _desiredAre= desiredAre;
    self.occlusionLeft = desiredAre.appendWon;
    self.unboundBusLabel.text = desiredAre.backupPub;
    NSString *note = desiredAre.partReady?:@"";
    if (note.sayAreAcross) {
        self.rawSenderLabel.hidden = YES;
        [self.unboundBusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.sawWetTintView.mas_right).offset(BadMeanSame.clockwiseSun.queueSunBars);
            make.centerY.equalTo(self.contentView);
        }];
    }else {
        self.rawSenderLabel.hidden = NO;
        NSRange markup = [note rangeOfString:BadMeanSame.clockwiseSun.wireBypassOneDietaryCompoundNepali];
        NSRange manWon = [note rangeOfString:BadMeanSame.clockwiseSun.rawPutValidityArtCubeDog];
        
        if (markup.length == 0 && manWon.length == 0) {
            self.rawSenderLabel.text = note;
            self.rawSenderLabel.font = [UIFont systemFontOfSize:BadMeanSame.clockwiseSun.sayEndsCycle];
            self.rawSenderLabel.textColor = UIColor.lightGrayColor;
        }else {
            NSRange tenNorth = NSMakeRange(markup.location+markup.length, manWon.location-(markup.location+markup.length));
            NSString *boxThe = [note substringWithRange:tenNorth];
            NSString *quitUse = [note stringByReplacingOccurrencesOfString:BadMeanSame.clockwiseSun.wireBypassOneDietaryCompoundNepali withString:@""];
            quitUse = [quitUse stringByReplacingOccurrencesOfString:BadMeanSame.clockwiseSun.rawPutValidityArtCubeDog withString:@""];
            
            tenNorth = [quitUse rangeOfString:boxThe];
            NSMutableAttributedString *scoreLoopWax = [[NSMutableAttributedString alloc] initWithString:quitUse];
            [scoreLoopWax addAttribute:NSForegroundColorAttributeName value:[UIColor lightGrayColor] range:NSMakeRange(0, quitUse.length)];
            [scoreLoopWax addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0, quitUse.length)];
            [scoreLoopWax addAttribute:NSForegroundColorAttributeName value:[BadMeanSame currentlyColor] range:tenNorth];
            [scoreLoopWax addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:14] range:tenNorth];
            
            self.rawSenderLabel.attributedText = scoreLoopWax;
        }
        
        [self.unboundBusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.sawWetTintView.mas_right).offset(BadMeanSame.clockwiseSun.queueSunBars);
            make.top.equalTo(self.sawWetTintView).offset(BadMeanSame.clockwiseSun.hueAreLoose);
        }];
    }
}

@end
