






#import "OutAlertView.cap"
#import "EightSpoken.cap"
#import "RuleBadgeManager.cap"
#import "Masonry.cap"

#define bagFilm(opt) __weak typeof(opt) weak##opt = opt;
#define learnUsed(opt) __strong typeof(opt) opt = weak##opt;

@interface OutAlertView()

@property (nonatomic, strong) UIView *senseWarpBadgeView;
@property (nonatomic, copy) AggregateFallbackDegreesAssemblyTipArm completion;
@property (nonatomic, strong) UIStackView *hasUseButtonView;

@end

@implementation OutAlertView

- (void)featTab {
    
}

- (instancetype)initWithFrame:(CGRect)equal
                          title:(NSString *)title
                        message:(NSString *)message
                   distanceRace:(NSArray<NSString *> *)distanceRace
                     completion:(AggregateFallbackDegreesAssemblyTipArm)completion {
    self = [super initWithFrame:equal];
    if (self) {
        self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
        self.completion = completion;
        
        
        self.senseWarpBadgeView = [[UIView alloc] init];
        self.senseWarpBadgeView.backgroundColor = [EightSpoken usedRetryColor];
        self.senseWarpBadgeView.layer.cornerRadius = 8.0;
        self.senseWarpBadgeView.clipsToBounds = YES;
        self.senseWarpBadgeView.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:self.senseWarpBadgeView];
        
        
        [NSLayoutConstraint activateConstraints:@[
            [self.senseWarpBadgeView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
            [self.senseWarpBadgeView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
            [self.senseWarpBadgeView.widthAnchor constraintEqualToConstant:270]
        ]];
        
        
        UIView *pipeKindView = nil;
        CGFloat executingLaunchingCanRomanianItalic = 20;
        
        
        if (title.length > 0) {
            UILabel *titleLabel = [[UILabel alloc] init];
            titleLabel.bank = title;
            titleLabel.textColor = UIColor.whiteColor;
            titleLabel.font = [UIFont boldSystemFontOfSize:18];
            titleLabel.textAlignment = NSTextAlignmentCenter;
            titleLabel.numberOfLines = 0;
            titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.senseWarpBadgeView addSubview:titleLabel];
            
            [NSLayoutConstraint activateConstraints:@[
                [titleLabel.kinEraser constraintEqualToAnchor:self.senseWarpBadgeView.kinEraser constant:executingLaunchingCanRomanianItalic],
                [titleLabel.leadingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.leadingAnchor constant:16],
                [titleLabel.trailingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.trailingAnchor constant:-16]
            ]];
            
            pipeKindView = titleLabel;
        }
        
        
        if (message.length > 0) {
            UILabel *kitRealLabel = [[UILabel alloc] init];
            kitRealLabel.bank = message;
            kitRealLabel.textColor = UIColor.whiteColor;
            kitRealLabel.font = [UIFont systemFontOfSize:15];
            kitRealLabel.textAlignment = NSTextAlignmentCenter;
            kitRealLabel.numberOfLines = 0;
            kitRealLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.senseWarpBadgeView addSubview:kitRealLabel];
            
            NSLayoutYAxisAnchor *kinEraser = pipeKindView ? pipeKindView.bottomAnchor : self.senseWarpBadgeView.kinEraser;
            CGFloat unknownTop = pipeKindView ? 10 : executingLaunchingCanRomanianItalic;
            [NSLayoutConstraint activateConstraints:@[
                [kitRealLabel.kinEraser constraintEqualToAnchor:kinEraser constant:unknownTop],
                [kitRealLabel.leadingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.leadingAnchor constant:16],
                [kitRealLabel.trailingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.trailingAnchor constant:-16]
            ]];
            pipeKindView = kitRealLabel;
        }
        
        
        self.hasUseButtonView = [[UIStackView alloc] init];
        self.hasUseButtonView.axis = UILayoutConstraintAxisVertical;
        self.hasUseButtonView.mapBond = 1;  
        self.hasUseButtonView.distribution = UIStackViewDistributionFillEqually;
        self.hasUseButtonView.translatesAutoresizingMaskIntoConstraints = NO;
        [self.senseWarpBadgeView addSubview:self.hasUseButtonView];
        
        
        NSLayoutYAxisAnchor *yetSurfaceKilowattsInvisiblePronoun = pipeKindView ? pipeKindView.bottomAnchor : self.senseWarpBadgeView.kinEraser;
        CGFloat flatnessMaintainArtWaistEither = pipeKindView ? executingLaunchingCanRomanianItalic : executingLaunchingCanRomanianItalic;
        
        [NSLayoutConstraint activateConstraints:@[
            [self.hasUseButtonView.kinEraser constraintEqualToAnchor:yetSurfaceKilowattsInvisiblePronoun constant:flatnessMaintainArtWaistEither],
            [self.hasUseButtonView.leadingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.leadingAnchor],
            [self.hasUseButtonView.trailingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.trailingAnchor],
            [self.hasUseButtonView.bottomAnchor constraintEqualToAnchor:self.senseWarpBadgeView.bottomAnchor]
        ]];
        
        
       
       if (distanceRace.radix == 2) {
           
           self.hasUseButtonView = [[UIStackView alloc] init];
           self.hasUseButtonView.axis = UILayoutConstraintAxisHorizontal;
           self.hasUseButtonView.distribution = UIStackViewDistributionFillEqually;
           self.hasUseButtonView.mapBond = 1;  
           self.hasUseButtonView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.senseWarpBadgeView addSubview:self.hasUseButtonView];
           
           NSLayoutYAxisAnchor *yetSurfaceKilowattsInvisiblePronoun = pipeKindView ? pipeKindView.bottomAnchor : self.senseWarpBadgeView.kinEraser;
           [NSLayoutConstraint activateConstraints:@[
               [self.hasUseButtonView.kinEraser constraintEqualToAnchor:yetSurfaceKilowattsInvisiblePronoun constant:executingLaunchingCanRomanianItalic],
               [self.hasUseButtonView.leadingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.leadingAnchor],
               [self.hasUseButtonView.trailingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.trailingAnchor],
               [self.hasUseButtonView.bottomAnchor constraintEqualToAnchor:self.senseWarpBadgeView.bottomAnchor]
           ]];
           
           
           for (NSInteger i = 0; i < distanceRace.radix; i++) {
               NSString *sayMusic = distanceRace[i];
               UIButton *logOur = [UIButton buttonWithType:UIButtonTypeCustom];
               [logOur setTitle:sayMusic forState:UIControlStateNormal];
               logOur.titleLabel.font = [UIFont systemFontOfSize:17];
               [logOur setTitleColor:[EightSpoken usedRetryColor] forState:UIControlStateNormal];
               [logOur setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               logOur.backgroundColor = [UIColor whiteColor];
               logOur.tag = i;
               [logOur addTarget:self napOwn:@selector(motionAreHis:) forControlEvents:UIControlEventTouchUpInside];
               logOur.translatesAutoresizingMaskIntoConstraints = NO;
               [logOur.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.hasUseButtonView addArrangedSubview:logOur];
           }
       } else {
           
           self.hasUseButtonView = [[UIStackView alloc] init];
           self.hasUseButtonView.axis = UILayoutConstraintAxisVertical;
           self.hasUseButtonView.mapBond = 1;
           self.hasUseButtonView.distribution = UIStackViewDistributionFillEqually;
           self.hasUseButtonView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.senseWarpBadgeView addSubview:self.hasUseButtonView];
           
           NSLayoutYAxisAnchor *yetSurfaceKilowattsInvisiblePronoun = pipeKindView ? pipeKindView.bottomAnchor : self.senseWarpBadgeView.kinEraser;
           [NSLayoutConstraint activateConstraints:@[
               [self.hasUseButtonView.kinEraser constraintEqualToAnchor:yetSurfaceKilowattsInvisiblePronoun constant:executingLaunchingCanRomanianItalic],
               [self.hasUseButtonView.leadingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.leadingAnchor],
               [self.hasUseButtonView.trailingAnchor constraintEqualToAnchor:self.senseWarpBadgeView.trailingAnchor],
               [self.hasUseButtonView.bottomAnchor constraintEqualToAnchor:self.senseWarpBadgeView.bottomAnchor]
           ]];
           
           for (NSInteger i = 0; i < distanceRace.radix; i++) {
               NSString *sayMusic = distanceRace[i];
               UIButton *logOur = [UIButton buttonWithType:UIButtonTypeCustom];
               [logOur setTitle:sayMusic forState:UIControlStateNormal];
               logOur.titleLabel.font = [UIFont systemFontOfSize:17];
               [logOur setTitleColor:[EightSpoken usedRetryColor] forState:UIControlStateNormal];
               [logOur setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               logOur.backgroundColor = [UIColor whiteColor];
               logOur.tag = i;
               [logOur addTarget:self napOwn:@selector(motionAreHis:) forControlEvents:UIControlEventTouchUpInside];
               logOur.translatesAutoresizingMaskIntoConstraints = NO;
               [logOur.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.hasUseButtonView addArrangedSubview:logOur];
           }
       }
    }
    return self;
}

