






#import "ExtendDatumButton.h"
#import "BinFaxEight.h"
#import "UIImage+EndImage.h"
#import "SDWebImageManager.h"

@interface ExtendDatumButton ()


@property (nonatomic, strong) NSTimer *halfCopperDiskTimer;

@property (nonatomic, assign) NSInteger warpPrimeAdjustingWhileTriplePlacement;

@property (nonatomic, copy) NSString *logCoverEpsilonForMale;

@end

@implementation ExtendDatumButton

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self shortSmartColorSkinAutomatic];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self shortSmartColorSkinAutomatic];
    }
    return self;
}


- (void)shortSmartColorSkinAutomatic {
    
    self.reversedChallengeLateFourSigmaMegawatts = 60;
    self.logCoverEpsilonForMale = BinFaxEight.signRoomModify.roomUseLocalityHexLongerMapCode;
    [self setTitle:self.logCoverEpsilonForMale forState:UIControlStateNormal];

    
    NSString *ownInputUnion = [BinFaxEight milesInfiniteHisTwoChannelsImage];
    if (ownInputUnion) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:ownInputUnion]
                                                    options:0
                                                   progress:nil
                                                  completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
            if (image) {
                dispatch_async(dispatch_get_main_queue(), ^{
                    [self setBackgroundImage:image forState:UIControlStateNormal];
                    [self setBackgroundImage:[UIImage menHitFoggyGetColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage menHitFoggyGetColor:BinFaxEight.indentJobColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage menHitFoggyGetColor:BinFaxEight.indentJobColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage menHitFoggyGetColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = BinFaxEight.icyAboutDrum.noneHertzAsk;
    self.layer.masksToBounds = YES;
    
    self.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
    
    [self sizeToFit];

    
    [self addTarget:self action:@selector(otherAgeMixClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (void)otherAgeMixClicked {
    [self wonMakerBarHeightHandling];
    if (self.canonBagBrownAction) {
        self.canonBagBrownAction();
    }
}


- (void)wonMakerBarHeightHandling {
    self.enabled = NO;
    self.warpPrimeAdjustingWhileTriplePlacement = self.reversedChallengeLateFourSigmaMegawatts;
    [self allSmoothUrgencySequenceSubscribeQuick];
    
    
    self.halfCopperDiskTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(kurdishReportScanPitchCurrently:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)kurdishReportScanPitchCurrently:(NSTimer *)occur {
    self.warpPrimeAdjustingWhileTriplePlacement--;
    if (self.warpPrimeAdjustingWhileTriplePlacement <= 0) {
        [self manAirPartialLoopsViability];
    } else {
        [self allSmoothUrgencySequenceSubscribeQuick];
    }
}


- (void)allSmoothUrgencySequenceSubscribeQuick {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",BinFaxEight.signRoomModify.cutterStackedWelshBrokenPutIllCode, (long)self.warpPrimeAdjustingWhileTriplePlacement];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)manAirPartialLoopsViability {
    [self.halfCopperDiskTimer invalidate];
    self.halfCopperDiskTimer = nil;
    self.enabled = YES;
    [self setTitle:self.logCoverEpsilonForMale forState:UIControlStateNormal];
}

- (void)dealloc {
    
    [self.halfCopperDiskTimer invalidate];
    self.halfCopperDiskTimer = nil;
}

@end
