





#import "EyePrimeEngineGregorianWake.h"
@import Network;

static NSString *sayDrawPinWarn = nil;
static nw_path_monitor_t stepQueryOrder = NULL;

@implementation EyePrimeEngineGregorianWake

+ (BOOL)nineSuddenLinePresenterProviding {
    return sayDrawPinWarn != nil;
}

+ (NSString *)chromeRegionType {
    return sayDrawPinWarn ?: @"none";
}

+ (void)terminateFactoryGrantedMapWhoSeed:(void (^)(BOOL nineSuddenLinePresenterProviding))completion {
    
    if (stepQueryOrder != NULL) {
        nw_path_monitor_cancel(stepQueryOrder);
        stepQueryOrder = NULL;
    }
    
    
    stepQueryOrder = nw_path_monitor_create();
    nw_path_monitor_set_queue(stepQueryOrder, dispatch_get_main_queue());
    
    __block nw_path_monitor_t runFullyTags = stepQueryOrder;
    nw_path_monitor_set_update_handler(stepQueryOrder, ^(nw_path_t path) {
        nw_path_status_t status = nw_path_get_status(path);
        if (status == nw_path_status_satisfied) {
            if (nw_path_uses_interface_type(path, nw_interface_type_wifi)) {
                sayDrawPinWarn = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                sayDrawPinWarn = @"cellular";
            } else {
                
                sayDrawPinWarn = @"other";
            }
            
            
            if (runFullyTags) {
                nw_path_monitor_cancel(runFullyTags);
                runFullyTags = NULL;
                stepQueryOrder = NULL;
            }
            
        } else {
            sayDrawPinWarn = nil;
        }
        
        
        if (completion) {
            completion([self nineSuddenLinePresenterProviding]);
        }
        
    });
    
    
    nw_path_monitor_start(stepQueryOrder);
}

@end
