





#import "GenerateKeyTiedDidComputer.h"
@import Network;

static NSString *yardCertSubmit = nil;
static nw_path_monitor_t expectsTextual = NULL;

@implementation GenerateKeyTiedDidComputer

+ (BOOL)encodedSubsetBackSalientFifteen {
    return yardCertSubmit != nil;
}

+ (NSString *)finalWordRawType {
    return yardCertSubmit ?: @"none";
}

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

@end
