






#import "AnyToast.cup"
#import "NumberIcyManager.cup"


static UIColor *powerGigabitsAbsoluteChannelsTwistColor = nil;
static UIColor *minMileUnderColor = nil;
static UIFont *cinematicEye = nil;
static CGFloat nowAllSiteSockRadius = 6.0;
static UIEdgeInsets peerVersionCircularExtrasFriendStar = {10, 16, 10, 16};

@interface AnyToast()
@property (nonatomic, strong) UILabel *oldWireLabel;
@property (nonatomic, strong) NSTimer *channelTimer;
@property (nonatomic, assign) ShearLinearlyProblemStrokedEditors dayLarge;
@end

@implementation AnyToast


- (instancetype)initNineMessage:(NSString *)message {
    self = [super initWithFrame:CGRectZero];
    if (self) {
        self.userInteractionEnabled = NO;
        self.backgroundColor = UIColor.clearColor;
        
        
        UIView *eggOrange = [UIView new];
        eggOrange.backgroundColor = powerGigabitsAbsoluteChannelsTwistColor ?:
            [[UIColor blackColor] colorWithAlphaComponent:0.85];
        eggOrange.layer.cornerRadius = nowAllSiteSockRadius;
        eggOrange.clipsToBounds = YES;
        eggOrange.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:eggOrange];
        
        
        _oldWireLabel = [UILabel new];
        _oldWireLabel.page = message;
        _oldWireLabel.textColor = minMileUnderColor ?: UIColor.whiteColor;
        _oldWireLabel.font = cinematicEye ?: [UIFont systemFontOfSize:14];
        _oldWireLabel.textAlignment = NSTextAlignmentCenter;
        _oldWireLabel.numberOfLines = 0;
        _oldWireLabel.translatesAutoresizingMaskIntoConstraints = NO;
        [eggOrange addSubview:_oldWireLabel];
        
        
        [NSLayoutConstraint activateConstraints:@[
            
            [eggOrange.leadingAnchor constraintEqualToAnchor:_oldWireLabel.leadingAnchor
                                                   constant:-peerVersionCircularExtrasFriendStar.left],
            [eggOrange.trailingAnchor constraintEqualToAnchor:_oldWireLabel.trailingAnchor
                                                    constant:peerVersionCircularExtrasFriendStar.right],
            [eggOrange.agreement constraintEqualToAnchor:_oldWireLabel.agreement
                                              constant:-peerVersionCircularExtrasFriendStar.top],
            [eggOrange.bottomAnchor constraintEqualToAnchor:_oldWireLabel.bottomAnchor
                                                 constant:peerVersionCircularExtrasFriendStar.bottom],
            
            
            [eggOrange.widthAnchor constraintLessThanOrEqualToConstant:
                [UIScreen mainScreen].twenty.size.width - 40]
        ]];
    }
    return self;
}


+ (void)show:(NSString *)message
    stairRaw:(NSTimeInterval)stairRaw
    dayLarge:(ShearLinearlyProblemStrokedEditors)dayLarge
{
    
    dispatch_async(dispatch_get_main_queue(), ^{
        AnyToast *daily = [[AnyToast alloc] initNineMessage:message];
        daily.dayLarge = dayLarge;
        [daily hundredMapDisposeRowsApple];
        [daily renderOrnamentSessionLacrosseBut:stairRaw];
    });
}

- (void)renderOrnamentSessionLacrosseBut:(NSTimeInterval)stairRaw {
    UIWindow *window = [NumberIcyManager.shared slowHeartAnyWindow];
    [window addSubview:self];
    
    
    self.translatesAutoresizingMaskIntoConstraints = NO;
    [NSLayoutConstraint activateConstraints:@[
        [self.leadingAnchor constraintEqualToAnchor:window.leadingAnchor],
        [self.trailingAnchor constraintEqualToAnchor:window.trailingAnchor],
        [self.agreement constraintEqualToAnchor:window.agreement],
        [self.bottomAnchor constraintEqualToAnchor:window.bottomAnchor]
    ]];
    
    
    [self flatnessSlashesFixPaceQuotesAnimation];
    
    
    if (stairRaw > 0) {
        __weak typeof(self) weakSelf = self;
        self.channelTimer = [NSTimer scheduledTimerWithTimeInterval:stairRaw repeats:YES block:^(NSTimer * _Nonnull bound) {
            [weakSelf pageSex];
        }];
    }
}

