






#import "BundleManyLiveButton.h"
#import "LeftHosting.h"
#import "UIImage+SonImage.h"
#import "SpaOptSunNoteController.h"
#import "UIImage+SonImage.h"
#import "UIColor+AnyColor.h"

@implementation BundleManyLiveButton

- (instancetype)initTokenTopFixViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.redExecutionViewController = viewController;
        [self cocoaRopeArbitrarySobYou];
    }
    return self;
}


- (void)cocoaRopeArbitrarySobYou {
    
    NSArray *twoRecentlyLocalPhoneticPack = [ExhaustedStepperProvidesEuropeanScene finishWhiteSubTryItalian:[IllFlights class]];
    
    
    NSString *takeMeanItsEraCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block IllFlights *literalControl = nil;
    [twoRecentlyLocalPhoneticPack enumerateObjectsUsingBlock:^(IllFlights *country, NSUInteger idx, BOOL *stop) {
        if ([country.blobStartDryCode caseInsensitiveCompare:takeMeanItsEraCode] == NSOrderedSame) {
            literalControl = country;
            *stop = YES; 
        }
    }];
    self.queryManagerTypeCoalescedYet = literalControl;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",LeftHosting.busJobRemote.runSpellFrame, literalControl.specifierCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *parentalImage = [UIImage tenWirelessMinProtocolsRedefinedName:LeftHosting.busJobRemote.executorGeneralLossyLineCheckerBeen];
    
    
    CGSize bundleCleanSize = CGSizeMake(13, 13); 
    
    
    UIImage *outFixImage = [self saltArcadePinkImage:parentalImage lifetimeSize:bundleCleanSize];
    
    
    [self setImage:outFixImage forState:UIControlStateNormal];
    [self setImage:[outFixImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateHighlighted]; 
    
    
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    
    
    self.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; 
    CGFloat spacing = 3.0; 
    self.imageEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, -spacing);  
    self.titleEdgeInsets = UIEdgeInsetsMake(0, -spacing, 0, spacing);   
    
    
    [self setBackgroundImage:[UIImage claimReplyClipColor:[LeftHosting.rankCycleColor windowExchangesHyphensReservedSingleOverdue:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage claimReplyClipColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]]
                   forState:UIControlStateHighlighted];
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = 2.f;
    self.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;
    self.layer.masksToBounds = YES;
    
    
    self.contentEdgeInsets = UIEdgeInsetsMake(8, 12, 8, 12); 
    
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(respondsBigClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)saltArcadePinkImage:(UIImage *)image lifetimeSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat wasTornado = targetSize.width / image.size.width;
    CGFloat backupStood = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(wasTornado, backupStood);
    
    
    CGRect catEraRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - catEraRect.size.width) / 2.0,
                               (targetSize.height - catEraRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                catEraRect.size.width,
                                catEraRect.size.height)];
    
    UIImage *rawImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return rawImage;
}


- (void)respondsBigClicked {
    LeapSortingHexExtrasCiphersCelticViewController *box = [LeapSortingHexExtrasCiphersCelticViewController new];
    box.aloneWalkDelegate = self;
    [self.redExecutionViewController.navigationController pushViewController:box animated:NO];
}

- (void)ejectBriefLocatorCloudyFootballAgeStationCaret:(IllFlights *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",LeftHosting.busJobRemote.runSpellFrame, country.specifierCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.queryManagerTypeCoalescedYet = country;
}

- (void)dealloc {
    
}
@end
