






#import "NotAlertView.h"
#import "MillLiftIll.h"
#import "BitmapWaxManager.h"
#import "Masonry.h"

#define capTask(ask) __weak typeof(ask) weak##ask = ask;
#define awakeHold(ask) __strong typeof(ask) ask = weak##ask;

@interface NotAlertView()

@property (nonatomic, strong) UIView *ensureFairRainView;
@property (nonatomic, copy) AllBigElapsedIllegalSignerDiacritic completion;
@property (nonatomic, strong) UIStackView *alpinePopHexView;

@end

@implementation NotAlertView

- (void)dealloc {
    
}

- (instancetype)initWithFrame:(CGRect)frame
                          title:(NSString *)title
                        message:(NSString *)message
                   betterBagNow:(NSArray<NSString *> *)betterBagNow
                     completion:(AllBigElapsedIllegalSignerDiacritic)completion {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
        self.completion = completion;
        
        
        self.ensureFairRainView = [[UIView alloc] init];
        self.ensureFairRainView.backgroundColor = [MillLiftIll shearHeadColor];
        self.ensureFairRainView.layer.cornerRadius = 8.0;
        self.ensureFairRainView.clipsToBounds = YES;
        self.ensureFairRainView.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:self.ensureFairRainView];
        
        
        [NSLayoutConstraint activateConstraints:@[
            [self.ensureFairRainView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
            [self.ensureFairRainView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
            [self.ensureFairRainView.widthAnchor constraintEqualToConstant:270]
        ]];
        
        
        UIView *powerSobView = nil;
        CGFloat orangeTipBackwardReleaseApplier = 20;
        
        
        if (title.length > 0) {
            UILabel *titleLabel = [[UILabel alloc] init];
            titleLabel.text = title;
            titleLabel.textColor = UIColor.whiteColor;
            titleLabel.font = [UIFont boldSystemFontOfSize:18];
            titleLabel.textAlignment = NSTextAlignmentCenter;
            titleLabel.numberOfLines = 0;
            titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.ensureFairRainView addSubview:titleLabel];
            
            [NSLayoutConstraint activateConstraints:@[
                [titleLabel.topAnchor constraintEqualToAnchor:self.ensureFairRainView.topAnchor constant:orangeTipBackwardReleaseApplier],
                [titleLabel.leadingAnchor constraintEqualToAnchor:self.ensureFairRainView.leadingAnchor constant:16],
                [titleLabel.trailingAnchor constraintEqualToAnchor:self.ensureFairRainView.trailingAnchor constant:-16]
            ]];
            
            powerSobView = titleLabel;
        }
        
        
        if (message.length > 0) {
            UILabel *easySeeLabel = [[UILabel alloc] init];
            easySeeLabel.text = message;
            easySeeLabel.textColor = UIColor.whiteColor;
            easySeeLabel.font = [UIFont systemFontOfSize:15];
            easySeeLabel.textAlignment = NSTextAlignmentCenter;
            easySeeLabel.numberOfLines = 0;
            easySeeLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.ensureFairRainView addSubview:easySeeLabel];
            
            NSLayoutYAxisAnchor *topAnchor = powerSobView ? powerSobView.bottomAnchor : self.ensureFairRainView.topAnchor;
            CGFloat ageLoading = powerSobView ? 10 : orangeTipBackwardReleaseApplier;
            [NSLayoutConstraint activateConstraints:@[
                [easySeeLabel.topAnchor constraintEqualToAnchor:topAnchor constant:ageLoading],
                [easySeeLabel.leadingAnchor constraintEqualToAnchor:self.ensureFairRainView.leadingAnchor constant:16],
                [easySeeLabel.trailingAnchor constraintEqualToAnchor:self.ensureFairRainView.trailingAnchor constant:-16]
            ]];
            powerSobView = easySeeLabel;
        }
        
        
        self.alpinePopHexView = [[UIStackView alloc] init];
        self.alpinePopHexView.axis = UILayoutConstraintAxisVertical;
        self.alpinePopHexView.spacing = 1;  
        self.alpinePopHexView.distribution = UIStackViewDistributionFillEqually;
        self.alpinePopHexView.translatesAutoresizingMaskIntoConstraints = NO;
        [self.ensureFairRainView addSubview:self.alpinePopHexView];
        
        
        NSLayoutYAxisAnchor *shelfSucceededLegibleEditorBegan = powerSobView ? powerSobView.bottomAnchor : self.ensureFairRainView.topAnchor;
        CGFloat convergedReturnsCloudAcceptingFactored = powerSobView ? orangeTipBackwardReleaseApplier : orangeTipBackwardReleaseApplier;
        
        [NSLayoutConstraint activateConstraints:@[
            [self.alpinePopHexView.topAnchor constraintEqualToAnchor:shelfSucceededLegibleEditorBegan constant:convergedReturnsCloudAcceptingFactored],
            [self.alpinePopHexView.leadingAnchor constraintEqualToAnchor:self.ensureFairRainView.leadingAnchor],
            [self.alpinePopHexView.trailingAnchor constraintEqualToAnchor:self.ensureFairRainView.trailingAnchor],
            [self.alpinePopHexView.bottomAnchor constraintEqualToAnchor:self.ensureFairRainView.bottomAnchor]
        ]];
        
        
       
       if (betterBagNow.count == 2) {
           
           self.alpinePopHexView = [[UIStackView alloc] init];
           self.alpinePopHexView.axis = UILayoutConstraintAxisHorizontal;
           self.alpinePopHexView.distribution = UIStackViewDistributionFillEqually;
           self.alpinePopHexView.spacing = 1;  
           self.alpinePopHexView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.ensureFairRainView addSubview:self.alpinePopHexView];
           
           NSLayoutYAxisAnchor *shelfSucceededLegibleEditorBegan = powerSobView ? powerSobView.bottomAnchor : self.ensureFairRainView.topAnchor;
           [NSLayoutConstraint activateConstraints:@[
               [self.alpinePopHexView.topAnchor constraintEqualToAnchor:shelfSucceededLegibleEditorBegan constant:orangeTipBackwardReleaseApplier],
               [self.alpinePopHexView.leadingAnchor constraintEqualToAnchor:self.ensureFairRainView.leadingAnchor],
               [self.alpinePopHexView.trailingAnchor constraintEqualToAnchor:self.ensureFairRainView.trailingAnchor],
               [self.alpinePopHexView.bottomAnchor constraintEqualToAnchor:self.ensureFairRainView.bottomAnchor]
           ]];
           
           
           for (NSInteger i = 0; i < betterBagNow.count; i++) {
               NSString *foggyMap = betterBagNow[i];
               UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
               [button setTitle:foggyMap forState:UIControlStateNormal];
               button.titleLabel.font = [UIFont systemFontOfSize:17];
               [button setTitleColor:[MillLiftIll shearHeadColor] forState:UIControlStateNormal];
               [button setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               button.backgroundColor = [UIColor whiteColor];
               button.tag = i;
               [button addTarget:self action:@selector(butUsability:) forControlEvents:UIControlEventTouchUpInside];
               button.translatesAutoresizingMaskIntoConstraints = NO;
               [button.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.alpinePopHexView addArrangedSubview:button];
           }
       } else {
           
           self.alpinePopHexView = [[UIStackView alloc] init];
           self.alpinePopHexView.axis = UILayoutConstraintAxisVertical;
           self.alpinePopHexView.spacing = 1;
           self.alpinePopHexView.distribution = UIStackViewDistributionFillEqually;
           self.alpinePopHexView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.ensureFairRainView addSubview:self.alpinePopHexView];
           
           NSLayoutYAxisAnchor *shelfSucceededLegibleEditorBegan = powerSobView ? powerSobView.bottomAnchor : self.ensureFairRainView.topAnchor;
           [NSLayoutConstraint activateConstraints:@[
               [self.alpinePopHexView.topAnchor constraintEqualToAnchor:shelfSucceededLegibleEditorBegan constant:orangeTipBackwardReleaseApplier],
               [self.alpinePopHexView.leadingAnchor constraintEqualToAnchor:self.ensureFairRainView.leadingAnchor],
               [self.alpinePopHexView.trailingAnchor constraintEqualToAnchor:self.ensureFairRainView.trailingAnchor],
               [self.alpinePopHexView.bottomAnchor constraintEqualToAnchor:self.ensureFairRainView.bottomAnchor]
           ]];
           
           for (NSInteger i = 0; i < betterBagNow.count; i++) {
               NSString *foggyMap = betterBagNow[i];
               UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
               [button setTitle:foggyMap forState:UIControlStateNormal];
               button.titleLabel.font = [UIFont systemFontOfSize:17];
               [button setTitleColor:[MillLiftIll shearHeadColor] forState:UIControlStateNormal];
               [button setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               button.backgroundColor = [UIColor whiteColor];
               button.tag = i;
               [button addTarget:self action:@selector(butUsability:) forControlEvents:UIControlEventTouchUpInside];
               button.translatesAutoresizingMaskIntoConstraints = NO;
               [button.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.alpinePopHexView addArrangedSubview:button];
           }
       }
    }
    return self;
}