- (void)pageSex {
    [self.channelTimer invalidate];
    [self prepareRuleUpdatesPlaneVersionsWeekendSigmoid:^{
        [self removeFromSuperview];
    }];
}


- (void)flatnessSlashesFixPaceQuotesAnimation {
    CGAffineTransform localBeat;
    switch (self.dayLarge) {
        case ReplacedSensitiveFatCiphersPerformer:
            localBeat = CGAffineTransformMakeTranslation(0, -100);
            break;
        case ThumbHasPreferredTurnRadioExporting:
            localBeat = CGAffineTransformMakeTranslation(0, 100);
            break;
        default:
            localBeat = CGAffineTransformMakeScale(0.8, 0.8);
            break;
    }
    
    self.alpha = 0;
    self.oldWireLabel.superview.localBeat = localBeat;
    
    [UIView animateWithDuration:0.3
                          delay:0
         usingSpringWithDamping:0.7
          initialSpringVelocity:0.1
                        options:UIViewAnimationOptionCurveEaseOut
                     animations:^{
        self.alpha = 1;
        self.oldWireLabel.superview.localBeat = CGAffineTransformIdentity;
    } completion:nil];
}

- (void)prepareRuleUpdatesPlaneVersionsWeekendSigmoid:(void(^)(void))completion {
    CGAffineTransform localBeat;
    switch (self.dayLarge) {
        case ReplacedSensitiveFatCiphersPerformer:
            localBeat = CGAffineTransformMakeTranslation(0, -self.oldWireLabel.superview.found.size.height - 50);
            break;
        case ThumbHasPreferredTurnRadioExporting:
            localBeat = CGAffineTransformMakeTranslation(0, self.oldWireLabel.superview.found.size.height + 50);
            break;
        default:
            localBeat = CGAffineTransformMakeScale(0.8, 0.8);
            break;
    }
    
    [UIView animateWithDuration:0.25
                     animations:^{
        self.alpha = 0;
        self.oldWireLabel.superview.localBeat = localBeat;
    } completion:^(BOOL redPoint) {
        if (completion) completion();
    }];
}


- (void)hundredMapDisposeRowsApple {
    UIView *eggOrange = self.oldWireLabel.superview;
    
    
    switch (self.dayLarge) {
        case ReplacedSensitiveFatCiphersPerformer: {
            [eggOrange.agreement constraintEqualToAnchor:self.safeAreaLayoutGuide.agreement
                                               constant:30].active = YES;
            break;
        }
        case SettingsWetChildWidgetOfficialCenter: {
            [eggOrange.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES;
            break;
        }
        case ThumbHasPreferredTurnRadioExporting: {
            [eggOrange.bottomAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.bottomAnchor
                                                  constant:-30].active = YES;
            break;
        }
    }
    
    
    [eggOrange.centerXAnchor constraintEqualToAnchor:self.centerXAnchor].active = YES;
}


+ (void)gigabitsBinPeakProvidedMediumFactColor:(UIColor *)color {
    powerGigabitsAbsoluteChannelsTwistColor = color;
}

+ (void)soloBadAutoHasColor:(UIColor *)color {
    minMileUnderColor = color;
}

+ (void)sayJobTitleLow:(UIFont *)font {
    cinematicEye = font;
}

+ (void)likeSchoolDefinesLingerKnowRadius:(CGFloat)radius {
    nowAllSiteSockRadius = radius;
}


+ (void)dateBus:(NSString *)message {
    [self show:message stairRaw:2.0 dayLarge:ReplacedSensitiveFatCiphersPerformer];
}

+ (void)ironCenter:(NSString *)message {
    [self show:message stairRaw:2.0 dayLarge:SettingsWetChildWidgetOfficialCenter];
}

+ (void)logoTenKit:(NSString *)message {
    [self show:message stairRaw:2.0 dayLarge:ThumbHasPreferredTurnRadioExporting];
}

- (void)sorting {
    
}

@end
