






#import "IdiomAtomicButton.h"
#import "PrintFarFor.h"
#import "UIImage+MinImage.h"
#import "SDWebImageManager.h"

@interface IdiomAtomicButton ()


@property (nonatomic, strong) NSTimer *seedActiveUsedTimer;

@property (nonatomic, assign) NSInteger fillReloadPanSixMomentPlug;

@property (nonatomic, copy) NSString *revertDueMongolianPubRadix;

@end

@implementation IdiomAtomicButton

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

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


- (void)extraCaptureFactoryFileCrop {
    
    self.monthUnloadFlattenDoubleOurType = 60;
    self.revertDueMongolianPubRadix = PrintFarFor.tempSockJobHas.veryKilohertzTooIntroDigitizedStringCode;
    [self setTitle:self.revertDueMongolianPubRadix forState:UIControlStateNormal];

    
    NSString *validityEight = [PrintFarFor redefinedConstantNetIdiomRotationImage];
    if (validityEight) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:validityEight]
                                                    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 netEarlyPinArtColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage netEarlyPinArtColor:PrintFarFor.expansionColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage netEarlyPinArtColor:PrintFarFor.expansionColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage netEarlyPinArtColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

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

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


- (void)armApplyLowClicked {
    [self sourcesGainDoneCyclingFusion];
    if (self.transposeDarkAction) {
        self.transposeDarkAction();
    }
}


- (void)sourcesGainDoneCyclingFusion {
    self.enabled = NO;
    self.fillReloadPanSixMomentPlug = self.monthUnloadFlattenDoubleOurType;
    [self carbonCutAddressesCriteriaDegreesBundle];
    
    
    self.seedActiveUsedTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(detachingExpectedYouPasswordsSentences:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)detachingExpectedYouPasswordsSentences:(NSTimer *)visit {
    self.fillReloadPanSixMomentPlug--;
    if (self.fillReloadPanSixMomentPlug <= 0) {
        [self ignoresBlobTriggersRingUpdate];
    } else {
        [self carbonCutAddressesCriteriaDegreesBundle];
    }
}


- (void)carbonCutAddressesCriteriaDegreesBundle {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",PrintFarFor.tempSockJobHas.likeCollapsedSevenKilobytesProxyBannerCode, (long)self.fillReloadPanSixMomentPlug];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)ignoresBlobTriggersRingUpdate {
    [self.seedActiveUsedTimer invalidate];
    self.seedActiveUsedTimer = nil;
    self.enabled = YES;
    [self setTitle:self.revertDueMongolianPubRadix forState:UIControlStateNormal];
}

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

@end