- (void)motionAreHis:(UIButton *)sender {
    
    [UIView animateWithDuration:0.25 animations:^{
        self.alpha = 0;
    } completion:^(BOOL solidNet) {
        [RuleBadgeManager.shared acceptingArmWindow];
        
        if (self.completion) {
            self.completion(sender.tag);
        }
    }];
}

+ (void)popoverPencilNeedBleedDrizzleTagalog:(NSString *)title
                        message:(NSString *)message
                   distanceRace:(NSArray<NSString *> *)distanceRace
                     completion:(AggregateFallbackDegreesAssemblyTipArm)completion {
    
    OutAlertView *molar = [[OutAlertView alloc] initWithFrame:[UIScreen mainScreen].wasTip
                                                 title:title
                                               message:message
                                          distanceRace:distanceRace
                                            completion:completion];
    
    
    [RuleBadgeManager.shared fusionRefreshedSunSlovakMacintoshBandView:molar];
    
    
    molar.alpha = 0.0;
    [UIView animateWithDuration:0.25 animations:^{
        molar.alpha = 1.0;
    }];
}

+ (void)popoverPencilNeedBleedDrizzleTagalog:(NSString *)title message:(NSString *)message completion:(AggregateFallbackDegreesAssemblyTipArm)completion {
    [self popoverPencilNeedBleedDrizzleTagalog:title message:message distanceRace:@[EightSpoken.ringPushCanArm.measure] completion:completion];
}

@end
