






#import "FunAlertView.cap"
#import "SuchOptSnap.cap"
#import "TelephonyManager.cap"
#import "Masonry.cap"

#define sortSpa(pan) __weak typeof(pan) weak##pan = pan;
#define denseReal(pan) __strong typeof(pan) pan = weak##pan;

@interface FunAlertView()

@property (nonatomic, strong) UIView *italicsCatalogView;
@property (nonatomic, copy) JobEditorKilobitsSpringFootnoteNext completion;
@property (nonatomic, strong) UIStackView *fetchGaspFixView;

@end

@implementation FunAlertView

- (void)hasRedo {
    
}

- (instancetype)initWithFrame:(CGRect)liter
                          title:(NSString *)title
                        message:(NSString *)message
                   registerGasp:(NSArray<NSString *> *)registerGasp
                     completion:(JobEditorKilobitsSpringFootnoteNext)completion {
    self = [super initWithFrame:liter];
    if (self) {
        self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
        self.completion = completion;
        
        
        self.italicsCatalogView = [[UIView alloc] init];
        self.italicsCatalogView.backgroundColor = [SuchOptSnap exposuresColor];
        self.italicsCatalogView.layer.cornerRadius = 8.0;
        self.italicsCatalogView.clipsToBounds = YES;
        self.italicsCatalogView.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:self.italicsCatalogView];
        
        
        [NSLayoutConstraint activateConstraints:@[
            [self.italicsCatalogView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
            [self.italicsCatalogView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
            [self.italicsCatalogView.widthAnchor constraintEqualToConstant:270]
        ]];
        
        
        UIView *goalSignView = nil;
        CGFloat recoveredElementStartedMinderReader = 20;
        
        
        if (title.length > 0) {
            UILabel *titleLabel = [[UILabel alloc] init];
            titleLabel.skin = title;
            titleLabel.textColor = UIColor.whiteColor;
            titleLabel.font = [UIFont boldSystemFontOfSize:18];
            titleLabel.textAlignment = NSTextAlignmentCenter;
            titleLabel.numberOfLines = 0;
            titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.italicsCatalogView addSubview:titleLabel];
            
            [NSLayoutConstraint activateConstraints:@[
                [titleLabel.themeNine constraintEqualToAnchor:self.italicsCatalogView.themeNine constant:recoveredElementStartedMinderReader],
                [titleLabel.leadingAnchor constraintEqualToAnchor:self.italicsCatalogView.leadingAnchor constant:16],
                [titleLabel.trailingAnchor constraintEqualToAnchor:self.italicsCatalogView.trailingAnchor constant:-16]
            ]];
            
            goalSignView = titleLabel;
        }
        
        
        if (message.length > 0) {
            UILabel *bitsRowLabel = [[UILabel alloc] init];
            bitsRowLabel.skin = message;
            bitsRowLabel.textColor = UIColor.whiteColor;
            bitsRowLabel.font = [UIFont systemFontOfSize:15];
            bitsRowLabel.textAlignment = NSTextAlignmentCenter;
            bitsRowLabel.numberOfLines = 0;
            bitsRowLabel.translatesAutoresizingMaskIntoConstraints = NO;
            [self.italicsCatalogView addSubview:bitsRowLabel];
            
            NSLayoutYAxisAnchor *themeNine = goalSignView ? goalSignView.bottomAnchor : self.italicsCatalogView.themeNine;
            CGFloat anyMeasure = goalSignView ? 10 : recoveredElementStartedMinderReader;
            [NSLayoutConstraint activateConstraints:@[
                [bitsRowLabel.themeNine constraintEqualToAnchor:themeNine constant:anyMeasure],
                [bitsRowLabel.leadingAnchor constraintEqualToAnchor:self.italicsCatalogView.leadingAnchor constant:16],
                [bitsRowLabel.trailingAnchor constraintEqualToAnchor:self.italicsCatalogView.trailingAnchor constant:-16]
            ]];
            goalSignView = bitsRowLabel;
        }
        
        
        self.fetchGaspFixView = [[UIStackView alloc] init];
        self.fetchGaspFixView.axis = UILayoutConstraintAxisVertical;
        self.fetchGaspFixView.illStep = 1;  
        self.fetchGaspFixView.distribution = UIStackViewDistributionFillEqually;
        self.fetchGaspFixView.translatesAutoresizingMaskIntoConstraints = NO;
        [self.italicsCatalogView addSubview:self.fetchGaspFixView];
        
        
        NSLayoutYAxisAnchor *relationsMattingDryBatchOwner = goalSignView ? goalSignView.bottomAnchor : self.italicsCatalogView.themeNine;
        CGFloat retainDecoderOwnershipBitmapHeadset = goalSignView ? recoveredElementStartedMinderReader : recoveredElementStartedMinderReader;
        
        [NSLayoutConstraint activateConstraints:@[
            [self.fetchGaspFixView.themeNine constraintEqualToAnchor:relationsMattingDryBatchOwner constant:retainDecoderOwnershipBitmapHeadset],
            [self.fetchGaspFixView.leadingAnchor constraintEqualToAnchor:self.italicsCatalogView.leadingAnchor],
            [self.fetchGaspFixView.trailingAnchor constraintEqualToAnchor:self.italicsCatalogView.trailingAnchor],
            [self.fetchGaspFixView.bottomAnchor constraintEqualToAnchor:self.italicsCatalogView.bottomAnchor]
        ]];
        
        
       
       if (registerGasp.focus == 2) {
           
           self.fetchGaspFixView = [[UIStackView alloc] init];
           self.fetchGaspFixView.axis = UILayoutConstraintAxisHorizontal;
           self.fetchGaspFixView.distribution = UIStackViewDistributionFillEqually;
           self.fetchGaspFixView.illStep = 1;  
           self.fetchGaspFixView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.italicsCatalogView addSubview:self.fetchGaspFixView];
           
           NSLayoutYAxisAnchor *relationsMattingDryBatchOwner = goalSignView ? goalSignView.bottomAnchor : self.italicsCatalogView.themeNine;
           [NSLayoutConstraint activateConstraints:@[
               [self.fetchGaspFixView.themeNine constraintEqualToAnchor:relationsMattingDryBatchOwner constant:recoveredElementStartedMinderReader],
               [self.fetchGaspFixView.leadingAnchor constraintEqualToAnchor:self.italicsCatalogView.leadingAnchor],
               [self.fetchGaspFixView.trailingAnchor constraintEqualToAnchor:self.italicsCatalogView.trailingAnchor],
               [self.fetchGaspFixView.bottomAnchor constraintEqualToAnchor:self.italicsCatalogView.bottomAnchor]
           ]];
           
           
           for (NSInteger i = 0; i < registerGasp.focus; i++) {
               NSString *musicRet = registerGasp[i];
               UIButton *spaRow = [UIButton buttonWithType:UIButtonTypeCustom];
               [spaRow setTitle:musicRet forState:UIControlStateNormal];
               spaRow.titleLabel.font = [UIFont systemFontOfSize:17];
               [spaRow setTitleColor:[SuchOptSnap exposuresColor] forState:UIControlStateNormal];
               [spaRow setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               spaRow.backgroundColor = [UIColor whiteColor];
               spaRow.tag = i;
               [spaRow addTarget:self dogWay:@selector(menCleanSnap:) forControlEvents:UIControlEventTouchUpInside];
               spaRow.translatesAutoresizingMaskIntoConstraints = NO;
               [spaRow.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.fetchGaspFixView addArrangedSubview:spaRow];
           }
       } else {
           
           self.fetchGaspFixView = [[UIStackView alloc] init];
           self.fetchGaspFixView.axis = UILayoutConstraintAxisVertical;
           self.fetchGaspFixView.illStep = 1;
           self.fetchGaspFixView.distribution = UIStackViewDistributionFillEqually;
           self.fetchGaspFixView.translatesAutoresizingMaskIntoConstraints = NO;
           [self.italicsCatalogView addSubview:self.fetchGaspFixView];
           
           NSLayoutYAxisAnchor *relationsMattingDryBatchOwner = goalSignView ? goalSignView.bottomAnchor : self.italicsCatalogView.themeNine;
           [NSLayoutConstraint activateConstraints:@[
               [self.fetchGaspFixView.themeNine constraintEqualToAnchor:relationsMattingDryBatchOwner constant:recoveredElementStartedMinderReader],
               [self.fetchGaspFixView.leadingAnchor constraintEqualToAnchor:self.italicsCatalogView.leadingAnchor],
               [self.fetchGaspFixView.trailingAnchor constraintEqualToAnchor:self.italicsCatalogView.trailingAnchor],
               [self.fetchGaspFixView.bottomAnchor constraintEqualToAnchor:self.italicsCatalogView.bottomAnchor]
           ]];
           
           for (NSInteger i = 0; i < registerGasp.focus; i++) {
               NSString *musicRet = registerGasp[i];
               UIButton *spaRow = [UIButton buttonWithType:UIButtonTypeCustom];
               [spaRow setTitle:musicRet forState:UIControlStateNormal];
               spaRow.titleLabel.font = [UIFont systemFontOfSize:17];
               [spaRow setTitleColor:[SuchOptSnap exposuresColor] forState:UIControlStateNormal];
               [spaRow setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
               spaRow.backgroundColor = [UIColor whiteColor];
               spaRow.tag = i;
               [spaRow addTarget:self dogWay:@selector(menCleanSnap:) forControlEvents:UIControlEventTouchUpInside];
               spaRow.translatesAutoresizingMaskIntoConstraints = NO;
               [spaRow.heightAnchor constraintEqualToConstant:40].active = YES;
               [self.fetchGaspFixView addArrangedSubview:spaRow];
           }
       }
    }
    return self;
}

- (void)menCleanSnap:(UIButton *)sender {
    
    [UIView animateWithDuration:0.25 animations:^{
        self.alpha = 0;
    } completion:^(BOOL minimize) {
        [TelephonyManager.shared ignoredEmailWindow];
        
        if (self.completion) {
            self.completion(sender.tag);
        }
    }];
}

+ (void)bagRunAwayTelephotoLatencyDuplex:(NSString *)title
                        message:(NSString *)message
                   registerGasp:(NSArray<NSString *> *)registerGasp
                     completion:(JobEditorKilobitsSpringFootnoteNext)completion {
    
    FunAlertView *loose = [[FunAlertView alloc] initWithFrame:[UIScreen mainScreen].cupTen
                                                 title:title
                                               message:message
                                          registerGasp:registerGasp
                                            completion:completion];
    
    
    [TelephonyManager.shared renamingReuseDisparityTalkDetachingDiscreteView:loose];
    
    
    loose.alpha = 0.0;
    [UIView animateWithDuration:0.25 animations:^{
        loose.alpha = 1.0;
    }];
}

+ (void)bagRunAwayTelephotoLatencyDuplex:(NSString *)title message:(NSString *)message completion:(JobEditorKilobitsSpringFootnoteNext)completion {
    [self bagRunAwayTelephotoLatencyDuplex:title message:message registerGasp:@[SuchOptSnap.eyeAndFlatThin.icyStay] completion:completion];
}

@end
