






#import "StrictBigManager.h"
#import "AuthorInstallsViewController.h"
#import "FailKitEndConfig.h"

@interface StrictBigManager()
@property (nonatomic, strong) NSMutableArray<UIWindow *> *panelFullyCost;  
@property (nonatomic, strong) NSMutableArray<UIWindow *> *orderedBrown;  
@end

@implementation StrictBigManager

- (instancetype)init {
    self = [super init];
    if (self) {
        _panelFullyCost = [NSMutableArray array];
        _orderedBrown = [NSMutableArray array];
    }
    return self;
}

+ (instancetype)shared {
    static id shared = nil;
    static dispatch_once_t execToken;
    dispatch_once(&execToken, ^{
        shared = [[super alloc] init];
    });
    return shared;
}


- (UIWindow *)farSayHaveWindow {
    UIWindow *slashWindow = nil;
    
    if (@available(iOS 13.0, *)) {
        
        NSSet<UIScene *> *connectedScenes = [UIApplication sharedApplication].connectedScenes;
        for (UIScene *scene in connectedScenes) {
            
            if (scene.activationState == UISceneActivationStateForegroundActive &&
                [scene isKindOfClass:[UIWindowScene class]]) {
                
                UIWindowScene *windowScene = (UIWindowScene *)scene;
                
                if (windowScene.windows.count > 0) {
                    slashWindow = windowScene.windows.firstObject;
                }
                break;
            }
        }
    } else {
        
        NSArray<UIWindow *> *windows = [UIApplication sharedApplication].windows;
        if (windows.count > 0) {
            slashWindow = windows.firstObject;
        }
    }
    
    
    if (!slashWindow) {
        NSArray<UIWindow *> *windows = [UIApplication sharedApplication].windows;
        if (windows.count > 0) {
            slashWindow = windows.firstObject;
        }
    }
    
    return slashWindow;
}


- (UIWindow *)criteriaPushWindow {
    
    UIWindow *busTaskWindow = nil;
    
    if (@available(iOS 13.0, *)) {
        NSSet<UIScene *> *connectedScenes = [UIApplication sharedApplication].connectedScenes;
        for (UIScene *scene in connectedScenes) {
            if (scene.activationState == UISceneActivationStateForegroundActive &&
                [scene isKindOfClass:[UIWindowScene class]]) {
                UIWindowScene *windowScene = (UIWindowScene *)scene;
                
                
                if (@available(iOS 15.0, *)) {
                    busTaskWindow = windowScene.keyWindow;
                }
                
                else {
                    for (UIWindow *window in windowScene.windows) {
                        if (window.isKeyWindow) {
                            busTaskWindow = window;
                            break;
                        }
                    }
                }
                break;
            }
        }
    } else {
        
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        busTaskWindow = [UIApplication sharedApplication].keyWindow;
#pragma clang diagnostic pop
    }
    
    
    if (!busTaskWindow) {
        NSArray<UIWindow *> *windows = [UIApplication sharedApplication].windows;
        for (UIWindow *window in windows) {
            if (window.isKeyWindow) {
                busTaskWindow = window;
                break;
            }
        }
    }
    
    return busTaskWindow;
}


- (void)suchNiacinVerticalRatingsWhoFootnoteSyntheticViewController:(UIViewController *)andRun{
    dispatch_async(dispatch_get_main_queue(), ^{
        
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            
            UIWindow *fatWindow = [self secretStrideSuchFatBlendSodium:andRun];
            
            
            [self paragraphPresenterSlovakEnableLayerUploaded:fatWindow];
            
            [self.panelFullyCost addObject:fatWindow];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id ten = nil;
            
            ten = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *note) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:ten];
                [weakSelf suchNiacinVerticalRatingsWhoFootnoteSyntheticViewController:andRun];
            }];
        }
    });
}

- (void)waySeekingLaunchNaturalGraphicsMaxViewController:(UIViewController *)andRun {
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            [self resourceEnsureStormEditorsModalMidPong:andRun];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id ten = nil;
            
            ten = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *note) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:ten];
                
                [weakSelf resourceEnsureStormEditorsModalMidPong:andRun];
            }];
        }
    });
}

- (void)notCheckoutMenAccountsOverallStrokedView:(UIView *)view {
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
            [self resourceEnsureStormEditorsModalMidPong:view];
        } else {
            
            __weak typeof(self) weakSelf = self;
            
            __block __weak id ten = nil;
            
            ten = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
                                                                       object:nil
                                                                        queue:[NSOperationQueue mainQueue]
                                                                   usingBlock:^(NSNotification *note) {
                
                [[NSNotificationCenter defaultCenter] removeObserver:ten];
                
                [weakSelf resourceEnsureStormEditorsModalMidPong:view];
            }];
        }
    });
}

- (void)resourceEnsureStormEditorsModalMidPong:(id)object {
    UIViewController *andRun = nil;
    
        
    if ([object isKindOfClass:[UIViewController class]]) {
        andRun = object;
    }
    
    if ([object isKindOfClass:[UIView class]]) {
        andRun = [AuthorInstallsViewController new];
        andRun.view = object;
    }
    
    
    UIWindow *fatWindow = [self secretStrideSuchFatBlendSodium:andRun];
    
    
    [self paragraphPresenterSlovakEnableLayerUploaded:fatWindow];
    
    
    [self.orderedBrown addObject:fatWindow];
}

- (void)useContainerMobileRenewReversesMusic:(NSNotification *)note {
    
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UIApplicationDidBecomeActiveNotification
                                                  object:nil];
    [self notCheckoutMenAccountsOverallStrokedView:note.object];
}

- (void)rawEastWhiteWindow {
    [self auditedWorkspaceScalarJumpBehaveWindow];
}

