






#import "LongUnitPolicyButton.h"
#import "RaceRateYou.h"
#import "UIImage+TagImage.h"
#import "CutMaxSlidingController.h"
#import "UIImage+TagImage.h"
#import "UIColor+EggColor.h"

@implementation LongUnitPolicyButton

- (instancetype)initWakeOwnBeatViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.unboundedSubViewController = viewController;
        [self toggleExposeZipSignalBusy];
    }
    return self;
}


- (void)toggleExposeZipSignalBusy {
    
    NSArray *vendorChestChunkyPinkImperial = [FunkHasScriptsForImplicit popGlucoseFinishingBehaviorsTorque:[ChromaSkin class]];
    
    
    NSString *doneNodeNowHisCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block ChromaSkin *itsPhoneTagYet = nil;
    [vendorChestChunkyPinkImperial enumerateObjectsUsingBlock:^(ChromaSkin *country, NSUInteger idx, BOOL *stop) {
        if ([country.positionSkipCode caseInsensitiveCompare:doneNodeNowHisCode] == NSOrderedSame) {
            itsPhoneTagYet = country;
            *stop = YES; 
        }
    }];
    self.collisionItalicsSafetySonDiamond = itsPhoneTagYet;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",RaceRateYou.wristBoldNot.mapKinInvalid, itsPhoneTagYet.heightMayCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *rankTaskImage = [UIImage dependingLigatureDimensionBuildEdgaName:RaceRateYou.wristBoldNot.hourlyPinPlaceOutdoorSmoothedSiblings];
    
    
    CGSize poloSubjectSize = CGSizeMake(13, 13); 
    
    
    UIImage *wayHasImage = [self pinchEastFloorImage:rankTaskImage rightMapSize:poloSubjectSize];
    
    
    [self setImage:wayHasImage forState:UIControlStateNormal];
    [self setImage:[wayHasImage 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 insetVoiceLastColor:[RaceRateYou.ropeCauseColor barriersMatchWeekMostBothFound:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage insetVoiceLastColor:[[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(andFormDropClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)pinchEastFloorImage:(UIImage *)image rightMapSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat flagLowHis = targetSize.width / image.size.width;
    CGFloat answerNever = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(flagLowHis, answerNever);
    
    
    CGRect originRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - originRect.size.width) / 2.0,
                               (targetSize.height - originRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                originRect.size.width,
                                originRect.size.height)];
    
    UIImage *panImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return panImage;
}


- (void)andFormDropClicked {
    FlagIndoorYesterdayTiedEstonianLegacyViewController *fat = [FlagIndoorYesterdayTiedEstonianLegacyViewController new];
    fat.minorReadDelegate = self;
    [self.unboundedSubViewController.navigationController pushViewController:fat animated:NO];
}

- (void)unifyCaseCarrierMarathiContinuedAbnormalSupportAsleep:(ChromaSkin *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",RaceRateYou.wristBoldNot.mapKinInvalid, country.heightMayCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.collisionItalicsSafetySonDiamond = country;
}

- (void)dealloc {
    
}
@end
