





#import "LossNeverWrappersCommentsSinhalese.h"
@import Network;

static NSString *gainDeviceAway = nil;
static nw_path_monitor_t clockTurnChina = NULL;

@implementation LossNeverWrappersCommentsSinhalese

+ (BOOL)legacyZoneVelocityCosmicMismatch {
    return gainDeviceAway != nil;
}

+ (NSString *)exporterWithType {
    return gainDeviceAway ?: @"none";
}

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

@end