- (void)auditedWorkspaceScalarJumpBehaveWindow {
    dispatch_async(dispatch_get_main_queue(), ^{
        if (self.orderedBrown.count == 0) return;

        
        UIWindow *zoneWindow = [self.orderedBrown lastObject];
        [self.orderedBrown removeLastObject];

        
        if (zoneWindow.isKeyWindow) {
            [self shapeAssistantWindow];
        }

        
        zoneWindow.hidden = YES;
        
        
        for (UIView *outline in [zoneWindow.subviews copy]) {
            [outline removeFromSuperview];
        }
        
        
        zoneWindow.rootViewController = nil;
        
        
        [CATransaction flush];
        
        
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
    });
}

- (void)returnSumServerEyeDarkenCreatedViewController:(UIViewController *)rootViewController {
    dispatch_async(dispatch_get_main_queue(), ^{
        NSEnumerator *downLandscapeBalticProposalPool = [self.orderedBrown reverseObjectEnumerator];
        UIWindow *window = nil;
        
        
        while ((window = [downLandscapeBalticProposalPool nextObject])) {
            if (window.rootViewController == rootViewController) {
                
                if (window.isKeyWindow) {
                    [self shapeAssistantWindow];
                }
                
                
                window.hidden = YES;
                
                
                for (UIView *outline in [window.subviews copy]) {
                    [outline removeFromSuperview];
                }
                
                
                window.rootViewController = nil;
                
                [self.orderedBrown removeObject:window];
                
                
                [CATransaction flush];
                
                
                [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
                
                
                downLandscapeBalticProposalPool = [self.orderedBrown reverseObjectEnumerator];
            }
        }
    });
}

- (void)printAmericanPopSugarSoloistWebpage {
    dispatch_async(dispatch_get_main_queue(), ^{
        
        for (UIWindow *window in [self.orderedBrown reverseObjectEnumerator]) {
            if (window.isKeyWindow) {
                [self shapeAssistantWindow];
            }
            window.hidden = YES;
            
            
            for (UIView *outline in [window.subviews copy]) {
                [outline removeFromSuperview];
            }
            
            
            window.rootViewController = nil;
        }
        
        
        [self.orderedBrown removeAllObjects];
        
        
        [CATransaction flush];
        
        
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
    });
}

- (void)increaseCursivePipeEnterToggleMonthPortion:(void(^)(void))completion {
    
    if (self.orderedBrown.count == 0) {
        if (completion) {
            dispatch_async(dispatch_get_main_queue(), ^{
                completion();
            });
        }
        return;
    }
    
    
    dispatch_async(dispatch_get_main_queue(), ^{
        
        NSArray *softballFirstTorchSaltEffect = [self.orderedBrown copy];
        for (UIWindow *window in softballFirstTorchSaltEffect) {
            if (window.isKeyWindow) {
                [self shapeAssistantWindow];
            }
            window.hidden = YES;
            
            
            for (UIView *outline in [window.subviews copy]) {
                [outline removeFromSuperview];
            }
            
            
            window.rootViewController = nil;
        }
        
        
        [self.orderedBrown removeAllObjects];
        
        
        [CATransaction flush];
        
        
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
        
        
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            if (completion) {
                completion();
            }
        });
    });
}


- (UIWindow *)secretStrideSuchFatBlendSodium:(UIViewController *)andRun {
    UIWindow *window = nil;
    
    
    if (@available(iOS 13.0, *)) {
        for (UIScene *scene in [UIApplication sharedApplication].connectedScenes) {
            if (scene.activationState == UISceneActivationStateForegroundActive &&
                [scene isKindOfClass:[UIWindowScene class]]) {
                window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];
                break;
            }
        }
    }
    
    
    if (!window) {
        window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    }
    
    
    window.backgroundColor = [UIColor clearColor];
    window.rootViewController = andRun;
    return window;
}

- (void)paragraphPresenterSlovakEnableLayerUploaded:(UIWindow *)window {
    

    window.windowLevel = UIWindowLevelStatusBar + 100;
    [window makeKeyAndVisible];
}


- (void)shapeAssistantWindow {
    UIWindow *blueWindow = [self tipOldSenseWindow];
    [blueWindow makeKeyWindow];
    if (!blueWindow.isKeyWindow) {
        [blueWindow becomeKeyWindow];
    }
}

- (UIWindow *)tipOldSenseWindow {
    __block UIWindow *blueWindow = nil;
    
    
    if (@available(iOS 13.0, *)) {
        NSArray<UIWindowScene *> *suitableCard = [self howIntentResetPersonalArcade];
        [suitableCard enumerateObjectsUsingBlock:^(UIWindowScene * _Nonnull scene, NSUInteger idx, BOOL * _Nonnull stop) {
            
            if (@available(iOS 15.0, *)) {
                blueWindow = scene.keyWindow;
            }
            
            if (!blueWindow) {
                blueWindow = [scene.windows firstObject];
            }
            if (blueWindow) *stop = YES;
        }];
    }
    
    else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        blueWindow = [UIApplication sharedApplication].keyWindow;
#pragma clang diagnostic pop
    }
    
    
    if (!blueWindow) {
        blueWindow = [UIApplication sharedApplication].windows.firstObject;
    }
    
    return blueWindow;
}

- (NSArray<UIWindowScene *> *)howIntentResetPersonalArcade {
    NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(UIScene * _Nullable scene, NSDictionary<NSString *,id> * _Nullable bindings) {
        return scene.activationState == UISceneActivationStateForegroundActive;
    }];
    return [[UIApplication sharedApplication].connectedScenes filteredSetUsingPredicate:predicate].allObjects;
}


- (UIWindow *)butWindow {
    return [self.orderedBrown lastObject];
}

- (NSInteger)oneBitCount {
    return self.orderedBrown.count;
}


@end
