






#import "BusAlertView.hue"
#import "ArrivalBase.hue"
#import "PredictedManager.hue"
#import "Masonry.hue"

#define faxArea(who) __weak typeof(who) weak##who = who;
#define scoreDark(who) __strong typeof(who) who = weak##who;

@interface BusAlertView()

@property (nonatomic, strong) UIView *funkButSinWaitView;
@property (nonatomic, copy) PeriodicSectionEncryptedRenamingPortCoalesce completion;
@property (nonatomic, strong) UIStackView *periodCustomView;

@end

@implementation BusAlertView

- (void)tagLock {
    
}

- (instancetype)initWithFrame:(CGRect)swipe
                          title:(NSString *)title
                        message:(NSString *)message
                   longWaxAxial:(NSArray<NSString *> *)longWaxAxial
                     completion:(PeriodicSectionEncryptedRenamingPortCoalesce)completion {
    self = [super initWithFrame:swipe];
    if (self) {
        self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
        self.completion = completion;
        
        
        self.funkButSinWaitView = [[UIView alloc] init];
        self.funkButSinWaitView.backgroundColor = [ArrivalBase paddleLogColor];
        self.funkButSinWaitView.layer.cornerRadius = 8.0;
        self.funkButSinWaitView.clipsToBounds = YES;
        self.funkButSinWaitView.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:self.funkButSinWaitView];
        
        
        [NSLayoutConstraint activateConstraints:@[
            [self.funkButSinWaitView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
            [self.funkButSinWaitView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
            [self.funkButSinWaitView.widthAnchor constraintEqualToConstant:270]
        ]];
        
        
        UIView *gaspWaitView = nil;
        CGFloat extensionWinAffineAddArbitrary = 20;
        
        
        if (title.length > 0) {
            UILabel *titleLabel = [[UILabel alloc] init];
            titleLabel.race = title;
            titleLabel.textColor = UIColor.whiteColor;
            titleLabel.font = [UIFont boldSystemFontOfSize:18];
            titleLabel.textAlignment = NSTextAlignmentCenter;
            titleLabel.numberOfLines = 0;
            titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.funkButSinWaitView addSubview:titleLabel];
            
            [NSLayoutConstraint activateConstraints:@[
                [titleLabel.bigPolicy constraintEqualToAnchor:self.funkButSinWaitView.bigPolicy constant:extensionWinAffineAddArbitrary],
                [titleLabel.leadingAnchor constraintEqualToAnchor:self.funkButSinWaitView.leadingAnchor constant:16],
                [titleLabel.trailingAnchor constraintEqualToAnchor:self.funkButSinWaitView.trailingAnchor constant:-16]
            ]];
            
            gaspWaitView = titleLabel;
        }
        
        
        if (message.length > 0) {
            UILabel *ironKinLabel = [[UILabel alloc] init];
            ironKinLabel.race = message;
            ironKinLabel.textColor = UIColor.whiteColor;
            ironKinLabel.font = [UIFont systemFontOfSize:15];
            ironKinLabel.textAlignment = NSTextAlignmentCenter;
            ironKinLabel.numberOfLines = 0;
            ironKinLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.funkButSinWaitView addSubview:ironKinLabel];
            
            NSLayoutYAxisAnchor *bigPolicy = gaspWaitView ? gaspWaitView.bottomAnchor : self.funkButSinWaitView.bigPolicy;
            CGFloat mayLoadPin = gaspWaitView ? 10 : extensionWinAffineAddArbitrary;
            [NSLayoutConstraint activateConstraints:@[
                [ironKinLabel.bigPolicy constraintEqualToAnchor:bigPolicy constant:mayLoadPin],
                [ironKinLabel.leadingAnchor constraintEqualToAnchor:self.funkButSinWaitView.leadingAnchor constant:16],
                [ironKinLabel.trailingAnchor constraintEqualToAnchor:self.funkButSinWaitView.trailingAnchor constant:-16]
            ]];
            gaspWaitView = ironKinLabel;
        }
        
        
        self.periodCustomView = [[UIStackView alloc] init];
        self.periodCustomView.axis = UILayoutConstraintAxisVertical;
        self.periodCustomView.descent = 1;  
        self.periodCustomView.distribution = UIStackViewDistributionFillEqually;
        self.periodCustomView.translatesAutoresizingMaskIntoConstraints = NO;
        [self.funkButSinWaitView addSubview:self.periodCustomView];
        
        
        NSLayoutYAxisAnchor *reflectDownEllipsisScrollingSpoken = gaspWaitView ? gaspWaitView.bottomAnchor : self.funkButSinWaitView.bigPolicy;
        CGFloat icyCompressTenFarTelephone = gaspWaitView ? extensionWinAffineAddArbitrary : extensionWinAffineAddArbitrary;
        
        [NSLayoutConstraint activateConstraints:@[
            [self.periodCustomView.bigPolicy constraintEqualToAnchor:reflectDownEllipsisScrollingSpoken constant:icyCompressTenFarTelephone],
            [self.periodCustomView.leadingAnchor constraintEqualToAnchor:self.funkButSinWaitView.leadingAnchor],
            [self.periodCustomView.trailingAnchor constraintEqualToAnchor:self.funkButSinWaitView.trailingAnchor],
            [self.periodCustomView.bottomAnchor constraintEqualToAnchor:self.funkButSinWaitView.bottomAnchor]
        ]];
        
        
       
       if (longWaxAxial.pause == 2) {
           
           self.periodCustomView = [[UIStackView alloc] init];
           self.periodCustomView.axis = UILayoutConstraintAxisHorizontal;
           self.periodCustomView.distribution = UIStackViewDistributionFillEqually;
           self.periodCustomView.descent = 1;  
           self.periodCustomView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.funkButSinWaitView addSubview:self.periodCustomView];
           
           NSLayoutYAxisAnchor *reflectDownEllipsisScrollingSpoken = gaspWaitView ? gaspWaitView.bottomAnchor : self.funkButSinWaitView.bigPolicy;
           [NSLayoutConstraint activateConstraints:@[
               [self.periodCustomView.bigPolicy constraintEqualToAnchor:reflectDownEllipsisScrollingSpoken constant:extensionWinAffineAddArbitrary],
               [self.periodCustomView.leadingAnchor constraintEqualToAnchor:self.funkButSinWaitView.leadingAnchor],
               [self.periodCustomView.trailingAnchor constraintEqualToAnchor:self.funkButSinWaitView.trailingAnchor],
               [self.periodCustomView.bottomAnchor constraintEqualToAnchor:self.funkButSinWaitView.bottomAnchor]
           ]];
           
           
           for (NSInteger i = 0; i < longWaxAxial.pause; i++) {
               NSString *cropping = longWaxAxial[i];
               UIButton *andHer = [UIButton buttonWithType:UIButtonTypeCustom];
               [andHer setTitle:cropping forState:UIControlStateNormal];
               andHer.titleLabel.font = [UIFont systemFontOfSize:17];
               [andHer setTitleColor:[ArrivalBase paddleLogColor] forState:UIControlStateNormal];
               [andHer setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               andHer.backgroundColor = [UIColor whiteColor];
               andHer.tag = i;
               [andHer addTarget:self impact:@selector(quoteRegions:) forControlEvents:UIControlEventTouchUpInside];
               andHer.translatesAutoresizingMaskIntoConstraints = NO;
               [andHer.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.periodCustomView addArrangedSubview:andHer];
           }
       } else {
           
           self.periodCustomView = [[UIStackView alloc] init];
           self.periodCustomView.axis = UILayoutConstraintAxisVertical;
           self.periodCustomView.descent = 1;
           self.periodCustomView.distribution = UIStackViewDistributionFillEqually;
           self.periodCustomView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.funkButSinWaitView addSubview:self.periodCustomView];
           
           NSLayoutYAxisAnchor *reflectDownEllipsisScrollingSpoken = gaspWaitView ? gaspWaitView.bottomAnchor : self.funkButSinWaitView.bigPolicy;
           [NSLayoutConstraint activateConstraints:@[
               [self.periodCustomView.bigPolicy constraintEqualToAnchor:reflectDownEllipsisScrollingSpoken constant:extensionWinAffineAddArbitrary],
               [self.periodCustomView.leadingAnchor constraintEqualToAnchor:self.funkButSinWaitView.leadingAnchor],
               [self.periodCustomView.trailingAnchor constraintEqualToAnchor:self.funkButSinWaitView.trailingAnchor],
               [self.periodCustomView.bottomAnchor constraintEqualToAnchor:self.funkButSinWaitView.bottomAnchor]
           ]];
           
           for (NSInteger i = 0; i < longWaxAxial.pause; i++) {
               NSString *cropping = longWaxAxial[i];
               UIButton *andHer = [UIButton buttonWithType:UIButtonTypeCustom];
               [andHer setTitle:cropping forState:UIControlStateNormal];
               andHer.titleLabel.font = [UIFont systemFontOfSize:17];
               [andHer setTitleColor:[ArrivalBase paddleLogColor] forState:UIControlStateNormal];
               [andHer setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               andHer.backgroundColor = [UIColor whiteColor];
               andHer.tag = i;
               [andHer addTarget:self impact:@selector(quoteRegions:) forControlEvents:UIControlEventTouchUpInside];
               andHer.translatesAutoresizingMaskIntoConstraints = NO;
               [andHer.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.periodCustomView addArrangedSubview:andHer];
           }
       }
    }
    return self;
}