- (void)butUsability:(UIButton *)sender {
    
    [UIView animateWithDuration:0.25 animations:^{
        self.alpha = 0;
    } completion:^(BOOL finished) {
        [BitmapWaxManager.shared slopeSpanishWindow];
        
        if (self.completion) {
            self.completion(sender.tag);
        }
    }];
}

+ (void)stackSpeedDesktopNoteTheBusy:(NSString *)title
                        message:(NSString *)message
                   betterBagNow:(NSArray<NSString *> *)betterBagNow
                     completion:(AllBigElapsedIllegalSignerDiacritic)completion {
    
    NotAlertView *learn = [[NotAlertView alloc] initWithFrame:[UIScreen mainScreen].bounds
                                                 title:title
                                               message:message
                                          betterBagNow:betterBagNow
                                            completion:completion];
    
    
    [BitmapWaxManager.shared megahertzCapsEraIntegrateGetCropView:learn];
    
    
    learn.alpha = 0.0;
    [UIView animateWithDuration:0.25 animations:^{
        learn.alpha = 1.0;
    }];
}

+ (void)stackSpeedDesktopNoteTheBusy:(NSString *)title message:(NSString *)message completion:(AllBigElapsedIllegalSignerDiacritic)completion {
    [self stackSpeedDesktopNoteTheBusy:title message:message betterBagNow:@[MillLiftIll.cutHoldDateSix.sampler] completion:completion];
}

@end
