





#import "ShiftUnlikelyOptionRowChain.h"
@import Network;

static NSString *violationBlood = nil;
static nw_path_monitor_t getLawCubeQuit = NULL;

@implementation ShiftUnlikelyOptionRowChain

+ (BOOL)glyphCaseOptRoomNearby {
    return violationBlood != nil;
}

+ (NSString *)flatReuseBitType {
    return violationBlood ?: @"none";
}

+ (void)transportUnpluggedTabSoloistInitiatedUnload:(void (^)(BOOL glyphCaseOptRoomNearby))completion {
    
    if (getLawCubeQuit != NULL) {
        nw_path_monitor_cancel(getLawCubeQuit);
        getLawCubeQuit = NULL;
    }
    
    
    getLawCubeQuit = nw_path_monitor_create();
    nw_path_monitor_set_queue(getLawCubeQuit, dispatch_get_main_queue());
    
    __block nw_path_monitor_t oldRedPeriod = getLawCubeQuit;
    nw_path_monitor_set_update_handler(getLawCubeQuit, ^(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)) {
                violationBlood = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                violationBlood = @"cellular";
            } else {
                
                violationBlood = @"other";
            }
            
            
            if (oldRedPeriod) {
                nw_path_monitor_cancel(oldRedPeriod);
                oldRedPeriod = NULL;
                getLawCubeQuit = NULL;
            }
            
        } else {
            violationBlood = nil;
        }
        
        
        if (completion) {
            completion([self glyphCaseOptRoomNearby]);
        }
        
    });
    
    
    nw_path_monitor_start(getLawCubeQuit);
}

@end