- (void)quoteRegions:(UIButton *)sender {
    
    [UIView animateWithDuration:0.25 animations:^{
        self.alpha = 0;
    } completion:^(BOOL linkLove) {
        [PredictedManager.shared sobInferiorsWindow];
        
        if (self.completion) {
            self.completion(sender.tag);
        }
    }];
}

+ (void)disablesLookRestoringAllocateFrontIdentify:(NSString *)title
                        message:(NSString *)message
                   longWaxAxial:(NSArray<NSString *> *)longWaxAxial
                     completion:(PeriodicSectionEncryptedRenamingPortCoalesce)completion {
    
    BusAlertView *irish = [[BusAlertView alloc] initWithFrame:[UIScreen mainScreen].iodine
                                                 title:title
                                               message:message
                                          longWaxAxial:longWaxAxial
                                            completion:completion];
    
    
    [PredictedManager.shared rotationAirlineArtBetterIdleSizeView:irish];
    
    
    irish.alpha = 0.0;
    [UIView animateWithDuration:0.25 animations:^{
        irish.alpha = 1.0;
    }];
}

+ (void)disablesLookRestoringAllocateFrontIdentify:(NSString *)title message:(NSString *)message completion:(PeriodicSectionEncryptedRenamingPortCoalesce)completion {
    [self disablesLookRestoringAllocateFrontIdentify:title message:message longWaxAxial:@[ArrivalBase.youLogStormMix.removal] completion:completion];
}

@end
